You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can load maps and build them at runtime by setting a QodotMap's map_file to your map, then calling verify_parameters(), then build_map() on the node.
I remember people running into dependency errors with their export settings, so I'm hoping someday I can write out the full method for this (including export settings) and add it to the docs.
As an alternative to supporting runtime loading, depending on the project, you can save your complete QodotMap builds as .tscn scenes, and just load those scenes. It's undeniably faster to load Godot's own data structures from your hard drive than it is to perform the entire build process in QodotMap which relies on various multithreaded API calls.
The text was updated successfully, but these errors were encountered:
Posting both to be subscribed to this and to write down the use case/reasoning for wanting to load maps at runtime.
My goal was to be able to write the game's gamemode logic (scoring, player spawning, etc) and keep it logically separated from the maps themselves. There's 3-4 approaches to this that I can think of, off the top of my head:
Create a scene for the gamemode logic, then instance it in each map scene. Most effort-intensive. This also means that fanmade maps will need to be .tscn files instead of map files. IDK what the modding workflow would be for this, but apparently Your Only Move Is HUSTLE has a modding workflow where modded characters are .tscn files, so that's somewhere to look for details. To cut down on duplicate scene files, you could add every valid gamemode logic scene to a map, and then use some logic on loading the map to control which gamemode node is "active".
Create a scene for the gamemode logic, which handles the process of loading the map by setting the QodotMap's map_file, calling verify_parameters(), and then calling build_map(). This is what I tried to do.
As above, but instead of loading the map file, load a scene with the map file already packaged in it. More performant (though I'm not sure how much it matters) and harder to break than 2. Same concerns about modding as 1.
Create a scene for each map, but instance the gamemode logic scene on map load. Similar to 2/3 in terms of effort saved. May not be meaningfully different from 3.
This is important because common use cases--like "I want to have multiple gamemodes that need to have separate logic, and multiple maps that might be valid for different gamemodes"--are exactly what people will want to learn about from the documentation. When someone looks up how to load a map at runtime, this is one of the questions they'll probably be trying to answer.
QodotPlugin/qodot-plugin#159
You can load maps and build them at runtime by setting a QodotMap's map_file to your map, then calling verify_parameters(), then build_map() on the node.
I remember people running into dependency errors with their export settings, so I'm hoping someday I can write out the full method for this (including export settings) and add it to the docs.
As an alternative to supporting runtime loading, depending on the project, you can save your complete QodotMap builds as .tscn scenes, and just load those scenes. It's undeniably faster to load Godot's own data structures from your hard drive than it is to perform the entire build process in QodotMap which relies on various multithreaded API calls.
The text was updated successfully, but these errors were encountered: