Non-takeable 'prop' objects

Chris H.'s Ultima / ACS-style game development system!

Moderators: Ice Cream Jonsey, joltcountry

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

Non-takeable 'prop' objects

Post by rld »

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.

User avatar
Tdarcos
Posts: 9341
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: Non-takeable 'prop' objects

Post by Tdarcos »

rld wrote: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
Duke Nukem handles this as does Doom III - and I think some other games do as well - through the same process your local TV station handles the guy standing in front of the weather map: Chroma-Key.

One color is picked as the transparent color, and anything that color is the Chroma-Key and disappears, allowing the underlying object to be seen. In a computer game, if there is no underlying object you get a transparent object you can see through to the other side. Very useful for doing glass; you have some white streaks on an area tile where everything else is the Chroma-Key color and it does a very good simulation of glass.

Make borders of an object the Chroma-Key color and you can show odd-shaped objects on rectangular tiles. Also on television if you're wearing anything that color that part of you disappears. Useful for special effects.

In the movie "Groundhog Day," WPGH uses blue as the Chroma-Key. Duke Nukem uses purple as its Chroma-Key; DOOM III and most television stations I think now use the shade of green about the same as automobile antifreeze. I found this out for DOOM III because sometimes it didn't draw everything properly.

They even show it on the TV program "Tosh.2.0"; if you watch that show Tosh is videoed with whatever bumpers or video they're using on his left side. At the end of the show they drop the Chroma-Key effect; during the credits they show him standing in front of the audience and you can see that for the whole show he's been standing before a studio audience with a green background behind him.

Visit My Site; now with more than 103,716% more content than Pnback's!
"I really feel that I'm losin' my best friend
I can't believe this could be the end."
- No Doubt, Don't Speak

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

Re: Non-takeable 'prop' objects

Post by rld »

Tdarcos wrote:
rld wrote: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
Duke Nukem handles this as does Doom III - and I think some other games do as well - through the same process your local TV station handles the guy standing in front of the weather map: Chroma-Key.

One color is picked as the transparent color, and anything that color is the Chroma-Key and disappears, allowing the underlying object to be seen.
ACK already has a transparency feature that operates in just this manner; for 'movable' objects (things that can be moved by the player, creatures, and the player itself) you can draw in portions of the graphics tile with the designated 'transparency color' that will allow the background/underlying tile to show through.

The trick is that when building up scenery, there is no way to stack one terrain tile using transparency on top of another - the game does not support this for static (terrain) objects, only movable ones.

Hence the need for the highly-elegant-and-not-at-all-horrendous hack described above.

garth

Post by garth »

Sweet hack rld. This just may what I needed to get in all the tiles i needed to finish my masterpieces. ;)

Post Reply