The AI Extension is here! šŸ’“

I usually use them as a condition! So ā€œif output >0.5 then press buttonā€. Not sure about the letters, as it should only give out numbers 0-1!

4 Likes

Thanks!

2 Likes

help

i have no idea what I’m doing. I’m trying to get the net to run away from a sprite. its not working one bit.

hideous code warning :arrow_heading_down:

3 Likes

Actually this works fine in principle, just a few bugs:

    1. You mixed up mysprite and mysprite2 quite a bit, I made it so the dog is always the one running but I realize maybe the meat was supposed to be running XD You could switch the images around anyway!
    1. You were using the distance between the sprites as an input between 0-1 by dividing by 100, but because the meat is only following at speed 10, the dog can get more than 100 pixels away- I fixed it so the sprites are in a 10*8 tilemap with walls around the edges so the maximum distance is always 160, so dividing by that ensures the input never goes over 100!
    1. I also changed the wya you assign velocities. In the original a value of 0.5-1 would get a speed of 50 - 100, but a value less than 0.5 would get a speed of 0 - -50. (This subsequently discludes values 0-50 and encourages fast positive velocities more.) Instead, I subtract 0.5 from the output first to limit the speeds to 0-50 and 0 - -50 respectively!
    1. This is something i’m fixing with the update- the base ā€˜random net’ function in my original extension is far too overpowered and usually outputs way higher than average. I added a ā€˜mix with empty net’ block to just push all of the weights closer to 0, so there is more variability at the start!
    1. Another error with my extension- it has dramatic pause a BIAS!!! Yeah, because the weights inside the net can ONLY range from 0-1, the neural net has a huge bias to output higher for higher inputs and lower for lower inputs (even though you want the opposite in this case.) In my much-needed update, ALL inputs, weights, biases, and outputs will be range from -1 to 1 to allow for negative relationships.
    1. This isn’t really an error, but because the dog can only ā€˜see’ the distance because it only has that as an input, it can never tell from which direction the meat is coming from. If you tried to evolve this AI, it would probably learn to just sprint as fast as possible in any direction! I suggest a separate input for ā€˜relative x value’ and ā€˜relative y value’. ā€˜mysprite x - mysprite y / 160’ and ā€˜mysprite y - mysprite2 y / 128’. would get these numbers, but they would be limited to -1 to 1, so you should also divide both by 2 and add 0.5 to limit them to 0 to 1.

TL:DR: Flaws with my extension mixed with some variable mixups and incorrect limits on distance and speed!
Sorry to make learning this extension so hard, I hope to seriously improve it in the update, and I really love that you’re dedicated to trying this out and being one of my first students : D

And for anyone dedicated enough to read this whole post… the estimated release date is tentatively sometime in October! Usually, I’d coincide it with a new 5-minute polished video, but by not making one I can actually focus more on the update and making a shorter video that’s just a tutorial on how to use it.

With my fixes:

  • I’M HYPED!!
  • I plan on using the new extension :smiley:
  • IDK, sounds complicated…
  • Buttons!
0 voters
7 Likes

@randomuser can you help me with this reel quick…

I need to have the AI be able to learn over time.
It would be helpful for you to start it because i dont really understand it.
I read the stuff but it didnt make sense.
Please add coments in the project so I can read them when Im editing the game.

6 Likes

Ai fails to move

2 Likes

I can help after CK4 ends! (the 30th)

3 Likes

no dip, I said i need help

2 Likes

Going to be late on that October deadline, but I’ve got some great improvements cooking!

4 Likes

LET
THEM
COOK
(It says in your bio any pronoun)

3 Likes

hey, could you help me figure out how to use this? I get how it works, built I don’t know how to translate that into actual code.

1 Like

Ah definitely!
It’s quite complicated at the moment, I need to update it to be easier to use XD
What are you trying to do?

3 Likes

I am also interested in neural nets. Don’t think I am smart enough (yet) to understand it. :slight_smile:
Maybe have a easy to understand incredibly simple example?

2 Likes

In school we are doing an essay on ai this is a great way to show it good job btw

3 Likes

That’s a good idea, maybe in demo form so it can be easily modified… I’ll get on that! :hammer:

4 Likes

I am mainly trying to figure out how to make some Ai characters move around based on where a ball is and other AIs are, but basically its AI Soccer. here’s an example of what I am trying to do with the follow function instead of the AI.

5 Likes

I always wanted to make FIFA in makecode…when i was a kid i was so close…so close…

3 Likes

@randomuser What’s the link, the link does not seem to be working for me.

1 Like

i made this with the demo since idk how to use the extension

2 Likes

They changed their username so just paste the link into a regular search engine and it’ll redirect to the new url which you can paste into makecode

1 Like