A little brain for the enemies
As the title says I'm working on the enemies and after a couple of days deciding the best approach to use I decided to go with a mixed solution: a part in the main AMOS code that parse a brain script and a part as AMAL program that handle the movements and the animations.
The idea was to build a skeleton AMAL program and interact with it during the interpretation of the brain script using the AMAL registers.
So I defined the rules, the registers to use as signal codes that make possible acommunication between the AMAL program and the AMOS source.
Bidirectional communication is necessary because if I send a "move" command I cannot go further with the script until the movement has been completed, unless something special happen (like a collision).
After some struggle with implementing this solution, now it seems to work, in the second screenshot you can see a very simple "brain script".
This script is interpreted by the main AMOS program with a frequency that can be tuned (right now every 4 cycles).
In the other screenshot there is some commands I implemented for the for the brain scripts, that will be interpreted by a "generic" AMAL program using the autotest feature to monitor the register R8 (used by the main program to signal an incoming input) while R9 is used by the AMAL program to signal the main source that the task has been completed.
If you are curious and want to see some movement there are two short videos I've uploaded on my Mastodon account that can be viewed clicking in the following links:
- First test : an enemy with a very simple brain moving left & right using recycled frames
- Second test : an enemy with its frames with little more complex brain that try to catch the player if he is near enough to be detected. During the video you can also see some triggers activated (the dialog that starts, the opening door and the same door closing).
Some enemies can ignore walls but the one in the second video cannot so you can also see how I implemented walls avoidance, it's not a "path finding" routine, but a more simple (and fast) solution that seems to just work.
The Gate
An action/adventure game for classic Amiga
Status | In development |
Author | Allanon71 |
Genre | Adventure, Action, Platformer |
Tags | Amiga, mistery, Retro, retrogaming, Singleplayer, the-gate |
Languages | English |
More posts
- New progress report landed!63 days ago
- Progress report: Map 1 completed!99 days ago
- Progress report: core game engine completed!Aug 09, 2024
- Progress report: problems & solutionsJul 17, 2024
- Triggers? Almost done!Jun 20, 2024
- Triggers!Jun 19, 2024
- Work on "The Gate" has been resumed! :DJun 03, 2024
- What I have done so farDec 20, 2023
- Game menu : ToolsDec 16, 2023
Leave a comment
Log in with itch.io to leave a comment.