Search
Rss
Links to friends
Categories
- Developement (53)
- Kickstarter (9)
- News (8)
- Patch (1)
- Real-Life (4)
- Uncategorized (2)
- Updates (14)
Contact us!
54Germain, our usual blogger, is out for tonight, so I will be writing the blog this week. This week was pretty much the same routine as the other weeks of the month. There is still no sign of our pterodactyl pet which escaped last week but we keep our hopes up. We spent most of the week either tweaking systems for the video or doing legal paperwork for our kickstarter. By the way, we suffered another delay in our big kickstarter registering quest. Our video will be ready any time now and we hope to have the legal permission of launching the campaign in the next few weeks.
Anyways, there will be no explicit list of our accomplishment because they are all kind of blurry system adjustments, but since we worked in the AI a lot and since it is one of my specialties, this blog will be about how to make a proper character AI.
First of all, many video games needs global intelligence system that gives orders to non-player-characters in a way similar to a player in a RTS game. Bad guys in a RTS and often in tactical role playing game are directed by a god-like or player-like intelligence. That type of intelligence is very different than the individual intelligence that makes every little guy run, attack or move. Today, we will talk about the individual intelligence, AKA character AI.
There are many ways of doing a character AI. The first and most simple one is to make your guys behave in a completely random way. In many basic 2D games, the simple fact that enemies behave in a unpredictable way makes them seem intelligent. A friend of ours programmed a simple 2D shooter once and didn’t bother creating a AI. His enemies simply chose, at any given time, between shooting, crouching, running towards the player or running away from the player. In the end, he received compliments for his elaborate AI because some player had seen enemies dodging bullets and running from grenades. If it works, it’s fine. Artificial intelligence in games is more about making the guys look intelligent than actually making them intelligent.
The second most straightforward way is the good old decision tree. A decision tree is always a good start because it is simple to design and to understand. Most of the time It can be drawn on a sheet of paper in a way that is easy to understand. It simply means that, at any given time, a character looks at the world and decides what to do according to a simple and static pattern.
For a university project, Germain and I made a weird 3rd person shooter RPG. I started off building a huge decision mechanism which could be modified in-game by the player and adapt to different situations. After a couple of weeks of development, it turned out that, with our game complexity, we only needed a simple two steps decision tree to choose between running and fighting.
Starting a game with a very simple decision tree AI allows to concentrate on other things. The tree will slowly grow as the game becomes more complex but in many games, it may just do the trick until the end.

The third and more complex way is to build a decision cloud (or a moving tree, if you prefer). This is what Castle Story use. If you are not interested in these sort of logical twists, you can go directly to the soundtrack of the week.
The general idea is to build a certain number of decision trees (let’s call them routines since they can be parallel and don’t necessarily banche in a predetermined fashion) and give any routine the ability to switch to a new one. For example, let’s say that, in a RPG, a character can choose, in any combat, between assuming a healing / supporting role or a fighting / attracting attention role. At any given time during the combat, he runs the routine for his current combat role (who will I heal, maybe I should boost someone’s strength) but he must also check if his role is still relevant and if he wouldn’t be better off switching to his fighting routine. These types of decisions may include general patterns that are harder to evaluate and can’t be checked every time he acts. Maybe it depends on a system of dialogues between characters that updates every ten or thirty seconds or so. However, if the first routine -the healing one- goes through all its tests and concludes that no one needs healing, support or hair brushing, maybe it would be appropriate that it changes its role himself.
One of the good ways to manage decisions clouds is to create a solid message system to pass arbitrary information between parallel routines. For example, in Castle Story, bricktrons have a four core decision system. One to decides their general purpose and actions (build, fight, run). One decides their specific actions (pick up a bloc, strike this guy). Another one carries the actual tasks the second one decided to do (you are in combat and you want to destroy this guy who is also attacking you: dodge, block or attack ?). Finally, a specific and mostly independent core helps the guys moving in a dynamic world where their goals may suddenly not be reachable anymore and were sometimes the best way to get the work done is to stop trying and ask someone else to do it for us. All these systems are linked together with a message manager.

Why don’t you try in drawing something like that on a single sheet of paper ? In these situations, I give this simple advice to programmers : gives clear and fleshed out names to you many routines and messages. Don’t make a system where you have to add orders like Order[8] and Order[25] in your todo list. It will be hell and you may sometimes get lost for hours in your behavioral bugs. Try something like “Drop everything” and “Run away”. Phrases and words might be longer to parse for a computer, but they are so much easier to understand for a human brain.
So that’s it for this week, I hope that short AI tutorial got you interested in the fantastic world of behaviour programming.
Ho, and by the way, I never was much of a melomane but I will try in giving you one of the sound track I like to listen when I program alone.
See you next week.
YAY!
I hope that is a Fluttershy yay.
No idea what that means. I don’t watch My Little Pony.
Louder.
That kind of yay is at least 20% cooler ;)
Fluttershy Yay is yay! he said YAY!… :P
A Fluttershy YAY! would be more like yay…
Space Narwhal, you knew who Fluttershy was.
That’s good enough.
very well!!
Great work! Are we getting near the kickstarter or 1-2 several mounths?
LOL :D :D :D WHERE IS THE VIDEO?? LOL
give the guys some time. project management isn’t that easy ;)
They sed that in their last two blogs! I’ going to shoot my self in the head if next week is
a fake hope for kickstarter.Strange thing is that they say every week that ”Next 1-2 weeks there will be a kickstarter.Just say you need 3 more mounths more and be done with it! It’s really hard to program this game great progress but it’s still 1-2 mouths more work!I bet next week will be the same!
i vote from now you pick the soundtrack of the week. i prefer this bad-ass music to that pansy-ass pussy shit that normally chosen (no offense to those that like pansy-ass pussy shit, to each his own.:D)
anyhow im so freaking pumped for the kickstarter!
J’espre que les casseroles ne vous drangent pas trop :P
Des qubecois! Je le savais, ca se voyaient trop. :P
Love the Nightwish playlist, thanks!
Game’s looking great, keep it up! :)
hah! im glad im not the only one who listens to Nightwish whilst programming
I’m Batman
Why so serious?
I am a Banana
My spoon is too big.
Hmm… i was thinking of making some sort of game with some sort of AI, but lacked the knowledge on how to do it. thanks for this info, and making it clear, that the goal is to make the AI LOOK intelligent, as opposed to making actual intelligence
P.S. nice choice of music, you should choose the music more often (no offence meant to Germain)
I personally believe in the bottom-up approach to that situation. Better work ten hours tweaking something to make it good than losing ten hours planning something perfect just to find out it doesnt work. So if you have no experience with character AI programming, my advice is to think a lot, but try event more. You will eventually figure out what works for you.
You can only drop usless promices and tonns of blog text.
Now I’m starting to think that you will never relise it. First fromice was winter, then the beginning of summer… What’s next huh? Next year? I stop following this project, bye.
Good God, it hasn’t even been half a year and you’re already giving up hope? That’s a little sad.
You sound like a whiny 7-year-old with absolutely no patience. This is a 2-man team and they have a lot to do. You obviously have never followed a game in development before. I’ve been waiting for a game to finally be released for about 3 years, and it still isn’t out. But I know eventually it will be and I just have to be patient. So honestly stop being such a baby, it will be released when it is ready or when Germain and Francois get out the Kickstarter.
Sound like you are waiting for “Lost Alpha” . :-)
I assume you also don’t like Diablo 3? :)
That made me laugh. :D
You obviously don’t know how much work it is to create a game… And never heard of patience… Sad.
Ouh litte boy, not all games are created with Kudo.
Why is it called a ‘bloc’? :D
Trs intressant, merci ! :)
Hey, thanks for writing this, I am getting into programming at University at the moment and find posts such as these really help to keep me on track.
Appreciate the time and simplification you put in!
I love the Nightwish soundtrack . Respect for you bro “brofist” .
Gaaaah! This makes me want to learn programming! (I’ll begin learning next year)
Anyway, it’s really neat of you guys to explain not only what this game is, but also how it works!
Appreciative of the Progress,
- Ben
(Haha, just found out there’s another guy that goes by “Ben” now XD)
One Ben to another, if you are learning at Uni or whatever… do not fall behind, this shit is not so easy to catch up on!
Do the assignment, then do it again, with your own idea and your own twist attached! Then, you will fall in love with it after a year.
Good work guys
On se raproche d’une BETA <3
Fuck yeah, nightwish is beast!
Can’t wait for 2days post!!!
Looking forward to the Screenshot Saturday! :D
???? why are the always late with 2 days?
?? I heard it has to be on Friday?
??I don’t know…….??
WHY THE HELL AM I TALKING TO MY SELF? :D
They live in Canada so it’s only a day late. They have a lot of stuff to do, but they will get to it eventually.
That makes sense!
Still one day!
Y U NO POST?
Looking forward to the Game play Video Sunday! :D
where did u find that out?
I didn’t. Last time they missed a Friday they did a screenshot Saturday, hence my previous comment. So since they missed Saturday, it’s a joke that it must be some sort of video Sunday.
o, hahaha