Pathfinding Problems: Guns vs. Swords

Pathfinding Problems: Guns vs. Swords

By Brian J. Lancaster (Feb. 2021)

Website: www.laughingcoyote.net


Brigand: https://steamcommunity.com/app/652410

Warlordocracy: https://store.steampowered.com/app/1748160/Warlordocracy/


A friend once told me he wanted to help on a first-person shooter because it's hard to see how repetitive the terrain textures are in that perspective and it sounded easier. Point taken, but there is a much better reason that making a decent FPS is easier than making an overhead 2D game: everyone can see how shit your AI is.

The best part about coding an FPS is that nobody can really see how shitty the AI is, especially with those guns, son. If you are making an FPS shooter with guns, AI is automatically easier (and it won't catch on fire like Russian-made automatics). The pathfinding doesn't have to go directly to its target. It can stand back in place and just shoot. It can make an attempt to reposition to better shoot its target, but ultimately, it can stand way the f*** back and just shoot.

The other advantage of a game based on firearms is that running into a wall and hugging the wall, then running against the wall is perfectly logical. When you are running against a wall with a sword, it doesn't look so good.

I fought the wall and the.. wall won.


Now, pretend you are me and going from an FPS sci-fi shooter to a 2D overhead strategy fantasy game. Now you have to think about pathfinding a lot more for 3 reasons:

Reason #1: Everyone can see how shitty your AI is if they have an overhead God-like view. They can see people running into shit, bumping their heads and going the other way. In an FPS game, you cannot see this. You only see the tiny corner you are hiding in, hoping to not get shot in the head.

Reason #2: (as mentioned previously) If you are playing with guns, pathfinding just isn't that important. All you really have to do is get within line of sight and shooting range, and you're good. You don't physically have to get right up next to your target. You just have to see it. Easy. In Brigand, I did have melee, but everybody knew it was a game based around firearms, despite the massive amount of skills you could increase.

Reason #3: A* is hard. If you read about A* in a book, it sounds simple and easy. Then you have to apply it to your game. This would be almost impossible in my previous FPS project, Brigand. First of all, it requires a grid, or at least some kind of diagram with lines, and I just didn't want to implement it. There was also no real reason to implement it. Now, the player can see all the characters running around face-first into walls, holding an axe in my new project. It is shameful, but at least it is tile-based and I will eventually implement A*.

However, despite the tile-based nature of my new project, there will still have to be check points for the A* algorithm to be truly efficient and not have an excruciatingly low framerate. AI is a bitch people. She is a harsh sexy bitch indeed.

Butt fuck it, I'm still working on the demo. We'll see if I can do A* with no check points and framerate efficiency.

Now here are the mandatory screenshots for the clicky-bait:






Comments