Commodore 64 (C64) Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Ian Bell e-mail?
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    Commodore 64 (C64) Forum Index -> General
View previous topic :: View next topic  
Author Message
oswald
Über Groupie
Über Groupie


Joined: 17 Jul 2003
Posts: 362

PostPosted: Fri Sep 18, 2009 12:24 pm    Post subject: Reply with quote

PeteD wrote:
Pretty much any 3d game stores its objects like Elite, there's no other real way to do it. Yes it is a list of coordinates, the "matrix" part comes in when you make it 3d.

A matrix in the general sense used in a 3d routine is a multiplication matrix that you need to rotate and move each object in your 3d world, not just each object in fact but each point of each object. This involves a crap load of multiplication and that's one of the things that makes 3d stuff slow on the poor old 1mhz C64, that AND the line draw. Looking at how fast both are and replacing both would be the best way to speed it up.

btw, if a draw routine goes to 255, that's 0-255 = 256 Wink

exactly. I'd add that in demos, clearing the screen is a huge bottleneck aswell. in games its percentage is probably less due to all the extra stuff a game has to do over a demo effect.

regarding speedup, it would be easyer to slow down the part of the game which counts time (if any?) and crank up the speed in an emulator Smile

probably the lineroutine is not superoptimised, but it will be sub demo line drawer speed no matter what, coz demos use shitloads of memory to speed lines up, and I guess elite does not have that.

255 or 256 pixels wide: I bet its 256, but dont forget coders start counting from 0. so there's no problem adressing it.

so 256 pixels width makes it possible to draw into character sets instead of bitmap, which with column based char arrangement allows for faster liens.

anyway I recognise this topic as "daydreaming" probably noone will ever do anything about it.
Back to top
View user's profile Send private message
oswald
Über Groupie
Über Groupie


Joined: 17 Jul 2003
Posts: 362

PostPosted: Fri Sep 18, 2009 12:31 pm    Post subject: Reply with quote

tfg wrote:
When using lookup tables like these one should be able to get away with a minimum amount of calculation per pixel. Perhaps Elite already does something like that? Then locating the tables might make it (relatively) easy to find the line-draw routines.

the fastest way is not even using tables Wink a fast lineroutine has code for each pixel column, one after the another in memory, you only have to adjust the Y coord while drawing the line, which can be the Y register on a cleverly organized character screen. to set the start end of the line, you jump into this code at the right place, and selfmod an rts to get out at the right place.

and you can go even faster than that, its possible to set more than 1 pixel at a time in a byte (small horizontal segments of liens), you could use the SID to calculate the slope for you, etc.


PeteD wrote:
btw, if a draw routine goes to 255, that's 0-255 = 256 Wink

But, but... what if the draw routine starts from a pixel >=1 for some weird reason? Very Happy[/quote]
in machine code 0 is a valid value like 1. and your first x coord is 0, and not 1. so you have 0 1 2 3 4 instead of 1 2 3 4, which explains how you get 256 different numbers.
Back to top
View user's profile Send private message
PeteD
Forum Junkie
Forum Junkie


Joined: 13 Aug 2009
Age: 44
Posts: 422

PostPosted: Fri Sep 18, 2009 5:27 pm    Post subject: Reply with quote

If someone was really interested in doing this one of the guys over on the Atariage forum has disassembled the beeb version well enough to reassemble on other platforms (in this case Atari800) so it would be worth getting that source from him.


Pete
_________________
Back to top
View user's profile Send private message
DanSolo
Immortal Grandmaster of C64
Immortal Grandmaster of C64


Joined: 23 May 2006
Posts: 3418

PostPosted: Fri Sep 18, 2009 7:09 pm    Post subject: Reply with quote

Thanks. I'm aware that they've a few optimized 6502 line drawing routines also.
Back to top
View user's profile Send private message
popmilo
Groupie in Training
Groupie in Training


Joined: 17 Dec 2004
Age: 39
Posts: 96
Location: Srbija

PostPosted: Sun Sep 27, 2009 7:50 pm    Post subject: Debugger...? Reply with quote

We should use new debugging tool ICU64 to see what is happening inside elite ...

http://icu64.blogspot.com/
Back to top
View user's profile Send private message Visit poster's website
darkatx
Groupie
Groupie


Joined: 06 Jun 2003
Posts: 243
Location: Canada

PostPosted: Sun Oct 25, 2009 10:51 pm    Post subject: Reply with quote

OK
I might get laughed at but I'll throw my hat into the ring.

The fastest way to have all the coordinates rotations pre-calced into a look up table.

I think Elite did something like this from what I saw on the other page.

They in effect changed the coordinates into vectors. That would reduce your typical 9 multiplications and 3 additions to a single multiplication...since the matrix has all the coordinate's rotations pre-calced

Problem is you lose angle resolution since its a rough 3d matrix and the larger/further the objects get the less the amount of fine accuracy. So the matrix would have to be pretty large. I think I read the a Fast Fournier Transform could be used for interpolation Rolling Eyes in order to get around that.

Also, that's a nice line algorithm site Smile (been there a few times) but there's the symmetric line algorithm where you only draw half the line then copy its other half saving rendering time...I heard that's pretty fast on top with the classics mentioned there.

That's what I'd do...but then I'm not a scener...not by any stretch.
Back to top
View user's profile Send private message Send e-mail
NorthWay
Groupie
Groupie


Joined: 07 Jan 2003
Posts: 289
Location: Grimstad, Norway

PostPosted: Mon Oct 26, 2009 10:37 pm    Post subject: Reply with quote

BTW, I seem to remember reading somewhere that for the C= 64 version they converted some of the maths to use logarithmic based code (which I believe gives you adds instead of multiplication for something) because it was a slower cpu. I'm guessing it used more space though.
Back to top
View user's profile Send private message
popmilo
Groupie in Training
Groupie in Training


Joined: 17 Dec 2004
Age: 39
Posts: 96
Location: Srbija

PostPosted: Tue Oct 27, 2009 1:26 pm    Post subject: source Reply with quote

Here are some links of stuff I found:

http://www.atariage.com/forums...bc__st__25

http://www.atariage.com/forums...elite-etc/

http://www.atariage.com/forums...ntry358962

And Ian Bells page with downloads, even source code!
http://www.iancgbell.clara.net.../index.htm
Back to top
View user's profile Send private message Visit poster's website
DanSolo
Immortal Grandmaster of C64
Immortal Grandmaster of C64


Joined: 23 May 2006
Posts: 3418

PostPosted: Tue Apr 13, 2010 4:34 pm    Post subject: Reply with quote

Ian C Bell wrote:
March 28 at 12:05pm
Hi. From what I remember the C64 had a full bimap display so no charcter map schenanigans. I think we used a division-free line draw algorithm but long time ago.

From the man himself. I'm not worthy, I'm not worthy...
Back to top
View user's profile Send private message
Micha1982
Newbie


Joined: 07 Nov 2009
Posts: 31

PostPosted: Mon Jul 12, 2010 5:57 pm    Post subject: Reply with quote

Some months ago I contacted Ullrich von Bassewitz - creator of Elite-Enhanced/128 - and he told that he already finished newer versions (DTV and a version with double-buffering and something more)!!

But he told he couldn´t release because copyright isn´t clear!!

He told if anyone is able to get a permission to release his versions from Bell or Braben then he will do Wink

So dont program too much - ´simply´ organize a permisson to release Bassewitz newer versions from Bell/Braben and everything is done!

Problem is that both of them didn´t answered my emails Sad
Back to top
View user's profile Send private message
DanSolo
Immortal Grandmaster of C64
Immortal Grandmaster of C64


Joined: 23 May 2006
Posts: 3418

PostPosted: Mon Jul 12, 2010 7:21 pm    Post subject: Reply with quote

Well, you'd have to think from Ian Bell's perspective that all of the old Elite stuff is now free to use for non-profit purposes. His e-mail might not work, but I contacted him on Facebook and he was very approachable.
Braben's a different story by all accounts. If you ask him I'm pretty sure the answer will be no.
Back to top
View user's profile Send private message
Micha1982
Newbie


Joined: 07 Nov 2009
Posts: 31

PostPosted: Tue Jul 13, 2010 11:25 am    Post subject: Reply with quote

Yeah, and what can we do to avoid problems with Braben???
Back to top
View user's profile Send private message
PeteD
Forum Junkie
Forum Junkie


Joined: 13 Aug 2009
Age: 44
Posts: 422

PostPosted: Tue Jul 13, 2010 1:46 pm    Post subject: Reply with quote

Shotgun?
_________________
Back to top
View user's profile Send private message
TNT
Administrator
Administrator


Joined: 09 Feb 2003
Posts: 4186
Location: HML, Finland Favorite games: H.E.R.O., Paradroid, Thrust

PostPosted: Tue Jul 13, 2010 1:52 pm    Post subject: Reply with quote

DanSolo wrote:
Braben's a different story by all accounts. If you ask him I'm pretty sure the answer will be no.

Follow your own link and click on "public statement (7)" and you find this from Braben:
Quote:
The end result is it is not legal, but I do not mind this as long as the copyright messages are intact, and it is not done for commercial gain, but be warned as the other copyright holder may object.
Back to top
View user's profile Send private message Visit poster's website
Fröhn
Grandmaster of C64
Grandmaster of C64


Joined: 13 Jan 2003
Posts: 1950

PostPosted: Tue Jul 13, 2010 4:00 pm    Post subject: Reply with quote

PeteD wrote:
This involves a crap load of multiplication and that's one of the things that makes 3d stuff slow on the poor old 1mhz C64, that AND the line draw. Looking at how fast both are and replacing both would be the best way to speed it up.

Multiplications can be done fast as hell on 6502. What's really slow is the clipping of the lines (divisions), and ofcourse the fact that you won't get away with 8 bit math for a game like Elite.
Back to top
View user's profile Send private message
PeteD
Forum Junkie
Forum Junkie


Joined: 13 Aug 2009
Age: 44
Posts: 422

PostPosted: Tue Jul 13, 2010 4:06 pm    Post subject: Reply with quote

Muls might be fairly speedy but they soon add up when you're doing lots of matrix maths.


Pete
_________________
Back to top
View user's profile Send private message
emu
Newbie


Joined: 21 Jan 2009
Age: 44
Posts: 21
Location: England

PostPosted: Tue Jul 13, 2010 5:27 pm    Post subject: Reply with quote

Double Buffering would make a big difference but that's 25% of the 64's memory gone on the screen buffer/display when using a bitmap screen. Mercenary does this, the first thing I thought when I saw this pic was look at all that memory being used up!

Using char's seems to be the best option for speed and double buffering but I can't remember too many games using that method.

Back to top
View user's profile Send private message
Troy
Lemon64 Game Champion
Lemon64 Game Champion


Joined: 26 May 2002
Posts: 829
Location: Edinburgh, UK

PostPosted: Tue Jul 13, 2010 5:41 pm    Post subject: Reply with quote

Would that matter about so much of the memory being used up?

Because in the end there isn't much to Elite is there? It's just an illusion. Aren't all the names and descriptions of the planets just mashed together from some basic table of limited descriptions and .. eh .. syllables?

I mean, it ran on an Electron didn't it?
Back to top
View user's profile Send private message
PeteD
Forum Junkie
Forum Junkie


Joined: 13 Aug 2009
Age: 44
Posts: 422

PostPosted: Tue Jul 13, 2010 5:41 pm    Post subject: Reply with quote

Elite on the Beeb was 32k and fit a screen in that as well (and that's 32k minus probably a couple of K for system stuff), a double buffer on C64 might not be a problem.

I know there was extra stuff in the C64 version but I'm not sure just how much

Pete
_________________
Back to top
View user's profile Send private message
emu
Newbie


Joined: 21 Jan 2009
Age: 44
Posts: 21
Location: England

PostPosted: Tue Jul 13, 2010 6:10 pm    Post subject: Reply with quote

I think Elite on the 64 is around 52k excluding the screen, so that leaves about 12k for the screen and the buffer. It might just fit with a bit of squeezing!
Back to top
View user's profile Send private message
DanSolo
Immortal Grandmaster of C64
Immortal Grandmaster of C64


Joined: 23 May 2006
Posts: 3418

PostPosted: Tue Jul 13, 2010 8:15 pm    Post subject: Reply with quote

Is the entire screen done in bitmap anyway? If not, the double buffering would be a lot smaller...
Back to top
View user's profile Send private message
PeteD
Forum Junkie
Forum Junkie


Joined: 13 Aug 2009
Age: 44
Posts: 422

PostPosted: Tue Jul 13, 2010 8:18 pm    Post subject: Reply with quote

It's all 256 wide anyway so you could do it all in chars, the play area double buffered and the panel not and probably save a bit of cpu on the line calcs while you're at it.


Pete
_________________
Back to top
View user's profile Send private message
enthusi
Forum Junkie
Forum Junkie


Joined: 19 Mar 2009
Age: 33
Posts: 510
Location: Potsdam, GER

PostPosted: Wed Jul 14, 2010 7:06 am    Post subject: Reply with quote

Elite on the Electron was limited in comparison to the c64 version.
AFAIK much less missions, no Thargoids, etc...
_________________
I like tapes. 'nough said =D
http://www.rgcd.co.uk
http://c64pixels.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Troy
Lemon64 Game Champion
Lemon64 Game Champion


Joined: 26 May 2002
Posts: 829
Location: Edinburgh, UK

PostPosted: Tue Jul 20, 2010 1:44 am    Post subject: Reply with quote

Here's what it would have looked like 'not' flickering. The first minute of this video is very cool with the music.


Link


I was watching an Amiga video of it too. I'd completely forgotten it had such a letterboxed display.

Also, shocked to see the Electron version was black and white.
Back to top
View user's profile Send private message
DanSolo
Immortal Grandmaster of C64
Immortal Grandmaster of C64


Joined: 23 May 2006
Posts: 3418

PostPosted: Tue Jul 20, 2010 12:05 pm    Post subject: Reply with quote

Troy wrote:
Also, shocked to see the Electron version was black and white.

I guess they has a graphics mode to suit Elite and went with it. ("320×256 (2 or 4 colours)" perhaps?) It wouldn't bother me much not having the colour in exchange for a bit less flickering.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Commodore 64 (C64) Forum Index -> General All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Tip: Get C64 Forever for super-comfy C64 emulation with pre-installed games, demos and other goodies!


Powered by phpBB © 2001, 2005 phpBB Group