StarCraft Bladder problems: On the road to release

So, I was working as much as I can on the SCHNAIL (StarCraft Human ‘N’ AI League – if you’re new to that, click a here). There were some interesting challenges. Currently we have internal releases, and I think I’ll just post the release notes here. Pictures and videos might follow in the future, but right now it’s coding time.

First, I’m trying really hard to get to open beta. That means that the client is basically stable, a dedicated server is set up, and no new features are added.

But first, a few improvements. Currently we work from the SSCAIT server when downloading the bots, and this is not tenable in the long term for multiple reasons. Obviously I can’t expect them to provide the infrastructure for me when there are more than a couple of people downloading stuff. But there is a stronger argument: The SSCAIT bots are optimized for bot vs. bot play. The SCHNAIL is for human vs. bot play, and some authors already contacted me about their bots having vs. human features. In the long term, I expect to diverge from SSCAIT, although I’m not sure how much. I see no reason for not allowing SSCAIT bots to be played against. Anyway, I added a “Skip Downloads” button – handy if you want to just test the UI.

Usability is one of my main priorities – I subscribe to the “Don’t make me think” principle when it comes to UX. Another feature requested was to be able to search for bots. I added sorting and text search as well – and as you can see, player name can be set now.

These are the major visible updates, but there were a lot of behind-the-scenes operations. There are some surprisingly simple things that were hard to solve. I think it’s the simplest if I just add the release notes here:

0.2.2:
------

Bugfixes:
- Updating bots no longer causes multiple entries in the bot list
- Bots with spaces in their name sometimes caused problems when exiting the game, and trying to save the replay. This has been fixed

New features:
- Added LF3 (latency frames) for bots. From the player side, this does not affect gameplay.
- Added proper management of learning files
- Added a schnail.env file to the bwapi-data/read folder. The existence of this file signifies that this is the SCHNAIL environment. It contains
key-value pairs of properties. Currently only the version property is present"
- Added localization. In the settings tab, there is a language selection dropdown. Currently supported languages: English (default), German,
Dutch, spanish, Chinese (Simplified), Chinese (Traditional), Hungarian, Swedish. Some texts might be missing, translation is not in sync with 
relases yet. 
- Added a functioning Quit, and a placeholder Log Out button to the Settings tab.

Enhancements:
- Added a message when bot files are being cleaned up
- Some bots were missing config files, and now they've been re-enabled.
- Adjusted alphabetical sorting to be case insensitive

Translation is an effort by a group of volunteers - special thanks to them! Namely: Hao Pan, Hannes Bredberg,
Johan de Jong, Dennis Waldherr, Javier Sacido, and Micky Holdorf.

0.2.1:
------
New features:
- Increased launcher size to 1200x900
- Added changing username functionality: Username, and settings are saved.
- Added a skip downloads button to the loading screen. This finishes downloading the current bot, then skips to the Game screen
- Added some margins around buttons
- Added alphabetic sorting to the bot list	
- Added a bot name search field 
- Added logging
- Added UI element "Enable logging" - currently logging cannot be actually disabled


Enhancements:
- Game automatically launches for 2+ player maps

Bugfixes
- Corrupted bots.dat file no longer causes the launcher to quit

An interesting detour was when I was trying to figure out how to set the proper registry keys – and more importantly, restore them. Apparently, SC 1.16 and Remastered stores this in different places. Figuring that out, and how can I actually modify them (it’s the Advapi32 library, the gods bless them) seemed daunting – the place I thought they were stored were not the correct one. In the end, the SSCAIT Discord came to the rescue (it is basically where all bot authors hang out, come join if you want. Be nice.), and now it is working. It was needed because I needed to set the proper amount of frames, and you can’t just do that, man.

Image result for sscait logo big
GO TEAM SSCAIT!

Another thing I added was localization – at the point of writing this, it’s still in progress. I thought it’s a simple, low-effort QoL enchancement.

You know how it goes from there, don’t you?

I created some property files, which store the translations. The first one was the Spanish one by Jabbo, and I found out that accented characters are a no-go. Okay, the problem was that we didn’t use Unicode. Okay great, let’s do that from now on.

Image result for I box unicode

Much like Russian history summarized in a few words, and then it got worse. Hao Pan was kind enough to provide me with some Chinese translations, and to no one’s surprise, this wasn’t displaying properly. We double-checked the encoding, that seemed fine. I tried changing the font to a different one (several different ones, in fact)

Yes, box box hieroglyph.

Turns out that the main problem was getting UTF-8 encryption, which is not that obvious from a first glance. In any case, just changed my text loader to this:

    return new String(targetText.getBytes("ISO-8859-1"), "UTF-8");

Among with everything else, this seemed to finally solve the problems we had.

Well, the comprehensibility of this is the same for me as the previous pic, but I’m not the target audience

As usual, this took a bit longer than I expected – but now we have a plug-in method for translations (I work with property files). And yes, Korean translation is of course on the list 🙂

A side note, but an interesting story: I toyed with the idea of adding flags next to the languages, because some sites do that. I quickly realized how bad of an idea is this. Multiple countries tend to speak the same language, and while an US/UK flag isn’t gonna rustle many jimmies, I suspect that picking the right flag for certain countries is problematic. For example, I imagine switching the Taiwanese/Chinese flags would come off as insensitive at best. And there are more Spanish speakers in Mexico than in Spain. Also, there are some languages that are not the official language of any country – for example, 1.7 million people speak Nahua, the language of the Aztecs. And if you think that people won’t get offended about this, then I’d like you to imagine what flag you would put next to the Kurdish language.

Also, history happens. A previous regime’s flag can be *very* undesired very quickly. Living in Germany, I can cite one prime example. I think you can figure out which one. In any case, this problem is not new, and other people seem to have reached the same conclusion.

So what’s next?

There are a few more parts I will add to the UI, but the core functionality is there. The next step is to migrate from SSCAIT, and set up my own servers. I’ve written out some bullet points so you can see where I’m at.

Short-term steps:

  • User management. Creating an account and keeping track of your matches and such.
  • Bot upload functionality. On SSCAIT, the bots play each other, here they play humans. An author might want to use slightly different versions. Also, I’d like to support as many types of bots as I can, so eventually SCHNAIL might have more types of bots.
  • Bot test pipeline: Test for crashes, lag, and see if the bot does anything meaningful in the game.
  • Handling of (custom) maps. Currently the map pool is fixed, but the idea is to have a per-bot map availability, and you can upload your own.
  • Getting more test data. With the current setup, I can only have a limited amount of testers, so my goal is to move to closed beta ASAP.
  • A custom bwapi version to handle the closing/restarting the game better.

Some medium-term goals:

  • ZZZero’s stream went great, and I want to do more of it. Not just with him, but other Brood War streamers as well. I’m already on this to a degree – if you want to participate, contact me!
  • Support for UMS maps, especially for practice bots.
  • Adding some kind of scoring system to bots, evaluating them on their skills.
  • Handling of bot learning data. I want to give bot authors the opportunity to get their learning data. I plan that submitting this is opt-out from the player.
  • Maybe an “offline” version of the client – nowadays internet connectivity is just assumed, but maybe you want to download the bots and go to the forest to play. This is low priority now.
  • A website for SCHNAIL. Sometimes around open beta I think.

Long term, and nice-to-have features:

  • Localization for more languages. Currently this is done with volunteers – it’s just 1-2 pages of basic text, so I expect I can “crodwsource” this in the future as well. The support is there, now I just need the texts.
  • Achievements, and maybe some social features like chat.
  • Maybe bot version history, even storing multiple versions. This would certainly help, but the cost/benefit
  • Maybe data and replay analysis.

And lastly, some plans around MCDT itself. I did a lot of different things since I started this site, and I want to continue giving value to my readers, especially the ones that support me. I will restructure my Patreon a bit, and add benefits related to SCHNAIL. I’m still thinking how to do that best, but one of the key bonuses will be getting a vote on new features, and maybe proposing new ones. The latter can be a double-edged sword: Well-meaning “bright ideas” can be impossible to implement. I really want to hear your opinion about this!

Expect the Patreon redesign soon.

Thanks for reading, and please consider following me on other social meda – such as Facebook and Twitter!

Leave a Reply