Advertisement

Structure of objects in isoland

Started by December 17, 1999 09:56 AM
0 comments, last by GameDev.net 25 years ago
I'm currently in the process of designing a CRPG. Not in code phase yet, mostly design.

I prefer to know what I'm going to do before I actually do it. ;-)

What I would like to do is to give all objects (trees, tables, walls) different physical characteristics.
Since they got it in real life I thought it would be neat to have it in the game as well.

A stone wall acts differently to a explosion than a paper wall.

Looking at an isometric tile there is a possibility of adding at least five objects on that tile. As far as I can see anyway.

I could make loads of maps to sort out all the objects but I thought that there must some better way.

Any ideas on how to build something like that?

the use of inheritance would be well applied here. the main issue is developing an interface that provides all of the functionality you need while remaining generic enough to encompass all of the descendent classes. also, each class will have to make good use of encapsulation, since your map only knows that there is a CThingie on the tile, not that it is a CStoneWall, or CRock, or CTree. You may find that containing a number of internal variables, such as Durability, can accomplish keeping track of things like how decimated a stone wall has become, or how destroyed a tree is.

you may also have to come up with a base class for mobile game objects like catapult stones, arrows, or whatever, so that you can generically give an InteractWith() member function to your immobile object's base class.

so, anyway, there's MY thought.

***OOP- THE WAY TO BE***

Get off my lawn!

This topic is closed to new replies.

Advertisement