Skip to main content


Showing posts from October, 2017

Pluggable AI via ScriptableObjects in Unity3d

I mentioned before that I was studying the pluggable AI tutorials, and still am. Can't say I fully get the idea, but yesterday I managed to assemble a little test, modify the original code, and improve it. I strongly recommend that you watch this conference (and the tutorials):

The tutorial uses an StateManager class which deals with updating the states (states are ScriptableObjects, which lacks the Update() method) and also serves as a repository to keep information. ScriptableObjects should not keep entity related info, as all the entities would be sharing the same object and thus, that would be a problem. Any data needed in states, decisions or actions should be provided by the state manager, so, each entity has one. An state has an action and a decision. Depending of the decision being true or false, it can transition to other two states. That's all... mostly.

The main advantage is modularity. I can write specific states and actions for each NPC, but of course, the ideal i…

Divinity: Original Sin 2

Got this game a couple of days ago and have been playing like 10-11 hours. Not gonna make a full review here, because there are people who does much better and earlier than me, these are some ramblings about disperse topics.

I don't have complains so far about the game. It is a really good RPG, and I would have done some things different, but thats all. As a writer, I tend to think the same about some books. For example, the first stage seems a bit long to me. I started in Classic mode, which is the second difficult level, and most fights are hard to win. As the game progresses, the only way I found to win was to outnumber the enemy. Then, I had to switch to Explorer mode, which is the easier level. Read here my opinions about how the first quests of an RPG should be designed.

In some cases, the information about the quests is not clear enough: I had to risk crossing a fortress in stealth mode because I had no idea about what other path there were. Not a big problem, this game is…

Pluggable AI

This weekend I spent some time revisiting the Unity Pluggable AI videotutorials, which illustrates the use of ScriptableObjects to build an AI system. This work is based on a conference by one Obsidian developer in some GDC (can't remember if was this year or the previous one).

My opinions on ScriptableObjects are still... vague, to say something. I'm trying to define if they are an essential tool or something that can be replaced by XML/JSON and one day I think they are the best and the next I think that I have to throw it to the recycle bin and go back to use XML. The opinions I have read on forums doesn't help me to decide.

But, how good is pluggable AI compared with my first approach to AI, based on coroutines? Well, it is much more modular, in first place. Not clearer, at least, not yet, because I'm still working to understand the basics. Maybe I can even get something good from this.

Right now I am in the stage of improving the code and integrating it into a so…