We absolutely don’t need templates with this size in H3.
It was discussed many times - implementation of multiple levels is quite complex. How would Subterranean Gates work, for instance? What about Cartographers? Level switch button?
It also requires changes in map format and pathfinder.
That’s simple. Press once and get to dungeon 1. Press next and go to next level. Press last and return to dugeon 1.
Same with surface levels (if there will be some)
How they work in HMM3. we get x,y coord for entrance and search most close subterra gate in all dungeons (or in z+1 dungeon).
On surface level 1 you enter gate, and it leads you to level n-1 (to subterra level 1).
On subterra level 1 you again press space and gate leads you to level n-2 (to subterra level 2).
On subterra level 2 you press space and get back in subterra level 1, then to surface.
What if subterra level 2 has only 1 gate, and subterra level 1 has 2 gates (map editor was not able to do good map)? You can make reverse check. Is this level 2 gate is closer to first gate on level 1 than to second gate, it will only work with first gate.
Another way is to have subterra gates like monoliths - add several types of them and use only subgates of same type.
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)
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.
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?
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,
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.