TheDuckCow / godot-road-generator

A godot plugin for creating 3D highways and streets.
MIT License
401 stars 21 forks source link

Create procedural use case demo #170

Closed TheDuckCow closed 2 months ago

TheDuckCow commented 5 months ago

Thanks in part to the new "Roadside Assistance" Patreon tier, we have a formal request that we are committing to: a working example of the Road Generator in a procedural project.

Philosophy:

Current planned scope of this demo:

Out of scope (at least for the time being):

brickyt commented 5 months ago

Thanks @TheDuckCow for making this happen! Very excited and grateful for sharing your work with the community.

Understanding timelines can/will change, what's the ETA for the demo?

Cheers!

TheDuckCow commented 5 months ago

Sure thing @brickyt my plan is to get the majority of this done by the end of July. I'll link a branch here once I formally start working on it so you could always check out the progress. Worth me stating for anyone curious: The intention is to build this for Godot v3.5 but then whenever we port-forward the project to the godot4 branch (around the time of releases), it'll be available there too with hopefully most of the same functionality working. That godot4 port part though might not happen within July, we'll see.

TheDuckCow commented 4 months ago

A good chunk of initial work has already been done, see the demo video here and corresponding code of this draft PR:

https://github.com/TheDuckCow/godot-road-generator/assets/2958461/80b6e0d7-7224-4fd0-8f01-cdec950dd81f

TheDuckCow commented 4 months ago

Minor progress as I wanted a good demo gif, I present to thee viewer: a wiggling road

demo procgen scn

I also started working on having the camera follow "on rails", but I'm running into the case where one RoadLane is not getting a registered prior/next lane. Though it seems this is properly assigned in the editor, will need to see why in the procgen scene I have right now this isn't happening. Might be an actual bug, or just some extra post-validation checks to run.

TheDuckCow commented 4 months ago

Edit on the above, checking in the Wheel Steal repo's fully procedural implementation, just by inspecting the remote (ie live gameplay) hierarchy, the RoadLanes there do have their corresponding next/prior lane's properly populated. So, should be able to find some fix in this branch as opposed to it being a core addon code change, still need to determine what that is though.

TheDuckCow commented 3 months ago

Just acknowledging that there's not too much progress here as we've had to spend some time investigating the snapping and children caching PR's, and it has created some headaches. Will return back to this, first to resolve the connecting Road Lanes (which will let the camera more smoothly follow the road), and then to place some random non-moving vehicles to the road.

TheDuckCow commented 3 months ago

Per the latest commit on the linked PR, making good progress on the camera agent, but the solution is appearing a little more complicated than I would have hoped (and also, not quite working perfectly, though better than a week ago where I was getting some pretty spastic movement). Current branch behavior, using the up/down keys to accelerate/slow down/reverse. Shows the camera following along the lane (not changing look dir, will come next once I have the flickering logic sorted)

https://github.com/user-attachments/assets/2a26d513-89df-4116-b896-8e933a8e5cb1

The note-to-self is to probably fallback and try to use agent's z orientation dot product to re-determine facing direction whenever on a given lane. That, or rely further on the lane's defined direction and assume we're matching that direction.

TheDuckCow commented 2 months ago

In prep for a discussion later today, made some good progress that arguably completes the scope of the base demo as described above, though there are still some improvements that could be made.

Working on this convinced me to actually create an official road_lane_agent node which the repo just directly provides, rather than requiring any given developer to have to build it themselves. Before merging this code I'll definitely have to think through that I am happy with the interfaces on this object I've created, since people will likely just start using it.

Demo of the current state, which shows off going forward and being able to change lanes (using left/right arrow keys) at will. I'm probably going to simplify the agents even further to make them not be kinematic bodies but just nodes which are manually animated, so everything remains on rails. Definitely could improve UI some more with some transform smoothing on the camera.

https://github.com/user-attachments/assets/cdec3460-eb59-4a3e-89e0-93b7f55a63b0

TheDuckCow commented 2 months ago

I've officially merged the branch now, so this demo is officially in dev! See the latest video demo here:

https://github.com/user-attachments/assets/d04c843f-0209-4374-a1ec-b66bdcd95ee4

Some improvements and descriptions called out here, but I'll be closing this issue in the meantime. Further improvements to be logged in their own issues.