Hey,so can someone explain me a bit more how should proper AI be made?
What should i do?Maybe some sketches,getting some pathfinding scripts etc. ??
[NOTE:Im not making the AI script maybe in near future after i get more experience in Js!]
Hey,so can someone explain me a bit more how should proper AI be made?
What should i do?Maybe some sketches,getting some pathfinding scripts etc. ??
[NOTE:Im not making the AI script maybe in near future after i get more experience in Js!]
I suggest hitting up google with game ai in the search box, loads of material to get stuck into.
Really the main 2 types of AI in games are finite state machines (most games) and fuzzy logic (sims)
Most games use A* for path finding but you’ve also got other variants like dynamic A* for games with changing/uncertain terrain (actually I’m not sure of any game that uses that, it’s more of a robotics thing)
Then you’ve got animal like behaviours like the boids algorithm, potential fields, swarm intelligence etc.
Plenty to think about but I’d start with what kind of game you’re making and what kind of things you want your AI to do, e.g. in FPS games you want the AI to follow and shoot at you
Ok thanks for the help i was thinking of making a simple FPS something like Counter strike.
Found some interesting stuff.
http://www.cgf-ai.com/docs/straatman_remco_killzone_ai.pdf
There are far more than 2 types of commonly used AI in games.
Finite State Machine (you mentioned)
Fuzzy State Machine (Not used much, Fuzzy logic is dying out)
Decision Trees (Halo 1 I believe)
Behavior Trees (Halo 2-3 if I remember correctly)
Rule-Based
Goal-Oriented (sims)
Markov State Machine
And those are just the ones off the top of my head.
For pathfinding its basically A* and its many variations ![]()
If you have some experience in Unity, it is not terribly daunting to implement your own simple FPS enemy scripts.
There are many more steps and implementations, like sound effects, attack and defense behaviours, and additional animations, but you ge the idea. Have Fun! ![]()
My enemies are rather simple minded but there steps are as follows
this script only allows basic basic basic AI, but they also have an illusion of being smart. mainly because in my script, if the player cant be seen by the enemy but is still within range to be followed by the enemy, the enemy automatically keeps moving to the players last known position, giving the enemy the illusion of being able to chase the player around corners, when in truth, its code only tells it to run in the direction its facing.
Really, simple AI is easy and quickly doable.
You can hard-code a simple FSM system in your game using a switch - case.
You’ll encapsulate the actions and transitions inside each case. Using coroutines and or time based methods you can control which and when your states needs to change.
The hard part is the pathfinding, you’ll provably find some “already done” pathfinding libraries here. Look for it on the forums.
You could also try out our behavior design tool EKI One that has an integration into Unity’s runtime workflow environments. You do not have to be a fully versed AI programmer to get something up and running quickly.
It takes care of basic problems you need to overcome, like navmeshes, pathfinding, steering and the visual creation of FSM-based decision making for your AI, to name a few.
Maybe it’s a viable solution for you: www.ekione.com
hey Maze, your EKI One tool looks quite powerfull, have you tested it with Unity iOS?
How fast it runs on iDevices?
@tatoforever: Sad to say, out-of-the-box only Windows Webplayer builds are currently officially supported.
Please have a look at http://www.ekione.com
You can directly download a trial there - http://www.shop.ekione.com
We have a complete integration package especially for Unity with several Editor extensions for Unity.
If you have questions please use http://www.answers.ekione.com
Is there any limitation on your trial license? Like building, saving, etc?
I’m about to install your trial it on Unity iOS and would like to make a quick integration build to my devices and see whats happen next. ^^
Really hoping it works on iOS, my current pathfinding system is quite slow and my FSM implementation is becoming very hard to maintain (its hardcoded). ^^
We are currently evaluating iOS and Mac and the compatibility will come within the next releases in August or November 2011.
Sorry forgot about your Dlls, ^^.
Yeah, well its a shame, there’s a lots of Unity iOS developers here willing to get some sort of robust AI system like EKI One.
Too bad, I’ll keep my own library till yours is compatible with Unity iOS.
King regards,
@ OP - I’ve had a lot of luck with FSM(Finite State Machine). I can block out most of what I want to do on paper and when I get home get to work. it’s really easy to manage and add to. I got the idea to use this based on an article about Doom and the demon dogs or something… worked like a charm.
If anyone knows any good articles on Finite State Machine’s please post them.
This should give you a good head start:
http://aigamedev.com/open/articles/fsm-implementation/
I’ve implemented the switch-case method (hardcoded) a while back and I’m still using it, elegant and simple.