Multi surface support for RSO

Place to get help with not working mods / modding interface.
yeganer
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Mon Jul 06, 2015 12:07 pm
Contact:

Multi surface support for RSO

Post by yeganer »

Hey guys,

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
Features that i have planned:
  • 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.
The Problems i'm facing at the moment:
  • 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.
The Code:
http://github.com/yeganer/RSO

Thanks for reading and i'm looking forward to your responses.
Last edited by yeganer on Sat Aug 08, 2015 7:38 pm, edited 1 time in total.

aka13
Filter Inserter
Filter Inserter
Posts: 793
Joined: Sun Sep 29, 2013 1:18 pm
Contact:

Re: Multi surface support for RSO

Post by aka13 »

I always wanted to ask, can you actually generate deposits bigger than a chunk?
Pony/Furfag avatar? Opinion discarded.

yeganer
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Mon Jul 06, 2015 12:07 pm
Contact:

Re: Multi surface support for RSO

Post by yeganer »

yes, actually i can create theoretical infinite size patches.

I'm calculating the spawn locations before the chunks are generated and i'm spawning the stuff when the chunk is generated

orzelek
Smart Inserter
Smart Inserter
Posts: 3922
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Multi surface support for RSO

Post by orzelek »

We will need to do one of those 2 things:
1. You need to pick up different name for the mod.
2. I will drop the original RSO and yours will replace it.

yeganer
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Mon Jul 06, 2015 12:07 pm
Contact:

Re: Multi surface support for RSO

Post by yeganer »

Yeah, we can do that, but i really didn't come up with a great name for now. Besides that, a bump in the version number could do the trick, too.

orzelek
Smart Inserter
Smart Inserter
Posts: 3922
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Multi surface support for RSO

Post by orzelek »

Considering that there is 1.0.3 and 1.3.0 now adding one more might make more confusion :)
And if you add things like gui to control the mod it would be much better :)

And gui is one thing I won't touch probably - I had to much of gui work in my job already.

Post Reply

Return to “Modding help”