Noise & Peaks Guide?

Place to get help with not working mods / modding interface.
User avatar
Dysoch
Filter Inserter
Filter Inserter
Posts: 445
Joined: Fri Oct 18, 2013 2:27 pm
Contact:

Re: Noise & Peaks Guide?

Post by Dysoch »

slay_mithos wrote:Still talking about noise layers, is it possible to state layers that might not exist (like dytech's gems or sand)?

If so, what is the actual effect if that layer is not used (because that mod might not be installed), and how to get around the problem if there is one?

I mean that if we can take compatibility into account right from the start, it might make thing easier in the long run.
It possible, but in a long way around ( atleast that is whati can think of)
You create 2 resource files, 1 for the mod compatibility, and one without. In the data.luafile you make this:

Code: Select all

if data.raw.resource["gemstone-deposit"] then
Require (the file with compatibility)
Else -- this is done when gemstone-deposit is not found
Require (the file without compatibility)
End
Creator of:
- DyTech
- DyWorld
- DyWorld-Dynamics
- DyWorld-Dynamics 2
Active since Factorio 0.6

slay_mithos
Fast Inserter
Fast Inserter
Posts: 204
Joined: Tue Feb 25, 2014 7:22 am
Contact:

Re: Noise & Peaks Guide?

Post by slay_mithos »

I guess you could also always add the 'base' structure, and have that IF add the peaks to the table, instead of redefining it.
That would make it more feasible to have compatibility to multiple mods, without having to maintain a lot of files for each time you change the main one.

PsudoSage
Burner Inserter
Burner Inserter
Posts: 12
Joined: Wed Mar 19, 2014 7:20 pm
Contact:

Re: Noise & Peaks Guide?

Post by PsudoSage »

slay_mithos wrote:Still talking about noise layers, is it possible to state layers that might not exist (like dytech's gems or sand)?

If so, what is the actual effect if that layer is not used (because that mod might not be installed), and how to get around the problem if there is one?

I mean that if we can take compatibility into account right from the start, it might make thing easier in the long run.
I made a sandstone resource and made it use the same layer as dytechs sand. They did share the noise layer, different generation results because dytechs sand is very spread out, but they did spawn in the same area.

I then tested by removing dytech and commenting out my own sand layer, so my sandstone was using an invalid layer and it basically spammed the resource. Not all over the map, but it seems to just ignore the missing layer and use the base random layer instead (Loads of big patches).

So:
1: If two people add the same resource on the same noise layer, it wont add too much to the world as they will just generate on top of each other anyway.
2: Generating without a valid noise layer is bad, but adding duplicate noise layers will still be the same layer so not a big issue.

User avatar
Reygan
Fast Inserter
Fast Inserter
Posts: 177
Joined: Tue Jan 28, 2014 8:42 pm
Contact:

Re: Noise & Peaks Guide?

Post by Reygan »

Are there any differences versus terrain generation? Can anyone make good explanation? I am just about week raping my brain about that stuff :?
Daniel V. Lenskiy

PsudoSage
Burner Inserter
Burner Inserter
Posts: 12
Joined: Wed Mar 19, 2014 7:20 pm
Contact:

Re: Noise & Peaks Guide?

Post by PsudoSage »

Ive been a bit busy with work for a while, but I am coming up with a fairly nice little system for worldgen. Im actually writing a wrapper/API for modded worldgen. So far I have it so you can simply state a rarity value and then a set of peaks can be generated based on the rarity so it should be simpler to add ores without knowledge of how all the peaks and influences work. I've also got simple peak methods for avoiding ores and starting area boosts etc. I'm going to try and take it a step further and have the auto-generated peaks react to how many ores are in the world too, but that will take a bit more time to work out as I will need to have some sort of ore registry to keep track of counts and rarities.

I shall post something in the WIP mods soon so other devs can take a look soon and see if you guys like it and want to make some input into it.

@Reygan: what differences are you referring to? different 'what' versus terrain?

User avatar
Reygan
Fast Inserter
Fast Inserter
Posts: 177
Joined: Tue Jan 28, 2014 8:42 pm
Contact:

Re: Noise & Peaks Guide?

Post by Reygan »

PsudoSage wrote: @Reygan: what differences are you referring to? different 'what' versus terrain?
Entities(ores, trees). But i am stuck with tile autoplacement.
PsudoSage wrote:Ive been a bit busy with work for a while, but I am coming up with a fairly nice little system for worldgen. Im actually writing a wrapper/API for modded worldgen. So far I have it so you can simply state a rarity value and then a set of peaks can be generated based on the rarity so it should be simpler to add ores without knowledge of how all the peaks and influences work. I've also got simple peak methods for avoiding ores and starting area boosts etc. I'm going to try and take it a step further and have the auto-generated peaks react to how many ores are in the world too, but that will take a bit more time to work out as I will need to have some sort of ore registry to keep track of counts and rarities.
I will be very helful. Curren system of worldgen is pretty complicated. Tons of parameters with weird effects... :)
Daniel V. Lenskiy

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: Noise & Peaks Guide?

Post by cube »

Placing entities is different than placing terrain -- in both cases we have the candidates that can be placed at the given position, but for terrain we simply use the one with highest probability, for entities they are sorted by the autoplace order and each one is placed with the calculated probability. The ordereing is important, because when an entity has a collision with something placed before, it is ignored.
I have no idea what I'm talking about.

User avatar
Reygan
Fast Inserter
Fast Inserter
Posts: 177
Joined: Tue Jan 28, 2014 8:42 pm
Contact:

Re: Noise & Peaks Guide?

Post by Reygan »

cube wrote:Placing entities is different than placing terrain -- in both cases we have the candidates that can be placed at the given position, but for terrain we simply use the one with highest probability, for entities they are sorted by the autoplace order and each one is placed with the calculated probability. The ordereing is important, because when an entity has a collision with something placed before, it is ignored.
Understood.
Could autoplace system be modified to more simple variant? Or, at least, some detailed guide?
Daniel V. Lenskiy

Post Reply

Return to “Modding help”