by rld » Wed Mar 09, 2011 11:37 am
Looking through some of the tile sets for the more complete game examples (such as U2B) I realized that a large number of graphic tiles can be used up by various 'prop' objects that may have no other function than decoration. Things like:
- windows
- torches on walls
- rugs
Of course, it is possible to conserve object numbers by using generic objects with 'set later' graphics, and picking tiles one-by-one, but this does nothing to conserve graphics tiles.
In fact, one problem with this approach is that if you have more than one type of wall, or floor, it is necessary to redraw the scenery tile for each combination, so you might end up with:
- window on red brick wall
- window on grey brick wall
- rug on stone floor
- rug on wooden floor
and so on. Unfortunately, there is no way to display transparency for terrain object tiles to 'layer' one terrain tile on top of another, and worldmap regions don't let you stack terrain tiles anyway.
What is needed is an object that can be stacked on top of the terrain tile, so that the underlying terrain shows through using transparency. So we would just need one 'window' object, and then you just place it on top of any type of wall, and it will display correctly.
Misc. item objects will work just fine for this, but then you have the problem of the player picking up (and moving) objects that were not intended to be moved from their original spot (unless you are implementing some sort of interior decorating game).
This means it's time to implement a hack. What I am planning is to fix it so that normally movable objects with a weight of exactly 9999 can no longer be picked up by the player at all. Normally, you would never make objects that are intended to be carried by the player this heavy anyway, so I don't see this causing too many problems.
The object can still be examined by the player, and can still have a description that will display, but if you try to pick it up, nothing will happen (just like if you try to [G]ET a terrain object).
So, for example you might have a couple of 'window' objects:
- regular window
- broken window
- stained glass window
and some plain wall objects:
- grey brick wall
- rough stone wall
- red brick wall
and then you can place them in any combination you want (like a stained glass window on top of a grey brick wall) without having to create new graphics tiles for each pairing.
The only catch here is that 'scenery' objects implemented in this way can no longer be animated (because only terrain objects can animate). So if you want to do a flickering torch or something like that, it's better to do it in the usual way.
Looking through some of the tile sets for the more complete game examples (such as U2B) I realized that a large number of graphic tiles can be used up by various 'prop' objects that may have no other function than decoration. Things like:
- windows
- torches on walls
- rugs
Of course, it is possible to conserve object numbers by using generic objects with 'set later' graphics, and picking tiles one-by-one, but this does nothing to conserve graphics tiles.
In fact, one problem with this approach is that if you have more than one type of wall, or floor, it is necessary to redraw the scenery tile for each combination, so you might end up with:
- window on red brick wall
- window on grey brick wall
- rug on stone floor
- rug on wooden floor
and so on. Unfortunately, there is no way to display transparency for terrain object tiles to 'layer' one terrain tile on top of another, and worldmap regions don't let you stack terrain tiles anyway.
What is needed is an object that can be stacked on top of the terrain tile, so that the underlying terrain shows through using transparency. So we would just need one 'window' object, and then you just place it on top of any type of wall, and it will display correctly.
Misc. item objects will work just fine for this, but then you have the problem of the player picking up (and moving) objects that were not intended to be moved from their original spot (unless you are implementing some sort of interior decorating game).
This means it's time to implement a hack. What I am planning is to fix it so that normally movable objects with a weight of exactly 9999 can no longer be picked up by the player at all. Normally, you would never make objects that are intended to be carried by the player this heavy anyway, so I don't see this causing too many problems.
The object can still be examined by the player, and can still have a description that will display, but if you try to pick it up, nothing will happen (just like if you try to [G]ET a terrain object).
So, for example you might have a couple of 'window' objects:
- regular window
- broken window
- stained glass window
and some plain wall objects:
- grey brick wall
- rough stone wall
- red brick wall
and then you can place them in any combination you want (like a stained glass window on top of a grey brick wall) without having to create new graphics tiles for each pairing.
The only catch here is that 'scenery' objects implemented in this way can no longer be animated (because only terrain objects can animate). So if you want to do a flickering torch or something like that, it's better to do it in the usual way.