Archived

This topic is now archived and is closed to further replies.

Question about zone's

This topic is 5648 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, just wondered how to do multiple zone''s, here is the idea User starts game => default zone loaded Once he advances in the game, he goes to other zone''s For instance, he starts in Greenwood If he goes south => he goes to a city: Titiboum If he goes North => Zone => Dark Rocks If he goes East => Boat to other continent If he goes West => Orcs Base How can I do this? I thought about two ways: 1 - Create a class that would have all the city info or zone info (npc''s, monsters, treasures, shops and so on) 2 - Create a file that did the same thing. But how to load the info? Many thanks

Share this post


Link to post
Share on other sites
Since you are the one writing the game data, you are the one deciding in which format it is saved, therefore you also decide how to load it.

All that''s left to you is to learn your language''s file IO API (i.e. C''s fopen, fread, fscanf ... or C++ std::ifstream with std::ifstream::read ... )

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]

Share this post


Link to post
Share on other sites
I looked more for help with the implementation, it should probably need more then one file or more then one Class, but then I wanted to know how to go to That file or That Class and not the other one?

Should I more use a Positioning of the Whole world

For instance => center of the world is 0,0 if you go to the North and come to 0,6 => go to Dark Rocks

Should this be feasible?

Many thanks

Share this post


Link to post
Share on other sites
Whether you use a global or zone-local coordinate system, one possible way is to store in each zone a set of links to the other zones.

i.e. "Once you reach point X in zone A, going towards Y really takes you to Z in zone B".

That''s the way MUDs have been implemented for years.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]

Share this post


Link to post
Share on other sites
quote:

1 - Create a class that would have all the city info or zone info (npc''s, monsters, treasures, shops and so on)

2 - Create a file that did the same thing.



You''ll need both. The zone''s data is in the file. You open the file, parse it and load the parsed data into the class for you to use in the game. Then you can play the zone.

Sander Maréchal
[Lone Wolves Production][Articles][E-mail]

Share this post


Link to post
Share on other sites