How A.I. learns - Java* simple example with dots and a goal

Started by Darren Dirt, October 20, 2018, 11:11:00 PM

Previous topic - Next topic

Darren Dirt


https://youtu.be/BOZfhUcNiqk


With a similar algorithm his AI can beat "World's Hardest Game"!

https://code-bullet.github.io/WorldsHardestGameAI/WHG/

Level 1:
https://youtu.be/Yo2SepcNyw4

And beyond:
https://youtu.be/kVwkLb8zxq0

"Code Bullet" is a very very cool YT channel.


...


*actually not quite Java.
Ever heard of "Processing"? aka "Proce55ing"? https://github.com/processing/processing/wiki/FAQ
_____________________

Strive for progress. Not perfection.
_____________________

Darren Dirt

#1
I love that YouTube channel.

Now he built a simple "auto-clicker" for a classic Flash game, "Storm The House".

https://www.youtube.com/watch?v=fURH8z3hb6Y

Worth watching to the end, when he actually breaks the game.

...

Also, LOL @ his new video yesterday "AI learns to drive"
https://www.youtube.com/watch?v=r428O_CMcpI
^  It captures the core of why we sometimes HATE the frustration of being a code poet -- but also why it is eventually so damn *satisfying* when you finally getsomething to work. just. RIGHT.

_____________________

Strive for progress. Not perfection.
_____________________

Lazybones

I was just watched the storm the house and the pac man one the other day.

Darren Dirt

Quote from: Lazybones on February 20, 2019, 12:17:29 PM
I was just watched the storm the house and the pac man one the other day.

Yeah that one is N.E.A.T. :)
and got me to this summary of quirks/tips https://www.webpacman.com/ghosts.html
_____________________

Strive for progress. Not perfection.
_____________________

Darren Dirt

https://www.youtube.com/watch?v=6bFN2YkN6bo
"You can fake somebody's voice with only 15 minutes of audio"
-sentdex, a programming youtuber and Machine Learning guru so good that he is who the "Code Bullet" looks up to and steals code from
_____________________

Strive for progress. Not perfection.
_____________________

Darren Dirt

Yikes this Machine Learning stuff is... escalating quickly.

https://forums.rwoc.ca/index.php?topic=12054.0

...

https://talktotransformer.com/

PROMPT:
That escalated quickly!

RESPONSE:

That escalated quickly! A fight broke out between several of the guests, and when the cops responded, everyone ran.

Apparently all that was left to do was grab a bottle and go to a nearby park to watch the fireworks, while the cops sat around watching, waiting.

They finally noticed a guy in the front seat throwing punches and kicking the doors in an attempt to stop the fight, but he fell down, breaking his jaw. (His jaw was knocked off, but luckily his face didn't.)

They were on their way to arresting the guy, when another guest walked in, and the cops ran after him.

Luckily, when he was arrested, he didn't seem to be too upset, so instead of being taken away without charges, the cops brought him back to his hotel room with a slap on the wrist.

The guy was charged with interfering with the arrest and disorderly conduct, but they had to drop the charges against the other guest at the request of the host that had kicked him in the face.

The cops made sure to
_____________________

Strive for progress. Not perfection.
_____________________

Darren Dirt

More NEAT stuff from CB.


Hey Code Bullet, eat a bag of...





...walking creatures!

https://youtu.be/62IheUGZQLU

_____________________

Strive for progress. Not perfection.
_____________________

Lazybones


Darren Dirt

Quote from: Lazybones on March 29, 2020, 12:59:40 AMI find code bullet very entertaining at times.

Today I watched all 4 of his "Snake" AI videos. Now I want to code my own.

Snake, I mean -- not Snake AI. I am not that insane!!!

_____________________

Strive for progress. Not perfection.
_____________________

Darren Dirt

Quote from: Darren Dirt on March 29, 2020, 01:39:27 PM
Quote from: Lazybones on March 29, 2020, 12:59:40 AMI find code bullet very entertaining at times.

Today I watched all 4 of his "Snake" AI videos. Now I want to code my own.

Snake, I mean -- not Snake AI. I am not that insane!!!



At 8pm on Friday night I watched a couple of CSharp tutorial videos and one was a nice detailed explanation of a simple Snake game.

So thinking about the logical pieces of the game that he described, I built my own from scratch today. Just 12 days after I first finally started actually deep diving in to some of the CSharp tutorial content that I had found over the last few months.

And as per usual for me, I did not keep it simple.
As I got certain elements of it to work, I went beyond the MVP.
For example, I made it speed up exponentially as you get longer (starting at 7.5 fps, up to a maximum of 20 fps-- otherwise U-Turns are impossible).  ;D
And instead of boring blocks, the tail is its own unique character to make it look like a rattler.
And when you crash into a wall your head gets splatted into "X", but if you crash into yourself it is "+". Because why not.
I even have a boolean flag for POOP_MODE (that is where the next food shows up right under your tail).

Not quite done yet, some ugliness to clean up still, and I have some other ideas to add to it like food that teleports to a new location if you take too long to eat it, or a randomly-generated "background" instead of just empty space.

But spending the day on this confirms, I am infected. With a sickness, an exhausting addiction.
I definitely still have a passionate love for coding.  8)

_____________________

Strive for progress. Not perfection.
_____________________

Darren Dirt

#10
...and now I have found myself writing and rewriting elements of a game engine for building "ConsoleWindow" games in CSharp. Yesterday I finished up all things Rect, a few days before that I took a shot at some multi-layer display logic (where in my UpdateGameState logic I Put(x, y, "Image"[w, h, char[rows][cols] "Pixels"]) for each layer writing to pageHidden and then the final step is to paint all [row][col] whose [char] is different than what is already stored in pageVisible[row][col] and as a result I made 100k+ "monsters" bounce around the screen at a surprisingly fast framerate (before you ask, yes I skipped collision checking -- hence the Rect stuff later -- otherwise a 120 x 30 console window could only have 3600 "pixels" filled in). My goal was to make sure all of the "pixels" logic could/should apply easily to Actual Graphics, for some future fun stuff maybe.

So, yeah, thanks youtube people who got me going again. This reminds me of when I was 16 and 17, but now I am Clean Code focused so this compulsion is even more intense... why am I so deep down this rabbit hole, idk, maybe it's just really fun.
_____________________

Strive for progress. Not perfection.
_____________________

Mr. Analog

I wish I could get my code mojo back, I feel like a rusty old tool

Sent from my SM-T810 using Tapatalk

By Grabthar's Hammer

Darren Dirt

#12
Quote from: Mr. Analog on April 13, 2020, 08:27:46 AMI wish I could get my code mojo back, I feel like a rusty old tool

Sent from my SM-T810 using Tapatalk



"javidx9" aka "One Lone Coder" is the cure for what ails ya.
https://www.youtube.com/channel/UC-yuWVUplUJZvieEligKBkA/videos

Seriously, in ~30 minutes he builds a game. And explains every step along the way.
And he has done this regularly for more than a year.

When I have been building (and re-building) Snake it has strengthened my coding muscle AND re-ignited my passion for it. AKA my ability to problem solve and plan out the code solution is hugely improved because of the obstacles I faced in getting certain common elements of any game to work "just right", and also it kept it fun the sooner I got something visual to work that responds to my keypresses. What I have gained from the last few weeks of consuming his videos and getting back behind the coding keyboard = will pay huge dividends for any coding I do going forward, whatever language and whatever project.

PS: perhaps "SnakeRebuild.exe" can be a motivating reminder to make programming FUN and you will get back on that horse! --> Darren's Dirt Pile new thread.

_____________________

Strive for progress. Not perfection.
_____________________