2012/12/04

Cube World AI

I've been working on the artificial intelligence of Cube World's NPCs and monsters. I've added pathfinding and some behavior features to the AI. The pathfinding is based on the A* algorithm, with some additional features like climbing and arbititrarily sized bounding boxes for creatures and obstacles. NPCs like villagers use it to find their way to various places in the city. Enemies use it to follow the player even to the most unreachable locations.

Below are a few screenshots to demonstrate the AI. The small red and yellow cubes are just for visualization purposes and won't be visible in the final game.

Let's spend the day with Alerick, a nice NPC living in this house in Tririon City.


Looks like he is still sleeping.


Ah, now he's awake. Let's see where he's going...



As mentioned above, the red dots are just for visualization of the path. The path is computed and updated on the fly while the NPC is walking. Obstacles like street lights are avoided.



Seems like Alerick is chilling in the park.


Now he's going to the armor shop...


Looks like he wants to go to the market next.




Where is he going?


Ah, to the item shop. :)



Looks like Alerick wants to hang out in the park again...



He just entered this inn.


His NPC friends are here, too.


Seems like he has enough of them. :) He's choosing a different seat.


Maybe he wants to tell me something in confidence. :)


Ok, time to get out of here.


He's going to the weapon shop.


Maybe I should buy some new weapons, too.




Later, in the evening...


It's time to go home.



Looks like Alerick is tired. His wife is already sleeping.


Good night!


In the next morning...


Let me show you the monster AI.


This plant creature is following me everywhere.


It can even climb up here.


Let's go to that castle.


As a rogue I can become stealthy. It works best in the shadow. The darker it is the faster I can become stealthy. When the stealth bar is full, enemies can't see me. Also my spirit increases so I can open the fight with a special attack.


Dungeon enemies are standing together in groups. If one of them sees me, the whole group will attack me.


There are also patrols like this Ogre. He is stronger than normal enemies.


He is patrolling from corner to corner.



It's better to eliminate the groups without the patrol...


... which is the specialty of an assassin. :)


Sometimes it's useful to pull groups around corners, e.g. when some of them are attacking from range.




That's all I have to show for now. I'm currently working on quests and the homepage. Maybe I'm gonna make a new video when the new quests are working.

407 comments:

«Oldest   ‹Older   401 – 407 of 407
Herbert Lian Hearn said...

So when is this going to be out? would love to buy it...

Daimyo21 said...

Will NPC adventurers travel from town to town and migrate eventually? Or they just patrol around their camp fire?

bob said...

i want to ask with my pet snout beetle why dose it spawn a enemy when he fights?

Trevor Keith said...

May I commend you on your ability to create possibly the best pathfinder I have ever seen the mobs (monsters) can get you almost anywhere! it's amazing you can't get away from them unless you run far enough away.

Stephen Cube said...

I can see that you are putting a lot of efforts into your blog. Keep posting the good. Mixup Cube is like a Rubik's Cube, but with an unexpected twist. When a mid plane is turned by 45 degrees, other turns are possible.

http://www.championscubestore.com/index.php?main_page=index&cPath=282

mr.bubbles said...

will there be spouses?

Olie Russum said...

when will it come out to mac

«Oldest ‹Older   401 – 407 of 407   Newer› Newest»