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

A.I in TopDown Levels?

Archive: 3 posts


I made a topdown shooter level, so far so good. Until i wanted to add in A.I.

I totally forgot about that, and i ended up being quite ****** off because i had so much work in creating this level, and thought it was impossible to create A.I in there.

I tried placing sackbots in the controlinator, but no luck, ofcourse they stand absolutely still because they dont know the controls.
I know i can 'record' a sackbot doing my actions, but i want the A.I to be a little more dynamic then that. Like, if i run away, i want them to follow me. or if i strafe to the left, i want to still aim at me at all times.

Is this possible? If so, can you please explain how and/or join my moon and do it for me?

PS. is this game slowly dying out? I see less players online every week...
2011-06-12 12:56:00

Author:
DoomeDx
Posts: 132


They way I see it, you can use look-at rotators to aim at the player at all time. Then, set up a radius of player sensors (with detection radius tweaked so they don't overlap) around the enemy, each segment set to a mover moving in that direction. You could put a tag on the enemy, and when they enemy gets too close it will start to cause "melee damage." You could even make the enemy run away when his health gets low by doing this:

Make your enemy with, say, 8 player sensors all looking away from the enemy, forming a circle.

Then, set up your movers to move in the 8 directions when triggered.

Set up an OR gate for each mover, with the first input being the sensor it is assigned to.

Now set up an AND gate for each mover. The AND gate will be the detector that determines if the enemy's health is low and where the player is.

For each AND gate (there should be 8), feed the low-health signal into one input, and the player sensor into the other. Make sure every player sensor is wired to the proper AND gate.

Now, for every AND gate, wire it to the opposite OR gate's other input. So, for example, if I have my sensors set up like this...

A B C
D E F
G H I

A's AND gate would feed into I's OR gate's other input.

This way, when the player is on the enemy's right and the enemy is low on health, the enemy will start to run away to the left.

Now, for one last thing...

Make an OR gate with 8 inputs. Wire each AND gate into the OR gate.

Wire the OR gate into a girly, terrified, blood-curdling scream.
2011-06-12 18:23:00

Author:
nunsmasher
Posts: 247


Make a new level and work on the AI separately using basic holo blocks before you get frustrated trying to implement it in your current level, would be my main piece of advice.

I'm guessing there are some areas of the map that have higher strategic value than others, so where (some of) the enemies want to go is determined by the strategic value of an area dependant on the player position, for instance: if the player enters area A go to position B. You can easily create more conditionals such as: if player enters area A and triggers tripwire C or scouting enemy D go to position B. You can see that very quickly you can create complicated behaviours and have different groups of enemies working as a team based on whatever trigger the player happens to activate.

The main problem is probably going to be pathfinding. This would have to be developed separately at first I imagine but it would be really interesting to try and create something that can work its way through a maze using a holo sensor array with impact/tag sensors or whatever.
2011-06-13 14:32:00

Author:
Ayneh
Posts: 2454


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.