Evolving Genetic Neural Network Optimizes Poly Bridge Problems

2024 ж. 14 Мам.
1 018 614 Рет қаралды

I made a genetic algorithm that can solve and optimize Poly Bridge puzzles with artificial evolution.
This Project's Source Code:
github.com/sam-astro/Genetic-...
Support:
● Patreon: / astrosam
● Ko-fi: ko-fi.com/astrosam
● Monero: 4AAjyAHKnYwCsgJp16v1YeeDPA1Z51QKUfCMWsiCDxkNBFCtbUfDHD7K5sZDrFH2pnGsDAH989XwXdudcoC4iqtVC9QLk8r
--------------------------------------------------
Related Links:
● Streaming Channel: / @astrosamstreams
● Itch.io: astrosam.itch.io/
● Github: github.com/sam-astro
● Discord Server: / discord
--------------------------------------------------
All Music was provided by Epidemic Sound (www.epidemicsound.com)
--------------------------------------------------
Chapters:
0:00 Intro
0:29 Remaking the game
2:06 Making genetic alg.
3:51 Managing agents
5:26 Calculating fitness
6:41 Mass, cost, and strength
7:37 Testing
7:53 Bug fixes
8:05 Real training
8:54 Funny first tries
9:00 Problems with genetic algs.
9:33 Outro
--------------------------------------------------
This video is not sponsored.
#programming
#neuralnetworks
#unity
#polybridge3

Пікірлер
  • 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"

    @senatordodo4240@senatordodo42409 ай бұрын
    • 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.

      @eduardokerber2931@eduardokerber29319 ай бұрын
    • ​@@eduardokerber2931you captured the minimal worth value programming thinking

      @Angel-kr4qo@Angel-kr4qo9 ай бұрын
    • HEY! HEY! Why did the Java programmer wear glasses? Because...he can't C#. Thank you, thank you, I'll be here all week.

      @MortalWombat1988@MortalWombat19889 ай бұрын
    • not funny

      @danimgmd3510@danimgmd35109 ай бұрын
    • @@danimgmd3510 shortest autobiography ever

      @eduardokerber2931@eduardokerber29319 ай бұрын
  • 5:48 I can't believe you really just went "assume a spherical car"

    @packediceisthebestminecraf9007@packediceisthebestminecraf900710 ай бұрын
    • Glad someone else caught that 😂

      @Roset595@Roset59524 күн бұрын
    • Google “peel trident”

      @AtroxSM@AtroxSM17 күн бұрын
    • Physics problems on tests be like

      @Achridian@Achridian17 күн бұрын
  • 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.

    @kerz5383@kerz538310 ай бұрын
    • 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@revwroth369810 ай бұрын
    • @@revwroth3698 I can imagine being told to make an escher design. I would die.

      @kerz5383@kerz538310 ай бұрын
    • @@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.

      @revwroth3698@revwroth369810 ай бұрын
    • As an engineer I affirm your statement and would like to add "salesmen" to the list.

      @benruss4130@benruss41309 ай бұрын
    • Summoning Real Civil Engineer..

      @Mike-mu7tk@Mike-mu7tk9 ай бұрын
  • Respect for the architect dig ❤

    @RealCivilEngineerGaming@RealCivilEngineerGaming9 ай бұрын
    • It had to be done

      @mloxard@mloxard9 ай бұрын
    • The man himself!

      @BwompProcessing14@BwompProcessing149 ай бұрын
    • Yo wassup rce love your vids

      @ZedakiahBoyer@ZedakiahBoyer9 ай бұрын
    • I like that real engineers treat Civil engineers the same way you treat architects.

      @hfbdbsijenbd@hfbdbsijenbd9 ай бұрын
    • 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

      @craigwhite1202@craigwhite12029 ай бұрын
  • "But there is a problem, I am way too busy to be playing this right now" - AstroSam Also AstroSam: recreate the whole game

    @nightartco@nightartco10 ай бұрын
    • '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@justinwhite272510 ай бұрын
    • @@justinwhite2725 sounds like a normal programmer to me.

      @maniacone4499@maniacone449910 ай бұрын
    • Well, he was technically busy redoing the whole game and training an AI to solve it.

      @cezarcatalin1406@cezarcatalin14069 ай бұрын
  • comically overcomplicating a small issue to solve it in unnecessary and often slower ways gotta be my favorite genre of youtube videos

    @realtired3670@realtired367010 ай бұрын
    • have you seen Harder Drive by suckerpinch? my absolute favorite when it comes to this

      @Terminator85BS@Terminator85BS9 ай бұрын
    • Would also recommend Harder Drive; Tom7 (suckerpinch) commits horrific crimes against maths and computing.

      @matthewwhiteside4619@matthewwhiteside46199 ай бұрын
    • This concept applied to Structural Engineering would be amazing.

      @noahschuler6388@noahschuler63889 ай бұрын
    • Just remember 16 hours of coding can save 20 minutes on planning and/or just actually doing it

      @oliverwaldock9710@oliverwaldock97109 ай бұрын
    • @@oliverwaldock9710 If this is done for actual bridges, it'd save a lot of time and money due to optimization.

      @noahschuler6388@noahschuler63889 ай бұрын
  • 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.

    @ojonathan@ojonathan10 ай бұрын
    • 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@AstroSamDev10 ай бұрын
    • @@AstroSamDev Part 2 yes no??

      @NikoCubeRoot@NikoCubeRoot10 ай бұрын
    • ​@@AstroSamDev and for Android

      @lakastusmanatus@lakastusmanatus10 ай бұрын
    • 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.

      @TlalocTemporal@TlalocTemporal10 ай бұрын
    • @@TlalocTemporalsince poly bridge is written in c# you can almost certainly access the physics engine through dependency injection.

      @RobertBleattler@RobertBleattler9 ай бұрын
  • "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

    @RoboxPpls@RoboxPpls10 ай бұрын
    • yeah bro was so lazy to run 1km that he ran a whole Earth lap 💀

      @justaguy311@justaguy3119 ай бұрын
  • "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

    @hudsonator7259@hudsonator725910 ай бұрын
    • RCE would be proud of him

      @stefanthatcat7143@stefanthatcat714310 ай бұрын
    • RCE was an architect all along

      @bunny6820@bunny682010 ай бұрын
    • RCE was the #1 architect hater until he became the #1 architect

      @hexturne@hexturne9 ай бұрын
    • RCE FTW!

      @yaroslavpanych2067@yaroslavpanych20679 ай бұрын
    • We are only missing some strong shapes!

      @yaroslavpanych2067@yaroslavpanych20679 ай бұрын
  • 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.

    @masonator__@masonator__10 ай бұрын
    • 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@AstroSamDev10 ай бұрын
    • @@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!

      @masonator__@masonator__10 ай бұрын
    • Ah ok

      @moji3812@moji38125 ай бұрын
  • You are like if Real Civil Engineer and CodeBullet had a child and I love it

    @rps4400@rps44009 ай бұрын
    • I’m instantly going to subscribe to both of those based on this sentence alone 😊

      @StephenOwen@StephenOwen9 ай бұрын
    • your not wrong...

      @realrane@realrane9 ай бұрын
    • Thought the exact same!

      @tozzasque@tozzasque9 ай бұрын
    • @@StephenOwen If you like real engineering stuff i would recommend PracticalEngineering too.

      @darthkarl99@darthkarl998 ай бұрын
  • 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

    @little_lord_tam@little_lord_tam9 ай бұрын
    • 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

      @enderiume8282@enderiume82829 ай бұрын
  • "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"

    @jvsonyt@jvsonyt9 ай бұрын
  • HE’S BACK!!!

    @peptobepto@peptobepto10 ай бұрын
    • Yooooooooooo

      @Cruciblecoder@Cruciblecoder10 ай бұрын
    • Fnilanyyyyyy!

      @gecko_6103@gecko_610310 ай бұрын
  • "this bridge is indestructible since it was made with engineers, so we just need need some architects" utterly comedic

    @meriabreadsticks@meriabreadsticks10 ай бұрын
    • Did you get the reference bro

      @gamecoder3833@gamecoder383310 ай бұрын
    • ​@@gamecoder3833probably not

      @yaroslavpanych2067@yaroslavpanych20679 ай бұрын
  • when the world needed him the most, he returned

    @ItsVasl@ItsVasl10 ай бұрын
  • The purpose was destroyed by AI holding the car hostage.

    @ancientluck6934@ancientluck693410 ай бұрын
  • Around 4:22 wouldn't it be better for visualization and filming purposes to do a 10x10 grid of bridges?

    @Rodasboyy@Rodasboyy10 ай бұрын
    • 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.

      @AstroSamDev@AstroSamDev10 ай бұрын
    • 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@AstroSamDev10 ай бұрын
    • @@AstroSamDev I understand! Was just a friendly suggestion from someone who gets 0 out of unity Thanks for explaining 😁

      @Rodasboyy@Rodasboyy10 ай бұрын
    • @@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@Rodasboyy10 ай бұрын
    • @@Rodasboyy Thank you!

      @AstroSamDev@AstroSamDev10 ай бұрын
  • multiple everything by deltaTime or you're comiting a crime

    @zetrium_@zetrium_10 ай бұрын
    • no >:(

      @AstroSamDev@AstroSamDev10 ай бұрын
    • @@AstroSamDev i know lol

      @zetrium_@zetrium_10 ай бұрын
  • 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

    @swivvy3037@swivvy30379 ай бұрын
  • i feel robbed, this video kinda ended abruptly, i was expecting to see more out of the evolution and it figuring out different scenarios

    @WolfsKitten@WolfsKitten9 ай бұрын
  • 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.

    @MrBuyerman@MrBuyerman9 ай бұрын
  • I hope there's a second part showing it solving various levels

    @braschlosan@braschlosan9 ай бұрын
  • 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!

    @an_asp@an_asp6 ай бұрын
  • 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.

    @Kurokuma10@Kurokuma109 ай бұрын
  • 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." 😂

    @hayleighhill1726@hayleighhill17269 ай бұрын
  • 6:10 : connecting to all points gives a better bridge Meanwhile polybridge players: 😅

    @slice6298@slice629810 ай бұрын
    • Weight!!!!!!! Money!!!!!!!!!!!!!!!!!!!

      @b_read6941@b_read694110 ай бұрын
  • 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).

    @batlin@batlin10 ай бұрын
  • My guy really said "if you didn't like the video, dislike it" you deserve my sub

    @WRLDOfSad@WRLDOfSad22 күн бұрын
  • When the AI discovers the physics of the game to cheat:

    @marktyshchuk@marktyshchuk3 ай бұрын
  • 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!

    @sundown456brick@sundown456brick9 ай бұрын
  • I would love to see a part 2. Maybe try solving some actual levels with the algorithm and seeing if it would work?

    @tdubmorris5757@tdubmorris57578 ай бұрын
  • 2:00 he CLEARLY watched RCE

    @DrPeeper@DrPeeper10 ай бұрын
  • Could you maybe make a part 2? This is an awesome video, and I would love to see how you will improve this project!

    @ickon_@ickon_9 ай бұрын
  • I imagine it'd be very fun to see the algorithm that got the car to the end goal in the slowest way possible

    @erin1569@erin15699 ай бұрын
  • How long did it take you to write the code? Could you also use an adaptive large neighborhood search?

    @katharinamarschall5662@katharinamarschall56629 ай бұрын
  • Super interesting! I don't know much about programming, but you explained it in just enough detail to understand the process.

    @anttitykkylainen9040@anttitykkylainen90409 ай бұрын
  • 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.

    @tpresto9862@tpresto98629 ай бұрын
  • 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.

    @DownhillAllTheWay@DownhillAllTheWay9 ай бұрын
  • 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...

    @a-blivvy-yus@a-blivvy-yus9 ай бұрын
  • Mans like "I don't got time to play" but has time to remake the entire game

    @TREKontheTUBE@TREKontheTUBE9 ай бұрын
  • "Clearly it was built by engineers, to break it you would need an architect" 💀💀

    @SatstackerHQ@SatstackerHQ9 ай бұрын
  • Ahh yes, immediately figures out dangling roads. It’s already a true Polybridge player

    @chapystick_@chapystick_9 ай бұрын
  • 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!

    @omernomer7429@omernomer742910 ай бұрын
  • 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.

    @atom-xgaming7507@atom-xgaming75079 ай бұрын
  • 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

    @soopFPS@soopFPS9 ай бұрын
  • There already is a fixed update function in unity for doing physics calculations

    @invention64@invention649 ай бұрын
  • Change the reword function such that time to cross is a factor so that by failing to complete in a timely manner it greatly impedes the reward. Time to cross over cost maybe?

    @richardbrooksshnee@richardbrooksshnee9 ай бұрын
  • "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..."

    @HappyfoxBiz@HappyfoxBiz9 ай бұрын
  • never expected a cool poly bridge video, it's amazing

    @aggold6757@aggold675710 ай бұрын
  • Would be awesome if you made a follow up video improving it to set records in game

    @teodorlb@teodorlb9 ай бұрын
  • 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 :))

    @leroy7647@leroy76479 ай бұрын
  • 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.

    @mohamedsarfaraazosman6419@mohamedsarfaraazosman64196 ай бұрын
  • I would love to see sequel for the vid.

    @borone8573@borone85739 ай бұрын
  • There is also Bridge Constructor series. I played Portal, and it was fun

    @OCTAGRAM@OCTAGRAM9 ай бұрын
  • hopnestly I thought we were going to see some amazing designs, but we got amazing TLDR's!

    @lionllew6601@lionllew66019 ай бұрын
  • I'd be curious to see if any of the designs would work in the actual game

    @torry2@torry29 ай бұрын
  • 2:41 Looking up at the sun in minecraft be like:

    @DamageMaximo@DamageMaximo9 ай бұрын
  • Really liked the more code based style of this video! Got one question tho could you slide me that vs theme name?

    @reniaz@reniaz9 ай бұрын
    • Thank you! The theme is called Monokai++, an extension for VSCode, and I made a port of it to Visual Studio which you can find here: github.com/sam-astro/monokai-plus-plus

      @AstroSamDev@AstroSamDev9 ай бұрын
    • @@AstroSamDev Thank you very much!

      @reniaz@reniaz9 ай бұрын
  • damn this dude is insane😮

    @Peter_kys2165@Peter_kys216510 ай бұрын
    • bro really went 😮

      @anomalousanimates@anomalousanimates10 ай бұрын
  • Interesting timing. I just made a genetic algorithm library in Go and am in te process of optimizing its performance.

    @k98killer@k98killer10 ай бұрын
  • "I dont have enough time to play the game so il make a new version of it from scratch"

    @alexandreblais8756@alexandreblais87568 ай бұрын
  • "It isn't the solution we wanted" I instantly thought "It is the solution you deserved." :)

    @dangingerich2559@dangingerich25598 ай бұрын
  • I was lowkey expecting you to recreate one of the result bridges in the original game

    @FoxSlyme@FoxSlyme10 ай бұрын
  • You have to use double precision fitness values or you get stuck in local minima.

    @Sven_Dongle@Sven_Dongle9 ай бұрын
    • I thought I was, but because it is all behind the scenes in a class I don't often edit and see that. Now that I look, I see that it is a double type, but I think when I add to it and set it from the Agent's class it is as a float. So I will fix this in a future revision

      @AstroSamDev@AstroSamDev9 ай бұрын
  • a follow up video on this but it minimized stress would be really interesting

    @panagiotisapostolidis6424@panagiotisapostolidis64247 ай бұрын
  • It would be interesting to see what happens if you take some of the more successful bridges and recreate them in Poly Bridge.

    @Markfr0mCanada@Markfr0mCanada9 ай бұрын
  • I was hoping for another step of adjustments to refine the reward system after you brought it up as an issue but was kinda left hanging like the bridge supports made of wood. 😂 I think (as someone glancing in from the outside) an issue was that your setup wasn't really rewarding the system for using supports in any constructive ways. If you come back to this at all, I personally would like to see refinement of the reward system to encourage more connectivity with supports back onto the road structure, and also to refrain from using road material outside of the direct path. Those are obviously just my thoughts, and either way, love the content.

    @thomasdow701@thomasdow7019 ай бұрын
  • 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.

    @merion297@merion2979 ай бұрын
    • I think I just may in a future video. Thanks for watching!

      @AstroSamDev@AstroSamDev9 ай бұрын
  • 2:48 "new Vector4" I didnt even know Unity had that lol

    @soundzythedev@soundzythedev10 ай бұрын
    • Great for when you are making 4D games, as we all do.

      @AstroSamDev@AstroSamDev10 ай бұрын
    • @@AstroSamDev I should have been doing this from the start! I have been using 2 separate vector2s instead!!!

      @soundzythedev@soundzythedev10 ай бұрын
  • 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

    @rayerdyne@rayerdyne10 ай бұрын
  • How is the Elapse function different from fixedUpdate? I imagine it is otherwise you wouldntve bothered but how is it different?

    @TheAshran@TheAshran10 ай бұрын
  • 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?

    @Drago_Whooves@Drago_Whooves10 ай бұрын
    • 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

      @eduardokerber2931@eduardokerber29319 ай бұрын
  • Very cool. I’ve been thinking about doing something like this but haven’t had the time or energy to put into it

    @RobertBleattler@RobertBleattler9 ай бұрын
  • This is like a mix of code bullet and real civil engineer😂😂 you got a new sub

    @Loli.slayer@Loli.slayer6 ай бұрын
  • Excuse me kind mortal, but what is the name of the song used at 8:05? I looked everywhere but can't seem to find it. Thanks.

    @hckr_-gh7se@hckr_-gh7se9 ай бұрын
  • 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.

    @Relkond@Relkond9 ай бұрын
  • This is pretty interesting and I think that if you make a few adjustments you could make a really cheap bridge for some levels in poly bridge and I would love to see that

    @joeflemo64@joeflemo649 ай бұрын
  • 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.

    @flameofthephoenix8395@flameofthephoenix839510 ай бұрын
  • You should make a video about the dynamic bridges, would like to see more

    @midasfury6165@midasfury616510 ай бұрын
  • Kinda wanted to see the final bridge in polybridge. D: Oh well. Lol

    @benb8075@benb807510 ай бұрын
  • What if you tweaked it to measure the total distance each part of the bridge moved during the simulation, and the less the bridge moved give it a higher score / the more the bridge moved the lower the score? Could also have it on some iterations remove a random non-road part to the bridge and if the score doesn't decrease massively, continue from there. Try to remove some of the additional clumps.

    @corgano6068@corgano60689 ай бұрын
  • 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.

    @PuppetSquid@PuppetSquid9 ай бұрын
  • Oh, thought you were gonna elaborate on the cheating thing and maybe do something about it but alright.

    @GIRGHGH@GIRGHGH10 ай бұрын
  • "I need to get the ball over there" "But If the ball falls into the abyss, i lose.." "Imma hold it"

    @potatosei2103@potatosei210323 сағат бұрын
  • 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

    @flexjranimates@flexjranimates10 ай бұрын
    • Sebastian Lague

      @Onaterdem@Onaterdem9 ай бұрын
  • I wondered where my boing ball went.

    @IntrinsicPalomides@IntrinsicPalomides9 ай бұрын
  • 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

    @alvesvaren@alvesvaren10 ай бұрын
    • that would get you banned

      @daefin9993@daefin999310 ай бұрын
    • ​@@daefin9993But they wont be used ng online anyways.

      @pacomatic9833@pacomatic983310 ай бұрын
    • ​@daefin9993 you can literally pirate the game

      @mloxard@mloxard9 ай бұрын
    • @@mloxard hadnt thought of that but piracy is illegal and modifying a multiplayer game is against most tos's

      @daefin9993@daefin99939 ай бұрын
  • In 3:45 ,why using void Elapse() when we can use FixedUpdate()? Curious about it , hope someone can explain to me .

    @user-xj9xd4oc8u@user-xj9xd4oc8u9 ай бұрын
  • 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()?

    @Doctor_XI@Doctor_XI9 ай бұрын
  • 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?

    @danielvinokurov236@danielvinokurov2369 ай бұрын
  • I hope the poly bridge devs see this and give you a chance to actually test an AI in the real game!

    @cpufreak101@cpufreak1019 ай бұрын
  • Architecture, AI, is this a prequel to a Neil Breen movie?

    @graduator14@graduator146 ай бұрын
  • The AI got very close to a very real bridge design. The jumbled wood members and some of the legths were the problem but overall you can actually make a bridge with a single column and just a few supporitng struts.

    @inventor121@inventor1219 ай бұрын
  • as they say, "be careful what you wish for"

    @kensaiix@kensaiix9 ай бұрын
  • "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

    @stefanthatcat7143@stefanthatcat714310 ай бұрын
  • hey I wonder where that z# stuff went, did you finish it?

    @timecubed@timecubedАй бұрын
  • I fear for humanity. In the future, lowest cost is paramount. All new bridges are dynamic swing bridges.

    @cronostvg@cronostvg9 ай бұрын
  • That ball who sits there and does nothing while thinking he is winning is just like me

    @supermario1576@supermario15769 ай бұрын
  • Are there any games that have AI agents trained like this? I was thinking of adding predator / prey entities into my game and have the predator rewarded by enemies eaten, and the prey rewarded by time survived

    @JordanShackelford@JordanShackelford8 ай бұрын
KZhead