top of page

Internship - Week 12 - Smart cockroaches and canibals

Hey there,

This week we're going to have a look at some new creatures what will be introduced to the simulation. These creatures will be an improvement/mutation of the first cockroach we created. From now on we will refer to this cockroach as the "dumb one".

 

Dumb cockroach

Let's take a quick look at how the dumb cockroaches work again, before we move on to the new, more interesting behaving cockroaches. Our dumb cockroach has no knowledge of path finding and will just aimlessly wander around the map. He will take a couple steps in a direction and then he will change direction and take another couple steps. Next to walking, he will also randomly dig pieces of wall and poop. Most of his actions cost stamina and when he is fatigued, he will sleep until he recovered his stamina. This is all the behavior the dumb cockroach possess. It is good but not very interesting.

Image 1: dumb cockroach, wandering.

 

Smart cockroach

While the dumb cockroaches possess no path finding, these smart cockroaches do and can detect food and other cockroaches from a distance. These roaches use the JPS and A* algorithms we made previous weeks to traverse the map. When they don't have a target, they will wander like the dumb one's. When they have a target they will actually use the path finding algorithms to find the quickest path and follow it. This has made it a lot easier for these cockroaches to find food and eat it, they actually "search" for it.

Image 2: smart cockroach, path finding.

 

Cannibal cockroach

This one should be pretty self-explanatory, he eats other cockroaches. All other cockroaches can only eat food that randomly spawns on the map but these cannibal cockroaches have acquired a taste for other cockroaches. When there is no cockroaches nearby, they will eat the spawned food without any problem, but when they detect another cockroach, they will stop their pursuit of the food and start to chase the cockroach instead. They are only able to eat the other cockroaches when they are standing right on top of them.

Image 3: cannibal cockroach, doing cannibal things.

 

Running away

This is a behavior for the smart cockroach that I didn't get to develop yet. When they detect a smart cockroach near them, they will try to run away and not be eaten. Hopefully I will be able to implement this, next week.

 

Small changes

Besides adding the new types, there were also a lot of small changes that took place. This consists of changes like, giving each cockroach a hunger meter, so they will have to keep it filled, otherwise they will die. Other changes were giving each different type it's own movement speed or giving them different amounts of stamina.


Featured Posts
Recent Posts
Archive
Search By Tags
No tags yet.
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square

Lars Temmink

Game Programmming Portfolio

bottom of page