GTB is such a huge game that I seem to veer into certain areas of it for weeks at a time, then veer back into other bits of it and think “did I write all this code?”
One of the features from Gratuitous Space Battles that I was very happy with, was the online challenge system. It was very popular. About 226 trillion billion zillion challenge games have been played (roughly). Obviously I want a similar system incorporated into GTB, and naturally I want to fix the things that were not perfect, which I identify as:
- The challenge browser was not as good as it could be. You couldn’t filter out played/downloaded challenges.
- Any challenge that had content, be it DLC or a mod that you did not have, could crash the game, and not be pre-filtered
- The emotional connection between you and the challenger was limited. (Rarely used messaging, and rating, but not leaving comments etc).
I plan to fix all of this, but the middle one is the current one of interest.
GSB had a binary .gsb format for a challenge, which basically packed in binary data for the fleets designs, deployments and orders, and a little bit of data about the challenge (custom settings etc) and that was it.
GTB will use a new .pak format I’ve written that will behave a lot like a zip file. (no compression yet, sadly). It will be a folder full of stuff for each battle, all the enemies unit designs, the deployment timings for their attacking units (or initial deployments of defending units), and all of the data from the scenario file, down to the location of every tree, crate, barrel, barbed wire etc…
That makes a GTB challenge file slightly larger than before, but I can live with that. They are under 100k. How many custom maps in games are under 100k now? It also means you could move a few trees or change the texture of a single tile, and upload an existing scenario trivially without any inconvenience.
Anyway…. The upshot of this new file format is that theoretically, if I write the code for it, the format could include custom sounds, graphics etc. That means you could do a mod for GTB which included different textures for the terrain, and custom units, issue it as a challenge, and EVERYONE could play it, because the required content gets downloaded with it.
Sadly, there is no way to prevent dupes there, so if you have a custom tank texture, and upload 10 challenges, someone downloading all 10 gets the texture 10 times, but I think that’s not so bad. Only a minority of players are likely to issue or play modded challenges anyway.
The main thing is, my pak file format pakker and unpakker all works fine, so it’s another step along the path to having online play working. Now I need to replicate a lot of the GSB functionality (and improve on it).
Edit: I swapped out my code to use some zip code instead , after finding a zip wrapper that was extremely lightweight.