Brass Watch Games

Best School Project Ever

by Jonah on February 16, 2015

I recently took a C++ class at community college. As part of the final exam, each student was to create a “sampler project” showcasing what they had learned. I play both World of Tanks and War Thunder, and have watched Girls und Panzer more times than I care to mention. You might say I have a passing interest in tanks. This project gave me the perfect excuse to do something with that interest. It’s not much yet, but I have big plans for it.

Unlike Shipyard and everything else I’ve made, I wrote this game in C++ rather than Java. I have continued to develop it even though the class ended months ago, with the most noticeable new feature being collisions between tanks and the grey blocks (tanks also collide with other tanks, but that is not demonstrated in the video). Unlike many 2D tank games, I went for some degree of realism. For example, each side of a tank has armor of a different thickness (based on historical data), and you can angle the tank to increase its effective thickness. If a shell hits but has less penetration than the effective thickness of the armor at the point of impact, no damage will be dealt. I even included the effects of drag on the shells, though the (currently) limited map size means this makes little difference.

Currently, this is about all there is to the game. The enemy AI could be rather generously referred to as “limited,” and the gameplay is, despite its novelty, not hugely exciting. That said, I have plans to expand it into a fully-fledged game. I want to include larger maps, more tanks, and perhaps more importantly a proper user interface. Once the basics are in, I want to add the ability to have preset scenarios and even entire campaigns, AI-controlled ally tanks, modding support, and maybe even (gasp!) online multiplayer.


2 thoughts on “Best School Project Ever

  1. pomelo777 says:

    If you are going to release this, could you please consider the following =D

    1. AI
    It would be cool if the AI could learn these things:

    i. Movement
    – Ability to move

    > Can pathfind through obstacles

    ~Avoidance of hazards
    > Will try to stay out of enemy tank turret firing arcs
    > Weaving to avoid fire

    ii. Strategy
    – AI intelligence

    > Will work together in a group, depending on surroundings, # of enemy tanks, etc.

    ~Usage of basic tactics
    > Swarming from all sides when underwhelmed
    > Putting armor (heavy armored tanks, duh) in front of heavy hitters
    > Good usage and control of chokepoints

    2. Tanks
    More variety of tanks, etc.

    i. Classes
    – Multiple classes of tanks

    ~Different classes of tank roles
    > Heavy, Medium, Light, Tank Destroyer, etc

    ~Different classes of tank weaponry
    > Different types of damage?

    ii. Infantry
    – Maybe?

    > Fast, small, with small guns
    > Can be dangerous, especially with anti-tank weapons

    3. Terrain
    – Cause flat ground and boxes are not representative of real life.

    ~Height (yay 2.5d!)
    > Height grants more range, but can gun depression can be a limiting problem
    > Strategic placement of ridges and hills in maps will allow more interesting gameplay

    > This should just be a result of height difference
    > You shouldn’t be able to climb on a rock 5 meters high

    Thank you for reading this sentence. You have made it through my wall of text. (Actually I don’t know why I wrote so much)

    • Jonah says:

      Thanks for the suggestions! I do plan to release the game at some point, but unlike Shipyard I’m going to wait until it’s mostly complete. Besides, with my server troubles I couldn’t upload it to begin with. I like or am already planning on most of the things you suggest, but there are a few that I don’t think would work out. Also, I don’t mind the wall of text since, as you’re about to see, it’s something I’m prone to doing myself.

      Obviously, the AI won’t be stationary forever. However, AI programming is something I don’t have much experience with, so I’ve been putting it off while I work on other aspects of the game. Once I do a bit of research into AI theory and implementation, I can start working on it.

      As for more classes of tank, I’m already working on these. Currently, tanks’ health is temporarily hard-coded to 3 points, but armor and shell damage is variable. The new tanks are all heavy tanks: the IS-2, KV-2, Tiger I, Tiger II, and Churchill Mk. VII. I probably won’t add explicit tank classes; instead stat differences will determine their roles. The only class I could not implement right now is tank destroyers, as there is currently no way to limit the gun angle. This is a feature I plan to add, but have not done so yet.

      I do plan to add different damage types. At the very least, there will be a difference between high explosive and armor piercing shells. AP shells will have high penetration but low damage, while HE shells will have very low penetration but much greater damage.

      I have no current intention of adding infantry to the game. I always envisioned the game as World of Tanks meets DotA, where combat takes place in an artificial arena where the “heroes” are all tanks. Also, the scale of the game is so small (10 pixels = 1 meter) that infantry would be very tiny. If the average human is 1.6 meters tall, a person laying spread-eagled would be barely larger than a favicon (the tiny logo next to the name of a website at the top of your browser).

      I do plan to include some kind of terrain system, though I’m not sure will go as far as you describe. The system I have in mind works on a grid with fixed height increments. Tanks could drive between tiles within one height level of each other, but two or more is a no-go. Shells could travel up or down one level per tile, so you could take cover in either high or low ground. This also lends itself to a relatively simple vision system, as line-of-sight could be calculated per-tile rather than using complicated (not to mention laggy) ray casting.

      As much as I would like the added realism, there are a few reasons why a smooth terrain system with accurate gun depression/elevation would be a lot of work for relatively little gain:
      – Each tank is so small relative to the screen that gun depression as a limit on firing range would only a major factor when your target within a few centimeters of screen space.
      – The armor model treats each tank as a perfect rectangle with a single armor value for each side. Effective thickness due to vertical sloping is calculated by hand before being entered into the stats file. Thus, two major advantages of gun depression, the ability to go “hull down” and to counteract sloping by firing from above, would be negated without a serious overhaul of the damage model.
      – The physics engine detects collisions only at the edges of each object’s rectangular model. Thus, if you were on top of a cliff and another tank was at the base, you could “collide” with it even though you are theoretically not on the same plane. Fixing this with the grid-based system is easy: treat cliffs as invisible walls. With a smooth system, though, I would have to perform what experts refer to as a metric crapton of math.
      – Designing an aiming interface which works intuitively with three dimensions when the game is drawn in only two would be difficult. It would probably end up something like artillery aiming view in World of Tanks, which is well suited to a slow-paced game like WoT but would feel clumsy in a (comparatively) arcadey game like mine.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.