We have not been able to upload a dev log for a while, but it is not because we have frozen but, on the contrary, we are advancing and improving Lamentum day after day.
In the devlog of today we are going to talk about AI in depth since last week we have been very focused on improving and expanding this topic.
The AI of our enemies has been programmed as a state machine and we have developed it through independent modules so that we can create different patterns of behavior following some basic rules.
The states on which our AI is based are:
– Inactivated: The AI is not active in the scene, it needs an external factor to start.
– Rest: The AI is active but has no objective.
– Alert: AI can move between routes with points of interest.
– Attack: AI in action fighting.
They may seem like basic states but these allow us to have different types of AI depending on the type of enemy, for example, some enemies in the Attack state will seek to reach the target according to their range of action while other enemies will maintain distance because their role is to spawn new enemies.
We previously showed how our AI was behaving in motion and explained that we had programmed a raycast system that would allow it to detect if the direction of movement was adequate or if it had an obstacle and needed to reposition itself to move forward. This in theory worked fine but not as well as we would have liked, in some cases with several enemies simultaneously strange situations were generated and some corridors with enough obstacles did not take a clear route and could lead to loops, so we have discarded that part and we have implemented a pathfinding algorithm that in turn takes into account the size that we want to define our enemies.
We have simulated a quite rare situation with several equal enemies in the same room, although we really doubt that such a case is in Lamentum, we wanted to put this algorithm to the test and we liked the results:
The good thing about having structured the AI into independent modules is that by discarding a part of the work that we had before with the raycast movement system, we did not have to redo the entire AI since it was only the module that we used for the movement. In fact the previous system we have left to some enemy that we want to look more “dumb”.
We had been some time since we wrote a devlog, the main reason is that we have been working on a new trailer.
Do you like it?
One of the most representative changes with respect to the previous trailer is that we have improved our lighting system by combining our shader to illuminate diffuse materials with particles and the truth is that we liked the result.
The main reason why we have worked on creating our own shader for the treatment of light instead of using the Unity lighting system is for the performance. When working with 2D pixel art graphics we do not need the light computations that generate the Unity lighting system by default and we can use a greater number of simultaneous lights with a lower cost of performance, this led us to consider… How did we get that the light had a little volume? The answer is the particles, with a bit of love we have managed to make the lights have more visual presence in the scene apart from the main objective of light, illuminate.
The last days we have been working on a new game mechanic, hiding from the enemies.
In Lamentum combat will not always be the best option. Sometimes hiding will be vital to survive.
Our character can use the environment to go unnoticed, however not all enemies can be deceived in this way. Some creatures will use other senses to find you and sometimes it can be a very bad idea to turn off the lamp … 😦
Features of the hiding system:
– New hiding points (e.g. Furniture).
– You can not hide with the active lamp.
– You will not be able to move while you’re hiding.
– You can not hide from all types of enemies, some can detect you even hidden.
– Hide is an option, you choose your way of playing.
During last week we have been ending the routes system and pathfinding of the enemies. We have also been working on the attack system of the enemies.
Pathfinfing by checking of collisions:
According to the video, we have the possibility of creating customized routes for each enemy (In this video, we have two created routes, blue and yellow points), besides, each enemy uses their own AI to dodge obstacles.
Attack system of enemies:
Now the enemies are able to attack the player. When the player go on their field of view, they leave the route that they were keeping and they follow him until they kill him.
The impacts of the attacks will change depending on the enemy’s strength (in some cases even they will push to the player, as in the previous video).
In future devlogs we will talk about the evolution in the player’s weapon system.