Thursday, June 12, 2008

XeO3: Final cleanup!

I was looking through the game and spotted a couple of things I want to try and fix tonight - pretty minor, but it would still be nice to fix them for the demo. Once I've done that, I'll get a package ready for Luca to post tomorrow night (whenever we're both home and ready).

However... I was thinking.... IF I really wanted to... I could probably speed the game up quite a bit. For example: The engine redraws the screen every frame - this is slow. It DOES mean I dont have to save+replace stuff, but it would be much quicker to slowly redraw a screen over several frames, THEN flip. I blit the screen each frame because I wanted to have large character sprites that cover large areas of the screen - but that would be too slow to replace. However, due to memory we've dropped that idea. (The source is still there so someone else can play with it!)

So... lets look at HOW you could speed it up.

If when drawing sprites I did collision of baddie sprites to bullets the same way as I do the player to the background, then I could remove the N*N loop I have which does bounding box checks. I could also draw a lot more bullets! (Dan did this in Armalyte, and I suspect its common practise with C64 shooters).

Next.. If I did a Save/Replace system for bullets and sprites I wouldn't have to redraw the screen. (this would save a large screen buffer anyway).

That way I only ever copy a couple of lines a frame rather than 21!! That would be a massive saving, possibly freeing up enough time to draw another couple of sprites! (which would make 12!) OR (more likely) allow drawing of more complex weapons!

Now... I could do this... But I think we have finally passed the point where major changes are allowed, otherwise we'd NEVER finish! If I ever do an XeO3-II, then I might alter some ideas.

Still while I'm talking about that.. After the Plus4 version, I'll finish the C64 one (possibly taking some of the above ideas on board), and then do a TG16 and PCEngine version, as I love BOTH those machines! Since they are both basically 6502, I dont expect them to take very long and I might be able to move to other platforms... like the Amiga/ST.

Still...its taken long enough to get here, so I'll worry about all this later!

No comments: