15/09/2021
Wednesday Update #38
General
---------
So we're back in the flow of things, and we have deadlines to meet already. That's fun! JimBob likes deadlines... But he's not so much of a fan of it when he has to do "a thing" to keep things going. More on that in the coming weeks.
Daxx Baxter: Come Get Your Daxxination
---------------------------------------------
>> General News
So JimBob has been doing a bit of planning which pertains to Come Get Your Daxxination over the past few weeks whilst undertaking other paid work, and it's probably going to come to fruition... Which is nice. Unfortunately, there are deadlines in play which means JimBob isn't confident he can get it up to the high standard he prefers... Still, that's part of the fun, isn't it! Trying to juggle work, personal life, and everything else... Yes... Fun...
Some of the planning involves story beats, such as the "Anti-Daxxers" (Thanks Ethan) and the various stages of Communism that have infected the population. Other parts involve behaviours, pathfinding ideas, and other such code-based things. It's been quite fun thinking of game balancing as a literal on-paper exercise.
>> Development Progress
This week, we're going to talk about pathfinding and what JimBob is having to consider while coding it! Why? Because it's a nice easy thing to get back in to having done other things the past few weeks, and JimBob is obligated to work on it for various reasons. Big deadline, externally imposed because something else needs to be done ASAP.
Ever wondered how NPC's find their way around a game world? Well, there are a few ways of doing it, but essentially it boils down to finding the shortest/most viable route from one point to another. There are a few different ways of doing this, and - whilst we could be here all day talking about navigation, pathfinding, and so forth - we can summarise the pathfinding methods that JimBob is using as follows:
- Using a "Navigation Mesh", which is like a special shape which defines which parts of the world can be walked through, to define which areas are - in general - traversable.
- Using "Nodes" to define key points in a route where - if an NPC is going within its region - the NPC should first attempt to walk
This is one of the few areas where JimBob isn't looking to invent the wheel, using existing systems as a basis for Daxx Baxter but then building on these systems to make them fit for purpose. One of the fun things about these systems is that, were we just to use Navigation Meshes, we'd end up with peculiar situations where characters hug door frames or walls because it's technically quicker, or characters would walk diagonally across corridors in a way which isn't natural in a real-world setting. This is why we top up this system with nodes! This allows NPC's to position themselves correctly within a location for that more natural feel (e.g. Keeping left in the corridor, not squeezing too tight to a door frame unless two people are trying to get through).
This is basically part of what JimBob has been doing, to give you an idea. For the most part, the foundations are fine, but there's work to be done. A lot. There are a lot of layers to pathfinding, but the approach towards pathfinding is generally this:
- Can you find a path in this scenario?
- Is the path efficient?
- Can the path be calculated efficiently?
- Does the path look natural, or would nodes need adding?
- Are there any circumstances where the path could be broken and confuse the "AI"?
- Where multiple "AI" are active, do they have a sufficient escape clause or queuing system to ensure bottlenecks do not occur? (JimBob likes nodes for this - Only allow one "AI" within a specified node region at a time, and force other "AI" to queue if they're all going the same way. If they're going opposite directions and it's feasible, have two directional nodes: One out, one in)
- Does the pathfinding interfere with any other general functions? E.G. Combat, Live Asset Library/Prefab management (Yes, this is a thing pathfinding can impact if mishandled or otherwise done poorly), other non-pathfinding AI?
- Have you remembered to turn the pathfinding off at the end? (This is an important step even though it seems obvious!)
- Can pathing calculations be cut down to save performance as more and more pathfinding objects exist in the worldspace?
This is basically JimBobs world. It's fun!
State of Good Value Gaming
--------------------------------
JimBob lives!