I’m calling it a devlog, but I’m not sure exactly what should I call this. Its been almost a month since I started this project and I must say: It feels great. I didn’t reached the point that I expected after a month, but I can feel the solid structure on all the project.

The idea of refusing to use a game engine for this project it is helping a lot to keep the next goal visible and focused. Having only long lines of code, clearly exhaust my brain power much more sooner than in the past, but still each line feels more well construct than anything I did on Unity on the past. There’s not a single sprite on the screen and this is helping me to keep focused on the ā€œreal problemsā€

The archicture of the program uses some old tricks that I learned through the years:

  • I’m using Goal Oriented Action Planning (GOAP) combined with Smart Objects to let the agents decide what action they will be doing next.
  • For moving the agents across the map I’m also doing a combination of tricks from the past by having a combination of strategies. When the agent is near the smart object that he wants to use, he will be guided by a small map around it to lead him towards the doors of the building something similar to what they do on Planet Coaster. While when he is too far, he should be using potential fields.
  • I did a bunch of Singletons for Factories and for the AI Game Loop. This will guarantee that will be a thread that I will be able to tie with the physical engine from any game engine that I want.

The structure that I’m proposing for my agents already uses a lot of common values from an RPG:

  • Basic Agents (Peons + Tax Collectors):
    • Health
    • MoveSpeed
    • ViewRange
  • Heroes (Swordman, Archer, Cleric, Thief), we have the ones before plus the next ones:
    • Mana
    • Level
    • WeaponTier
    • ArmorTier
    • Strenght, Agility, Dexterity, Intelligence, Luck
    • Morale
    • Hunger
    • Social
    • Energy

I’m still debating if I will not pull Morale, Hunter, Social and Energy to the Basic Units too, but for now those are the status that I have.

The implementation of the GOAP is very academic, per se. I’m using the original thinking of a simplified state machine that varies between Animation or MoveTo. To decide where the agent needs to go and which smart object he should interact I use graph where each node is an state of the world and each vertice is an available action from an smart object. Then to decide the plan was a simple usage of an A* algorithm. I’m already thinking of ways to optimize the implementation of this code, since I’m using a sort algorithm to determine the sequence.

I’m at a point that normally I would be relaying on a game engine just to render the position of each object on the screen, but that means that I would need to start to implement HUD. That’s a discussion that I don’t want to have right now, so I did what I did on the past… A prototype with paper and small wooden blocks:

The grid on the paper showns the position of each building, and where their flow field is leading the agents. I imagine that on the past I could visualize this easily, maybe some skill issue, but I still don’t want to compromise to any game engine until I have everything in a comfortable point on the AI.

I do plan to add more things to give more personality to each of those agents, something similar to what is present on The Sims. I still need to study more references from game design, but I’m sure that I will implement a small relationship system as a small memory system.

I want to add small details like an agent having fear of spiders, so the player will really need to sweet the deal to get his butt there, or small dramas that the player can watch between agents. It was really fun to see dwarvens and elvens beaten the shit of each other in majesty, I want that but on a smaller level.