Author Topic: Whole new subject to ask annoying questions about  (Read 352 times)

Offline JohnnyDmonic

  • Hero Member
  • *****
  • Posts: 627
    • View Profile
Whole new subject to ask annoying questions about
« on: October 06, 2007, 04:06:11 PM »
Is there a way to generate random starting maps for use with the Map editor?  Ie a command line : Random WildMap Bordertype 31 Gapfill stuffs

Also, what do the gapfill stuffs do?  I've been reluctant to play with that, even though I see it get used some of the scene missions.

Also also, if I do make a map file, can it be only partially full, then have the scene provide additional elements and terrain?  Or in those cases would it be better to plan it out in the map editor then copy it over by hand into the scene?  Basically what I'm asking is if it's possible to create a minimap, or partial map, or even a full map with blank spaces, and insert it into a scene.  Dunno if I explained that well.

Offline Joseph Hewitt

  • Administrator
  • Hero Member
  • *****
  • Posts: 2552
    • View Profile
    • http://www.gearheadrpg.com
Whole new subject to ask annoying questions about
« Reply #1 on: October 06, 2007, 07:39:09 PM »
I don't believe the map editor can generate random maps, no. It's a function I thought about adding but I didn't get around to it.

The gapfill string lists a number of map feature types (the numbers correspond to the types listed in randmaps.txt) which will be inserted into empty spaces on the map. To illustrate how this works, open up randmaps.txt in your editor and look at Map Type 1, the "Default Wilderness".

The rendering command for default wilderness is "Fill 1 0", which simply fills the entire map with "Open Ground" terrain. The next line, the GapFill line, is where the real action takes place. It lists five map feature types: "-4 -5 -9 -4 -5", which correspond to Forest, Hills, Lake, Forest, and Hills.

So when a default wilderness map is created, first the entire map is filled with open ground. Next, the map generator starts placing randomly generated map features in any empty spaces that it finds. Because forest and hills are listed twice in the gapfill string they are each more likely to be generated than the lake is.

If a scene has any predefined map features, these get placed first before the gapfilling features are generated. Map features can do all of this recursively, down to a size of about 5x5 tiles. See how Hogye is constructed for an example.

A map generated with the map editor can't be only partially defined, since a pregenerated map loaded from disk doesn't go through the random map generation process. In GH2 it is possible to define a 5x5 minimap and insert that into a scene, and it's also possible to assign map feature anchor spots in a pregenerated map, but neither of these things work in GH1. Sorry.