AI Tips and Tricks!

Could any body please help me in making AI?

3 Likes

What kind of AI?
I know nothing about AI other than that it runs on Python
So maybe learn Python.

1 Like

Sure! What do you want it to do?

1 Like

o I love ai here are some of my ai projects and I’m glad to see other people getting into ai and if you every need any help with ai feel free to ask me because I have done ai for a long time and I now an expert in ai and physics

and with the second game it can be a bit laggy because I built a custom system for its seeing but if it loses sight of you it goes to the last place it sees you last and it can hear so it’s one of my most advanced ai

1 Like

Maybe make it act like AI in Brawl Stars (I don’t know if Brwal Stars has AI)

1 Like

This is LOVELY

How do you do this?

1 Like

alot of blood swet and tears

What do you mean?

I’ve never played that game, sorry! :sweat_smile: You mean like the code that controls how the enemy moves and attacks?

1 Like

basically I spent a lot of time learning how ai works and spend a lot of time experimenting with different kinds of ai

1 Like

Yes you’re right on the money!

1 Like

Are there any extensions that help with AI (not only Sprite Sight)

Didn’t you make an AI extension?

Probably use that.

Where? Send me the link

1 Like

Here you go.

1 Like

For attacks, I’d suggest making a loop that checks if an enemy is within range to attack, then use an if statement to choose which attack to use— for example, one could be “if the enemy is within 16 pixels use the sword, if not use the bow”.
To add extra depth to the attacks, you could give each enemy a random “strategy” value from 1 to 5. Then an if statement in the looping attack code could change their attack strategy based on that value. For example, “if the enemies strategy is 1, aways use a bow. If the enemies strategy is 2, only attack at a long distance and run away if the player gets near.” Etc.
You could use the AI extension to train this logic, and I’ve planned on eventually making a neural network powered enemy, but it may give even worse results than just programming it yourself due to how small their brains have to be :laughing:

For movement, I’d suggest a few different strategies you could use or combine:

  • using the sprite vision extension to tell if the enemy can see the player, and if they can, make it follow the player
  • Use the A Star path finding extension to make enemies automatically find the shortest path around the walls to the payer
  • Use the ‘strategy’ code described above to code a few different movement styles (ex. One makes the enemy circle the player, the other makes the enemy avoid the player, one makes the enemies stay as close as possible to the player, and so on).

I’m on phone right now so I’d struggle to recreate the code, but if this is too confusing, LMK and I can make a demo when I’m on PC! :smiling_face:

3 Likes

well it looks like we found the god of ai

1 Like

Who??

1 Like

randomuser

2 Likes