Thursday, September 3, 2009

Four walls

Clearly I had no idea what I was talking about when I said starting a blog was the hardest thing to do. Coming up with things to talk about in a development blog when development is sluggish - that's what's hard.

Recently I've added roofs to the rooms in my dungeon. Before a player enters them, they are dark. After a player enters them, they're bright. Hurrah! Right?

There's a few issues this raises that aren't immediately obvious. Items in the rooms are drawn after the rooms themselves (that is, the room is drawn on the map, then the items are drawn in the room). Since the roof is part of the room, and not an item in the room - what do you do with all the items? Do they dissapear? Do they only generate when you enter the door? How about things that move other than the player entering a darkened room? The best solution I can see with the engine I have is to simple not draw any item that's in a room that hasn't been discovered yet. It'll be a little more computationally intensive than, say, keeping each room as it's own object and going from there. (rooms are collections of coordinates, see.)

The outside, of course, will have to count as a room too. Otherwise there might become strange logic as to things not being in a room - although with my code the way it is, things don't care about rooms or not, yet. Hell, they don't really even care about walls. But the outside has to be made a room just for carefulness's sake.

But now is the big question: walls.

Why are walls such a big issue when I'm drawing the rooms? Because you shouldn't be able to see them when you're walking around outside the building - you should only be able to see the walls once you've got inside. So, walls don't appear until you've entered the room. Great, the building will look like a big black shape on the map, because we now aren't drawing *exterior* walls. And If I start to keep them in their own buffer, what about when I draw a funny shaped building? What if I want to change the code to add more rooms on?

Sigh, times are tough...

No comments:

Post a Comment