Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Custom Roads #97

Closed
Renan02938 opened this issue Jun 16, 2023 · 4 comments
Closed

Add Custom Roads #97

Renan02938 opened this issue Jun 16, 2023 · 4 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@Renan02938
Copy link

Renan02938 commented Jun 16, 2023

Create road networks by importing your own models

@Renan02938 Renan02938 changed the title Add create custom roads Add Custom Roads Jun 16, 2023
@TheDuckCow
Copy link
Owner

TheDuckCow commented Jun 17, 2023

Hi @Renan02938 thanks for chiming in with this use case.

If you mean having sections that are pre-modeled (such as hand crafted meshes, or prefab scenes already laid out in a scene), then yes this should in fact already be possible - it's a core use case in the Wheel Steal game we are making this for. But at the v0.3.2 point of the plugin, it is somewhat awkward. We will create a page around it soon, but in short:

Video overview

demo.cusotm.mesh.roads.mp4

Step by step

  1. Import your hand-crafted model into its own scene (being in its own scene just makes it reusable, you could also just do this in the "main" scene with your RoadNetwork)
  2. Manually place RoadPoints with the correct number of lanes for each end point of your custom mesh. Do NOT connect them together, otherwise geometry would be created between them. I should have reduce the "shoulder size" to zero on both points in this demo, since the mesh basically has no shoulders.
  3. Optional (not shown in video): If you're using the generated AI lanes with the rest of the road, you'll need to manually place "RoadSegment" curves which follow each lane that you'd like AI to be able to follow. Note that the the AI lane system is pretty basic right now and leaves most of the work to the user at the moment to make useful, it will be getting better.
  4. Bring your custom scene into your scene with the rest of the road network
  5. Mark the instance as "editable children" (this is not necessary if you are making these connections on the fly during the runtime of the game)
  6. Then, manually connect the according "prior points" to "next points".
  7. Tweak the sizes of the roadpoint as necessary (in the video, I did this on the "editable children", I should have done this in the original scene itself to save rework on reusing this piece).

Note: Connecting two custom segments like this right now likely won't work, as the RoadNetwork just looks for RoadPoints to generate meshes for which are children of the Points spatial. So if you are hoping to use exclusively models you've created yourself as a sort of lego block of piecing things together, it won't work very nicely (it's also not going to be that useful to use the plugin anyways, other than eventually making use of the smart placement tools we are planning to build).

Note 2: We are indeed hoping to make this experience even easier, as this is our strategy for how we'll implement off the shelf complex road configurations and intersections, so users won't have to build it all themselves each time.

Hope this helps! Let me know if you were thinking of something different.

@TheDuckCow TheDuckCow added question Further information is requested enhancement New feature or request labels Jun 17, 2023
@TheDuckCow
Copy link
Owner

Sorry one more follow up to this topic. I realized that my demo scene here had it working, but the released code has some "validators" that actual make the roads disconnected. Your workaround in the meantime is to disable the "auto refresh" setting on the RoadNetwork, and on runtime call the function on the network called "rebuild_segments". But I realize that's not great to work with and doesn't become visible in the UI.

So, I'm marking this a bit more explicitly as an open task to do. The implicit requirement is to allow for nested scenes to work better (let the validator pass), and to create tools to make it easier to connect to different road points in the 3D viewport, and not have to fiddle with the inspector panel.

@TheDuckCow TheDuckCow added this to the v0.4.0 | Intersections milestone Jun 17, 2023
@TheDuckCow
Copy link
Owner

Also flagging this video I think you had initially shared in one of your earlier videos, it makes a compelling case for letting the user specify their own geometry to be curve-deformed, which is an interesting case (doesn't especially meld well with our use cases of having flexible lane selections, but something for us to consider nonetheless):

https://www.youtube.com/watch?v=EiFkNPcQVc0

@TheDuckCow
Copy link
Owner

I'm going to mark this task as done, as we now have pretty robust tools for connecting different RoadContainers together since v0.4.0, though other ongoing efforts such as snapping referenced here will continue to make this even easier in the future. The curve deform is also a separate task now, defined here: #123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants