0
\$\begingroup\$

So I am contemplating whether or not to add a Pre-Generated Map or a randomly generated map into my game. But I also need to add Tile properties into the map (i.e. so that water tiles aren't being walked on by the player, etc.). Which way is better, to add tile properties to an existing image file or to add tile properties to a randomly generated map?

I want to make it so that I can add Tile properties to a pre-generated map as I already have one ready to go, but is it even possible to add tile properties to a pre-generated map?

I am using Java and the Slick2D gaming engine.

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

I think your question is not very clear and actually brings many mini-questions in one (what you should avoid doing in this website).

That said, I will address very briefly some points:

is it even possible to add tile properties to a pre-generated map?

Yes, it certainly is. Once you generate the map, for each tile you can just pull a bunch of information related to the tile type in question. For example, suppose you generate a 10x10 map, where the rows are identified by letters and columns by numbers. So, when you randomly define cell A1, it ends up being "water".

Then, you just have to import the values for that cell from a list or array of tile types that has a format similar to the following (in this case, water is the first row):

type; walkable; food;
water; 0; 10;
grass; 1; 5;
rocky; 1; 0;

If B1 is randomly determined to be a "rocky" type, again you identify which row in the above list/array corresponds to "rocky" and imports that row into the new tile.

Is It Better To Generate A Pre-Generated Map or A Randomly Generated Map When Using Tile Properties?

Now that's an entirely opinion-based question. Specially because we know nothing about your game. So, it's utterly impossible to give you clues on that. However, what I can do is tell that it's fairly and equally easy to assign properties to tiles in either case.

So, no, your choice between pre-generated and randomly generated maps shouldn't have anything to do with assigning properties to each tile.

Choosing if you are going to use pre-generated maps or randomly generated maps is a game-feature decision. It's a higher-level game design decision that you should make beforehand mostly on the basis of what you want your game to be like and offer to players.

\$\endgroup\$
3
  • \$\begingroup\$ Alright thanks for the response. Also, I apologize for the vagueness of the question ;). \$\endgroup\$
    – BlueJet
    Dec 22, 2015 at 4:20
  • \$\begingroup\$ @BlueJet Not a problem at all, I mentioned it just to help you in the future. And about the answer, you are certainly welcome! \$\endgroup\$
    – MAnd
    Dec 22, 2015 at 4:25
  • \$\begingroup\$ Commenting on pre-generated vs. generated, there's a game project I was working on where my maps were hand-built from tiles, but the game generated the walkable graph at runtime. This was so it was easy to get the maps the way I wanted without having to do fiddly things with the pathing arrays. On startup, the game would simply loop over the various tiles and insert the walkable/notwalkable values into the arrays. It took a minute, but was well within reasonable load times and made my life easier. \$\endgroup\$ Dec 22, 2015 at 6:21

Not the answer you're looking for? Browse other questions tagged .