Making of Sentients in Unity3d


Hey, fellow gamers and supporters! 

This won't be a very long post, just wanted to share some progress about the making of Sentients and share some software architecture.

While there must be a solution around for enemies in the asset store, I am from those kind of developers that prefer to do their stuff by hand and avoid understanding and integrating foreign code and dealing with foreign bugs that I feel doing so might introduce.

I might as well called them enemies, as that's the main objective of creating this... however, these sentients might not always be enemies, not all kinds of sentients anyway.

Types of sentients


At this point there is only one Sentient named "BasicEnemy", this one is actually an enemy because this prefab shouldn't attack other sentients but only the main character.


There might be other sentients that attack everybody, others that attack everything but the main character (that would introduce allies instead of enemies), others might consider enemies to everyone but sentients of it's kind

The problem is: at this point that's not working yet haha! This variable is not being called anywhere in the logic, therefore it will attack whatever it finds around, that's work in progress so far


Architecture overview

I've tried to make it as composable as possible, so each sentient prefab would have 5 animations: Idle, Usual movememt, Attack, Falling and Death. These movements can be associated with a Movement, which is a script that handles the movement (translation) of a sentient. The only movement that exist right now is "PatrolWalk", which consist on moving around an area cyclically, like a police patrol


The actual movement is managed by the animator FSM, but some transitions still need to be handled, for example at this moment, while the sentient can attack, it won't transition to the attack state, also the transition to falling has some bugs



Conclusion

This is still work in progress, a lot might change, but as you see I want this thing to make it work for as many sentients kinds as possible, so I can create multiple movements and multiple transition management systems so there can be multiple permutation of sentients, and the only thing I'd need to worry about is about animations

Hope this might be a helpful guide in case someone is also developing an enemy system in their game, also if you guys have some feedback, it's more than welcome

Until next time, JB

Get Matter

Leave a comment

Log in with itch.io to leave a comment.