4 Hugues Ross - Blog: Chainsaw Deathrace Design #2: The Grid
Hugues Ross


Chainsaw Deathrace Design #2: The Grid

This is my second post on the design of the new version of Chainsaw Deathrace that I'm working on. This one will be about the grid and the placement of various objects. The previous one was about the characters. Read it here.

If you've played my game at this point, you might ask "What's wrong with the grid now???" The answer is, of course, nothing. The grid isn't what I'm worried about. Walls, on the other hand, are a gigantic pain in the rear to deal with.(You may want to skip this next paragraph, which is a gigantic rant about walls)

Here's an excerpt from the map data. This is just the information on walls for 3 squares:
|0 8 0 8|0 0 0 8|0 0 0 8|. Each type of wall has no less than 4 different entities to its name. Top, bottom, left, and right. Worse yet, this becomes absurd when you reach the code that decides what you see. There's a wall in the way, so you see nothing behind it. However, that means you don't see the wall either! After all, the wall is part of the square. I need to place left walls right of right walls, and top walls under bottom walls. Otherwise, you can't see them. Locked doors are walls too, so we need to place them in pairs as well. That means you need keys that technically open more than 1 door at a time. The Chainsaw Killer saws through walls, so what are we supposed to do then? It's a nightmare. Better yet, it effectively quadruples the amount of memory the wall textures take up.

I think the best way to deal with this issue is not by changing how walls work, but how the grid works. As it is now, each square has 5 spaces: one for each wall, and one for other things(Items, graves, etc.). In the new system, this will be a bit different. Each square will be a cube with 7 spaces: center, and all of the edges. I've been wanting 3-dimensional maps for a while now. Anyway, the big difference is that these aren't what all map squares are like. in between these, there will be invisible rows and columns with only 1 space each. When unused, these will collapse into adjacent tiles, making them bigger. Here's a diagram showing what I mean:
This may look like 4 tiles, but it's actually 25.

Now highlighted with red, blue and green.

This may seem wasteful, but it saves in other areas(like vision calculations). One other thing it allows is interesting. In fact, I'm not sure how I'll use this feature yet, cool as it is. I can place, say, two pits next to each other. If I want to, I can put a pit in the in-between square, leaving we with 1 big pit. However, I can also leave it as 2 little pits. I'm still trying to find a use for this. It seems too good to let go of.

Up next: Turns, Speed, and Sprinting!

No comments: