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

Pacman + Ghost-Esque Movement

Archive: 9 posts


I wanted to recreate pacman, or something similar. If the player is going either left or right, I do not want the player to be able to go up and down, and vice-versa. I want to limit how close the player can get to the walls of each corridor too. I also want the enemies to follow the player around each corridor, but actually move along the corridors, turn corners etc. Until they have caught the player, in my attempt to do this, they will try and cut across the map using a follower, instead of following the paths laid out before them. Any and all help will be appreciated. I apologise if my explanation was hard to follow. Thank you.2013-02-27 20:42:00

Author:
NexusDave
Posts: 14


First of all your enemies and player-model should be on the same layer level so they don't cross over the wall's. If you want a invincible wall you can set four wall's that have every side is separated from another(use hologram or sticker material and turn them to 0%), around your moving model's/objects make. place a collision registered and set it to "include rigged off" > "marker (red)" on every separated wall. place a red marker on the wall. Place the a chip on one object/model(pacman) and put a= mover, x4 odd (1 active on, 2 active off) and set it whit 3 inputs, 2x -/+ and a controller (as a reviser). Connect the 4 collision's to the 4 odd whit 2 wires and place them after the -/+ controller chip and the controller to last port, and then further on to the the move chip. But you still need some time to set it right. this might not be a good explanation. But add me on PSN and i will show you its hard to explain here in words sorry :/ but it will 100% smooth this way 2013-02-27 22:44:00

Author:
Unknown User


I appreciate the reply, you are right it is a bit hard to follow from what you have told me, but I will give it a go and be sure to add you. Cheers.2013-02-28 11:17:00

Author:
NexusDave
Posts: 14


Hi there Nexusdave, hope this helps.
Gyroscopes wolud help.
PLAYER:- Use an invisible controllinator, which the player will sit in. On the controllinator (DCS), wire the DCS's left/right analouse stick to a DIRECTION SPLITTER. and wire the splitters positive output to the input of a 1 count COUNTER. Next, wire an output from the DIRECTION SPLITTER's negative output into the input of a second 1 count COUNTER. Next take a wire from the first counters output and wire it into the reset of the second timer. Finally, wire the output of the second counter to the reset on the first counter. (This will split the left/right output to be always on in the direction you pushed. So if you were pushing left, and then push right, it resets the lefts on counter etc). REpeat the process for up/down.
Taking one stick direction as an example (left)- from that counter connect up to MOVER and a ROCKET ROTATOR. The mover should match the direction the stick is pushed in (So only set a speed to the left/right value (- for going left). Also from the counter connect to a ROCKET ROTATOR. This will make the DCS face in the direction the seat is travelling in.

ENEMY- For random maze movement, at each junction in your make, place a RED TAG (labelled Random).
ON the enemy's chip have a matching TAG SENSOR (its best to use an IMPACT SENSOR on some holo or sticker)
Connect this TAG SENSOR to TIMERs reset tab (set this timer to be 0.1 max and invert it). Next connect to a RANDOMISER (set its tweaks to be max on 0.1 and max off 0.0 so things are instant).
From the randomiser:- wire 4 outputs (representing up/down/left/right) and connect each one to a set of 'a mover, rocket rotator'
(so for example, one output from randomiser controls going left, so the mover would be set to left/right -3.0, up/down 0.0.)
So each time an enemy reches a junction, it senses the tag and this chooses a direction via the randomiser.

I hope this helps my friend
2013-02-28 13:56:00

Author:
Sean88
Posts: 662


I agree whit sean88. he explain the same way of doing it as i do, he just do it a-lot better then me if you can still don't understand you can still feel free to add me so i can show you 2013-02-28 20:10:00

Author:
Unknown User


So I used your method for movement Sean for Pacman, but instead of setting one mover to the opposite reset, I set up an or gate to connect the three other movers to reset to the mover you want to activate. I did this four times, once for each mover. Then I copied this and replaced movers with gyroscopes to get the model to face the way he was moving.
My problem with the enemies is that I dont know how to get the enemy to move on its own to reach the tags. I have put a tag at each junction, whether it is a two-way, threeway, or fourway junction. It simply doesnt move on its own. Cheers.
2013-02-28 23:40:00

Author:
NexusDave
Posts: 14


Actually, rotating pacman creates movement that is not smooth. Check out my pac man level here. http://lbp.me/v/bjkyn9

What I did, was created a circle of yellow neon material, then used slice and dice to cut it into 4 pieces, with the cuts in the shape of an X. Each segment is set to color yellow when on, black when off. Whatever direction pac man is travelling, the corresponding segment flashes on and off, creating the illusion of "turning", without actually turning.

If you want, I can show you how I did some of my logic. Just let me know if and when you wanna join me and check out some of my logic.

EDIT: btw, the ghost movement logic was probably the single hardest thing I've done yet, logic-wise.
2013-02-28 23:43:00

Author:
Brannayen
Posts: 438


Thanks guys. Its just a way to do it.... Brannayman has an excellent idea.
To get the enemies started moving, use a timer. Start by placing an emmiter in the maze center so that it will emmit the ghost over the emmiter have have a tag directly beside the emmiter that triggers a mover on the enemy to go out in the direction of the door (gap from the middle into maze)as the ghost leaves the centre, place a tag for a random direction outside the exit so the ghost will move off in a random direction.I would use a slightly different setup though, compared to a normal junction randomiser. This one randomises between only 3 ways, so this tag will never select making a ghost go back into centre.
Hope this helps buddy
2013-03-03 20:17:00

Author:
Sean88
Posts: 662


Here's my method for ghost AI, since you don't just want the ghosts going in random directions.

On my level, each intersection has a microchip with tags indicating which directions are possible to go. Each chip also has a common tag labeled intersection. The ghosts use followers on these chips to travel to the next intersection. When a ghosts reaches an intersection, this is the progression of logic:

1) it eliminates the opposite direction as a possibility (if it was going left, it will not turn around and go right).
2) it picks a random direction based on remaining possible choices.
3) Based on what level you're on, it will sometimes choose a direction towards pacman (or a tag leading pac man) instead of the random choice. For example, on level 1, it will do this once every six intersections, twice on level 2, and so on up to level 5, where 5 out of every 6 intersections, it's choosing it's path instead of randomly.
2013-03-04 02:19:00

Author:
Brannayen
Posts: 438


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.