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.