@@kerz5383 not to mention having to implement building codes, imagine having to design wheelchair ramps for all those staircases. That sounds awful to me and I'm not an engineer.
Damn, nice video! About 7:09: Yours didn't performed like Poly Bridge probably because Poly Bridge has its own custom physics engine, this was done because the Unity3D physics engine is not deterministic, which caused a lot of problems on Poly Bridge 1, not only rerunning the simulation will give you a different result, but game speed also affects the outcome. So for Poly Bridge 2 and on, they're using their own physics engine.
Yes, I did some research on it and found many differences, so my version is pretty different. One way I get around it not being deterministic is by running the simulation multiple times and taking the mean of the fitness, although this obviously takes more time.
"now one problem we have is it is indestructible. Clearly it was made by engineers. So in order to fix this, we just need some architects" sounds like real civil engineer EDIT: holy shoot 2.1k likes I think that's the most I've gotten before thanks a bunch
I like how this AI shows that trial and error can result in so seemingly complex things like the swining bridge that seemed delibertly made while its just the result of failing many times prior. Just like evolution
As someone who has played a ton of Poly Bridge, this is very cool! Also, I dunno if this has been clarified yet, but there is a 1:4 ratio between polygrams and unity's mass units.
Oh I see. Since I recorded the audio, I actually changed the weights a lot, and it seems they actually did almost reflect that. But it is good to know now 😁
@@AstroSamDev Certainly lol. Also, I don't know how well this can translate into your system, but I might be able to give you the current strengths and weights of each material, along with possibly some models from the game if you plan to make any follow-up videos!
We gave something like this as an assignment to students in an evolutionary computation class a while back, and it was a lot of fun. We used a "maximum load" fitness function (keep adding weight until the bridge collapses), and also had students add a cost minimization objective at one point for NSGA-II, though that ran into some fun problems (What bridge minimizes cost? The one where you delete the whole bridge, of course!). On one test problem we were getting really weird results only to find that our scenario was missing one of the two anchor points on the sides of the bridge, so the evolutionary algorithms were desperately trying to keep a huge cantilevered pier from falling over with surprising success!
I think if you made closeness to the flag an exponential reward, that might help incentivize reaching the goal. And if you also awarded points for bridge rigidity, that could be good for preventing dangling messes. The rigidity could be scored based on least amount of average travel for each joint node.
Honestly, half this stuff went over my head, but i can totally get on board with the concept of spending 5x as long avoiding doing something than the original task. Fascinating stuff.
It actually uses unity's 2d physics system, so having multiple rows moving back in the z axis would overlap collisions, and stacking them vertically could make the ball interfere or bridge pieces. The only way to prevent that would be to build extra barriers or delete falling things, which would reduce performance. And for visualization, it wouldn't be possible to show all of them at once on screen, and I think just showing a single one evolving gets the point across well.
To clarify, it would be possible to show them all at once, but they would be too small. And if you were talking only about the video, I wanted to show what the simulation actually looked like.
9:26 "our reward function was not specific enough, which is actually a big problem with reinforcement learning in..." education systems across the planet lol well said sam
As an architect who worked with engineers in an A/E firm for 20+ years, I love your dig at us starting at about the 1:55 mark. I had many engineer coworkers who I still call my friends -- a couple very good friends -- but professionally we drove each other crazy.
very good video, only downside I found is that it felt "incomplete" I'd absolutely LOVE to see more of this, tweaking, adding different materials, etc etc it is a pretty good concept and execution, so you definitely could invest some more resources into it. Will definitely turn out to be very good content. Keep up the good work!
That was really well done and enjoyable to watch. I wonder if Poly Bridge 3 has an easily-understood save file format -- you might be able to use that (plus some hairy automation helpers) to test candidate solutions in the real game environment, although it would probably be a lot slower and might suffer from the nondeterministic physics update you mentioned. Unless the PB3 devs have also done work to make their custom physics model fully deterministic (maybe it works out the physics interactions before playing back the animations? Presumably they would need something like this to be able to replay solutions consistently).
The genetic algorithm should be choosing which ones survive differently, each ai makes a bridge, then they have to walk across their bridge's 100 times with the simulation wearing down pieces over time, any of them that fall die, the other ones move on. If they all die repopulate it with another 100 random ais.
MY MAN! I saw you just a while ago making videos getting less than 1000 views WTF HAPPENED? you blew tf up congrats! I hope you have the best game dev journy ever!
So many questions: 1. Why not specify in fitness function, that "car" should cross the bridge? 2. Where 3d red connection point come from at the bottom? 3. Why not use gravity and shape for the "car"? 4. Why not use probability function, bases on fitness to decide parents? 5. How many spicies do you create per generation?
I like that this video demonstrated a safer example of the paperclip optimiser problem at the end. AI's goal isn't specific enough, so it does something ridiculous instead of what was intended. That could be stopping the ball from crossing the space instead of helping it to do so, or it could be consuming the entire galaxy to turn everything into paperclips...
I once heard that an algorithm had been designed to assist in choosing the most efficient route for a road across London. When the program was tested, it came up with an answer in less time than expected - straight down the river.
reading the comments and just reminded me of the swinging bridge and throw result. a nice simple way to overcome that would be to have 2 balls one after the other test the same bridge like traffic.
Cool! And it's a great foundation to build on. Would you try to improve the model with more realistic criteria? 1. Two-way crossing so that the solution can be symmetrical. 2. Vibration measurement, its minimization... 3. And anything else I didn't think of.
Having a maximum penalty for lost balls is an effective improvement; it shouldn't be (much) worse than a ball that hasn't moved at all. As the evaluation function is already composite (anchors, ball distance...), I'd also consider a non-linear evaluation on the ball distance. Closer to the finish should be very important and perhaps the distance should be rated exponentially. Another thing that could be interesting is average velocity of the ball; lower average velocity means smoother bridge. I would love to see a followup with improvements on the evaluation (perhaps my suggestions :))
Would be really cool if someone did this but hooked into the actual game and used that to simulate everything. Seems like it may be easier than reimplementing them too
I expected a super barebones explanation of how it worked, but I think I know a little bit more about machine learning now as a non-coding layman. great stuff
When creating fitness functions, I’ll often find multiple ways to score it, such as, for example: ‘distance traveled exceeds 5 units’ and ‘minimum distance to goal’ Scoring perfect gets you one point for each. 1 point for a minimum distance of 0, 1 point for traveling 5 units. I’ll then take all these disparate fitness scores and multiply them together for the final fitness score for the bridge. so if the ball never leaves the start (0 points for 0 of 5 units moved) and the ball never gets closer to the goal (0 points for goal proximity) - 0 * 0 = 0… which fair, bad example. the point is, any single fitness function doing poorly penalizes the overall score, and none of these functions need to ‘pass’ before other functions start getting considered. There’s some finagling to do (what if all functions start scoring at zero?) … but the point is, don’t limit yourself to just a linear score. Powers, logs, priorities use what works for you.
Ooh just tought it would be really cool if the AstroSam logo closes at the end instead of fading out It would close exactly in the same way that it opened at the beginning
I love that 8 months later YT said, "Hey, here's a video you might be interested in!" Yes, thank you YT, I watched it and dropped a like on it, and multiple comments, months ago. Good thing I have the memory of a goldfish, cause here I go watching it again! Look forward to seeing this comment in 8 months when YT brings me that fresh new video I might be interested in.
is there a way to inject the Neural Network controls directly into the game? could even reach out to the devs and see if they can make a special build of Poly Bridge 3 that allows for injection?
without reverse engineering the game, the easiest way i can think off is tracking the image of the game while played for the simulation part, for the building it think his code may be able to be adapted to work, biggest problem is the amount of time it would take to train it on a single instance running at a time
Very good lesson for evolving genetic AI: find out what you _really _*_want_* BEFORE you put the machine on it. Or revise when it goes off the rails. This is why AI should _NOT_ be trusted with criticial decisions like steering a vehicle if it has become a completely black box to us.
Another point of reinforcement should have been the speed of the "car". The faster the car reaches the flag, the better BUT: if the velocity of the car is faster then a set value (overspeed) or doesn't move below a certain threshold: penalties. there could be another penalty, if the car drives backwards. just some ideas i had.
Maybe double the mass of the ball, forcing the system to find a way to stabilize it. Or maybe do recreate a golf cart, where if the cart tips over, it's game over.
Your fitness function could have been based on three things: the changes to the road pieces (max distance change, max angle change) and the max distance change of the balls. Also you should have randomized ball size. With keeping the ball as level as possible the main goal. This will help avoid jumps, hills, swings, and dips. If you’re given a straight path of road joints and told to keep it as level as possibly by only adding bridge connections etc.
"as long as the bridge doesn't fall down and cars don't crash you will be paid" engineers: "ChatGPT, design me a 4 lane, 423 meter long bridge east to west..."
So i'm sure you already thought of this, but I think the AI would have a better chance if piece placement was changed to emulate the Arc tool. Like if the distance between two points it chooses is greater than material.maxLength, add a third point halfway between the two and offset it by a random number * the line's normal (weighted toward 0 offset) to define an arc, then create floor(arcLength/material.maxLength) connections and equally space them along the curve. It would probably still be a mess, but it would likely get it closer faster and is closer to how real players think when they plan a bridge.
I suspect the "hold the ball at the start" issue can be solved by scoring it by the closest the ball got to the flag. Ergo, the falling ball would, at least briefly, been closer than the held ball and scored higher.
Do you only have 2 members in your population? It looked like every bridge throughout the entire training was just a slight variation on the previous one. You really need a large population to explore a large amount of different designs, and a mutation bias high enough that a clearly bad design doesn't stick around for hundreds of generations.
Use a checkpoint system for reward at crossing every point on the bridge, instead of end result only, maybe that will determine the AI to solve the crossing the bridge problem and build an actual bridge.
While watching Matt(@RealCivilEngineerGaming) tweaking his bridges I thought I'd be cool to replace Matt with genetic algorithm. I don't even thing neural network is required for that. Basically we can give the bridge (with suboptimal but working design) to the computer and ask it to move joints around until it'd land on the cheapest possible bridge without structural modification. That would drastically speed up the search (compared to generating the bridge from scratch) and hopefully show what the design actually is capable of. And implementing it as a mod/plugin for the original game would be absolutely cool but i have no idea how hard would it be to integrate such thing into the game.
To keep the ai from keeping the ball in the same spot, add in penalties for the ball staying in the same spot. I.E. if the ball stays in the starting area after 3 seconds, start decreasing the score.
As Michael reeves put it: "I made a 5 hour long problem into a 2 and a half month long problem, cause I'm a programmer and that's what we do"
but now it can be reused every time you need to solve the 5 hour problem, while taking just 4.5 hours, and it works (almost) every time.
@@eduardokerber2931you captured the minimal worth value programming thinking
HEY! HEY!
Why did the Java programmer wear glasses?
Because...he can't C#.
Thank you, thank you, I'll be here all week.
not funny
@@danimgmd3510 shortest autobiography ever
5:48 I can't believe you really just went "assume a spherical car"
Glad someone else caught that 😂
Google “peel trident”
Physics problems on tests be like
@@ThatBoyAstrooo holy car
2:00 As an engineer i can confirm that architects will show you some magical item/building that defies the laws of physics and expect you to build it.
Lol it's kinda telling that MC Escher wanted to be an architect and actually enrolled in a school for architecture and decorative arts.
@@revwroth3698 I can imagine being told to make an escher design. I would die.
@@kerz5383 not to mention having to implement building codes, imagine having to design wheelchair ramps for all those staircases. That sounds awful to me and I'm not an engineer.
As an engineer I affirm your statement and would like to add "salesmen" to the list.
Summoning Real Civil Engineer..
comically overcomplicating a small issue to solve it in unnecessary and often slower ways gotta be my favorite genre of youtube videos
have you seen Harder Drive by suckerpinch? my absolute favorite when it comes to this
Would also recommend Harder Drive; Tom7 (suckerpinch) commits horrific crimes against maths and computing.
This concept applied to Structural Engineering would be amazing.
Just remember 16 hours of coding can save 20 minutes on planning and/or just actually doing it
@@oliverwaldock9710 If this is done for actual bridges, it'd save a lot of time and money due to optimization.
"But there is a problem, I am way too busy to be playing this right now" - AstroSam
Also AstroSam:
recreate the whole game
'i didn't have time to play polybridge so I recreated polybridge exactly so am AI can simulate it and solve it for me.'
@@justinwhite2725 sounds like a normal programmer to me.
Well, he was technically busy redoing the whole game and training an AI to solve it.
Respect for the architect dig ❤
It had to be done
The man himself!
Yo wassup rce love your vids
I like that real engineers treat Civil engineers the same way you treat architects.
Hi rce love your videos and architects are the worst and honestly my sister wants to be an architect and I want to be an engineer
"Im way to busy to be playing the game" 0:09
" To start off im going to need to replicate the entire game" 0:30
yeah bro was so lazy to run 1km that he ran a whole Earth lap 💀
@@justaguy311 No, he remade earth, and made an ai run on it instead.
Well, now you know why he doesn't have time to play the game
Damn, nice video! About 7:09: Yours didn't performed like Poly Bridge probably because Poly Bridge has its own custom physics engine, this was done because the Unity3D physics engine is not deterministic, which caused a lot of problems on Poly Bridge 1, not only rerunning the simulation will give you a different result, but game speed also affects the outcome. So for Poly Bridge 2 and on, they're using their own physics engine.
Yes, I did some research on it and found many differences, so my version is pretty different. One way I get around it not being deterministic is by running the simulation multiple times and taking the mean of the fitness, although this obviously takes more time.
@@AstroSamDev Part 2 yes no??
@@AstroSamDev and for Android
Since Polybridge is made in unity, I wonder if some bepin tool could extract enough of the physics engine to implement this as an actual solver.
@@TlalocTemporalsince poly bridge is written in c# you can almost certainly access the physics engine through dependency injection.
"now one problem we have is it is indestructible. Clearly it was made by engineers. So in order to fix this, we just need some architects" sounds like real civil engineer
EDIT: holy shoot 2.1k likes
I think that's the most I've gotten before thanks a bunch
RCE would be proud of him
RCE was an architect all along
RCE was the #1 architect hater until he became the #1 architect
RCE FTW!
We are only missing some strong shapes!
I like how this AI shows that trial and error can result in so seemingly complex things like the swining bridge that seemed delibertly made while its just the result of failing many times prior. Just like evolution
Yeah i really found it beautiful and honestly, i tyink it can really be compared to a very young child, just trial and error the lifd
As someone who has played a ton of Poly Bridge, this is very cool! Also, I dunno if this has been clarified yet, but there is a 1:4 ratio between polygrams and unity's mass units.
Oh I see. Since I recorded the audio, I actually changed the weights a lot, and it seems they actually did almost reflect that. But it is good to know now 😁
@@AstroSamDev Certainly lol. Also, I don't know how well this can translate into your system, but I might be able to give you the current strengths and weights of each material, along with possibly some models from the game if you plan to make any follow-up videos!
Ah ok
You are like if Real Civil Engineer and CodeBullet had a child and I love it
I’m instantly going to subscribe to both of those based on this sentence alone 😊
your not wrong...
Thought the exact same!
@@StephenOwen If you like real engineering stuff i would recommend PracticalEngineering too.
Genetic Algorithm in action!
My guy really said "if you didn't like the video, dislike it" you deserve my sub
UA-cam algorithm doesn't care about dislikes
when the world needed him the most, he returned
HE’S BACK!!!
Yooooooooooo
Fnilanyyyyyy!
"this bridge is indestructible since it was made with engineers, so we just need need some architects"
utterly comedic
Did you get the reference bro
@@gamecoder3833probably not
We gave something like this as an assignment to students in an evolutionary computation class a while back, and it was a lot of fun. We used a "maximum load" fitness function (keep adding weight until the bridge collapses), and also had students add a cost minimization objective at one point for NSGA-II, though that ran into some fun problems (What bridge minimizes cost? The one where you delete the whole bridge, of course!). On one test problem we were getting really weird results only to find that our scenario was missing one of the two anchor points on the sides of the bridge, so the evolutionary algorithms were desperately trying to keep a huge cantilevered pier from falling over with surprising success!
i feel robbed, this video kinda ended abruptly, i was expecting to see more out of the evolution and it figuring out different scenarios
I think if you made closeness to the flag an exponential reward, that might help incentivize reaching the goal. And if you also awarded points for bridge rigidity, that could be good for preventing dangling messes. The rigidity could be scored based on least amount of average travel for each joint node.
Honestly, half this stuff went over my head, but i can totally get on board with the concept of spending 5x as long avoiding doing something than the original task. Fascinating stuff.
Around 4:22 wouldn't it be better for visualization and filming purposes to do a 10x10 grid of bridges?
It actually uses unity's 2d physics system, so having multiple rows moving back in the z axis would overlap collisions, and stacking them vertically could make the ball interfere or bridge pieces.
The only way to prevent that would be to build extra barriers or delete falling things, which would reduce performance.
And for visualization, it wouldn't be possible to show all of them at once on screen, and I think just showing a single one evolving gets the point across well.
To clarify, it would be possible to show them all at once, but they would be too small. And if you were talking only about the video, I wanted to show what the simulation actually looked like.
@@AstroSamDev I understand!
Was just a friendly suggestion from someone who gets 0 out of unity
Thanks for explaining 😁
@@AstroSamDev great video btw!
I'm always amazed to see NN getting to the hardest and coolest solution and thinking "Hmm , that's perfect" haha
@@Rodasboyy Thank you!
I was really hoping for more from this video. Not sure if I'm being unrealistic but it just felt like it started to gather momentum then stopped dead
Oh man, you would get along so well with RCE.
"This bridge is indestructible- clearly it was made by engineers."
"To fix this, we need architects." 😂
"I don't have time to play the game, so I spent time to program the game in unity and trained an ai to play it"
2:41 Looking up at the sun in minecraft be like:
I hope there's a second part showing it solving various levels
6:10 : connecting to all points gives a better bridge
Meanwhile polybridge players: 😅
Weight!!!!!!! Money!!!!!!!!!!!!!!!!!!!
The purpose was destroyed by AI holding the car hostage.
2:00 he CLEARLY watched RCE
multiple everything by deltaTime or you're comiting a crime
no >:(
@@AstroSamDev i know lol
9:26 "our reward function was not specific enough, which is actually a big problem with reinforcement learning in..." education systems across the planet lol well said sam
As an architect who worked with engineers in an A/E firm for 20+ years, I love your dig at us starting at about the 1:55 mark.
I had many engineer coworkers who I still call my friends -- a couple very good friends -- but professionally we drove each other crazy.
very good video, only downside I found is that it felt "incomplete"
I'd absolutely LOVE to see more of this, tweaking, adding different materials, etc etc
it is a pretty good concept and execution, so you definitely could invest some more resources into it. Will definitely turn out to be very good content.
Keep up the good work!
That was really well done and enjoyable to watch. I wonder if Poly Bridge 3 has an easily-understood save file format -- you might be able to use that (plus some hairy automation helpers) to test candidate solutions in the real game environment, although it would probably be a lot slower and might suffer from the nondeterministic physics update you mentioned. Unless the PB3 devs have also done work to make their custom physics model fully deterministic (maybe it works out the physics interactions before playing back the animations? Presumably they would need something like this to be able to replay solutions consistently).
The genetic algorithm should be choosing which ones survive differently, each ai makes a bridge, then they have to walk across their bridge's 100 times with the simulation wearing down pieces over time, any of them that fall die, the other ones move on. If they all die repopulate it with another 100 random ais.
3:50 you know that FixedUpdate exist
When the AI discovers the physics of the game to cheat:
Correction: any optimization algorithm will cheat the system
Any system seeking a goal not perfectly aligned with your intent will produce undesired outcomes.
Typical software engineer mindset, lmao. Don't have the time to do it? Spend way more time to try to automate it.
MY MAN! I saw you just a while ago making videos getting less than 1000 views WTF HAPPENED? you blew tf up congrats! I hope you have the best game dev journy ever!
So many questions:
1. Why not specify in fitness function, that "car" should cross the bridge?
2. Where 3d red connection point come from at the bottom?
3. Why not use gravity and shape for the "car"?
4. Why not use probability function, bases on fitness to decide parents?
5. How many spicies do you create per generation?
Oh, thought you were gonna elaborate on the cheating thing and maybe do something about it but alright.
Could you maybe make a part 2? This is an awesome video, and I would love to see how you will improve this project!
I like that this video demonstrated a safer example of the paperclip optimiser problem at the end. AI's goal isn't specific enough, so it does something ridiculous instead of what was intended. That could be stopping the ball from crossing the space instead of helping it to do so, or it could be consuming the entire galaxy to turn everything into paperclips...
I once heard that an algorithm had been designed to assist in choosing the most efficient route for a road across London. When the program was tested, it came up with an answer in less time than expected - straight down the river.
8:30 he's beginning to believe
I hope the poly bridge devs see this and give you a chance to actually test an AI in the real game!
I'd think it would be cool for you to solve custom levels that are made by the UA-camr Real Civil Engineer.
It would be interesting to see what happens if you take some of the more successful bridges and recreate them in Poly Bridge.
I would love to see a part 2. Maybe try solving some actual levels with the algorithm and seeing if it would work?
reading the comments and just reminded me of the swinging bridge and throw result. a nice simple way to overcome that would be to have 2 balls one after the other test the same bridge like traffic.
I have never seen you before but i should be taking notes
You’re the only programmer on yt that i know of that
Shows what they’re doing
Sebastian Lague
Cool! And it's a great foundation to build on. Would you try to improve the model with more realistic criteria?
1. Two-way crossing so that the solution can be symmetrical.
2. Vibration measurement, its minimization...
3. And anything else I didn't think of.
I think I just may in a future video. Thanks for watching!
Having a maximum penalty for lost balls is an effective improvement; it shouldn't be (much) worse than a ball that hasn't moved at all. As the evaluation function is already composite (anchors, ball distance...), I'd also consider a non-linear evaluation on the ball distance. Closer to the finish should be very important and perhaps the distance should be rated exponentially. Another thing that could be interesting is average velocity of the ball; lower average velocity means smoother bridge. I would love to see a followup with improvements on the evaluation (perhaps my suggestions :))
damn this dude is insane😮
bro really went 😮
Would be really cool if someone did this but hooked into the actual game and used that to simulate everything. Seems like it may be easier than reimplementing them too
that would get you banned
@@daefin9993But they wont be used ng online anyways.
@daefin9993 you can literally pirate the game
@@mloxard hadnt thought of that but piracy is illegal and modifying a multiplayer game is against most tos's
"Clearly it was built by engineers, to break it you would need an architect" 💀💀
I expected a super barebones explanation of how it worked, but I think I know a little bit more about machine learning now as a non-coding layman. great stuff
There already is a fixed update function in unity for doing physics calculations
When creating fitness functions, I’ll often find multiple ways to score it, such as, for example: ‘distance traveled exceeds 5 units’ and ‘minimum distance to goal’ Scoring perfect gets you one point for each. 1 point for a minimum distance of 0, 1 point for traveling 5 units. I’ll then take all these disparate fitness scores and multiply them together for the final fitness score for the bridge. so if the ball never leaves the start (0 points for 0 of 5 units moved) and the ball never gets closer to the goal (0 points for goal proximity) - 0 * 0 = 0… which fair, bad example. the point is, any single fitness function doing poorly penalizes the overall score, and none of these functions need to ‘pass’ before other functions start getting considered. There’s some finagling to do (what if all functions start scoring at zero?) … but the point is, don’t limit yourself to just a linear score. Powers, logs, priorities use what works for you.
Ooh just tought it would be really cool if the AstroSam logo closes at the end instead of fading out
It would close exactly in the same way that it opened at the beginning
I imagine it'd be very fun to see the algorithm that got the car to the end goal in the slowest way possible
You know that there is a thing in unity called FixedUpdate(){} right? so your elapse function is useless
no
@@AstroSamDevand you can also set after how much ms it's called, default is 33ms so every frame on 60fps
I love that 8 months later YT said, "Hey, here's a video you might be interested in!" Yes, thank you YT, I watched it and dropped a like on it, and multiple comments, months ago. Good thing I have the memory of a goldfish, cause here I go watching it again!
Look forward to seeing this comment in 8 months when YT brings me that fresh new video I might be interested in.
Architecture, AI, is this a prequel to a Neil Breen movie?
OH DAMM, FINALLY, A NEW ASTRO SAM VIDEO!!!
never expected a cool poly bridge video, it's amazing
is there a way to inject the Neural Network controls directly into the game? could even reach out to the devs and see if they can make a special build of Poly Bridge 3 that allows for injection?
without reverse engineering the game, the easiest way i can think off is tracking the image of the game while played for the simulation part, for the building it think his code may be able to be adapted to work, biggest problem is the amount of time it would take to train it on a single instance running at a time
Would be awesome if you made a follow up video improving it to set records in game
watching the bridge grow and twitch as it evolved felt like something out of an Alan Resnick film
Super interesting! I don't know much about programming, but you explained it in just enough detail to understand the process.
Interesting timing. I just made a genetic algorithm library in Go and am in te process of optimizing its performance.
"this bridge is indestructible clearly it was made by engineers so in order to fix this we just need some architects" RCE would be proud
2:48 "new Vector4" I didnt even know Unity had that lol
Great for when you are making 4D games, as we all do.
@@AstroSamDev I should have been doing this from the start! I have been using 2 separate vector2s instead!!!
Very good lesson for evolving genetic AI: find out what you _really _*_want_* BEFORE you put the machine on it.
Or revise when it goes off the rails.
This is why AI should _NOT_ be trusted with criticial decisions like steering a vehicle if it has become a completely black box to us.
a follow up video on this but it minimized stress would be really interesting
Another point of reinforcement should have been the speed of the "car". The faster the car reaches the flag, the better BUT:
if the velocity of the car is faster then a set value (overspeed) or doesn't move below a certain threshold: penalties.
there could be another penalty, if the car drives backwards. just some ideas i had.
That ball who sits there and does nothing while thinking he is winning is just like me
You can avoid the scaredy cat by adding a reward for moving outside of a set range, or a penalty for moving slow.
Mans like "I don't got time to play" but has time to remake the entire game
Maybe double the mass of the ball, forcing the system to find a way to stabilize it. Or maybe do recreate a golf cart, where if the cart tips over, it's game over.
I was lowkey expecting you to recreate one of the result bridges in the original game
So bridges in the future just sling your car to the other side, meticulously having it land with minimal impact
Your fitness function could have been based on three things: the changes to the road pieces (max distance change, max angle change) and the max distance change of the balls. Also you should have randomized ball size. With keeping the ball as level as possible the main goal. This will help avoid jumps, hills, swings, and dips. If you’re given a straight path of road joints and told to keep it as level as possibly by only adding bridge connections etc.
I'd be curious to see if any of the designs would work in the actual game
"as long as the bridge doesn't fall down and cars don't crash you will be paid" engineers: "ChatGPT, design me a 4 lane, 423 meter long bridge east to west..."
So i'm sure you already thought of this, but I think the AI would have a better chance if piece placement was changed to emulate the Arc tool.
Like if the distance between two points it chooses is greater than material.maxLength, add a third point halfway between the two and offset it by a random number * the line's normal (weighted toward 0 offset) to define an arc, then create floor(arcLength/material.maxLength) connections and equally space them along the curve.
It would probably still be a mess, but it would likely get it closer faster and is closer to how real players think when they plan a bridge.
I suspect the "hold the ball at the start" issue can be solved by scoring it by the closest the ball got to the flag. Ergo, the falling ball would, at least briefly, been closer than the held ball and scored higher.
Do you only have 2 members in your population? It looked like every bridge throughout the entire training was just a slight variation on the previous one. You really need a large population to explore a large amount of different designs, and a mutation bias high enough that a clearly bad design doesn't stick around for hundreds of generations.
The population size was 100, and I think the mutation chance was about 10-20 percent
I was expecting you to demonstrate IN THE GAME that the evolved solution actually works.
Ahh yes, immediately figures out dangling roads. It’s already a true Polybridge player
hopnestly I thought we were going to see some amazing designs, but we got amazing TLDR's!
Use a checkpoint system for reward at crossing every point on the bridge, instead of end result only, maybe that will determine the AI to solve the crossing the bridge problem and build an actual bridge.
Kinda wanted to see the final bridge in polybridge. D:
Oh well. Lol
3:37 doesn't Unity have a built in update function that *does* run at a fixed rate? Was there a specific reason that you didn't use FixedUpdate()?
While watching Matt(@RealCivilEngineerGaming) tweaking his bridges I thought I'd be cool to replace Matt with genetic algorithm. I don't even thing neural network is required for that.
Basically we can give the bridge (with suboptimal but working design) to the computer and ask it to move joints around until it'd land on the cheapest possible bridge without structural modification. That would drastically speed up the search (compared to generating the bridge from scratch) and hopefully show what the design actually is capable of.
And implementing it as a mod/plugin for the original game would be absolutely cool but i have no idea how hard would it be to integrate such thing into the game.
I'd be interesting to see a mod of poly bridge doing this, so you can actually make it solve levels
To keep the ai from keeping the ball in the same spot, add in penalties for the ball staying in the same spot. I.E. if the ball stays in the starting area after 3 seconds, start decreasing the score.
"I'm too busy to play this game, so I recreated the game for an AI to play it."
THANK GOD HES BACK LETS GOO