Return to “Technical”


Question regarding the procedural distribution of objects

As I am dealing in writing a procedural universe application for oculus rift with Unity3d myself (just for the fun of it, as I am only a hobby programer), I have a question about how Limited Theory deals with procedural distribution or instancing with objects.

I am especially interested how this is done with asteroids and asteroid fields.
In my first brute force version, I've been throwing positions out of a 3d grid around the player constantly into a simplex noise algorithm. Based on the result I decided if there should be something instantiated (an asteroid, planet etc). This gave a good result as the position of asteroids was very organic (there were dense asteroid fields as well as empty zones, due to the simplex noise nature), howevery this approach was not efficent on the performance side (to many simplex noise calculcation just for the result that there should be "nothing"). Therefore I now look for algorithms that immediatley throw out 3D positions (not using random functions, as I want the same result on the same seed (which would be a certain position I check) over and over again. Something like Random Walk (however it should base on a seed) or Strange Attractors (from Chaos Theroy).

How does Limited Theorey do the placement of asteroid fields so that the distribution in space is not completely random and that there are more dense and less dense areas of asteroid fields?

Thanks a lot!

Re: Question regarding the procedural distribution of object

The astroid fields, and all zones, are bound inside a zone shape defined by the generator function. The placement of the asteroids themselves we dont know much about since we have yet to see that LTSL code to generate them, but I would assume some sort of noise function coupled with a gaussian distribution. Im pretty sure that the performance hit is somewhat mitigated since the system is only generated once, and then the locations cached for each subsequent time you enter the system. Note this is all speculation, but once the game gets closer to release we will have access to the actual LTSL scripts to generate the systems, so we shall see!

Re: Question regarding the procedural distribution of object

If you're doing extra calcs to determine there should be nothing then use a multi-stage approach. Run a first pass at lower spacial resolution to determine if anything will be nearby, then run your second pass at full the way you are now. Interpolate between the two and skip any tests in areas the low res pass determined shouldn't contain an object. Due to the interpolation there'll be a certain threshold value between which determines whether to test the spot or not, generally this is desirable because it gives you a cutoff variable you can tweak to affect level of detail for testing or other uses.

Multi-stage passes will also come in useful when/if you add collision to your game for the exact same reason, pruning tests you don't need.
woops, my bad, everything & anything actually means specific and conformed

Re: Question regarding the procedural distribution of object

Thanks for your notes and suggestions.

Using a multistage approach might have been a good approach to my issue, yes! Maybe I might get back to this, right now I moved away from my approach (at least for the asteroids), because either way I remain bound to a certain density of a grid in which I check the simplex noise values and position the asteroids.
For large distances sure this isnt that worse, however I like the idea more that multiple asteroids can have "free" positions, so from very distant to very very close. Therefor I look for a approach which shoots outs positions instantly, not bound to a grid approach. I might and will use the optimiuztion hint of multistage when it cames to position nebulae or planets (where I have a similar approach to position objects based on simplex results).

For the asteroids right now I use a combination of Strange Attractors and SimplexNoise. Normaly, when using just a strange attractor algorithm you get those nice looking structures like in this picture: Image Nice for nebulas, not perfect (but anyhow interesting) for asteroids. Strange attractor algorithms base on the idea that they consists of calculate a larger number of dots/positions, considering the result of the previous calulcation cycle for positioning a dot/partice for their next calulcation cycle. What I did is, I disturbe this algorithm by applying a Simplex Noise on the previous result when handing it to the next one. By setting by how much percent I add the noise, the structure of the strange attractor gets totally destroyed (=chaotic), or remains a bit visible.

Thats nice for asteroids because a) Somehow you meet some organic asteroid-field positions, meaning that the asteroids seem to be influenced by some force that brought them into some structures.
And b), due to the nature of strange attractors, changing the input parameters just a bit leads to very different results. That way the whole positiong remains a bit unpredictable and can lead to some extrem results.

One thing I now need to resolve is that I need to avoid that the asteroids are positioned to near to each other / overlap.

Anyhow I look forward finding out how Limit Theory did this, once we get to know.

Online Now

Users browsing this forum: No registered users and 1 guest