Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Need help from a logic master!

Archive: 13 posts


I've been working on a pac man level, and I'm having some difficulty with the ghost AI. For the most part, it works great, but it eventually glitches and the ghost stops moving. Sometimes it happens very quickly, sometimes it will run for 5 minutes before glitching. I cannot seem to figure out why it's happening. Would anybody be interested in taking a look at it? Maybe a second set of eyeballs might help. You can join me online, or i can give you a copy of what I have so far to look at offline.

If someone does want to help, I will do my best to make sure that it not just some noob wanting to copy what I have. I would prefer someone that I recognize from these forums as regular posters. Any help would be greatly appreciated, and mentioned when published.
2012-03-29 02:11:00

Author:
Brannayen
Posts: 438


*waits to see who posts first therefore admiting they considers themselves logic masters*
Oh wait......
You can send me a friend request, but I can't garantee I'll have the time till the weekend
2012-03-29 02:31:00

Author:
evret
Posts: 612


friend request sent.2012-03-29 02:43:00

Author:
Brannayen
Posts: 438


I'm not NEARLY as logic mastery as evret.. But I do know a fair amount of logic.. And I have time to spare Send me a friend request and I will help you out if you want. I recommend trying evret first though. 2012-03-29 02:44:00

Author:
Wolffy123
Posts: 406


Well, if you want to keep it true...let me tell you a bit about the ghost AI.
The red ghost, Blinky, chases the player.
The pink and blue ghosts, Pinky and Inky, try to position themselves in front of Pac-Man's mouth.
The orange ghost, Clyde: you can make it so that just wanders around randomly-but in the game he actually chases the Pac-Man as well, but when he gets too close, then he just moves towards the lower left of the screen.

I guess I just made things a lot more complicated.
2012-03-29 03:04:00

Author:
Kalawishis
Posts: 928


I'm not worried about making the ghosts behave the same as the original game. I have enough to worry about just getting the basics to work. Essentially, as they come to an intersection, it will choose a random direction based on available choices, excluding backwards. However, there is also logic, based on level, that causes the ghost to detect in which direction the player is, and if that direction is a possible choice, it will choose that instead of the random choice. The higher the level, the more often it overrides the random choice. That is the basic essence of my ghost AI. And they will all be the same, except for color.

What will set my level apart is additional powerups, and new and bigger boards. I haven't designed any powerups yet; I'm trying to get the AI to work first.
2012-03-29 03:11:00

Author:
Brannayen
Posts: 438


Not anything to add, dont think ill even understand what youve built so far lol.
Just until evret comes to the rescue...

1) Shooting in the dark... you have the ghosts using a follower-tag, reposition themselves at the center of every intersection?
Possibly if you use physical materials to keep the ghosts on track may result in stuck glitching.

2) A request: Can you reveal the logic you use for the ghosts when they choose a random of whats available?

Thanks in advance.
2012-03-29 09:42:00

Author:
zupaton
Posts: 167


I can post a picture later this evening. The Pac man is physical material, using a track to stay on course...that's working fine. The ghosts are holo material with a microchip; nothing physical at all. It's getting stuck from the logic somewhere.

The ghosts are using followers. I was originally using movers and tag sensors, but they would end up so far off track that they would go right past an intersection and keep going.
2012-03-29 11:07:00

Author:
Brannayen
Posts: 438


Oh, cool. Thanks. No hurries. 2012-03-29 11:32:00

Author:
zupaton
Posts: 167


Ok, here's pictures of the logic as it currently exists:

This is the main microchip; the logic starts at the sensors in the bottom left
http://ic.lbp.me/img/ft/dfc2b180b74b97d28c694b7a06eab3187c8ceaa6.jpg

This sub-chip determines when there's only one possible choice
http://ib.lbp.me/img/ft/f4b9aef5196f5e796b7ab5d2c10b9630631066e0.jpg

This sub-chip randomly chooses when there are 2 possible choices
http://i6.lbp.me/img/ft/226a4644a2001fb25fb5cea27cb8b93c2e5a378c.jpg

This sub-chip randomly chooses when there are 3 possible choices
http://i0.lbp.me/img/ft/ce0dfeabaeacba6dda57951f9682e1df4e10b340.jpg

This sub-chip takes into account the logic and sets the direction, activating the followers
http://i1.lbp.me/img/ft/911ac9b4a1774de53f90cb857840df8ab1c04323.jpg

This final sub-chip has logic for when pac man eats a power dot, and for when the ghost is eaten
http://i7.lbp.me/img/ft/a3766d43fabb0f1bac791e5109cfa7cd65c131bf.jpg

It's quite possible that I'm overcomplicating the matter. I'm trying to create the best level I can, and simple random directions just won't make for a challenging level.
2012-03-30 01:43:00

Author:
Brannayen
Posts: 438


It's fixed!!!! Thank you soooooo much to SonofaSack96 for the troubleshooting help. Here's what the problem turned out to be....

1) It occured to me that every time, right before it would glitch, the ghost would reverse direction, which it's not supposed to be able to do.
2) SonofaSack96 pointed out one spot in my logic where 2 things were dependent on one output, and also on each other. And, if they happen in the wrong order, chaos ensues.

This selector switch determines the ghost's current direction. It was also feeding...
http://i9.lbp.me/img/ft/8894dec0dd4d3ae4354c31a57099218040038ac1.jpg

These NOT gates. They are fed by opposite direction (i.e. if ghost is going left, it cannot select right as a possible direction) from that same selector switch.
http://ib.lbp.me/img/ft/c8b079eb2d885d662dbbe970de413b4dfa391bc8.jpg

So, I implemented this fix...a second selector switch, delayed from the first one, to feed the NOT gates.
http://ic.lbp.me/img/ft/8bc3a291e17b6f897291bce81f3309f347e9a553.jpg

After making this change, the ghost ran non-stop for almost 20 minutes, and only stopped when I stopped it. I do believe it's fixed =)
2012-03-30 04:51:00

Author:
Brannayen
Posts: 438


Darn! I was hoping for a more simpler solution but i see the main point of yours anyway.
Thanks. : )
2012-03-30 07:58:00

Author:
zupaton
Posts: 167


BOO YAA!!! I'm soo proud of myself right now 2012-03-31 02:16:00

Author:
Wolffy123
Posts: 406


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.