Random map generator

In two weeks I will have more time where it would make sense to work on the RMG and to transfer jfhs’code along with a few additions into our codebase. I don’t know if we release VCMI 0.95 in January next year but I think this will be too closely. (it’s a bit unrealistic, perhaps February would be better) I could either work on the RMG or prepare a testing concept. (and do some tests)

I am asking because I would be interested to take a look at it too. (Not as main developer, but who knows maybe I will have an idea or too). It will help a lot to have the latest code committed to know what was done and what not. this independent of what will actually be included in the release.

Here some thoughts on RMG options necessary to cover… The advantages of many are self explanatory.
One key idea is that rather than banning things from the whole map, a per zone setting allows decent starting zones with more powerful objects being possible later in the game.

First, some game rules like no diplo, no fly etc should be covered in a separate special part “general map options”. I think I saw a H3 mod with a nice GUI that enabled disabled individual spells, artifacts, etc.

Here a list I have for now:
**
Zone Options:**

Type: "PlayerStart", "Treasure"
Size: '1','2' Proportional with map size
Owner: 'Player Number', 'none'
Terrain: 'Type' or 'matchesPlayerTown'
PlayerTowns, NeutralTowns: 'TownType', 'Quantity'(min/max), 'allowSameType', 'forceSameType'
BannedTowns: 'Castle', 'Rampart'
BannedAdvMapObjects: 'hillforrt', 'utopia', 'chartographer'
AllowGrail: (Per zone setting. Allows grail in treasure area)
Exclude Scrolls: ('level5', 'Berserk')

   **Ability to override zone density for individual objects**

Mines : 'wood', 'ore', 'crystal', 'sulfur', 'gem', 'mercury' (min / max)
'Leprecauns' / 'Windmils' / 'Watermills' (min / max)
'Crypts' (min / max) 
'Utopias' (min / max) 
'Creature Dwellings < 6' (min / max) 
'Creature dwellings 7' (min / max) 
Pandora Boxes: Reward type, Frequency, Guards. Different Pandoras in different zones.

Misc:

- zone visual separators like in H6 (but with no meaning)
- add a max to connection wideness

Global Options for all Zones:

  • Map size: use Square numbers 144x72 (allows rectangular maps)
  • Template description / recommended difficulty, etc

All the following :recommendations: can be overridden via the before mentioned general game options.

  • Recommended exclusion list for Adv map objects (hillfort, utopias)
  • recomended exclusion list for spells
  • recomended Disable Grail => no grail or obelisks

Misc:

  • Game option to allow for only 1 external creature dwelling. (Even if more could be available in area).
  • Game option allowFortsIfSameType

Sounds nice, this settings belong to the template. General map options which can be chosen by the player should be kept to a minimum, but a few so called expert settings (utopia, grail, dimension door, fly, … ) should be OK.

I want do a few things on the RMG after working on campaigns (heroes moving to next scenario) and perhaps battle (gate animation).

It is already present in original templates. There are three types of objects possible to spawn in each zone. Also, each zone has minimum and maximum object value.

You forget that the whole point to write new RMG is also to add new objects in the future. Listing all possible objects to spawn in a zone is a no-go, we must provide more general and easy to handle mechanics. Like spplitting all objects to several classes (pickable, creature banks, stat boosts for example). This way new objects could be easily assigned to specific class and work fine in old templates.

Particular objects could be banned by mods, setting them as unavailable or changing their value.

I have a question, will be supported by old teamplate? for example 2SM4d(3), 8MM6.
Or manually created for example Jebus Cross? If you put rmg in a folder DATA.

Right now most difficult part of RMG is implementing algorithms (like voronoi diagram or automatic obstacle placement tool from editor). How they will be used is quite minor detail at this point.

Besides - as already mentioned by Warmonger this should be made in more generic way. And to do that we first need quite a lot of refactoring in map object handling - currently this is combination of hardcoded H3 properties that was written when project started + set of hacks to make objects from mods work (like dwellings).

If you really want to push this further - maybe you should move this to more easy to edit wiki? And then decide what should be part of zone configuration, template configuration, what should be user-selectable and what should become property of objects or object classes

UPD: actually - looking on current RMG format I think we should move rmg template format to wiki. Current format already have some (quite minor at the moment) points that I don’t like
Current version is in file config/rmg.json or here: github.com/vcmi/vcmi/blob/maste … g/rmg.json

Povelitel
Up to beegee or to whoever will implement rest of RMG. In worst case you’ll have to rewrite template to VCMI format. Considering that most difficult part in templates is balancing porting to vcmi should be easy - just rewrite those 10-20 lines from rmg.txt to our format.

Of course you cannot hard-code every object inside map template. But doing like original RMG, will create highly unbalanced maps. (1-3 utopias on your zone while enemy has 0). (Grail on your zone… etc).

So specific rules should be implemented for these balance breaking objects and probably add a few more from the upcoming mods.

  • New map rule, allow only 1 level 7 to be flagged. This allows presence of 2-3 dwellings on your terrain but you will choose which one to “take”.

  • “Dirty bit” for conservatory gained creatures. Meaning you cannot upgrade and/or combine them.

These ideas are very very bad.
If only as map editor options.
PS Last problem is solved by creating copy of griffin creatures. They will not upgrade, and if set as “special”: true, will not be met in maps

These are not my ideas, it is merely a list of rules that people play ATM in multiplayer. And some things I introduced to allow players a more balanced way to still play with certain things.

For example right now grail has to be outright banned from the beginning, since you can stumble upon it at the gate of your castle… Imagine fun game for the other side in that game.

forum.heroesworld.ru/showpost.ph … ostcount=4

Don’t see fun in playing symmetric games with no possibility.
It’s a war, someone will find victory, someone will loose.
And grail is only gold, what can it give at start of the game?
Only Tower grail is useful at first time.
For Conflux there are no good mages at start, etc.

krs, what about this:

Split your suggestions into these property groups I mentioned (zones, templates, user-selectable, object) and start page named “RMG template format” or something like that. Your suggestions are OK but I’d rather have them on wiki rather than on forum.

This will have to wait till scripting. I just don’t see them possible to be implemented in vcmi - they are questionable and are too specific to tournaments.

I do not see the role of scripting in all this… Can you please explain.

For banning stuff from the map I imagine a kind of gui where you opt out things that you do not want to appear on the map. Something like a :disabled: or something. Where does scripting come in place?

And I am not saying apply those rules to every single template. I am just saying that a framework has to be laid down so such things should be possible. EG: you like playing with 0 utopias while opponent has 5… set min utopias to 0- max to 5. For those wanting balance they will set it to min1-max1 or min1-max2 or 0-0.

As for Grails building… funny that you;ve mentioned tower grail that I lost to in one game while clearly ahead hero and army wise… Here an excrept: “The tower grail building is the impressive Skyship, which provides an additional +5000 gold per day, boosts creature growth by +50 percent, reveals the entire world map, and gives garrison heroes a +15 knowledge benefit.” So in addition to a free chartographer (which by the way is also banned) it gives you 1/2 more troops and loads of money to buy those troops while my 3 towns were producing … 3500G… (even less in week 1)

As for wiki I think more brainstorming is necessary. These are just some things I came up with from my little mp/rmg experience.

I was referring only to 2 suggestions from last post (dirty bit for creatures and single level 7 dwelling).
Everything else may be a good idea to implement as part of object configuration or RMG itself.

This is actually the reason why I suggested wiki - to keep everything in one place instead of spreading it out across whole thread.

It’s now, when dwellings modding system is not yet implemented. But how many options will be required, when there will be possibility to create 20-30 dwellings similar to Dragon Utopia?
I think it’s better to create predefined buildings type (like treasure/relic/etc) and to work with these types on RMG, not with exactly pointed buildings.

Types like:
DWELLING0LEVEL
DWELLING1LEVEL

DWELLING8LEVEL
BANK_1LEVEL

BANK_7LEVEL (Dragon Utopia)
BONUS_1LEVEL (like Windmill or shrine 1)
BONUS_7LEVEL (like Emerald tower)

I’ve done some maps with grails in enemy towns, etc they can be defeated.
PS As I said only Tower grail gives advancing on first weeks because of map exploration.

Dragon Utopia is NOT a dwelling.

There is no need to split objects by their “level”, just a generic value of object for all types.

We are talking about multiplayer balance here, when the entire game lasts 3 weeks on XL map.

Dwellings, bonus buildings and banks still must be divided at least.
Or we end up with 5 dwellings of level 7 or 4 utopas near town.

What is wrong with that? If a zone is rich, it contains valuable objects. I would rather see 4 Utopias than 25 Crypts in a treasure zone.
Also, adding more types of objects would solve the problem.

The problem with Utopia is that it really gives you a lot in comparision to other banks. So having it or not in a zone may secure a victory for a player.

Another problem is that dragons inside surround you are fast and so tough to kill without losses. Here comes another part of balance . Some towns get it really easy to win utopia in 2 or 3 week without losses and some towns just cannot do it.

For example with fortress you can go into Utopia and finish it up with just 3-5 hydras and 6 lizardsman (optional cure spell helps but is not needed). Not every town in h3 has such trick that makes it easy or possible to win Utopia in 2 or 3 week of game. Important to note here is that most multiplayer games end in 3 week of play.


So another question is who uses random generator ? Well it is mostly used in multiplayer. Singlepalyers prefer campaign and good solo scenerios. So random generator is mostly used in multiplayer and maybe by some mapmapkers to ease up map making process. So IMHO VCMI should target random map generator ar mainly a multiplaye feature as it mostly used there.

Why is it used in multplayer while there are many good ‘fixed’ maps for mp ? Well, because it’s the only way to be close to what original heroes is . On fixed maps you must know the map and most likely you will know it in a way that all your game is already planned before you start playing to the point that you know when what object on map you will visit. That is why random maps are used so much multiplayer because it gives a new unknown map to both players.

So what MP needs is balanced maps and a way to make sure that none of players can view generated map in the map editor to cheat. While we may argue on objects and stuff I see no one told here anything about the most easiest way to make random maps balance which is to mirror zones of players. That way both players get the same amount of utopias dwelllings etc.

Mirrored random map templates was added to Heroes 3 World Tournament . IMHO mirrored random maps would be nice to have in VCMI. The pattern could be:

-Fully mirrored all players have the same mirrored zones

  • Partially mirrored - zones closest to players are mirrored, but some zones in the middle between them are not and are considered passage zones (zones through which you can pass to other player land)

In practice fully mirrored maps would be the most balanced ones. Also it is a pattern of most fan made multiplayer maps.

I agree that template and support for mirrored maps should exist along with the rest. They are not mutually exclusive, they are just a particular case of rmg templates.