Game Development Week 9 – Blog #7 – AI as always!

This week following the milestone was assessing some of the problems we felt had cropped up including the Wolf being able to slow the spiders, I discussed this last week and talked about how I was going to replace it with function that would make the Spiders back off to a location based on the Wolf’s location. I have begun implementing this behaviour during this week and I am refining it to work correctly but the core functionality is ready. The difficulty for this comes with finding a position in the Navmesh that is in the opposite direction to the wolf.

Secondly Bradley felt that the Squad Manager could do with some optimisations so he put together a struct in C++ and asked me to implement it and optimise the code. I took on this task and I have struggled with trying to reduce the complexity of the code within the time frame we have available but I feel I’ve been able to make it a little simpler.

Squad Struct

Squad Struct by Bradley Stone.

This code allows us to reuse the same collections over and over to help cut down on creating different Array’s to store data at runtime. We can store a list of spiders, store the squad’s leader and we can also store a lot more within this one data structure allowing us to keep squad information in a single place.

finally this week I worked on allowing the small spiders to retreat to a chosen point at runtime when they’re no longer part of a squad, this allows us to add an interesting behaviour to the spiders to run away and it also allows us to clean them up when they’re out of view.

Overall due to the time the optimisations have taken I haven’t gotten a lot more done this week but I have been given my task list from now until the end of the project and will now be moving onto the Boss mechanics and wildlife AI behaviours.

Thanks for reading!

Advertisements

About The Rob Watling

Hi there, I’m Rob Watling, I’m 22 years of age and currently studying Computer Games Programming at Derby University.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: