Discuss Scratch

gtoal
Scratcher
1000+ posts

Is this AI too smart? I can't beat t...

Over the last couple of days, I've put together an advanced AI for the ghosts in pacman. Trouble is that the AI is so deadly, I'm not sure the game is even beatable any more. I haven't been able to clear the level - closest I've come is four dots left before I'm caught. I don't suppose I could get some of you to try it out and let me know if you can beat it? https://scratch.mit.edu/projects/56421322/ (I warn you, it's completely addictive; I haven't had as much fun playing a video game since the original came out)

I'll be putting in things to slow it down/dumb it down for the earlier levels - it's currently playing at its best, which is at the strength it would be for the final level with all slowdowns removed. I need to know if the final level is beatable.

You might find the code interesting - it's a lot simpler and easier to follow than ifugu's version, which has been my favourite of the various versions of this game here on Scratch.

I intend to reskin it with new graphics before final release. For now it is using the look and feel of Acornsoft's “Snapper” game from the BBC Micro.

Graham
djdolphin
Scratcher
1000+ posts

Is this AI too smart? I can't beat t...

Yeah, the AI is really difficult to beat. Usually I can get all or most of the dots before being caught in pacman-type games, but the ghosts keep cornering me in.

!
drmcw
Scratcher
1000+ posts

Is this AI too smart? I can't beat t...

Yes it is hard; the speed increase when you eat a pill is a bit much for my liking and it doesn't help that you can't eat the ghosts to get them out the way.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
Rumanti
Scratcher
1000+ posts

Is this AI too smart? I can't beat t...

The ghosts are definitely creepy, they're really cooperative and done great teamwork cornering me
My high score is 201 -_-

:wq
Zaidhaan
Scratcher
100+ posts

Is this AI too smart? I can't beat t...

Woah yeah It really is hard! you could try decreasing the speed and testing again and again until it is possible to win

gtoal
Scratcher
1000+ posts

Is this AI too smart? I can't beat t...

drmcw wrote:

Yes it is hard; the speed increase when you eat a pill is a bit much for my liking and it doesn't help that you can't eat the ghosts to get them out the way.

I' not sure how to do fractional speed increases. At the moment it either moves 1 pixel per frame or 2. Maybe if I set a counter and move by 2 on say 7 out of 8 frames and by 1 on the 8th frame, I could make it run a little less than 2X … I'll try that.

I'll add the ability to eat the ghosts soon. Just hadn't got around to it yet. Thanks for the feedback. I guess it will be easier to clear a level when you get multiple lives to do it in.

G
Zro716
Scratcher
1000+ posts

Is this AI too smart? I can't beat t...

Try using interpolation between squares on the pathway so that you can adjust their speed however you want.

As a long time Scratcher, I have found new meaning to the name “Scratch”: for me, it means to “scratch that itch”, to come back again and again to realize new ideas in this toy language, even when I'm capable of creating my projects in real programming languages years later. It's a friend that helped me to pursue programming and get me to enjoy its fruit. I'm certain many others who have walked this path as well have grown fond of its importance in their life.
MegaApuTurkUltra
Scratcher
1000+ posts

Is this AI too smart? I can't beat t...

gtoal wrote:

I' not sure how to do fractional speed increases
Use variables for position, increase them fractionally, and round for on-screen position?

$(".box-head")[0].textContent = "committing AT crimes since $whenever"
gtoal
Scratcher
1000+ posts

Is this AI too smart? I can't beat t...

MegaApuTurkUltra wrote:

gtoal wrote:

I' not sure how to do fractional speed increases
Use variables for position, increase them fractionally, and round for on-screen position?

It *might* work, but certain things happen only when the player is aligned exactly on a cell, which is a 16x16 pixel unit. I can't for example move by 3 units at a time because it will miss the next 16-pixel alignment point and a bunch of stuff would fail. So I would have to be very careful and find all those places in the code and rewrite them without that constraint.

I'm considering messing with the frame rate as an alternative. Have you seen what happens when it's in Turbo mode??? :-)

G

Powered by DjangoBB