Skip to main content


Polishing the AI system

Well, the AI system is done. I figured out the way it works enough to be able to extend it a bit and implement a couple of different behaviors and situations. I'm working to polish the demo and then I will probably release the code on Github. It is very basic, and will include player vs 1, player vs group, player group vs group, and some other stuff like reaction to player, warnings, attack after warning and follow the player.
Also, I will include some needed subsystem, like items and abilities. This is not in any way a 100% reliable tutorial, it is just me throwing code to see if it works. Expect more news on this later this week or next.
Recent posts

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…

The Witcher videogame history

Found this interesting documentary on YT, that every Witcher fan should see. They go back to the pre-CD Projekt attempt to make a Witcher videogame, how did it fail, and the evolution of The Witcher 1.

Trying 0 A.D.

This is the game that hurt my wrist again! Lately, free games are killing open source games. Nobody cares about source code and compiling when you can get all the free games you want in your phone. I have to admit that I haven't been paying attention to open source scene since a couple of years.

0 A.D. was on my wishlist since long time ago, but I always delayed it, waiting for a better AI. Playing an RTS against a weak AI is one of the worse experiences a gamer can have. Also, I'm playing about 2-3 games per year, plus  the occasional DOTA, or Warzone or Freeciv match. Writing and programing are eating most of my free time.

But last week I decided that I had waited enough, and downloaded the latest alpha. To my surprise, the AI is good enough most of the time to beat me if I'm not quick enough. Not only AI is decent and poses a real threat, graphics are great, even commercial quality, and when you get used to game philosophy, you can have lot of fun. Seems that the money…