Jump to content

Random position/offset


Timps
Go to solution Solved by Manny,

Recommended Posts

Hey team,
Am I missing something obvious? Cause that happens....

I can't see how to randomly move something when spawning it with GeNa.
The chance of something spawning is there, but not WHERE it spawns.

image.png.eac381149b3e895849916d76523c9e59.pngThis is a point of interest I spawn in Gaia. Easy to do.
I can set a spawn chance for things so they turn on and off. Or even multiple instances.
I can do that with GeNa too.

But in Gaia you can set position offsets as a range. And move things around. I can have benches close and far from the fire. I can have the log pile right next to them or 5 units away. It creates a lot of variety.

Is there a decorator I'm missing to give things a random position to add in variety?
Otherwise it feels like the only way would be a "one of" decorator and making clones of each prefab positioned at a bunch of places.

Thanks!

Link to comment
Share on other sites

Hi @Timps,

In GeNa Spawners, to introduce variety in the positions of spawned items, you can use the 'Position Modifier' and 'Rotation Modifier' feature. Here's how to do it:

  1. Open the GeNa Spawners panel.
  2. Locate the 'Spawn Prototypes' section.
  3. Select the prototype you want to spawn.
  4. Adjust the 'Position Modifier (Y)' and 'Rotation Modifier (Y)' values to your liking. Note: This allows you to set a range for how far and in which direction each instance of the prototype can be randomly positioned from its original point as well as rotation along the Y axis.

image.png

By setting these values, you can control how close or far each item spawns relative to the central point, adding the variety you're seeking. If you find yourself still needing assistance or have further questions, please don't hesitate to reply to this thread!

Link to comment
Share on other sites

17 minutes ago, Manny said:

Adjust the 'Position Modifier (Y)

This didn't have any effect apart from the Y axis, which is what I had before based on the tooltip.
There's no option for X and Z offset for variety.

Thanks for the answer @Manny, but thats not the one.

Link to comment
Share on other sites

  • Solution
36 minutes ago, Timps said:

This didn't have any effect apart from the Y axis, which is what I had before based on the tooltip.
There's no option for X and Z offset for variety.

Thanks for the answer @Manny, but thats not the one.

My appologies... Could you then try selecting the 'Advanced' option next to the title of the prototype? It should expand the min and max position offsets for all axis instead of just Y.
image.png

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Continuing this, I have just... So many GeNa pro questions I can't see the answer for.

Is this kind of thing the intended workflow for the most part?
image.png.b250ffb9c7310374c21991fa1bc50ee8.png

I build a little layout. A farm, a camp, etc.
I have a prefab unpacker decorator, and I set random offsets and rotations on things. Adjust the spawn chance of things.

This gets variety in the stuff that spawns and the layout.
The issue though, is those random offsets need to be "unique" or collissions happen.
I can't have the windmill in the centre and move it 20 units in a random direction, as it will end up inside the house or greenhouse some of the time. 

Is there a way to have these things positioned randomly, but avoid collissions?
Can I somehow spawn 12-20 things and ask them nicely to just not run into one another?
Is it a decorator? or a change in the workflow when building a prefab point of interest to spawn?

Link to comment
Share on other sites

Next issue.
Spawner is set to "All" 
image.png.6165577b381631c0abefb57e4be51d2f.png

There are 5 things in it.
image.png.797b5e84e4f9380a973dda99ecb82551.png

But if I spawn it, even in a massive circle it spawns between 1 and 3 of them only.

Spawn type is set to every. The range is 50, throw distance is 5.
Shouldn't this be attempting to spawn every 5m inside the throw area?
I've tried setting check collissions, height, slope etc to none.
There's nothing restricting it. It just doesn't spawn all 5 things dropped in.

Link to comment
Share on other sites

Hey @Timps,

I will attempt to respond to the multiple requests you have made in one forum topic. But in future, if you have any more issues with GeNa, may I please request that you create a new topic for each? Otherwise, some topics that are marked 'solved' will need to me re-marked and it gets messy.
 

On 12/19/2023 at 1:31 PM, Timps said:

Continuing this, I have just... So many GeNa pro questions I can't see the answer for.

Is this kind of thing the intended workflow for the most part?
image.png.b250ffb9c7310374c21991fa1bc50ee8.png

I build a little layout. A farm, a camp, etc.
I have a prefab unpacker decorator, and I set random offsets and rotations on things. Adjust the spawn chance of things.

This gets variety in the stuff that spawns and the layout.
The issue though, is those random offsets need to be "unique" or collissions happen.
I can't have the windmill in the centre and move it 20 units in a random direction, as it will end up inside the house or greenhouse some of the time. 

Is there a way to have these things positioned randomly, but avoid collissions?
Can I somehow spawn 12-20 things and ask them nicely to just not run into one another?
Is it a decorator? or a change in the workflow when building a prefab point of interest to spawn?

Regarding your first query about spawning objects with random placements while avoiding collisions.
To address this, you might consider the following approaches:

  1. (Recommended) Pre-defined Layouts with Random Selection: Create several pre-defined layouts with your objects, ensuring no collisions in each layout. Then, utilize a OneChildOf Decorator to randomly pick one of these layouts during spawning. This method ensures collision-free setups while maintaining randomness.
  2. Random Offsetting with Collision Checks: Manually adjust the offsets for each object type in your prefab. For example, assign specific offset ranges that prevent overlap. While this requires more initial setup, it allows for more controlled randomness.
  3. A Combination of Options 1 and 2

Each method has its trade-offs between control, randomness, and setup time. If you would like to see a working version of this kind of system, you can refer to the 'Flooded Grounds' Content Pack that's shipped with GeNa. Note: This will require installing the Flooded Grounds Asset Pack from the Asset Store before-hand (it's also free).image.png
 

On 12/19/2023 at 11:03 PM, Timps said:

Next issue.
Spawner is set to "All" 
image.png.6165577b381631c0abefb57e4be51d2f.png

There are 5 things in it.
image.png.797b5e84e4f9380a973dda99ecb82551.png

But if I spawn it, even in a massive circle it spawns between 1 and 3 of them only.

Spawn type is set to every. The range is 50, throw distance is 5.
Shouldn't this be attempting to spawn every 5m inside the throw area?
I've tried setting check collissions, height, slope etc to none.
There's nothing restricting it. It just doesn't spawn all 5 things dropped in.

Moving onto your second issue regarding the spawn quantity being less than expected:

It sounds like there might be an issue with the spawn settings in GeNa. Even though you've set the spawn type to 'Every' and adjusted the range and throw distance, there are a few things to consider:

  1. Collision and Terrain Checks: Ensure that collision checks, height checks, and slope constraints are appropriately configured. Sometimes, even if these are set to 'none', the underlying terrain or existing objects might impact the spawning.
  2. Spawn Algorithm Tuning: Experiment with the spawn algorithm settings. Sometimes, tweaking these settings can result in better spawn distributions.
  3. Check for Overlapping Spawn Points: If the spawn points are too close to each other, GeNa might skip spawning to avoid overlaps. Increasing the spawn area or adjusting the throw distance might help.
  4. If all else fails, enable 'Force Spawn': If you are still having issues with spawning with GeNa, just enable 'Force Spawn' in your Spawn Settings to ensure that the layout is not being affected by any of these checks.

Remember, sometimes the interplay of different settings can produce unexpected results, so it might require some experimentation to find the right balance for your specific scenario.

Just note; If you are still experiencing issues with GeNa after all of these suggestions, I would like to refer you to our tutorial series we put together on GeNa to ensure that your workflow aligns with the way it was intended to be used. I recommend looking at the 'GeNa Pro | Deep Dive' series in this playlist below:

GeNa Pro Quickstart Guide - YouTube.url

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...