Discuss Scratch

apple172
Scratcher
15 posts

HOW TO MAKE AI?

asivi
Scratcher
1000+ posts

HOW TO MAKE AI?

Advertising?
Wahsp
Scratcher
1000+ posts

HOW TO MAKE AI?

asivi wrote:

Advertising?
No I don't think so

Here's a link to the wiki page on making artificial intelligence in projects

rpglurker
Scratcher
100+ posts

HOW TO MAKE AI?

In order to build an AI, start by writing down what you would do and why. For example, when would you go after an ammo power up? a life power up? etc. You will need to code this same logic in to your AI. When do you chase down your opponent or fire your guns?

Sometimes developers change the rules for computers to make the AI easier. For example, the computer does not go after ammo power ups, it automatically gains x amount of bullets every x seconds until it reaches the max capacity….or it has unlimited ammo…. You can design multiple AIs that are more or less capable (easy to hard)…etc.

As far as moving toward a target (a target can be an enemy tank or a power up selected by your AI) point in direction of the target and move until you hit a wall. You can use an alternate costume to detect whether the wall you hit is in front or on the side by placing different colored feelers to the front and sides, this can help you determine whether you need to turn right or left. Switch the costume back to the original and continue moving. If you code this in a “More Block” you can disable screen refresh while you switch costumes and your user will not see the alternate costume with the feelers.

I like to periodically reset the movement AI to point back at the target and restart the chase algorithm. This helps if you are chasing a moving target and keeps you from moving too far off course when you change directions to get around a barricade. You can also use your feeler to detect the edge of a barricade so you can turn back on course when you get around the edge.

The biggest problem with this AI is getting in to a loop where the AI gets stuck. This is called deadlock. Tracking your path, or a small amount of random direction can help to avoid deadlock, but get the basics working before you try to tackle deadlocks.

The goal of AI is to create a “computer player” that is indistinguishable from a human player. Figuring out what you would do and why is the key to building a good AI. Once you have a good idea of what you would do, it is much easier to code the computer to do something similar.

https://scratch.mit.edu/projects/933971 This is a tank project with AI that may prove useful.

Last edited by rpglurker (Dec. 12, 2017 16:51:26)


Retired Microsoft Software Manager Turned CS Teacher
“Education is the most powerful weapon which you can use to change the world.” - Nelson Mandela
Changing the world one CS student at a time!!!
captainsuperawesome
Scratcher
8 posts

HOW TO MAKE AI?

how to make
(☁ aI)
for a
(smash Bros)
project 

Last edited by captainsuperawesome (March 6, 2019 19:41:50)

captainsuperawesome
Scratcher
8 posts

HOW TO MAKE AI?

Dont just ignore me!!!

Last edited by captainsuperawesome (March 6, 2019 19:42:35)

deck26
Scratcher
1000+ posts

HOW TO MAKE AI?

captainsuperawesome wrote:

how to make
(☁ aI)
for a
(smash Bros)
project 

I won't ignore you, I'll remind you not to spam or necropost.
Zekrom_Unova
New to Scratch
1 post

HOW TO MAKE AI?

i'm still learning, but i got a good help
https://scratch.mit.edu/projects/110823424/
Kraken_Games
Scratcher
100+ posts

HOW TO MAKE AI?

Zekrom_Unova wrote:

i'm still learning, but i got a good help
https://scratch.mit.edu/projects/110823424/
Topic is old. Don't necropost

KRAKEN_GAMES


I live in the depths


.)
Wahsp
Scratcher
1000+ posts

HOW TO MAKE AI?

why was I following this wow

apple172
Scratcher
15 posts

HOW TO MAKE AI?

Wahsp wrote:

why was I following this wow
lol same unfollowing now
c00lman8
Scratcher
1 post

HOW TO MAKE AI?

anyone have tips for making an ai for a mortal kombat or street fight er type game?
ResExsention
New to Scratch
1000+ posts

HOW TO MAKE AI?

c00lman8 wrote:

anyone have tips for making an ai for a mortal kombat or street fight er type game?

Stop hijacking this thread!

I'll request closure to prevent future off topic discussions, please create your own, thanks!

Know therefore that the Lord your God is God, the faithful God who keeps covenant and steadfast love with those who love him and keep his commandments, to a thousand generations. - Deuteronomy 7:9

——————————————–

Playing: Minecraft, stuff…?

Powered by DjangoBB

Standard | Mobile