Behind “Evil” Craig

October 31, 2010 at 2:47 pm 9 comments

The major component of Caveman Craig 2 is the tribal warfare between your own tribe, and an enemy tribe on the other side of the terrain. And with no tribe complete without a leader, a lot of my time has been spent designing the artificial intelligence for the enemy tribe leader, or his working title, “Evil Craig”.

There’s a sort of trade off in complexity between Craig and other normal cavemen. While Craig is controlled by the player, he needs to be able to perform most of the tasks any other caveman can. On the other hand, hunters, gatherers, and preparers only need to perform a few tasks but need to be able to automate it. When I realised I had to combine both complexities with “Evil Craig” (automating what he needs to do, and doing a large number of tasks), I started to feel a little overwhelmed. But after a significant amount of planning, this is how Evil Craig does his thaing.

As with all cavemen, Evil Craig has a ‘status’ variable which determines what he is doing. These statuses range from ‘throwingrock’ to ‘struggleraptor’ (being ripped apart by our beloved velociraptor), but the most important is ‘normal’. The ‘normal’ status, in the case of AI, tells the cavemen to pick what they want to do based on countless conditions, and then walk towards the required location. Once they reach that location, the ‘normal’ status tells the caveman to change his status to whatever he needs to do, be it pickin’ berries or clubbin’ innocent dinosaurs. It’s a switchboard, or ‘main menu’, for the caveman’s AI, if you will. This is simple for say the Hunter, who’s job is to pick the most dangerous dinosaur and then run towards him, eventually clubbing him or standing afar and throwing rocks based on priority.

Unique to Evil Craig however is his ‘mode’. This tells Evil Craig what he should aim to do. If the mode can’t be performed (for example, if he wants to prepare some meat but there are no carcasses in the cave), the mode cycles until Evil Craig CAN fill the request. The mode is processed within the ‘normal’ status.

Once Evil Craig can fill the mode’s request, an alarm is in most cases set at random as an indicator of when he should move onto the next thing. Preparing a bush may take a very long time and we don’t want Evil Craig spending too much time on it.

What’s left then for Evil Craig is the more strategic, non-‘hands on’ decisions. Namely, choosing what bonuses or cavemen to create, when to get them to follow him, and when to attack Craig’s tribe. This is handled by the “Tribe Director” object which is also responsible for spawning dinosaurs, vegetation, and controlling the weather.



Entry filed under: Caveman Craig 2.

Craig’s beefy makeover Some exciting news

9 Comments Add your own

  • 1. QWERT ( Yubs)  |  November 3, 2010 at 1:30 pm

    Wow. That looks tough…
    Good luck on that.
    Also why is the dudes arm hanging down? Are you making beds or something for them?

  • 2. Arkatox  |  November 4, 2010 at 11:59 am

    Sounds totally awesome! But the thing is . . . will Evil Craig be able to train his own men?

  • 3. Rhys Andrews  |  November 4, 2010 at 12:02 pm

    He sure will!

  • 4. Arkatox  |  November 4, 2010 at 12:52 pm

    Haha, awesome. 😀

  • 5. QWERT ( Yubs)  |  November 5, 2010 at 3:29 pm

    That training thing gave me an idea! Splitscreen.
    That would make the game ever more fun!

    Also do we take over the enemy cavemen if we kill the evil Craig?

  • 6. Bob  |  November 7, 2010 at 4:09 am

    Wow, nice

  • 7. Green  |  November 19, 2010 at 10:42 pm


    Looks great, thank you for the update.

  • 8. Strawzzboy  |  November 24, 2010 at 4:11 am

    “Evil Craig” eh? You should totally name him “Daniel”

  • 9. DudeDino94  |  January 28, 2011 at 10:45 am

    Evil Craig looks nice, though I wouldn’t want him to be an expert military strategist like Sun Tzu.

    If that happens, Craig’s a dead-caveman lol.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed

Get Caveman Craig 2 Here!

Parabox is..

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 17 other followers

From our Twitter..

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

%d bloggers like this: