Coding Challenge #69.4: Evolutionary Steering Behaviors – Part 4

[ad_1]
This is part 4 (five parts total) of an evolutionary steering behaviors coding challenge. The goal is to create a system where autonomous steering agents evolve the behavior of eating food (green dots) and avoiding poison (red dots).

This challenge is part of the spring 2017 ITP “Intelligence and Learning” course (

Link to Part 1:
Link to Part 2:
Link to Part 3:
Link to Part 5:

Support this channel on Patreon:
To buy Coding Train merchandise:

Send me your questions and coding challenges!:

Contact:
Twitter:
The Coding Train website:

Links discussed in this video:
The Nature of Code Part 2 (Spring 2017) – Intelligence and Learning:
Repo for Autonomous Agents in p5.js:
Nature of Code:
Craig Reynolds’ Steering Behaviors:
My Video on Autonomous Agents and Steering:
My Genetic Algorithm Playlist:
My Video on Vectors in p5.js:

Source Code for the all Video Lessons:

p5.js:
Processing:

For More Coding Challenges:
For More Intelligence and Learning:

Help us caption & translate this video!


Posted

in

by

Tags:

Comments

31 responses to “Coding Challenge #69.4: Evolutionary Steering Behaviors – Part 4”

  1. Vincent B Avatar

    Right now: 333k subs, 333 likes, 3 dislikes

    What a moment!

  2. Barnabás Kiglics Avatar

    +The Coding Train14:18 there is one who eats hisher own father'smother's body

  3. Sibi Akkash Avatar

    Man !! you are awesome. I wish i can code like you

  4. missing no Avatar

    Great great challenge, congratulations!

  5. Christian Aigner Avatar

    Hi Daniel! Great video style! I love it! 🙂

    While watching I thought: Could you simulate car traffic (with crossings and highway links/ramps) with genetic programming and find out, whether a certain optimum speed would eliminate traffic jams at crossings/links/ramps?

  6. jordan fink Avatar

    you have it so that they die if they see food, not just if they eat it

  7. Funny Geeks Avatar

    I don't think its eating radius should be its max speed, it should be its current speed. (also sorry, I didn't watch the full video before commenting)

  8. Naftali Friedman Avatar

    Why not run clone 1% of the time, instead of putting that probability into the function itself and running it all the time?

  9. Henrik Samsonsen Avatar

    Hey, I have a question for processing. I am not the best at processing so please keep it simple 🙂
    How can you test if i shoot and object and it hits another object, but the object it hits is made from an array, how can i then spesifically destroy that object from the array?

  10. BrokenRobot Games Avatar

    As Bradley mentioned, there is a bit of a negative feedback loop going on.
    I recommend an increasing tolerance to poison per generation of the …..whatever that thing is. Poison should vary in potency and if your resistance is higher than potency the poison becomes food.

    Limit the need for food. While now they are losing food quite quickly, there should be a point where a "food storage" begins to fill. If they go from almost dead to full in 3 pellets, then grab 3 more in quick succession, then they should be consumed as they are needed, not immediately. If there is food around and they are maxed on storage, eating poison should count against the reserve food storage allowing for them to clear the field of nuances that will eventually flood the screen making survival possible.

    Also, eating your own species being gross is a matter of morals limited to a scope of humans. Many species eat their
    wounded/dead as opposed to burying them. We have no idea what these things taste like, but apparently they are nutritious.

  11. sulindvas Avatar

    hello, try make a terraria game.

  12. GABRIELFILMSTUDIOS Avatar

    21:00 The poor compression algorithm!

  13. Mat2095 Avatar

    About that magic number 5 (speed and eat-radius):
    The vehicles go 5 units per frame, but 5 is the radius, not the diameter, so the radius could be 2.5 and it still wouldn't jump over food if it was going perfectly straight. It isn't going perfectly straight, so having a bigger radius is actually good.

    Ideas:
    – a dying vehicle should spawn poison, not food. Eating your own species is gross, don't do that
    – one could give the clones some initial velocity, e.g. in the same or opposite direction as their parent

  14. PsyNeur Avatar

    I can barely watch this with how long and convoluted your code is. You could use continue in side for loops, you could use this.dna = dna || [random(-2, 2), random(-2, 2), random(0, 100), random(0, 100)]. But the concepts are entertaining and keeps me coming back. It would just be nice if you showed off some newer strategies for javascript coding.

  15. Dan W-B Avatar

    holy mother of youtube compression

  16. Andy Avatar

    Hey Dan! I'm interested in learning processing, but I'm not sure wether to buy your book (2nd edition) on it, or just to watch your tutorials, or maybe both? Do you cover everything in detail in your videos or is there more, and deeper information in the book?

    big fan <3

  17. Sriram Avatar

    you inspire me!

  18. Sebastian B. Avatar

    Dude you are a great educator. Keep it up!

  19. Shrek T Avatar

    Should make them fight each other. Violence is progression.
    Make them shoot poison after eating like 5 food.

  20. Bradley Shrader Avatar

    I don't know if anyone else has mentioned this, but this system creates a negative feedback loop that could end up killing all of the vehicles. If the perfect vehicle only consumes food, then they end up effectively concentrating the poison. Therefore, increasing vehicle success decreases vehicle success.

    i thought of a few solutions to this, one boring and some really cool ones IMO.
    1. Boring solution: make poison randomly decay (possibly give it some half-life or spoilage timer)
    2. Add a third entity which is an antidote to the poison and increases health (needs a perception and steering force)
    3. (My favorite solution) Add a commensalistic vehicle to the environment that consumes poison (possibly allow it to be attracted to other vehicles as a type of pilot fish)

  21. JoraForever Avatar

    lol, this video isnt released yet

  22. Matthew Holevinski Avatar

    he needs wayyy wayyyy wayyyyyyy more poison

  23. The Zip Creator Avatar

    This world's logic:
    [1]: Drops ice cream
    [2]: Steps on ice cream
    [2]: Eats ice cream because it stepped on it

  24. Rioreur Avatar

    in real life humans are different in the way they need foods, maybe you can put the variation of health over time in the DNA so veicules that need less food survive longer

  25. Juan Sevila Avatar

    So i think you missed defining the "mr" mutation rate variable and they are not mutating at all. You can see at the end of evolution that they are cloning the same thing over and over.

  26. SuperNicejohn Avatar

    I'd only let them clone if their lifespan is larger than the average, which of course implies a "var lifetime" for each vehicle, that gets averaged. Also maybe having, say 10 food at all time. Idk though, but I really liked this four-part series! 🙂

  27. Sean Avatar

    The Nature of Code should be compulsory at school level.

  28. Donnut Caffe Avatar

    This creature is above poison!

  29. The Circuit Avatar

    I just pointed out the problem. Just to see I got solved next part.

Leave a Reply

Your email address will not be published. Required fields are marked *