|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006290||Spring engine||General||public||2019-08-31 20:14||2019-09-02 19:32|
|Status||closed||Resolution||no change required|
|Product Version||104.0 +git|
|Target Version||Fixed in Version|
|Summary||0006290: Heightmap changes are not available for widgets/gadgets before GameSetup|
|Description||When playing on a map that has a gadget that generates the heightmap, the generated heightmap isn't available for other gadgets/widgets until GameSetup. This can be worked around, but would be handier if the heightmap was available during initialization.|
For example, the startbox drawer widget in BA/ZK relies on Spring.GetGroundExtremes, and because of this boxes are drawn underground on a generated map. If the widget is reloaded when the game is running, the boxes are drawn correctly on the terrain.
|Tags||No tags attached.|
|Checked infolog.txt for Errors||Yes|
For reference, this was tested with https://springfiles.com/spring/spring-maps/randommapgen12x12
The attachment contains the gadget that makes the heightmap.
The relevant parts of the gadget: https://pastebin.com/PhELTSxK
Last edited: 2019-08-31 20:48
LuaGaia map gadgets are loaded after LuaRules.
While flipping them around would be trivial, I don't particularly want to change the ordering at this point in Spring's life without very good arguments, sorry.
This randommapgen_mapgen is a LuaRules gadget btw (layer -100, before startbox drawing). No LuaGaia involved in these scenarios. Just wanted to clarify.
Feel free to close in any case if you think it's not worth it. This thing can be worked around by overriding Spring.GetGroundExtremes values or delaying things until GameSetup(), and I don't have any strong arguments.
Spring.GetGroundExtremes returns *four* arguments (https://springrts.com/phpbb/viewtopic.php?p=565531#p565531), not two (as assumed by https://github.com/ZeroK-RTS/Zero-K/blob/46d9b8c1f78ef57e24991c63791ead8cb4ce5f59/LuaUI/Widgets/minimap_startbox_new.lua#L146 and other ZK code), so no need for any delaying hacks.
Moving the randommapgen_mapgen.lua gadget to a much lower layer will make the changed heightmap extrema available to other gadgets as well.
|2019-08-31 20:14||Antero||New Issue|
|2019-08-31 20:35||Antero||File Added: randommapgen_mapgen.lua|
|2019-08-31 20:35||Antero||Note Added: 0020103|
|2019-08-31 20:48||Kloot||Note Added: 0020104|
|2019-08-31 20:48||Kloot||Note Edited: 0020104||View Revisions|
|2019-08-31 23:03||Antero||Note Added: 0020107|
|2019-09-02 19:32||Kloot||Status||new => closed|
|2019-09-02 19:32||Kloot||Resolution||open => no change required|
|2019-09-02 19:32||Kloot||Note Added: 0020108|