Some projects i did

  • added ant simulation :ant:!!! (uncopylocked place)
1 Like

u gotta make a tutorial on the Antonomous cars for sure

1 Like

its still in its earliest stages, and has quite a lot of problems, like manually making curves, fiddling around with the PID controller, etc. I could rewrite the code structure to be cleaner, since its a mess right now; but if you’re wondering, you can just grab a base car chassis model and make a function to calculate the angle of steering (perhaps the throttle as well), then pass it to the PID controller to get the “smoothed” value, and finally apply the steer and throttle into the car

the thing I just explained is the car controller, functions to guide the car towards a certain point. It’s much simpler for the AI, just arrange some road networks. In each intersection, add pointers (ObjectValue or something) to point to the valid networks to merge into. For the traffic light, I made the waypoint turn black whenever the light is red, which signals the car that is currently on the waypoint to stop and wait until the waypoint turns white

(hold on let me go get a rough illustration)


arrows = in-network pointers (pointing to other waypoints in the same network)
blue dots = network waypoints
curves = where the cars can go into another network (green is the focus here, pointing to other networks)

“network” is basically just lanes, you can have a lane until you want to make an intersection, then you have to create another network

2 Likes

sounds kinda hard to tune tbh
how do you define the paths and what are the networks constructed of

1 Like

pretty much, I made that a long time ago so it was pretty messy and hard to work on, since then I adopted a more modular approach into new projects

lets clarify some things:

  • networks, waypoints, pointers is just my made-up terminology, so it may not 100% reflect the actual thing
  • networks are made of waypoints, each waypoint is numbered
  • diverge is the transition to leave a network, while a merge is the transition to enter a network

Since a network is one-way, you can just increment the waypoint index, then if its the end of the network (cannot find the next waypoint), there will be a list of available networks in the last waypoint, which you can choose randomly, then just change the car’s network into the new one, reset the waypoint index, and move the car into the first waypoint of the network

tl;dr:

ai loop

  • set network
  • set waypoint
  • check waypoint color → if black then stop → if white then proceed
  • get next waypoint → if no waypoint found → get a random available network to merge to → stop current iteration and start next iteration
  • move to the next waypoint
2 Likes

I kinda understand how you implemented it in an abstract way but if you dive down anymore into lower level im gonna be braindead soon.

how did you learn to make these? not just the network ai loop for cars but all of ur projects
these are quite difficult looking projects

most of the projects listed are inspired from projects outside of roblox, usually in the form of video demonstration, explanation, etc. For example, the pendulum thing is inspired by TheCodingTrain (hes such a w), which he implemented in p5js; which I implemented in roblox

The procedural hexagonal-based terrain started when I saw a devforum topic where the OP tried to do a hexagonal grid system, and since at that time I recently got into procedural terrains. It struck me.

a pretty good chunk of the projects also come from Sebastian Lague (another w), for his channel has a lot of videos demonstrating and explaining it in the way that you’re actually learning. Ant Simulation, A*, Cave Generation & Marching Squares are all thanks to him. I actually learnt heap sort from the A* video (trees stuff), a much efficient sorting method than the linear sorting. So definitely check him out

You pretty much need to know how to translate your thought process into code, like first, how do i make the car move? how do i make it move smoother?

And after that, you’re pretty much all set, you just need to implement the remaining stuff, waypoints, lanes, diverging and merging, traffic lights, avoidance, etc.

So my opinion is, get a base understanding of how you want it to work, a pseudocode would work just as fine. After you do the foundation of your project, you can do your side quests

Ideas can come from anywhere, whether you accidentally stumble upon them, or not, whether you act upon it, or not.

1 Like

surprisingly ive seen a few of Sebastian Lague’s vids including perlin noise generator, and a bit of heap sort somewhere, ur right about pseudo coding the ideas first but at times Idk what options I have to do a certain thing. e.g… I can move a base part using a for loop or tweenservice or lerp etc
so glad I found ur profile its like stumbling across a new experience on Roblox

oh and on a side note what languages do you code in other than luau

1 Like

i primarily code in js now, mainly for webservers and stuff, the esm syntax is just much cleaner than that of luau’s syntax; though i occasionally do python but its really hard for me to try to get back on python cause theres so much implicit stuff going on. I once tried Godot and used the C# version, it was suprisingly easy to catch up

this happens to the best of us, sometimes you don’t know what method should you use to do a certain thing, like what do i use to make the car move? do i use a chassis module? do i just make it tween? or do i use physics constraints?

it really depends on your use case, if you want a realistic approach, do physics constraints. if you want a simplistic way which does not need collisions, use tweening. if you want an easy but realistic way, use a chassis module

(i reworked my ant simulation btw)

1 Like