i decided to add multi surface support to RSO and in the process i started to rewrite the complete mod. My goals with the new version are the following:
- Allow surface based settings for resources (like size, frequency, richness)
- Build an API for other mods to add resources ( it would be possible to create surfaces that spawn only specifig ores)
- Implement proper reading of map_gen_settings
- Don't provide any resource configurations apart from vanilla. Additional Resources can be added via the interface or are read from entity_prototypes and generated with default settings
- A gui to set basic settings ( like region size, overall spawn chance of ores, biter spawning behavior and so on). Perhaps even change the settings of each surface "on the fly"
- It should work out of the box with new surfaces and unknown ores.
- Try to make a config file "obsolete" by moving all the settings to the gui at game start and by moving the resource specifig settings to the mod authors.
- I don't know what approach would be the best to support the adding of the ores. The idea is to provide a simple file that mod authors can place in their mod. What that file does is basically implementing data:extend() and calling an interface function of RSO to parse that data. The data would be the prototyp definition of that ore with the optional addition of a rso_data field that can be used to tell RSO what to do instead of calculate something based on the prototype. Now here comes the problem. When creating my Surface handler i want to parse map_gen_settings and create a resource instance for each resource. now if mods are added to the game i won't have the information for those resources yet because i'll get them in the init or i don't know if it even works to call an interface in the control.lua. so i'm completely unsure how to handle the adding of resources. How would you do that?
- The next thing is that it could happen that several mods use the same resources and these would be added multiple times. What would be the best way to decide wich settings to use?
- My current code for the ore patch generation sometimes lags the game because part of it is expensive to calculate (iterating over the area, then calling some function on each coordinate several times). Are there any easy tipps or tricks to improve performance (Found the bug, still expensive but barely noticeable)
- Any tipps how to approach balancing in general? The spawn logic isn't fully funcional (map_gen_settings aren't taken into account and it's hardcoded one spawn per region which will definitely change)
- Since this is my 1st lua project i'm glad for any tipps regarding modding and modding in lua. So feel free to correct me on all those stupid mistakes i've made.
http://github.com/yeganer/RSO
Thanks for reading and i'm looking forward to your responses.