Jump to content
  • Advertisement


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


static map generation

This topic is 6332 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, I have a concept for an online campaign manager for my local tabletop wargame group which is a non-animated, turn-based (Yes, there are some of us left who play those! )system capable of being run through a browser. The data for the map, contents, and player positions are going to be stored in a database and the idea I have is to pull the data from the DB and use it along with a library of pregenerated maps and icons to regenerate the map with up to date information and send it back to the browser. Is this a good idea? and if so, what is the easiest way of doing it, I know a little C++ and program in PHP. Thanks all! Eric J.

Share this post

Link to post
Share on other sites
If it''s going to be web-based, you may want to use Java or Perl (or maybe even Lingo?), and not write a client app in C++.

Basically, I think the database should simply contain per-player information, the hight and width of the map, and then a list of tiles, with the tile type, the units on it, etc. The list can be linear, because, given the height and width of the map, you can determine which item in a list is appropriate. So you could even store it in a simple text file, especially if you wanted to write a server and client software.

What I mean by getting data from a 1d list given 2d coordinates is this:

Take a 2d map:


And transform it into a list like so:


If z is the index of a 1d array you want to find, then, given 2d coordinates x and y:

z = y * width + x


z = (y * width - 1) + x
//if the array starts at 0.

That would be a simple system.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!