Since I last posted, I have released 2.2.9, 10, and 11, which were individually small bugfix releases but add up to a fair number of changes now that there are three of them.
The bulk of these changes have been focused on making the time machine and its corresponding reports more robust and – dare I say it? – bug free. Now that all API keys are automatically discovered from your messaging, the time machine and reports know how to properly use all the data available to give you the best historical info possible given what you know. The ownership report and activity report no longer require you to have merged your own key to know what to do. The key report can recognize dead keys and tell you when they were invalidated so that when someone revokes a key on you, you’ll know when they did so.
For formal alliances, the combat calculator now recognizes stars and fleets belonging to your allies and gives you more correct combat outcomes taking that into account. As far as I’ve seen, this works well in formal alliance games to enable you to properly plan defence and attack with multiple players’ fleets on the move. Also for formal alliances, your counterparty gets charged 150 until they accept, and acceptance refunds 75; so on the accounting sheet the balance will show you what they owe you from your point of view if you offered the alliance.
For bulk trading, if you had to send multiple levels of the same tech it used to show you the correct cost but then transmit only one level of each tech. Now it transmits all levels that are missing to the recipient.
Game messaging read/unread bugs are improved, but I don’t think they are completely eliminated. I would really value bug reports on specific cases where it failed for you as this is turning into a thorny problem that is outside the clients’ control.
The economists have come to town. They would like to advise you so that you can figure out when Terraforming is a better tech than Banking. They report as follows:
First off, they assume you’ll spend your cash stockpile on econ (the number in brackets in the header). Then, they tell you how much income that’ll buy you if you have no tech in time (the $170) or if you get banking tech first ($245), or if you get Terraforming first to make the econ cheaper ($200). Then they compute the balance you’ll have right after paytime and tell you how much Econ, Industry, OR Science you could buy if you spent it all in one category. As expected, you can buy more with less in late game Terraforming, but in early to mid-game banking is quite competitive. Happy researching.
The controls table is updated. It’s as ugly as ever but now lists the hotkeys in the hopes that will make it easier to absorb them for future use. In addition, if you press a hotkey when the UI is already up it will show you the correspnoding report rather than just silently putting it on your clipboard (it is still on the clipboard and in the ‘Intel’ button as before). Finally, hotkeys that conflict with browser hotkeys, like Control-8 and Control-9 on Windows and Linux now take over the functionality so that they work without triggering browser behaviour too.
Speaking of C-8 / C-9, if the territory display is not visible and you try to change the style, the first “change” will make it visible instead of changing it. So when players are confused that it is missing and try to change the style to bring it back, that will now work as they expected (2 users with this bug report).
Pimple drawing on range and scanning territory didn’t used to adjust when you used the combat handicap to see what you’d get with one more level of these techs; now it does. Substitutions in messages used to cap at 1,000 which was too few for really big games; increased the cap. And the QUIT QUIT QUIT bug came back and had to be fixed again.
Some fixes for unread state; still unsure it is working.
Update star ownership to work across multiple API keys. Following the same pattern as for activity, walk through the ticks using all available API keys to generate the best star report this user can.
Fix a missing case for alliance detection. The allied fleet check for the combat calculator only worked in one direction; but alliances go both ways and so the condition needed updating. I think it is correct now.
Fix the activity report to use all available scan data. Instead of relying on the user to have a single key for the whole game, search all known API key data to build the activity report. The approach taken is horrifically inefficient, but after caching the JSON.parse results the time varies between about 60 - 100ms, fast enough to be not worth fixing yet.
Charge for alliances in the accounting screen. When you request peace, consider that the other owes you the full price of peace until they accept. If/when they accept, count that as half the value so they still owe the other half. On game defaults that means someone owes you $150 as soon as you offer peace and $75 if they accept.
Attempt to fix unread state after load time too.
Update the economists report to include buys. In addition to your balance, show how much of each thing you can buy after the tick so that it's clear when Terraforming has made your money more valuable than $75 more of today's dollars.
Try a different layout for the controls table. The controls table was already not very nice looking; try having a single column with hotkey reminders on the right to see if that helps users find/remember the hotkeys.
Update battle calculator for allied fleets. If we know a fleet is allied with us or we are allied with the destination star, show an arrival rather than a combat.
When the UI is already up, visibly display reports. If the user has brought up the UI and triggers a report, immediately display it as well as putting it on the clipboard.
Change territoryBrightness behaviour when display is off. Sometimes users have turned off territory display with ) by accident and then try to use ctrl-8 / ctrl-9 to change the style to fix it, but think it's broken. If display is off and you change the style, turn it on first (and don't change the style); then if you change the style again it will change as expected. Also attempt to make all hotkeys override browser hotkeys by telling Mousetrap that is what we want, so that c-8 / c-9 don't also switch tabs on Windows and Linux.
Fix up some bad boundary condition bugs. In bulk trade, if you didn't have the cash to send a level, the new code to try to send all levels would wind up in an infinite loop. Just give up in this case. In time travel, traveling forwards across an API key reset boundary would fail to start at the right place in the new block and give up on finding data. Fix it to start at the beginning when moving forward, and at the end when moving backwards. Linear is still fast enough but probably I will want to make this a binary or galloping search if the tick # is far enough away from the current index...but at least it is now working well in the presence of multiple API keys in all directions.
Record eof so that the key report works again.
npaserver doesn't yet recognize bad keys, defend for it. Since the server will happily return error codes for every tick after someone invalidates a key, be sure to trim those bad entries off so that the time machine still works.
Fix key report to handle regenerated keys. Once a key is regenerated, recognize it and find the last good scan from that key. Report that timestamp in the table for all seen keys.
Early version of the economists report.
Bulk send wouldn't send duplicate techs. Bulk send would send only the first level of each tech instead of sending all of them. The price listed was correct but the transfer was incomplete, fix it to send all missing tech levels at once.
Accept dashes in youtube video IDs.
Have the message cache read state be authoritative. The server expects that if you request a comment thread, you must be on the screen that displays the comment thread because that's the only way that ever happens in the vanilla game. However since NPA is caching all the diplomacy for you behind the scenes, that means that the read state is wrong for the UI. Update it so that the read state in the database cache is authoritative, and that read state changes will trigger database updates. This seems to fix the unread count/unread message problems.
Increase substitution limit to 5k for big games.
Update pimple drawing to respect range adjustement. Previously the pimples for borderline stars were based on the star owner's true range, without the handicap adjustment. Fix up the drawing to be simpler for star territory so that the range adjustement would be factored out, and then use the refactored range calculation for the pimples too so that the feedback is always right.
Add visibility pimples for stars on the border of range/scan. Shrink where the border is a bit so that it clearly excludes stars that are out of scan/fleet range, and then route the border around stars that are close to the border but actually in range. Should make it much clearer what is in or out.
A first cut at typescript types for scanning_data. The API returns the galaxy wrapped in an object named scanning_data. Provide typescript types for this structure to make it safer to take apart correctly.
Fix the QUIT QUIT QUIT bug again. When the early exit was added to avoid merging one's own scan data, it also bypassed the fix for the QUIT QUIT QUIT bug on each merge. Fix it so that the player name reset always happens.
Make the time machine move in turn increments. In turn based games, it is annoying to have to step through multiple ticks of "missing data" because of the 8 tick turn increment. Instead read the game configuration and jump around in turn increments so that you can play back the game as you might expect given that there are no intermediate updates.