@ 3:41 THIS is why you are my favorite programmer. You SHOW the hardship, but also the practice of overcoming the problem. Much love, man. : D
@likeyou33177 жыл бұрын
I did the clone version related to health and it's really rewarding. I can watch the mechanisms of nature on my pc for like 10 minutes and I ain't bored at all! Thanks a lot dan.
@nyscersul425 жыл бұрын
The random excitement dances are the best part!
@XoIoRouge6 жыл бұрын
How have you not been meme'd yet? You make such perfect gif memes I just need that Evolution Dance for a "YAY" meme to gif everwhere...
@asystat7 жыл бұрын
Dude you are a great educator. Keep it up!
@Mat20957 жыл бұрын
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
@TheCodingTrain7 жыл бұрын
Great points and great suggestions!
@bradleyshrader81027 жыл бұрын
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)
@brokenrobotgames25777 жыл бұрын
In real life....having children is a negative feedback loop. I only have so much money a month, I can afford x amount of groceries, groceries / occupants is a decreased value if I have a child. But according to this game, if an occupant dies, I get more food. I don't even get that in real life. I'd have to bury the child in a box that takes more food away from me. So in a way this is absurd now that you mention it. They eat their dead!
@bradleyshrader81027 жыл бұрын
what you're talking about is entirely different from what I'm talking about. you're talking about the distribution of and competition for limited resources, which is a necessary component of evolution. the limited resources create a carrying capacity which limits how many organisms can exist in the environment. What im talking about is the negative feedback loop created which in a perfect world actually ensures that NO organisms can exist. think of its edge case: if poison is constantly added and only perfect vehicles exist, then by the nature of a perfect vehicle, poison is never removed. therefore the poison will eventually occupy every single pixel in the environment. thus this creates a universe where no organism can exist. considering your example, as the population grows the rate of consumption grows until it exactly meets the rate of production. If the rates are ever unequal competition steps in to balance them, so the trend is for the population to exactly equal the carrying capacity. so, obviously our arguments are entirely different.
@brokenrobotgames25777 жыл бұрын
I see. So there is something consuming food, therefore, unless there is something to eat/use poison, then eventually there is doom regardless of the DNA attributes inherited and passed from one to the next. Perhaps a resistance to the poison could be developed over time based on how many generations of offspring have been created. Then, if poison has a varying degree of potency as the resistance is increase, the effects are reduced, eventually becoming food itself. I mean, that is short of giving them the ability to become an intelligent species and start using it for rodent eradication. But I don't see that for the future of these little guys.
@Tracks7777 жыл бұрын
Great! Keep it up!
@brokenrobotgames25777 жыл бұрын
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.
@caigner7 жыл бұрын
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?
@TheCodingTrain7 жыл бұрын
Oh, interesting idea!
@peterbonnema89136 жыл бұрын
I'm not that familiar with JS but in c++ there are copy constructors. The idea is that you pass in an instance of the same class and the resulting instance of the constructor is simply a copy. That way you don't need to fiddle with separate arguments in your ctor just to have it fullfill two purposes.
@badunius_code3 жыл бұрын
17:00 initialize them in uniform way then manually map them to the desired range
@WistrelChianti2 жыл бұрын
There's a random bonus of interesting to this which is seeing just how specifically awful the compression is on the vehicles. KZbin really doesn't like a lot of small lines moving about suddenly.
@SuperNicejohn7 жыл бұрын
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! :)
@TheCodingTrain7 жыл бұрын
These are great suggestions!
@danw-b66777 жыл бұрын
holy mother of youtube compression
@MatthewHolevinski7 жыл бұрын
inorite... youtube should fix their encoder to check, have i just blurred the shit out of everything, maybe i should run over this section for a few more passes and then continue on.
@GABRIELFILMSTUDIOS7 жыл бұрын
21:00 The poor compression algorithm!
@missingno78437 жыл бұрын
Great great challenge, congratulations!
@sibiakkash41727 жыл бұрын
Man !! you are awesome. I wish i can code like you
@markvador66677 жыл бұрын
Exciting concept and exciting tutorial ... awesome o_O
@phillipneal81945 жыл бұрын
Great !!!
@keshavkumarOfficial4 жыл бұрын
how we can use generative algorithm code in Architecture floor plan planning??
@sanchitverma28925 жыл бұрын
TheCodingTrain goes X rated for a day
@thezipcreator7 жыл бұрын
This world's logic: [1]: *Drops ice cream* [2]: *Steps on ice cream* [2]: *Eats ice cream because it stepped on it*
@MonzennCarloMallari7 жыл бұрын
The Zip Creator lol XD but to be fair it's more like running smack against a food or poison, which forces the vehicle to eat it.
@daniellebarker72056 жыл бұрын
drives car over sandwich eats sandwich because it drove over it
I just pointed out the problem. Just to see I got solved next part.
@TheCodingTrain7 жыл бұрын
Haha, my past self thanks you!
@henriksamsonsen877 жыл бұрын
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?*
@TheCodingTrain7 жыл бұрын
Short answer, however, is take a look at my ArrayList tutorials with Processing. ArrayLists have a "remove()" function.
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.
@CivilF113 жыл бұрын
A) The cloning rate is extremely low. When being cloned, it's a 1% chance of a mutation happening. B) The changes when a mutation happens are very slight. For example, the radius perception can change from -10 to 10, but this also means it can choose changes close to zero. The weights themselves are changes within decimals, you will not reasonably see changes on the screen with that. I know this comment is four years too late, but oh well.
@amdreallyfast7 жыл бұрын
I had a bit of fun and made an "egg" instead of cloning immediately
@MrCmon1136 жыл бұрын
That's a nice way of giving them a different position as well. I think I'll do something like that myself, thanks. : D
@joraforever98997 жыл бұрын
lol, this video isnt released yet
@toasty24387 жыл бұрын
Patreoooon >_
@joraforever98997 жыл бұрын
actually i have found the link to this video in the part 3 of the series, also you can watch part 5, it is not released yet, but you can watch it if you click on video at the end
@toastyPredicament3 жыл бұрын
noted: do not drop powdered sugar into a monster
@jnfsmile7 жыл бұрын
Why not run clone 1% of the time, instead of putting that probability into the function itself and running it all the time?
@TheCodingTrain7 жыл бұрын
Interesting suggestion, thank you!
@sirdondaniel7 жыл бұрын
Could't u just add a new Child when someone dies and also add new food/poison when someone eats it?
@mario1ua5 жыл бұрын
They should have an option to eat one another, muahahaha!
@jjppmm297 жыл бұрын
would have probably put DNA into its own object with a mutate function using mutation weights where mutation weights are their own structure 🤔
@Mrqwertar7 жыл бұрын
Right now: 333k subs, 333 likes, 3 dislikes What a moment!
@Protegit7 жыл бұрын
So... if these vehicles suddenly became concius... you'd be a god for them :O
@beaverjoe91716 жыл бұрын
Hardest part.......
@lukaasg34767 жыл бұрын
hello, try make a terraria game.
@psyneur91827 жыл бұрын
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.
@LPCelllule7 жыл бұрын
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
@DasAntiNaziBroetchen4 жыл бұрын
That would create the obvious result: All vehicles will end up needing less food.