By the way, now we have in templates records like “xl+u”, “m+l” for sizes of map.
This way there is no possibility to use custom size maps with more than one underground.
Is there are ideas how to make custom sizes possible?
So minSize is size in 64 squares, maxSize - in 72 squares. This will fit maps 64x72, 72x64, 64x64, 72x72.
minDungeon=0 means that it will fit map with no dungeons at all
maxDungeon=3 means that RMG can generate up to 3 dungeon levels choosing randomly (if in RMG dialog user selects “Dungeon”).
To buttons “S”,“M”,“L”,“XL” must be added “C” (custom size). In maps filters it will show all maps that are not S/M/L/XL.
In RMG settings tab when selected it will give dialog like “Choose resolution window”, where all availeble sizes allowed by current templates will be shown (with template name to the right) (or only non-standart sizes).
Like i make template with “minSize” : 1024, “maxSize” : 2048, than when pressing “C” i will get listbox with “1024x1024 (name of template)”,“1024x2048 (name of template)”,“2048x2048 (name of template)”, “2048x1024 (name of template)”.
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,