Sunday 15 March 2020

Bounty Hunter III Development #4: AI

Hello there

Preface
Through the development of Bounty Hunter II, the AI was all hard-coded - in the process it was quite tedious to code. For months I have thought of a new system and now it's implemented into the game, albeit incomplete.


Artificial intelligence


I have made a new system which I tried to make as similar to BHII's AI system as much as possible - without the coding. This system is very much like the cutscene system except it is for AI. It consists of a series of instructions that instruct a character to move, dash, wait or shoot, what determines which instruction executes is the pointer which goes through the list. There are also labels, like in my POUCH system, where it shows the point where the pointer needs to go. For example if I could use these labels to determine the AI state - for example I could have a label that resembles a regular attack state or another state that has the enemy run away.

When one function executes, the system jumps ahead and looks into the conditions of the next action to see if it is fulfilled.
Let's illustrate an example: Say a character is moving towards the player and you want them to attack said player. The function that is executing at the moment is the Move function, the system will check executing if the conditions for the dash block have been fulfilled, say if the player is a certain distance. If this condition has been satisfied, the pointer will move on to the dash until it is finished and go to the next function.

This can prevent the tedium I had to endure in Bounty Hunter II where I had to write code to determine what action the AI had to do next in an "after dash" function, based on which state they were in. Now I don't have to worry about what state the character is in, since the pointer would simply move to the next action within the state.

As of writing, I only have 2 enemies which have this system put in so there may be quite a bit of bug-fixing going on, but I hope this will make things easier in the long run. It's also pretty incomplete since I'm planning to make this system more complicated with features like determining which attack state they go in based on a random number or what their health is, for better variety.


Still working on the maps


Regarding the areas, I did say before that I was nearly finished with them. I drew a map and designed the areas around the map. I can say for real that I have implemented most of the zones that the player will need to go through, although I may still need to put in some extras. The amount of areas that the player will go through well exceeds the amount of Bounty Hunter II's. Bounty Hunter 2 had almost 30 whereas this has over 3 times more, and it isn't as linear either meaning you could go back. Although I still plan this to be a short game, I don't want to waste the player's time with backtracking - therefore if the player chooses to backtrack Peast will insist that he "Has no need to go back". This would save me time having to prevent things like the player going back and having to defeat a boss they fought the first time.

I have been recently implementing story parts into some of the areas, which will get fleshed out later. These cutscenes only have dialogue rather than movement and animations as well.


Conclusion


Progress is still alive on this project, though there won't be many interesting things to say on this which is why it's rather short. I'm also working on another blog post about game design philosophies, this time it's about the silent protagonist. Hopefully, by the time I next post about this project, the areas and story will be in the game and I would be working on the enemies and polish.

That's all from me!

######

On an unrelated note, I have been well aware of the coroniavirus (since around January). The amount of cases have been rising in the UK (where I live) and are mainly prevalent in London (also where I live). What I would advise is wash your hands, don't touch your face and disinfect devices. Don't panic about it - relative to how many people in the world were infected, over half have recovered and far less died from it, but stay informed. Use sources from experts and stay safe!

No comments:

Post a Comment