November 1GAM – Five Man Team

Given that it is still October, it is perhaps premature to be releasing a game for November. However this project came together rather quickly so I saw no need to delay. Plus my December project is quite ambitious and will coincide with a time of year that is rife with interruptions so I thought it best to leave myself some contingency time.

My November project is a simple top down real time strategy game called Five Man Team. I did consider naming it Five Person Team or similar but it just didn’t have the same ring to it.

In a series of matches you face an opponent who is leading a team of five units that are identical to your own. Both the computer and yourself have the same units, the same rules are applied to you and you have absolutely no advantages or disadvantages over the computer opponent.

You control the unit’s movements but not their firing. I did actually have code in there at one point to allow the player to set targets but then you get odd situations where a unit is ignoring incoming fire while trying to chase down some fleeing target and it just felt more and more like you were controlling mindless automatons who did not care if they died, which you essentially are but there’s no need to highlight that.

The shots fired by units are most accurate when the unit is stationary. They become less accurate if they are moving. They are less accurate again if they are moving while firing at a target off to their side. They are really really inaccurate if they are moving while firing at a target behind them. To figure out the direction of the target versus the direction of movement I used dot products.

This has the unfortunate side effect that the best strategy is to “dig in” by clustering your units together and sitting and waiting for enemy units to wander into range. This seems quite realistic from what I know of modern warfare. Better to be the guy hunkered down in the defensive position than the guy charging into a hail of gunfire. This kind of sit and wait, sentry duty simulator style of play just isn’t particularly fun. To make this a better game I would need to either add some reason for the player to have to move or tilt the odds, perhaps by having a small team facing waves of attackers.

I did have plans to implement both obstacles and A* path finding to allow the units to negotiate those obstacles. I’ve implemented an A* algorithm in Java but never in Javascript. The reason for abandoning this idea is primarily excitement about my December project. I am drawn like a moth to a flame to things I have not implemented previously.

So, finally, here is the game. Hopefully someone out there enjoys it if only for a few minutes.Five Man Team

The code (such as it is) is available on github.

Leave a Reply