Jump to content

How to avoid trees colliding with each other?


Matmalm
Go to solution Solved by Peter,

Recommended Posts

I'm trying to create a little forest with the spawner but I can't find the way to make the trees not collide with the others, as you can see in the images.

Also, how can I undo the actions? I don't have the 'Undo' buttons which are shown in the tutorial videos.

trees_col.png

trees_col2.png

Link to comment
Share on other sites

Ive had some luck with messing with the spread and range values, as well as using masks strategically. Check out this thread about how bounds will in the future help out a ton:

 

The search function in the forums is a pretty good way to look for previous topics, at least once you learn the jargon for your search terms a bit. Good luck!

Link to comment
Share on other sites

9 hours ago, Manny said:

Happy to report, the new version of GeNa Pro (3.3.16) addresses this issue!

Check out the latest here:

 

Sorry but I can't really see what you do or trying to do in the video, is too fast.

I think is not related to what I'm trying to do, why should I create a spline?

What I'm trying to achieve is to avoid 2 trees spawning into the other one using the spawner tool. It's a forest so in this case the spline will not work.

The problem is 2 or more trees spawning in the same position (sometimes one spawn inside another).

The same thing happens to me when I use the spawner with details, I try that the details don't collide with the trees and in the visualization it shows something that doesn't reflect when I control + click.

Link to comment
Share on other sites

17 minutes ago, Manny said:

Hey @Matias Gesche,

I think there's a big misunderstanding. The new patch for GeNa isn't just the new spline collision system. If you look closely, I mentioned that this patch directly addresses your issue with the bug fixes:
image.png 

Well I might be doing something wrong then.

 

Because I just tried it

 

tree.png

Link to comment
Share on other sites

22 minutes ago, Manny said:

I can confirm that this is correct behaviour. 

You need to press CTRL + SHIFT to update the visualization.

Yes, the image I posted is the actual visualization and the second image is the result.

If this is the correct behaviour then I don't get why is there a circle and a visualization at all? No matter the range I set is always going to spawn the same size...

Link to comment
Share on other sites

11 hours ago, Manny said:

Ah I see what you mean now. 

So just to confirm, are you saying that the details are spawning past the size of the range?

Yes, it is just using the terrain decorator. So no matter the settings I put in the 'Overview: detail' window, it only going to apply what I put down in the 'Terrain Decorator' window.

I don't get then why is there a spawner to add details when I can just place a terrain decorator. It's just confusing as I can't use the settings of the spawner.

 

Also: is there a way to avoid the details to collide with the trees?

Link to comment
Share on other sites

12 minutes ago, Manny said:

Yes, I understand your logic behind this.

The old way that GeNa used to spawn details was a big problem with performance and you actually couldn't control it properly. Our reasoning behind using the Terrain Decorator as our grass spawner is due to the fact that internally, Unity uses textures to spawn details. This allowed for way better performance and control over the kinds of textures and strengths (density) you want to spawn your grass in. 

However, I totally agree about the fact that your spawn range should constitute to the overall spawn result. This is something we're working on for other reasons, whereby the spawn range acts as a 'mask' of whatever you spawn. Otherwise, the spawn range has no particular purpose other than modifying the throw distance.

That being said, I have also added this to my internal bug tracker so that I can continue to add this masking system.

Ok, but is there a way to avoid collisions?

I have tried tweaking things for hours, and the tutorial videos are too old.

Visualization:

spacer.png

 

After:

 

spacer.png

 

There are even details inside the rock, with trees is the same thing. Just need to know if it's possible to avoid collision and how. I've tried tweaking the 'collision check number', 'range', 'strength', etc. but same results

Link to comment
Share on other sites

  • Solution

@Matias Gesche As a workaround while Manny is investigating, you could consider using a simple Gaia spawner to spawn Grass in a similar fashion with collision detection. For this you would need to do the following:

1. Create a new, empty game object.
2. Add the Spawner Component to it

image.png

3. Add the first spawn rule
image.png

4. Inside the spawn rule, open the resource settings and set it to "Terrain Detail". You can set up a terrain detail prototype in a similar fashion as you would set it up on the unity terrain detail directly.

image.png

5. Activate the visualization, and reduce the range of the spawner a bit - the area highlighted in color would be the area where the grass will appear. Per default that is everywhere within the spawner range:

image.png

5. To influence where the spawner spawns, you can add masks to the spawn rule. There are a lot of different masks that you can add to restrict spawning, slope, height, etc. To avoid collisions, you would need to add a collision mask:

image.png

6. When I click "Spawn Local" now in the spawner, it spawns everywhere but in the area that is ruled out due to the collision:

image.png

7. You can add an image mask if you want to emulate the brush shapes from GeNa, the visualization will reflect the shape and collision info as well:

image.png

8. You can then move this around in the scene by using the transform gizmo in the scene view, or by pressing Ctrl+Shift and dragging, and clicking "Spawn Local" wherever you want to spawn.

63a1511737b2b0769b7f3a486b00c3b2.gif

This is a bit unwieldy compared to the GeNa spawner, but this would give you something to work with while the GeNa update is underway. Alternatively you could consider to configure the Gaia grass spawner in such fashion that it does the entire terrain in one go, if that is feasible for your project / workflow.

Link to comment
Share on other sites

  • 2 weeks later...
On 2/11/2022 at 3:52 PM, Peter said:

@Matias Gesche As a workaround while Manny is investigating, you could consider using a simple Gaia spawner to spawn Grass in a similar fashion with collision detection. For this you would need to do the following:

1. Create a new, empty game object.
2. Add the Spawner Component to it

image.png

3. Add the first spawn rule
image.png

4. Inside the spawn rule, open the resource settings and set it to "Terrain Detail". You can set up a terrain detail prototype in a similar fashion as you would set it up on the unity terrain detail directly.

image.png

5. Activate the visualization, and reduce the range of the spawner a bit - the area highlighted in color would be the area where the grass will appear. Per default that is everywhere within the spawner range:

image.png

5. To influence where the spawner spawns, you can add masks to the spawn rule. There are a lot of different masks that you can add to restrict spawning, slope, height, etc. To avoid collisions, you would need to add a collision mask:

image.png

6. When I click "Spawn Local" now in the spawner, it spawns everywhere but in the area that is ruled out due to the collision:

image.png

7. You can add an image mask if you want to emulate the brush shapes from GeNa, the visualization will reflect the shape and collision info as well:

image.png

8. You can then move this around in the scene by using the transform gizmo in the scene view, or by pressing Ctrl+Shift and dragging, and clicking "Spawn Local" wherever you want to spawn.

63a1511737b2b0769b7f3a486b00c3b2.gif

This is a bit unwieldy compared to the GeNa spawner, but this would give you something to work with while the GeNa update is underway. Alternatively you could consider to configure the Gaia grass spawner in such fashion that it does the entire terrain in one go, if that is feasible for your project / workflow.

Alright.

I just tried this, but it's not what I was looking for, it still spawns inside unless I set a really high number in the mask settings but then it would be easier to paint it manually myself with unity integrated tools. I'll wait for the update 🙂

Link to comment
Share on other sites

  • 1 month later...

Hello, still seeing this as an issue. Was it fixed? It is happening also to me, hard to spawn forest withou checking the spawn after every click.

Link to comment
Share on other sites

  • 1 month later...
On 2/11/2022 at 3:52 PM, Peter said:

@Matias Gesche As a workaround while Manny is investigating, you could consider using a simple Gaia spawner to spawn Grass in a similar fashion with collision detection. For this you would need to do the following:

1. Create a new, empty game object.
2. Add the Spawner Component to it

image.png

3. Add the first spawn rule
image.png

4. Inside the spawn rule, open the resource settings and set it to "Terrain Detail". You can set up a terrain detail prototype in a similar fashion as you would set it up on the unity terrain detail directly.

image.png

5. Activate the visualization, and reduce the range of the spawner a bit - the area highlighted in color would be the area where the grass will appear. Per default that is everywhere within the spawner range:

image.png

5. To influence where the spawner spawns, you can add masks to the spawn rule. There are a lot of different masks that you can add to restrict spawning, slope, height, etc. To avoid collisions, you would need to add a collision mask:

image.png

6. When I click "Spawn Local" now in the spawner, it spawns everywhere but in the area that is ruled out due to the collision:

image.png

7. You can add an image mask if you want to emulate the brush shapes from GeNa, the visualization will reflect the shape and collision info as well:

image.png

8. You can then move this around in the scene by using the transform gizmo in the scene view, or by pressing Ctrl+Shift and dragging, and clicking "Spawn Local" wherever you want to spawn.

63a1511737b2b0769b7f3a486b00c3b2.gif

This is a bit unwieldy compared to the GeNa spawner, but this would give you something to work with while the GeNa update is underway. Alternatively you could consider to configure the Gaia grass spawner in such fashion that it does the entire terrain in one go, if that is feasible for your project / workflow.

Any update on this topic for GeNa Spawner?

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...