playMaker

Author Topic: Creating Critter A.I.  (Read 1352 times)

MeekoSoup

  • Playmaker Newbie
  • *
  • Posts: 1
Creating Critter A.I.
« on: July 02, 2016, 12:31:12 PM »
I am currently working on a fully 2D Third Person RPG project, similar to games like Final Fantasy 6, and I would like to place some wandering critters in my game. These critters might at first behave like those found in Starcraft, where they simply wander around and collide with terrain, but I plan on going further with them, creating small cute behaviors and interactions with other NPCs and the player.

The trouble is actually making it work. Right now I'm using both Playmaker and C# Scripting to control my critter. I can't seem to avoid this, as working with mathematical expression in Playmaker, like any visual programming environment, is a nightmare. Not to mention dealing with collisions hasn't been a fun experience.

I've got two critters so far that use similar systems, both unacceptably flawed.

The first will randomly choose an angle between 5-30 degrees, and then it will move in that direction for a random amount of time. This is pretty nice, and not too buggy, but it means that I can't control its movement by distance. It cycles after that random amount of time is up.

The second chooses a random point, and moves to it. This one is controlled more by distance than time, but if it can't reach said point, such as if the point is in a wall, it will just ram the wall forever. This one only cycles when it reaches the point.

I want a lot more options with my AI. I want to be able to tell them to move away from walls, or to move toward other objects, maybe even moving objects.

I have looked into some of the assets on the store and it doesn't appear that any of them are good for 2D AI. So, I'm asking here if anyone has any solutions for good, modular AI for animals, NPCs and the like.

Thanks in advance!

cwmanley

  • Full Member
  • ***
  • Posts: 107
Re: Creating Critter A.I.
« Reply #1 on: July 03, 2016, 12:27:02 PM »
You might look at making a custom action for your mathematical expression.

Since it is a Top-Down game could you a 3d solution(Navmesh)? 

Here is paid 2d solution that supports Playmaker.

Poly|Nav - 2D Pathfinding

https://www.assetstore.unity3d.com/en/#!/content/14718
« Last Edit: July 03, 2016, 12:28:47 PM by cwmanley »