Random map generator

This is the only way that will work with different amount of gates in levels. Also it will require many types of gates. IOW we need to implement advanced teleport mechanics for sub-gates first (make them equal monoliths but retain compatibility with original or make them configurable - explicit teleport channel). Only when it will work for 2 levels, we can go forth. (Same for cartographers)

Pathfinder will just work. Though as mentioned already subterranean gate would need rework.

New templates, 150 of them! With new Hota, WoG and Axolotl creatures:

Nice! How to get’em?

Today I ran profiler and optimized some suprising parts of code. Generation time for Jebus XL+U was cut down by about 60%.
Further 40% could be improved by rewritting WeightedRule class from CMapEditManager. It uses a lot of expensive string copying and comparison, which should be replaced with enum or something.

Can water generation be expected in near future?

Well, I don’t have much time recently - better just polish existing game instead of adding new features.

I know very little about RMG code, but since you started to optimize it I gave it a try with Valgrind. Most interesting part of object creation already have your comment, but other weird thing I found is that TerrainViewPattern::WeightedRule::isStandardRule use quite a bit (5%+) of CPU time since on large map it’s called like 40-50 million times.

Can something like STRONG_INLINE help a bit there?

This function should be replaced with just one cashed field.

Implemented.
Reduced string usage and added caching for flipped patterns -> about 50% performance improvement.

One thing I wounder about with current git version of RMG.

Why every player-owned town have some impassable object right under the entry (where hero stay)?

I din’t know really. So far my interest was only to ensure zone passability.
Maybe it’s just optimal to route path diagonally.

But road does not fit there. Roads can`t be diagonal.

Hello,

I am a bit confused with random map generator, does it work? I don’t have a rmg.json in my config, do I have to create one? How? Is there templates available and if so how to apply them?

Sorry for silly questions but I better be safe than sorry,

Thanks for response, cheers

All available templates are in vcmi\defaultTemplates submod included in 0.99 release.
There in no single rmg.json anymore. Also there is a conversion tool (see wiki.vcmi.eu/index.php?title=Mod_list#Utilities) to convert rmg.txt temples to vcmi format.

Thanks for your reply,

I don’t have a defaultTemplate submod or subfolder :confused: Is it available somewhere so I can grab it?

Yes, it’s in 0.99 package (Windows at least).

Could anyone confirm it’s also in the linux package? Because I don’t have it, the find command does not return any entries.

Or if anyone could just upload it separately?

Just download and unzip windows version and all wanted files you’ll find under Mods directory.

Haha yeah indeed thanks