I love this! I want to learn to do something like this in the future. How many lines of code if to just change from one car to another?
Low Poly Car Generator
xyz I suspect CSG could produce artifacts,
It definitely can, in the godot 4 thread I shared a Cornell box I had made with CSG that did run into it. Fix was simple enough, I just changed the parenting order around a bit which forced a rebuild, but yes, it definitely can.
Now, if you don't mind a 'challenge' to test your system I challenge you to replicate a facsimile of the tesla cybertruck. I don't think it's too outrageous and is already in the ballpark of the previous car example you showed tho. But it would allow you to claim ability to replicate a 'real' car.
The CSG in Godot is very basic and only useful for prototyping, For example, it doesn't even support UV or textures.
- Edited
Gowydot I love this! I want to learn to do something like this in the future. How many lines of code if to just change from one car to another?
Thanks. Glad you like it. There's not much code. This is more of an exercise in polygonal modeling. Granted done procedurally via code but most of the time was spent on figuring out optimal topology and logical parameters to mold it. The main script is about 800 lines. Half of it is trivial: parameter declarations, getters/setters and functions that assign parameters from/to resources objects. Mesh generation itself is about 150 lines, and blending function is just 15 lines. It goes through a list of parameters and launches a bunch of tweens.
Megalomaniak Now, if you don't mind a 'challenge' to test your system I challenge you to replicate a facsimile of the tesla cybertruck. I don't think it's too outrageous and is already in the ballpark of the previous car example you showed tho. But it would allow you to claim ability to replicate a 'real' car.
Careful there calling the cybertruck a real car... oh wait, 'real' was in quotes... ok then
Here's the best I could pull off:
With this cabin shape, I couldn't preserve a straight line under the cabin going along the whole length of the body. Adding a parameter that "closes" the back side window would make this possible. This parameter would also be useful for all bodies with thick C-pillars (like 70s Firebirds or Vector W8) as well as semi trucks and windowless vans. W8 was, btw, one of my benchmark shapes. Didn't get to making it yet though.
Megalomaniak It definitely can, in the godot 4 thread I shared a Cornell box I had made with CSG that did run into it. Fix was simple enough, I just changed the parenting order around a bit which forced a rebuild, but yes, it definitely can.
cybereality The CSG in Godot is very basic and only useful for prototyping, For example, it doesn't even support UV or textures.
CSG as such is cool but it produces untidy meshes, simply by the nature of the technique. It's ok for making a single design that can be cleaned up offline. But for real time generation of hundreds of live models, I don't know... too risky. I'd choose it for building complex concave shapes. But car body is almost a single convex form. Direct vertex pushing is better fitting here.
xyz Yeah I was mostly thinking csg might be good for the wheel wells
Sure. It'd look cool but that's too much detail for the representation I'm aiming for.
I've put the said parameters in. Like it or not this is the official cybertruck DLC in this system
Getting sued by Elon Musk would be great free publicity.
cybereality Getting sued by Elon Musk would be great free publicity.
Or getting commissioned to make a driving mini-game for the entertainement console in teslas...
cybereality Getting sued by Elon Musk would be great free publicity.
Megalomaniak Or getting commissioned to make a driving mini-game for the entertainement console in teslas...
I'm hoping for both. With psychotropic entity like Musk it's possible for those to happen simultaneously
xyz I'm hoping for both. With psychotropic entity like Musk it's possible for those to happen simultaneously
You'll be sued to be forced to make a mini-game, be careful of what you're wishing for !
Then, Biden administration could put the blame on you because the game allegedly interfere with a way or another with the car systems and cause crashes & fires all around the world.
The game would be used to train the self-driving AI, duh. It's like those image captchas.
Reluctantly I upgraded the topology with an extra edge loop for the front mask. It is the car's "face" after all. Can't hurt to have more definition there. By more I mean 6 quads
With addition of head and tail lights I think I'm done with mesh fiddling for this iteration. On to randomization system!
- Edited
This is so great. The gifs really sell it.
cybereality Yeah the blending looks tasty. I haven't even planned to do animated transitions. They somehow just naturally sprang out of the system. With everything else in place, it was trivial to add this.
I made a basic randomization system. It's based on handmade templates. Each template contains the default configuration and a sub-list of parameters that are allowed to be randomized inside specified min/max ranges. This selective randomization works nice to keep variations congruent. From the design standpoint, randomization can be "directed" to parameters that have a lot of leevay in a specific body type, while disabled for ones that would cause trouble. Tested only a few templates but it's looking solid
Also implemented a spawner that clones configured cars and puts them on a highway:
It's finished!!!
So cool and so fun to watch from step 1. You made the forums 4x times more interesting. I love that white monster truck the most, also love the diversity between the truck and the sedans. It really doesn't seem like anything is missing from the road except road kill.
The road so far is impressive !
You just need to work on trailers (fuel/milk/chemical, goods, short and long) now add some truck and also caravan and other camping-car, many more parameters to play with
And... maybe the most important a game around that. The easiest would be the classic frog which cross the road.
Another idea would be a road creator and watching cars and trucks moving around for fun, create or fix traffic jam (which need to add traffic lights and stop, maybe crosswalk and pedestrians), or a funnier one about creating car crash, quite like Demolition Inc. (a very fun game with an alien creating mayhem in a city to destroy buildings).
- Edited
It's low poly but you have pretty much just rekt every major game studio out there. I mean, all you need are some artists maybe to go to town and create some assets for you and that's going to be one hell of a car generator.