• entries
    743
  • comments
    1924
  • views
    579118

Slow progress

Sign in to follow this  
Aardvajk

84 views

The rebirth of Udo is still alive and kicking. Progress is slow and steady at the moment as I'm trying really hard to avoid all the spaghetti code chaos that happened last time.

So far I've got the (placeholder) title screen and all the options and play-game menus working. You can set the resolution to one of three options (if supported) and my Direct3D wrapper takes care of all the scaling, so the program can act as though the resolution is 1024x768 and everything works fine at 640x480 and 800x600.

Playing the game results in the map being loaded and you can scroll round it with the arrow keys. Music and sound effects are also working and you can switch the sound off.

Good to get stuff like this working before you get stuck into the game, I reckon.

Like the later incarnations last time, the main game screen currently consists of a scrolling sky, a distant and faded landscape and the actual foreground map that you interact with. The three layers scroll at different speeds, making a nice parallax effect.

I'm trying to avoid a multi-layer map for the foreground map this time as it made levels a nightmare to design last time. I was thinking it through and the only reason I actually needed a multi-layer map was so I could have map cells that were drawn in front of the free items.

This seems quite wasteful as well as complicating the level design process. There are three more healthy options:

1) Any map cells that should be drawn in front of the player are taken out of the map and placed in the level as free objects. Even this is probably more efficient than looping through a map buffer consisting mainly of zeros just to draw a handful of water tiles.

2) Iterate through the same map twice during the render loop and mark certain tiles to be drawn on the second iteration rather than the first.

3) Try to get z-buffering working and use that. Don't like this option as previous tests seem to show that this drastically slows down the frame rate.

Really, option 2 is the most viable. Option 3 is unpopular for the reasons specified. Option 1 is okay, but means that I can't have a water block over the top of a rock block, which looked quite cool on the last incarnation of the game.

So I guess I've talked myself into option 2 then. Nice things about free items is that I can give them a Z value (automatically specified in the level editor based on the item type) which is used to do an insertion sort into the items list when they are loaded from the file, so I don't have to worry about the order I place free items in the level editor. Worked pretty well last time.

I just need to keep focused on making the levels as easy to design as possible this time since that is where I fell over last time.
Sign in to follow this  


2 Comments


Recommended Comments

Wouldn't it be better to mark tiles when the map is loaded? At least if their order won't change during the game.

Also I hope you're not iterating through the entire map when rendering, it would be unnecessary and inefficient.

Share this comment


Link to comment
Quote:
Original post by Scet
Wouldn't it be better to mark tiles when the map is loaded? At least if their order won't change during the game.


That's what I meant. Sorry - not very clear above.

Quote:
Original post by Scet
Also I hope you're not iterating through the entire map when rendering, it would be unnecessary and inefficient.


No - only the part of the map visible on the screen.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now