Development Diary Archives - May 2003
|25th May 2003 - Build 512|
Where did this week go.. Well I spent a lot of time making a piece of furniture and spending may too much money. Also had to get a new TV as one of mine decided that old age wasn't for it.
Enough Ramblings.. What did I get done this week ??.
Well for starters. I spent the first part of the week getting jumpman the move around the screen (not following any girders/ladders) at the correct speed. Like I mentioned last week, I had to work out a way to scale up the speed if the player is using a high screen resolution and scale it down if they are playing in a low res.. Turned out to be quiet simple.. All I needed to do is get it playing good at one resolution (I am using 800x500) and that becomes my reference resolution.. Then all I need to do is multiply my speeds by "screen resolution" / "reference resolution". It's all done in floating point but you have to do that anyway to ensure you get smooth movement depending on the current fps. Put in the code to change the run speed by pressing 1-8 (as per the 64). The relational speeds are not quiet the same as it's 64 counterpart but I think they are more realistic as all Randy could do is skip n' frames (current speed value) which made things sluggish. I can sub-divide everything by lot finer values so even if it is slow, it still responds quickly.
I then defined the HotSpots for Jumpman so he knows what he is standing on and what he is over. The below picture shows the 8 defined spots, which allow me to see what's below is feet, what's at is feet, what's at his head and what's above his head.
The code to use the level bit masks (each cell has certain bits set depending on the object(s) which exists at that point) was written and a small debug function coded to print it out on the screen.
Above, you can see the debug information and the actual location of Jumpman. The debug information prints G for Girder, L for Ladder, C for Chain and R for Rope. Offcouse the actual bit patterns are more detailed than that and I can test to see I'm over the Left edge, Left Middle edge, Right Middle edge and Right edge of the ladder (as it is 4 cells wide). The same goes for the other objects.
I then put in the correct animations for running and climbing (ladders, not ropes/chains yet) and started putting in some of his behavior code.. Ie. When Jumpman is on a girder but over a ladder, then he will using the first climb frame instead of the standing frame.
Put in the ladder detection code into the climb up and climb down states and he now correctly climbs up (and stops) at the top of the ladder (see below picture) and climbs down (and can drop off) the ladder. The caveat to this is that if Jumpman is on the bottom girder of the level then he will not go though the climbing animations and just stand there..
Still got the do the Girder interaction code (where he follows the shape of the Girder) but things are slowly getting there.
One thing I did add to the sprite drawing code is to draw the jumpman sprite twice but the first time use the old x/y location and only draw him at 20% translucency. I then draw him fully at the new location.
This gives him a slight shadow/blur. This provides an optical illusion which helps smooth out the sprite (as you eyes see him) as he moves quickly around the screen.
|18th May 2003 - Build 512|
Been another good week.. Got a fair bit done on Jumpman and had a nice day out to the Old York Motor Museum (with my Dad). On the down side I did slice my finger open at work so typing was out of the question on Friday (but not mouse clicking ). Although still sore, its back to finger poking typing speeds again.
Added in the Bomb objects into the Game rendering Engine.. I made them animate (16 frames max) but you can ofcourse use the same image 16 times if you don't want it to animate or replace it with something completely different (which is what I will be doing for the Grand Puzzle 2 level). I just made a simple pulse animation. Looks good on the screen though. There is a new bomb property to pick a random start frame of the animation so all the bombs can pulse differently.
Coded up the video options screen which allows you to pick which screen res (and full screen or not) to play in aswell as the aspect ratio to render the game at (this really only works in windowed mode as openGL fails to open the non-pc aspect windows). I was looking at the game the other day and realized it was looking different (in aspect) to the 64. The 64 uses a 8:5 ration while you average PC screen is 3:4. It wasn't too hard to put in the supporting code to get it to render differently but it makes it look a heaps better.
You can see the difference it makes (with the same level) in the following screen shots.
You can see that the Jumpman Player sprite is also in, but at the moment that's all he does.. No running around platforms just yet. Got in the Ladder, Rope and Chain smoothing code which builds the objects up out of several graphic elements.
While my finger was not feeling too well.. I did find time to finish up putting in the rest of the 'Beginner' levels.
Also played around with Transparency and Blending and got the level elements drawn at different transparency levels. (note the top corners of the screenshot below). I want the elements to fade in and out as they become visible/invisible. Should look rather cool. Ofcourse the objects below would be totally hidden but they are slightly visible purely for this screenshot.
Probably the biggest achievement was the rending of the girders using the proper graphic set. This involved working out all the graphic combinations of the girder (with a simple inset shader) and copying all the unique individual elements into a sprite bitmap. Worked out a neat way to quickly process it real time during the game so multiple girders blend in with each other. Horizontal and Vertical Girders do not blend together as I want them to look like 2 different types).
I know the Girder graphic set looks like its all the same green thing but they are all slightly different. The Bottom row is for vertical girders.
Also spent a bit of time building up the sound effect library so it's there when I need it.
|12th May 2003 - Build 510|
Happy Mothers Day Mom (Not that she reads this )
Been a fun week full of a lot of work and some very long hours.. On Monday I think I burnt myself out (after a 16 hour stint) so Tuesday was spent doing something a little simpler and this, the new look website was born.. I think it turned out quiet well.. I'm very happy with the menu.. I pictured it in my mind and it came out reasonably close. Unlike Stein my graphic ability is not good.. I have a eye for what works (well I think so ) but getting it out is another thing.
A good part of this week was spent putting what I had learnt about openGL into the actual Editor. It took quiet a while to add in all the code to open up a display and use the same messaging system as the editor.
I spent some more time working on the Texture Loading system and got it working fine from within the game player.. I converted the textures in the saved game file with no problems which was a big relief.
I also spent a lot of time on the problem of making the game truly resolution independent.. so it renders the same no matter what the screen resolution is.. After I lot of playing I discovered that openGL has some excellent support for that if you set things up right..
For example.. In Jumpman-UC. The level design is basically 80 x 100 cells. Now if you want to render 80 cells at 1024 res (an example) then 1024/80 = 12.8.. The .8 bit doesn't quiet fit into pixels so it has to be adjusted to whole number.. If you round it down then you get 12 (dah!) and 80*12 = 960 which leave 64 pixels unused (don't want them dying of boredom ). Round it up to 13 and you get a total width of 1040 which is bigger than our destination resolution. Now this is where openGL comes in.. You can set the Viewport (physical screen size) and the Ortho Matrix to different values so I can actually render at 1040 and GL will automatically fix it up for me so it correctly renders at 1024.. Wicked Stuff.
Once all that was sussed out then came the actual rendering of the level.. I worked on Nehe's font plotting code and expanded it to be a bit more friendly to what I wanted (which was an inverse font). At the end of that process I got the score panel up and running which draws all the filled in boxes (via GL display lists) and then blends in a black font over it..
I did some tests and worked out that I could get over 600 sprites (on the bellow screen) and still get 180+ fps which for me is more than enough.. The only thing you have to worry about with game speed is when the FPS drops below the refresh rate of the players monitor.. If it does that then it looks jerky.
You can see with the above pic I have the beginnings of a level.. Ofcouse there is no actual level at this point but it is displaying the picture requested by the level aswell as the game score panel. You can see that I seem to like that background picture. A friend of mine sent me some very nice render pics which will make some excellent backdrops..
I'm still working out what to do with the score panel.. would like to make it totally definable in a future version but for now it works ok.. (ofcourse a new font wouldn't hurt..)
After a lot of work setting up the Game Update classes, which the Game Player uses to reference all objects in the level (basically, each object just inherits the sub-class and overloads anything it needs to). Once I got it running ok (even today Inherited Classes are still a black art (certainly when you add the word Virtual)) then it didn't take very long to get the static objects in the game starting to render.. A Static object is basically an object the can be walked on, climbed etc.. These use a special cell map that the collision detection uses for jumpman. Other objects (such as lifts, monsters) are more complex and will use a totally different dynamic system.
And now something blue..
At least, the object information from the Editor is being correctly handled.. They both Look boring without anything else.. Working on that
The graphics at the moment are very plain.. But its a start.. I want to add in some very nice shading stuff which I will be doing next before I add too many more objects that can render. (saves modifying code too many times). I talked about this a few weeks ago but each element in the game will have several graphic frames depending on what it needs to draw.. Ie a Ladder has a Top, Middle (repeating) and a Bottom so the graphics can be smoothed out over the entire length of the ladder.. Girders are a LOT more complex as they can slope up and down. All objects can all join other graphics so if you have 2 ladders on top of each other then they should look as one when rendered. If one ladder vanishes, then the other should reformat it'self to it looks correct..
You may of not noticed, but there has been a Forum setup to discuss the development of Jumpman-UC.. Please Click Forum and start asking questions or making suggestions..
Dave Campbell has released his long awaited Jumpman Zero.. Very nice game. You can download it here Jumpman Zero
|4th May 2003 - Build 429|
May Already.. Man where is this year going..
Well I managed to fix the bloody toolbar problem which was plauging me from day 1. Turned out it needed an extra flag in the CreateToolbarEx() function call.. Argh.. Windows!!
The first half of the week was spent tyding up my list of issues with the editor and fixing some minor bugs. The list thankfully wasn't that long but like all things, took time to do.. Finished off the compression for the sounds/images, aswell as finished off the library support code.
When you create a 'New Game', it's now preloaded with the default graphic sets (and sounds when Iget that far) so you don't have to import them yourself (unless you want to use your own graphics)..
I feel I've done as much to the editor as I need to at this point, and that I should be starting the actual game rendering engine. Ofcouse once the basic rendering engine is done then its back to the editor to add in the VBS (Visual Basic Scripting) support aswell as the other objects needed (Monsters, Doors, etc..)..
Sent off a version of my Editor to Randy (Glover) and my other beta testers to play with.. So far positive responses. Talked to Randy a bit out the development of Jumpman (the Atari Version (original) took 4 months on and off to do). Randy is working on a programming project at the moment so we've been talking a bit about that too (no, it's something completly different to Jumpman)
Took a break for 2 days to work on a programming project for a friend to control some quiet complex serial devices via a simple PC program.. The first program was only a tester to allow him to test each command on a device aswell as set its parameters. More complex software will need to be written in time but it was nice doing something completely different for a bit.
After my 2 day break (if you call still programming a break ) got stuck into the openGL stuff which thankfully (and for Nehe's great site) wasn't too hard to get started.. I worked out how to open a GL window, do the timing loops, render some text and draw a few sprites (or bobs (Amiga talk) or whatever they are called these days). Got a quick hack demo up which has over 200 sprites on it and some scrolling text. Was a lot of fun learning about GL's Alpha support and the Blending effects.
Spent most of yesterday working on NeHe base picture code and expanding it into a more versatile library. So things like Alpha conversion can be turned on/off (and specified what to convert) aswell as integrating other loading methods and TGA support (transparent, no separate function calls).
Oh Stein has been playing with his Mr Potato Head kit again..
Considering I watched Austin Powers 3 : Goldmember this week, It stuck me that he looked like the Dutch bad dude.
This week I will be playing a lot more with openGL but I think I have enough understanding of the basics (or will do in a short time) and can actually start implementing it into the Editor and start rendering levels. Ofcourse a lot of support functions will have to be written but I've got a bit of time free this week and my enthusiasm levels are up.