Skip to content

Releases: khuiqel/tanks-game

v0.3.0b

Choose a tag to compare

@khuiqel khuiqel released this 17 Mar 03:21
d556207

PowerTanks Battle | Version 0.3.0b
More maintenance.

v0.3.0a

Choose a tag to compare

@khuiqel khuiqel released this 02 Mar 04:49
62b2cf9

PowerTanks Battle | Version 0.3.0a
Maintenance update, no user-facing changes.

v0.3.0

Choose a tag to compare

@khuiqel khuiqel released this 14 Dec 04:10
512113f

PowerTanks Battle | Version 0.3.0
No new content this version, only performance. Roughly 5-10x improvement over v0.2.5.

Changelog:

  • Cross-platform compilation
  • Switch to GLFW from FreeGLUT, and Glad2 from GLEW
  • Massive performance improvements
    • Main things: consolidated the various collision passes, added multithreading to the broad phase, used instanced rendering for bullets
    • As a consequence of this, it's now impossible for tanks to save themselves by shooting a bullet the exact frame they would have died
  • Changed "extra cannons" to not behave like real cannons by default (added and made the default in v0.2.5)
  • Render the game in the center of the window (as opposed to the bottom left)
  • Optional transparency draw mode for bullets
  • Raised instruction set to SSE4.2 by default

How to play:

Windows: Simply download the zip file and unzip it, then run the .exe. If you have an Intel/AMD CPU made after 2016, your CPU should have the AVX2 instruction set, so try running the -avx2 executable for free extra performance. If your CPU is really old, run the -sse2 executable. I won't provide SSE2 executables after this release.

Linux: You have to compile it yourself. See the directions in the README. Basically you just need GLFW and CMake.

dev-collision-multithreading-v2

Pre-release

Choose a tag to compare

PowerTanks Battle | pre-release Version post-0.2.5.1: Collision Multithreading v2
I improved the multithreaded collision implementation, then completely rewrote collision to be single-pass. Now multithreading shows noticeable performance gains. :)

Changelog (new main things only):

  • fixed off-by-one thread creation count
  • collision rewrite: single-pass, multithreading for broad phase, no copying partial results into a separate list, static list to avoid reallocations
  • various performance optimizations
  • bumped instruction set to SSE4.2 (though the attached executable was compiled with SSE2)

Developer Notes

I tried rewriting collision to be "single-pass", and it worked. (Previously, different object collisions were calculated in separate "passes"; this meant tank-bullet collision could only happen after bullet-wall collision was finished.) It was a lot more straightforward than I thought, and the performance gains were significant. Note that only the broad phase of collision is multithreaded, as multithreading everything is an extremely difficult problem; even real games made in professional game engines struggle with that, despite multi-core consoles having existed since the 7th generation (PS3 & Xbox 360).

How to run:

(Set the number of threads in the INI (ThreadCount). 1 is single-threaded, 0 is every core on your system. Additionally, you may want to experiment with changing ThreadTaskSize depending on your CPU utilization.)

Windows

To play, simply download the zip file and unzip it, then run the .exe. If you have an Intel/AMD CPU made after 2016, your CPU should have the AVX2 instruction set, so try running the -avx2 executable for free extra performance.

Alternatively, you can build from source using Visual Studio. Just download the source code and compile it.

Linux

You have to compile from source.

  1. install GLFW and GLEW: sudo apt install libglfw3-dev libglew-dev
    • non-Debian systems currently untested
  2. mkdir build && cd build
  3. cmake .. -DCMAKE_BUILD_TYPE=Release (optional and recommended: -DCMAKE_CXX_FLAGS=-march=native -DCMAKE_C_FLAGS=-march=native)
  4. make -j$(nproc)
  5. Copy res/ and tanks.ini to the build directory
  6. Note: On Ubuntu, going fullscreen seems to force the window to the largest monitor, unless "Auto-hide the Dock" is enabled. It appears that Ubuntu forces windows that are too large for the current screen (which means full height is too much due to the dock) to the largest screen.

dev-collision-multithreading

Pre-release

Choose a tag to compare

PowerTanks Battle | pre-release Version post-0.2.5.1: Collision Multithreading
I added multithreaded collision!... And performance is nearly identical. :(

Changelog (main things only):

  • multithreaded collision (though performance is nearly identical to single-threaded)
  • switched to GLFW from FreeGLUT
  • cross-platform compilation

Developer Notes

I tried investigating the lack of performance gain from going multithreaded, and I think the limitation is memory bandwidth. Each thread does part of the collision, then the list of collision pairs is merged. From my simple and unscientific tests with 4 threads, the merging takes about as long as the broad phase algorithm. There is a rather obvious solution to this: don't merge the results, instead letting each thread handle the rest of the collision (narrow phase and resolve). In order to do that, the entire collision system would have to be rewritten, which I'm not as against as I used to be, but that's a lot of work I don't plan on doing anytime soon.

How to run:

(Set the number of threads in the INI (ThreadCount). 1 is single-threaded, 0 is every core on your system.)

Windows

To play, simply download the zip file and unzip it, then run the .exe. If you have an Intel/AMD CPU made after 2016, your CPU should have the AVX2 instruction set, so try running the -avx2 executable for free extra performance.

Alternatively, you can build from source using Visual Studio. Just download the source code and compile it.

Linux

You have to compile from source.

  1. install GLFW and GLEW: sudo apt install libglfw3-dev libglew-dev
    • non-Debian systems currently untested
  2. mkdir build && cd build
  3. cmake .. -DCMAKE_BUILD_TYPE=Release (optional and recommended: -DCMAKE_CXX_FLAGS=-march=native -DCMAKE_C_FLAGS=-march=native)
  4. make -j$(nproc)
  5. Copy res/ and tanks.ini to the build directory
  6. Note: On Ubuntu, going fullscreen seems to force the window to the largest monitor, unless "Auto-hide the Dock" is enabled. It appears that Ubuntu forces windows that are too large for the current screen (which means full height is too much due to the dock) to the largest screen.

v0.2.5.1

Choose a tag to compare

@khuiqel khuiqel released this 11 Mar 05:11
5420377

PowerTanks Battle | Version 0.2.5.1
Mainly updated dependencies, took the time to add a few performance optimizations.

Changelog:

  • Updated dependencies
  • Small performance improvements (~30%)
  • Power duration setting
  • Fixed the diagnostics graph not updating collision time

To play, simply download the zip file and unzip it, then run the .exe.

v0.2.5

Choose a tag to compare

@khuiqel khuiqel released this 01 Dec 00:57
038ec83

PowerTanks Battle | Version 0.2.5
It's done. Not everything I would have liked to add, but it's done after nearly 4 years of work (with at least two years' worth of break in that).

Changelog:

  • update to Visual Studio 2022, update to C++20
  • collision: use Sweep and Prune for broad phase (as opposed to no broad phase before)
  • graphics: rewrite renderer, do batched rendering
  • INI file
    • configure a bunch of stuff, like first level and bullet limit
  • diagnostics graph, showing where most CPU time is spent; if the white line is above the limit, then slowdown is noticeable
    • red for collision, green for vertex upload, blue for drawing, white for combined
  • custom levels and powers!
  • some documentation: list of every level effect, level, powerup, and hazard; also INI configuration and custom level and power help
  • separate RNG into game, visual, and level RNG; now level choosing is deterministic, regardless of other objects
  • fix some memory leaks, oops
  • fullscreen toggle key changed to F11
  • enormous cleanup
  • level effects:
    • Magnetism (unfortunately doesn't work well with Respawning Powerups)
    • move Invisible Walls to vanilla-extra
  • powerups:
    • Swarm: bullets orbit around the tank; it's cool as heck!
    • "extra cannons" (from Shotgun and Triple) behave like real cannons, can be turned off in INI; makes Blast + Triple go from 16+2 bullets to 16×3 bullets
    • bullets that grow or degrade mix better
    • [dev] Backwards Movement: by pressing the special key (e and /), the tank moves backwards
    • [dev] Wall Sparks: bounces and creates "sparks" when it hits a wall
    • [dev] Edge Sparks: bounces and creates "sparks" when it hits an edge
    • [dev] Colorless Long Invincible: Long Invincible but it doesn't show, you cheater
    • [dev] Triple Spread: like Triple, but the bullets spread out instead of moving parallel
    • [dev] Ring Shooter: shoots a ring of bullets
    • [dev] "Ancient" Megadeath: the first-ever unseen implementation of Megadeath; tracking, accelerating, wallhacking
    • [dev] Banana Split: Banana but explodes at fixed angles
    • [dev] Trickster Circle: the bullets circle around their path
    • [dev] Trickster Snake: the bullets move up and down along their path
    • [dev] Mine Layer: bullets lay down "mines" while moving along
    • The Super: the strongest power ever
  • hazards:
    • Patrolling Turret: a turret that moves along its path
    • Mother Turret: a large turret that can create more turrets
    • Ginormous Turret: a ginormous turret that tells its turrets where to shoot
    • Spiral Lava: lava spirals out from center
    • Gravity Well: pulls in tanks and bullets, as you would expect from gravity (no angle change though)
    • [dev] Cloud: spits out powerups occasionally
    • [dev] Reflecktor: bounces tanks
    • fix Horizontal and Vertical Lightning randomization factories, because I never realized they've been broken for like forever
  • levels:
    • "Tight Patrolling Corridor": has Patrolling Turrets
    • "Dangerous Center": has a Mother Turret
    • "Untraditional Divider": a giant horizontal wall separating the tanks, instead of vertical ones
    • "Terrifying Chaos": an extreme name, but there's a Ginormous Turret
    • from JS: Portal Level but without the portals, just so every old level is present and I never have to look at hacky JS code for levels
    • [dev] a bunch of unnamed levels: 3, 4, 6, 9, 10, 11, 12, 13
      • decent ones: 4, 6, 9/10, 13
    • renamed "Corridor" level back to "Evened Corridors" because I realized most levels followed the "adjective_noun" pattern
    • old versions of some levels (Evened Corridors, Few Obstacles, Hiding Places)
    • moved Concealed Powerups, Lightning Corners, and Lone Turret levels out of vanilla because they are boring
    • [dev] Developer Level 3 and 4
  • minor things:
    • fix Stationary Turret canSeeTank()
    • performance mode drawing for bullets, toggleable in INI
    • option to print current level (enabled by default)

Overall completion status: 100%
Content completion status: not really 100% but I don't know what else to add

To play, simply download the zip file and unzip it, then run the .exe.

v0.2.5-beta

v0.2.5-beta Pre-release
Pre-release

Choose a tag to compare

@khuiqel khuiqel released this 04 Oct 21:25

PowerTanks Battle | Version 0.2.5-beta
The custom power interpreter is here. And some documentation!
Hopefully I won't need a gamma or delta release, but I still have a few more things I want to do before the full release...

Main things:

  • custom power interpreter
  • some documentation
  • ginormous turret hazard

Things wanted before the full release:

  • some multi-threading on collision
  • a few more levels and stuff

To play, simply download the zip file and unzip it, then run the .exe.

v0.2.5-glfw-test

v0.2.5-glfw-test Pre-release
Pre-release

Choose a tag to compare

@khuiqel khuiqel released this 22 Sep 20:45

PowerTanks Battle | Version 0.2.5-glfw-test
Tried switching from FreeGLUT to GLFW, since FreeGLUT is old and GLFW is used a lot more.
Didn't like it and will revert, but I'll at least post a release to remember this moment.
One of my biggest motivation for converting was the increased precision on waiting (GLFW uses a double, FreeGLUT uses an int). As I found out, GLFW doesn't have a way to wait an exact amount of time (through an event), so this was not very helpful.

Pros:

  • lots more control
  • better keyboard and mouse handling
  • much easier to set up an arbitrary refresh rate

Cons:

  • could not leave fullscreen after entering it
  • forcing a refresh rate outside of the VSync is accomplished through sleep()ing, which is unreliable, or spinning, which is a waste of CPU resources

For these reasons, I'll revert back to FreeGLUT.
Also, I looked into switching from GLEW to Glad. GLEW is far easier to manage so I'll stick with it.

Because managing windows and inputs is so annoying, I don't want to continue to code in raw C++. I'll use a game engine for my future games.

To play, simply download the zip file and unzip it, then run the .exe. I included the GLFW DLL, though it's not needed.

v0.2.5-alpha

v0.2.5-alpha Pre-release
Pre-release

Choose a tag to compare

@khuiqel khuiqel released this 16 Sep 23:08

PowerTanks Battle | Version 0.2.5-alpha
It's been a long time since the last release, so I don't remember everything that's changed. Also a lot has changed (like seriously a lot).
Full version coming in 1-2 months, hopefully. You'll get your full changelog then.

Main things:

  • custom level interpreter
    • made this alpha release just to give a sneak peek at this
    • for syntax, just look at the four included levels
  • an INI file
  • batched rendering
  • some QoL improvements
    • tank color, tank death, no bullet zones, lightnings
  • patrolling turret hazard

Things wanted before the full release:

  • some multi-threading on collision
  • maybe a custom power interpreter
  • switch from FreeGLUT to GLFW
    • and maybe GLEW to Glad
  • some more code cleanup (though I've lost count of how many times I've already done major cleanups this version)

Note for future versions: hazard powers likely won't ever be implemented because they would be realistically not very useful (there's only one hazard that moves, added this version). Also they would be very complex: every hazard needs a "cannon" for something like multishot, though that doesn't mean multishot needs to do anything, it just means each hazard will have a lot more bloat. Hazard powers aren't impossible to implement, just very time-consuming for little gain... which I've done many times before but that's not the point.

Other note: Thanks to Unity's EA CEO (backup links: Wayback Machine, Wikipedia) for telling me Godot exists. I will start using it once I wrap up this version.

To play, simply download the zip file and unzip it, then run the .exe.