Tuesday, October 03, 2006

XeO3: Surprise Surprise!!!


Well, in only 2 days, I've done the main part of the port to the C64! Although there are no sprite graphics yet, and no multiplexor, its running through the game and its paths. Alien Bullets are off a bit for some reason, but that should be an easy one, unfortunately because the Plus/4 one has been designed to run in 2 frames, the C64 one runs a bit quick. I can slow it down to 2 frames as well, but I'm not sure I want to yet. Past experiance says that when you're PLAYING the game, you dont notice, and 2 frames gives you a lot of free time to do cool things. Because of Hardware Sprites, I can however move the players ship every frame, which will help make it seem like's going quicker than it is... I could also scroll the screen by 1 pixel a frame as well, but I dont think thats gonna work becasue sprites that are supposed to be attached to the background will judder - I think.

I've just been thinking, if I move the VIC bank to $4000-$7fff, then I'll be able to use more or less the same memory map, and use Luca's SID music as is (since it sits at $1800 - currently right in the middle of my sprites!) It would be nice to use his music, as it helps round out a demo.....

Monday, October 02, 2006

XeO3: C64

I'm having fun with the C64 just now while Luca gathers together some sprites for me to use, but I've hit my first snag.... The MCM on the plus4 uses differnt bits than the C64! Damn. So, I've done a bit flipper to swap bits $01 and $10. This lets the colour RAM on the C64 do the bright colour (since in MCM on the C64 you only have a choice of 8), and the 2 full colour registers then make up the rest... This will work fine for the game graphics, but......... The panel has some HiRes graphics in it...Damn, damn.....

So looks like I'll have to do a character index and tell it the ones I WANT to swap...bugger. However, once thats done it should just be a matter of importing Plus4 graphics and using them directly! Initally I'll do a port routine for the Plus4 sprites as well, then I'll get them resized. The C64 sprites are 24x21 (or 12x21 in MCM), while the Plus4 ones are 16x16 so there quite a bit of extra space there! The reason for the odd sizes is simpky that it lets the C64 have a sprite every 64 bytes, making 256 in a VIC bank.

I think I can get the whole thing up and running (without sprites) pretty quickly, then I'll need to get a multiplexor going... and then that "should" be it! :)

(in theory....) Imagine doing a "dual" retro release!! How cool is that!!! Now... if only I could persuade Russell (Kay - Lemmings PC programmer) to write the spectrum one...Mmmmm.... That WOULD be a complete rewrite though...

Sunday, October 01, 2006

XeO3: bits and bobs...

Sound is interesting.... you can work away trying to get perfect pitch and volume and then when its working just the way you want, you can sometimes make it really course and never notice the difference. I put keys for volume control into the game, and all the work spent on the ADSR (a whole day of it...) is reduced somewhat to a whimper depending on the volume. Now, when playing back on the actual machine TED sounds are far FAR louder than Solder's SID chip addon, so I need to set a volume of around 2 or 3. This means all my ADSR values of 7 down to 0 are now just 2 or 3 down to 0. Not a lot... But they do still count, because if you dont use ADSR at all, it sounds terrible... weird.

I have to confess, I've been playing with some C64 code tonight.... I found the source to the Armalyte Multiplexor on (Lemon64), and thought I'd go through it... and perhaps get it up and running. However, this has lead me to look back at my Blood Money multiplexor (which itself was based on me hacking Armalyte - although I wrote it myself once I had the gernal idea), and its not bad either... theirs is a bit larger with the loops unrolled a lot, but mine wasn't too bad at all. Anyway, I think with very minimal work (and a working multiplexor) I can get XeO3 up and running pretty quickly on the C64. I'm kinda half waiting on Luca to do some more sprites now anyway, so I've an excuse to play a little... well... thats my reason and I'm sticking to it! It will be a little harder to get .PRG's onto the C64, although my MMC64 will help a bit, but a download cable would be much better.....

So, after looking through the source, I've started to macro it a bit more to make it easier to follow - for the sort at least, I may well write my own multiplexor bit again... but I suspect I'll try and get something running first. The great thing about doing a C64->Plus4 or a Plus4>C64 conversion is that being 6502, it'll just run - I won't have to rewite it all the way I used to do when doing a port. This means I get to do all the fun stuff and dont have to do ANY of the boring stuff again!!! Great!!!

XeO3: Sounds....V2

Weel, I've gotten 2 channels...almost - but good enough I think. Basically, I now have 2 full effects playing and both use ADSR envelopes, however channel 1 (Square wave only channel) will now check to see if its ADSR value is bigger than channel 2's sound. This means that either channel can get louder if sounds overlap, but you don't really notice that much, and having 2 channels is much nicer.

I'm also starting to feel the pinch, and memory is becoming tight. I've had to do my first code shuffle since code space was over running, so I've moved lots of local function variables into the games DATA area, which I've now expanded by 2k to make room for it. This isn't something thats gonna improve, it'll just get worse. It also leads me to wonder what the hell Im gonna do for a front end! Theres just NO space left for one, let alone character sets and all. I'm not a big fan of "loading" front ends since this is really bad news when you first start playing a game and get killed a lot, long load times don't make for a fun game.....

Speaking of long load times... I'm looking at the memory map and ralise that I'll need to load 3 seprate files per level; it would be much nicer if I could make it one big one, load times would drop quite a bit. I'll have to see if its possible to shuffle things around to be able to do that.

Saturday, September 30, 2006

XeO3: Sounds.....

I've been having a play would some sound effects just now, and for basic TED sounds.... its not bad really. I can only use one of the TED channels since I need to change the volume to create an ADSR envelope. Its a pitty since 2 channels would me a big difference to the overlapping nature of effects. Still, I've added in apriority system so firing sounds are drowned out by explosions, which in turn are drowmed out by pickups and so on. It means that at least theres some basic sound effects as well as music - normally you only get one or the other.

I've had to create a 64 byte volume table to allow the sound effect volume to be turned up/down. Since I use the volume to create the ADSR, I need a redirection table depending on what the volume actually is. For example, if we're at volume 4 then ADSR value of 4 becomes 2 (instead of staying 4 when SFX volume is 7). This means I can turn down effects smoothly just like the music.

XeO3: Pickups.

I've now added those commands; didn't take long, and now I've moved on to do the pickups. What I now have running is a set of 5 baddies where all of them need to be shot and the last one then explodes and drops a coin (or any pickup at all in fact). I had to add a NOSHOOT flag as well and make it different from NOCOLLISION so that you can't shoot the pickup, but explosions also won't harm you. I guess I could have left NOSHOOT out and just set the number of hits to something insane, but this feels a little cleaner. So now all I need to do is get instructions from Luca on how the weapons and pickups actually work! Then we can finish with this bit and move on. Also means Luca can plan out the levels a bit better with all the bits in the right places. I only have a couple of bits left - I hope I don't need to add too many more flags!

And...............rest.

After having been hard at work *ahem* doing the demo, I'm, having a nice relaxing day today. I've been sitting here scanning the old Zzap64 site and reading Braybrook's Morpheus diary again. I remember when it first came out, I was rivited! Actually reading day-to-day delveopment was great - this was before I was doing it myself of course. Great fun re-reading it, although some of it now seems a bit silly, but it was obviously designed to be read by non-professionals, and was well written for that. I've also been playing with my MMC64 (a card that plug into a C64 that lets it read+write MMC cards.), and its been great seeing some of the old demos+games again. I can also use it as a SID player while I work! Cool!

Seeing the power of the C64 again really makes me want to port the game over to it, theres SOOOO much more that could be done if I had Hardware sprites. More characters, more animations - more space in general!! Oh well... one thing at a time.... I might play with a multiplexor sometime soon though....just for fun.

Oh well, back to work I guess. Time to implement the new sprite group system, and add a couple of new commands for Luca (who's now learning how to use the scripting system). He needs SETFLAG <flag> and CLEARFLAG <flag> to allow some effects for certain alien types and shouldn't take long to add in. I've also decided I don't need STOPGROUP since you have to set a flag for it to be IN a group anyway, so if you dont want to be in a group, just don't set the flag!

Friday, September 29, 2006

XeO3: Power ups..

So, back to work then... I've been thinking on how to get powerups from baddies, and I reckon that the best way would be if you had to kill groups of them; miss any, and you dont get anything. So, what I need is a couple of script commands to help with this. So, I'll create RESETGROUP <index>, SETGROUP <index> and STOPGROUP. This will let me tie baddies together, but they'll also need a new GROUP flag so that I know I have to link them with the others.

To do this, I'll simply create a 8byte array (so I have 8 groups to play with at any one time) and after I issue a RESETGROUP in the path any sprite started with GROUP will simply increment the variable in the group array that we're currently using. Then, when it dies, decrement it. If something does die, and the counter goes to 0, then we can start the death path which then releases the power-up.

Should worl fairly well, and with SETGROUP , should let me have multiple groups on the go at once. Most I think will drop money, but some will drop weapons.... I think... Up to Luca I suspect :)

XeO3 scripts...

The cool thing about doing a script engine is that whenever you need a new feature or have a special case, you can simply add a new command for it. Which is exactly what I've done to help the Teaser demo; so now when it reaches the end of the level, instead of waiting for the BOSS (which isn't there - we dont want to give the whole game away!) the level will restart and you can watch it all again!

I've been throwing in a load of scripts to help fill up the level and its looking pretty good, but I don't expect many of these paths to be kept once we do the level properly We'll take a lot more care in placement than I've done with these quickies!

What really gets me with XeO3 on the Plus/4, is that its doing SOOO much work! If I ported it to the C64, I wouldn't have to draw any software sprites (although I might mask the baddie's bullets), and since running a multiplexor is actually fairly cheap, the game would fly!! I could also scroll the bloody screen properly rather than 2 pixels at once making it much smoother as well. Once the Plus/4 one's finished, who knows...I might port it over to the C64 - the basic game would "just run", and all I'd need to do is polish it. We'd also have a TON of characters freed up for even nicer backgrounds! I wonder if I could do a bitmap scroller so I could use colour...Mmmm... that'd be very cool.

Thursday, September 28, 2006

XeO3 teaser....

Okay, so I've spoken to Luca, and we've both decided a teaser would be better as we don't want to give too much away, but we do both want to show the progress we're making. I think part of the reason for the demo is that people have to "see" it to believe that its not just all fiction, and to see that that we're not exaggerating on the website as to how good its looking.
So I've spent this evening putting in a TEASER assembley option so I can enable this whenever I want to. After 6 years, it'll be nice to get peoples reaction once they actually see it run!

Doing this also showed that the Plus4 would actually be capable of a simultaneous 2 player game! This would be amazing! 2 players on screen at once blasting away! But I'll leave that as a lesson for the reader.. :)

This demo has also showed up a bug in the sprite system, it wasn't setting the first frame of the sprite correctly, so thats now fixed.