You may know about the project I’m working on called “THe Gate”.
For those who are unaware of it, well, I started a journey about 7 months ago starting to code an adventure/action game on AMOS Professional to be able to target classic Amiga.
As a freelance worker, and being with very few work lately, I’m focusing on this project to pay the bills and to produce an intriguing game with lot of features, a great story and some action.
Lately I’ve focused my energy on two game engine parts:
- Triggers
- Enemies
TRIGGERS
A trigger is an invisible area that can raise an event if touched by the player, by an enemy or by one of them.
For example a trigger can lock or unlock a door, can spawn an enemy, or freeze it, or even start a dialog, and things like these.
Click this link to view a small clip (hosted on mastodon) of triggers being… ehm… triggered 😛
ENEMIES
Enemies are a bit more complicated, but I’ve figured out how to manage these entities and keep programming flexibility.
The enemy behaviour is governed by two separate parts:
- A generic AMAL program that manage the animations and the movement listening at some registers that are modified by the main AMOS program
- A brain script (built completely from scratch!) that uses commands to simulate a behaviour.
For example the script command SCN means [Scan for the player], if the player is within the enemy “sensing” area an internal flag will be set.
Next this command we could use JID [Jump if the player Is Detected] than could jump to the part of the script where we have implemented the enemy attack phase.
All this complex stuff seems to work just fine and I’m finalizing this part with intense testing and adjustment before putting all the harcoded code externally, in text files that I can easily edit and make several “brains” for the enemies.
In the following image you can see how a brain script looks like, with my very own command set created from scratch:
In this other image you can see some of the commands I developed, used to build the the brain scripts:
Since some enemies cannot go through walls I’ve also implemented a method to avoid them, it’s not a path finding routine but a simple algorhytm that seems to work fine and it does not slow down the main loop.
Here is another clip (hosted on mastodon) with an enemy with a very primitive brain I’m using to test features.
I have to be honest: my brain was in danger of melting, but the “intense” phase is over 😀
If you like the idea consider to join as a Patron to help me pay the bill and to let me focus even more on this game, I’m pretty sure to be able to create something never done using AMOS.
Right now the source code is approximately 265Kb without resources, just the code!
The main bob/sprite bank includes 145 frames!
Drop me message if you want to know more, for example if you want to have a look at the enemy data structure (which is pretty complex) 😛
Follow me on Mastodon for every single update 🙂