Phase 2: Slow Progress


The first bit of work on Phase 2 has been going slowly.

Working through Phase 1, I used a simple system by which units would select a relevant target and get that target's data via the detection system, which fed that then to the movement system. This target is generally agnostic such that the AI Manager should allow units the ability to select whatever is relevant to them at the time they are selecting new targets. The idea was that if per the unit's needs, the unit's hunger were to get too low, the AIManager would prioritize that it select say a 'foodSource' tagged unit and target the nearest ideal foodSource that it would then move to; whereas if the unit were in a combat situation the AIManager would select the nearest enemy unit and then travel to it. Since this was just point A to Point B, units often clumped up on terrain features or would end up dragging their faces across the backs of trees until they got past the obstacle. So pathfinding is needed. It should only be utilized in a situation where GOAP indicates that a unit needs to get in range of it's target, but since it should ideally keep units from colliding it needs to recognize terrain features and other moving units when it's plotting it's path.

So I have plenty of examples of what to do. My intention is to try and implement A* pathfinding. I have outdated ECS examples and non-ECS examples I've gotten from researching. Likewise I have Hexagonal grid setups. The problem is meshing all of this together, and trying to decide how to factor my world gen into it, since I'll be tearing up my world generator to make this work. Ultimately this is needing to happen anyway. Right now my world gen is extremely simplistic and basically only creates an square grid. I think I should be able to create hexagonal grid squares that I can then instantiate as entities that contain some data about what they represent. My ultimate hope being that they would then be able to impart information to entities passing over them that would modify movement, stamina drain, or state depending on what the underlying square is. In this way I could have tall grass or brush that is difficult to pass through and limits vision and open land with nothing on it all backed up by the world gen's framework.

But this, is all the result of 8 days of research and poking at the code trying to make it do something. Not that a slower few days is a bad thing, I worked all out for 120 hours on Phase 1, so a few days of Phase 2's start being slow isn't a huge deal.

Leave a comment

Log in with itch.io to leave a comment.