Neptune's Pride Agent αλφα Edition

Announcing “Neptune’s Pride Agent αλφα Edition”!

I’m excited to announce that over the course of December, NPA topped 200 weekly active users. With so many of us using the extension, it’s much more nerve-wracking to just upload new code … I don’t think anyone wants a repeat of v1.15 when the extension abruptly stopped working for everyone.

With that in mind I’m excited to announce Neptune’s Pride Agent αλφα Edition v2.0.2, which will replace NPA v1.18 with NPA v2.1 once we deem the new features stable.

The alpha edition launch marks the start of a new era. I have gotten permission from Jay to open source the extension code, so NPA is now released on github and all kinds of contributions are welcome. You can get involved by

The current v2.0.2 has the following features:

  • Display git hash and build date in version info
  • Fixes autocomplete bug where if you typed [[0] fast enough it would fail to autocomplete
  • Substitute [[Tick #n]] with the user’s preferred date/time format
    • This has the side effect that if you mail fleet reports to another player, your timezone is no longer revealed as they see times in their local time
    • Also fleet outcomes in the HUD are displayed with [[Tick #n]]
    • The % hotkey now cycles between four formats: absolute ETA, relative ETA, number of ticks, and absolute tick #:

  • A new ‘$’ hotkey produces a csv file suitable for pasting into a spreadsheet to give you trackable global stats of all players. Paste the result and then use the ‘Split Into Columns’ function to record and analyse the game state.

The next alpha version will be live in a day or two and adds the ability to link images in in game messaging, to colour yourself white so that you can distinguish yourself easily in large games, and to display territory so that you can spot routes like this one:

See you in game!

Osric

2 Likes

v2.0.3 is now live in the store. Existing users of αλφα Edition will be auto updated.

This version includes these changes:

commit 74a4549bc40405f06e04be8bdaa48f5a321b48bb

Add support for image links to imgur or ibb.

Messages with links like [[https://i.imgur.com/qY3K26V.png]] will
expand the image inline.

commit 8c5cb7ccd3baa15182f939d3f2943da08c613b24

Add ability to recolor players, and w hotkey.

Generically make the code respect the player color given
by the values in NeptunesPride.universe.galaxy.players[uid].color
and add a recolorPlayers() function that will reset all sprites,
CSS, and images to the colors as specified.

This has the side effect of changing the size of any 48x48 ownership
rings, but these are still small enough to appear OK in the UI.

By default, other than that size change no change is apparent. If
the user uses the 'w' hotkey, their own colour will be changed to
white so that they can easily distinguish their own empire on the
map.

As a follow up, it would be nice to be able to persistently set
any player's colour.

commit c8cd81bdf949414abf9be6587ea10f47c8ffc889

Show territory to visualize borders/conflict.

Osric

v2.0.3 is now available for desktop Firefox.

I am looking into why they didn’t enable it for Firefox on mobile. I am hoping that they will approve it and that will provide a solution for Android users.

I intend to transition from the v2 αλφα Edition to v2.1 stable once I have a stable version of v2, and from then on I will probably only publish stable for Firefox. If there are users out there who want the bleeding edge for firefox and are willing to collaborate on the project, please PM me or get in touch via github and I can change the plan. I am not clear on how many potential users FF has, but I imagine it isn’t that many of us; unless of course Android becomes a reality which might make it one of the more popular ways to use NPA.

Osric

1 Like

It turns out that firefox doesn’t really support all extensions on mobile. It is possible to install NPA if you run firefox nightly on Android. The steps are:

  1. Install the nightly firefox
  2. Go to about. Tap on the logo 5 times until a notification appears saying “debug menu enabled”
  3. Go to settings, find the advanced menu, choose “Custom Add On Collection”
  4. Enter 17719143 as the “Collection Owner” and NPA as the “Collection Name”.
  5. Click OK
  6. Enter settings and click add ons. Choose the + icon to install NPA

These steps are documented by Mozilla. If my instructions are hard to follow, try theirs.

Osric

1 Like

Those are some great news, but not really helpfull.
My Mi 9t (which is not that bad) surprisingly struggles to get above what looks like 10 fps while scrolling in NP on Firefox, despite having no problems in Chrome derivates. So, while your addon works great there, full expirience mobile NP is still unreachable, sadly.

Firefox is slow rendering NP’s map canvas on all platforms, but especially bad on mobile.

That said, if you go into settings and set the map graphics to “low” it is usable even on old devices. My test device is a Google Pixel C from 2015, and I am able to play the game on it even though it is a distinctly worse experience than on an iOS device. Give the low graphics setting a try…

Osric

I was already on medium, and it didn’t fix it completely. But that looks more like 20 frames, yes.
And I have not said that it is unplayable, we’re talking essentially turn-based strategy with 1 hour per turn, even 5 fps could be playable) It’s just not pleasant.

For firefox users, v2.0.6 is now available. For Chrome users, expect 2.0.5 tomorrow, and 2.0.6 on the weekend. iOS is currently on 2.0.3, expect 2.0.6 tomorrow.

Changes in v2.0.6:

commit 516f6205a889fa4c7dbda1f9015c4b6256809420

Player recolouring was completely wrong for 64p games.

First off, the CSS for the player underbar doesn't exist and was
throwing an exception and completely breaking the code for 64p
games.

Secondly, there were not enough glow icons in the sprite for
every player to have a unique glow. Make the destination sprite
bigger to handle the extra positions, draw the extra glows, and
override the sprite positioning for stars with gates. The end
effect is unique glows per player that correspond to their sprite.

commit 666f4790e2c901f46356c6c2111006c4589e59d0

Make time display persistent and have ticks update UI.

Make the default time display relative (i.e. the ticking production
clock as usual in the game) but also make the '%' key store the
user's preferred time setting persistently so that if they change
how the clock works it sticks across sessions and games.

Also watch the clock for the 29th second, so that times formatted
from [[Tick #]] will update to the correct minute every time the
rounded time would adjust itself; this makes the map repaint and
the UI refresh. This seems mostly good but it can be annoying if
you are in a long message thread because it will focus the comment
box. Let's see how much people hate that.

Changes between v2.0.3 and v2.0.5:

commit 56120b0cad72f9526cfa77fe1d9e2a54daf16bb8

Add merge all users hotkey '('. 
See the help for details (press ?).

commit a7576dac9e6fbbafacb51dac50b08eace1340eda

Add API key report bound to 'k'.

Navigate to the report with the GUI for easy access to
any API key you have previously viewed.

commit 917d9b4155334c2cfea334eb94dcf1785d85d89e

Store game events in indexeddb to avoid hitting server.

In order to make it efficient to do accounting and message
analysis on the client (especially for long-lived games with
tons of messages) store all the game event data in indexdb
so that the client only needs to fetch the most recent
messages each time rather than loading the full message
set into memory at startup.

*Currently only working for game event data, not diplomacy.*

commit 6b5b4c63846b32e366216b8e5fd1e2a6c37769b2

Rudimentary accounting report with transaction logs.

Navigate to 'Accounting' in the GUI.

commit 56f9a4fae067dcab8c1064184f1506543cce7779

Attempt to work around a problem with 'w' on firefox.

It seems that there's some issue where firefox doesn't pick
up the changed sprite images right away, but scheduling a
map rebuild 500ms later works on my Mac. Unclear if this will
work generally as the reported behaviour for the bug is a bit
different.

commit 5853cf8c0485a6c3ed9d1ade274adf30eaa2cdf5

Fix ibb URLs to match with embedded slashes

commit fb70ebf929ac27be145af0a5c08b057d7c97ce46

Check if we are on Chrome before overriding touch.

Touch handling and mouse handling works fine on Chrome without
Jay's original code to distinguish cases, and for touchscreen
Chromebooks disabling his original code enables the trackpad
and touchscreen to work in tandem.

On iOS Safari, this would disable touch handling in favour of
a trackpad that the user probably does not have, so guard this
as a Chrome-only hack so that the iOS version of the extension
works.

Since I don't know what happens on firefox, leave the default
behaviour in place.

Osric

For Firefox, iOS, and MacOS, 2.0.8 is available now. For Chrome, expect it to auto update in the next 24-48h depending on approval speed.

There are only a few small changes in this version. Proteus support, hotkeys to invoke the UI,
partial SAT compatibility, and reproducible builds and therefore a shorter version signature.

I am getting close to considering this a release candidate for stable. Please file bugs aggressively.

commit e6aa2070025639d04446b0c3502ba4fc6220256a

Detect and ignore duplicate injection.

In an effort to be as compatible as possible with the fork of
the code embedded in SAT, ignore the duplicate code it tries to
install so that if both extensions are installed things will
"mostly" work.

commit c189c54224a7d0c4cb9536707b7092850e6cf361

Make a hotkey to bring up the UI.

The UI itself is useful enough that the user might actually want
to use it, especially for the API Key screen or the short fleet
reports or the accounting.

Bind ` to bring up the UI and make it so that if you clip a report
it is the default view (otherwise it is the last thing you looked
at in the UI). So for example k` brings up API keys, a` brings up
the accounting, ^` brings up the short fleet report.

commit e73c58fcb2498f19241704dbac4779860de8da97

Improve the behaviour of the NP Agent menu item.

First off, multiplex the item with the new fleet item
so that it gets the benefit of being a "legit" screen
according to the rest of the UI - namely, that it will
be refreshed automatically if the UI is refreshed (for
example if the user changes timebase with '%').

Second, make it remember what report you were on so that
it can show you the report you wanted. Very likely users
will often want to see the ledger or API key report over
and over again.

Third, position it above the back menu item.

The code is ugly as sin but the UX is great.

commit 744cadf0215050d481c4b1f4958419cde2e2e700

Updates to make NPA work on proteus.

Battle calc doesn't add defender bonus.

Player recolouring respects custom shapes. There remains a bug
where now the avatar colour indicator doesn't update until you
refresh it or reload, but everything else works smoothly.

commit 05c3e4efda6f77499dd8f60e6f4c5b2d2ef1b4cd

Rebuild version without the caution sign for prod.

Osric

For iOS, MacOS, and Firefox, 2.0.9 is available now. Expect Chrome to update in about 24h.

I am likely to declare this the next stable version and promote it to 2.1 on the main extension. This release adds the ability to link a player with just their shape via [[#0]] instead of [[0]] to refer to the 0th player, a crude UI for people using the extension on phones that exposes buttons for all the hotkeys so that you can use the extension without a keyboard, and a “Trading” screen that shows you your tech status with your allies (based on whose API keys you have) and everyone you can trade with (restricted to scanned players if trade scanned is on).

Also contains a bug fix to proteus battle calculations and a fix of the (QUIT) (QUIT) (QUIT) bug when you merge multiple players’ API keys into your view.

commit 3bc4d1ce52e3ab4cbb450c4d9a8a25533a15b66a

Make trading report respect trade scanned.

To make the report more useful, thin it out to scanned players
when trade scanned is on.

commit 02c27b05ffd783b59ea3ee6616270559fb8de4ed

Refactor to show all player's tech.

commit 5761ed2c476a8cfd93942c2b19442137507964a8

The beginnings of a tech trading screen.

So far, this just shows a table of tech for those you have API
keys for.

commit c753f36c3942c83d2548115cd397e20b849aa16a

Add the ability to make NPA buttons.

Now the text [[hotkey:<key>]] or [[goto:<key>]] will create a
button that can trigger an NPA action. Normally you will want
[[goto:<key>]] so that the user sees the UI corresponding to
the report; the hotkey one is just like they pressed the hotkey
which in many cases just puts stuff on the clipboard and doesn't
navigate.

Use this to create a crude controls table that displays all the
hotkeys so that users who are on phones or tablets without keyboards
can find and execute all the functionality in NPA.

commit f571a44c5594e2cdf4fcf1533e45e38d0d79fb74

Install mousetrap types and package.

It isn't 100% clear to me that this is the right way(tm) but
rather than declare my own partial types, use the real packages
for Mousetrap.

commit 6efe870741d3c2248af5fa05b1b460137b08302b

Fix the (QUIT) (QUIT) (QUIT) bug.

For each merge you did, the on full universe code would append
an indication that the user had quit to their alias. Reset the
aliases each time so that you only get one (QUIT) or (AFK) or
(KO) tag.

commit 03b98bb78606a41affd1f0b983a7e7bcb50a3f77

Proteus doesn't have fractional ships defined.

commit f608a62496ec59469b9d4040a2689672239e7fd8

Nudge the reports over to center the tables

commit a54aeee0b1bb0ac205ae28fbe92460645ce33d0f

Add the ability to link players with only their symbol.

You can already type [[0]] to link Player 0 and display
their name as a link alongside their symbol; add [[#0]]
to do the same but with only their symbol as the link.

In non-extension games this will show up as (#0) which
is hopefully clear enough, and in extension games you
can now make dense tables with the player's symbol as
the column heading.

Osric

1 Like

NPA αλφα Edition is now updated to v2.1.2. It is available as a new extension on Firefox; the previous firefox extension is now pinned to stable and is at v2.1.0. It is still the only channel for iOS.

The firefox version is approved and the Chrome version should be available in 24-48h depending upon approval times. The major change in this version is the addition of a live research report for allies, accessed via the E hotkey, and the ability to send techs to others from the trading report summary (the lowercase e hotkey). If you click a green number in the tech summary table and you are able to send that tech, you’ll be prompted to see if you’re sure and then the tech will send.

Also for turn based game players the long-standing submit button bug is fixed and absolute times are in terms of turns rather than real time since as near as I can tell real times are useless/don’t make sense for turn based games. If you play turn based games, your feedback would be most welcome as I usually do not and am playing one mainly for testing purposes.

Detailed changelog:

commit 7a9e7b976657d959c65ab6995e58f5d44b6a52b4

Complete research screen for allies.

Provide a research report (hotkey E) that summarizes research
for everyone in the alliance based on API keys and contains
the live data from the other players.

The resulting report can be emailed and times will update, but
the times will be based on the historical research rate at time
of paste. Still useful for getting live updated ETAs, but one
must be careful about the distinction between getting a fresh
report with everyone's current science and seeing a potentially
stale report based on science as at a certain time.

commit 47f3b0fc5df325c049b9af6203f91e8ee0a262c4

Make table rendering pickier about the header line.

Some players actually use --- in their messages, which causes
the table render to trigger. Make it dramatically pickier so
that table rendering is only invoked when definitely intended.

Now --- must be at the very start of the line, and a second ---
must be in the line, in order to decide you want a table following.

commit 520e83b72a1f74acfaa3f33e655d409fba627018

Fixes for turn based games.

Put the submit button in its proper place so it isn't overlapping
all the screens.

Change "eta" time format to not use clock times, which are meaningless
since the clock is entirely driven by the players completing their
turns. Instead, make ETA in terms of integer turns so that you can
know how many turns away everything is and use that for planning.

commit 83bdae4c8279ac8e9131399a634aa2ded49c5dbd

Make tech table transmit tech if you click.

commit ee6905ed385855dc867d77707cc5565eb9fe9ca9

Colour balances in the ledger.

Osric

Somehow I missed announcing v2.1.3. As of today the extension is updated to v2.1.4.

Highlights of v2.1.4:

Finish fixing the “Submit Turn” and “Submitted” buttons in turn based games not to overlap the rest of the UI.

Fix the combat calculator to report integer numbers of ships on each carrier, and to correctly account for carriers with a ‘Delay’ set for their departure. Note that there may be a bug in the ‘Delay’ feature of the game itself making the timings unreliable.

Now, if you generate an API key, NPA automatically caches it for you so that when you type [[api: into a message it autocompletes your own key. Additionally this makes sure you show up in your various alliance reports, like on the trading screen or the research screen.

Make red numbers trigger cash transmission (with a confirmation dialog) if you click them in the trading screen or the accounting screen, for easy payment. Add bulk payment and bulk tech transmission options to the trading screen.

v2.1.3:

Fixed fleet merging when you merge multiple API keys. In the past, you wouldn’t see complete fleet orders for others unless you viewed the map as them. Now, when you merge multiple API keys you get to see complete fleet orders for everyone. Also, API key merging is cached so it is much faster, and the clock doesn’t get reset to the wrong time when you merge keys anymore.

Table markdown is pickier and only recognizes --- Title --- as the start of a table if the --- occurs at the start of the line. This avoids mangling messages from players who actually type --- in their message. Additionally, tables are formatted properly on first view and not only if you refresh the message from the server.

The research screen shows a new ↑S column that tells you how many science that ally needs to buy to improve delivery of the tech by one or more ticks. If more than 10 science would be required, the entry is blank.

The controls screen buttons now highlight on desktop just like other buttons in the UI.

commit 5f54bcfcb8e32910f40feef340933fa1cdf7e9b4

Make balances owing actionable on accounting screen.

Update the accounting screen so that red balances trigger a
money send, making it quick to settle up when you owe.

commit ae7fef4f752825cb42c51c50f2a3e592de0f3af7

Add initial bulk tech send functionality.

commit 8f09918ab69c0695f43e543e2d5ad05e3dd6198a

Add the ability to bulk pay for tech transfer.

commit dd97284845650a8ca4bffcd5e66954cb7f10d2c3

Make tech deficits trigger send cash if clicked.

Now if you click a red entry on the tech summary screen, the UI
will ask if you want to send the transfer fee amount of cash to the
holder of the superior tech for them to transfer it to you.

commit d4b357e5a6cc6a27608ce9b2d42023cfa7316113

Handle delayed departures properly, and note them.

Handle delayed fleet departures correctly and note the departure
in the delayed tick's combat report.

commit fbc2f945b4d8cd852cb59cd9ecbbfa4d40947a13

API Key convenience features.

When the user generates an API key automatically cache their own
scan data so that the API key will forever be known to this instance
of NPA.

On every UI refresh (which we are doing every minute) ensue that the
allies API data are fresh in the cache. Never wait again for the
research screen to load.

Inside message compose, autocomplete [[api: with the user's own API
key. If they really wanted to send someone else's, they can go back and
paste it over their own key.

commit d018f524eb412b7d1b317ef9de2fd13110d59526

Fix combat calculator to distribute ships in integral quantities.

The largest arriving fleet gets the first leftover ship, the second
largest the second leftover ship, and so on down the line. Produces
pretty numbers that are hopefully exact matches for the game's approach
to the same problem.

commit 2fb341af53793ac899d0ce4584c7646c8b871168

Also look for the Submit Turn as "Submitted".

commit 660ab1cad324c75ffd45264f780d6b2e2caa5818

Changes listed below were shipped in 2.1.3

commit f01d7a7d3fd17a6f1ae916527ab5a98a732a6932

Fix fleet merge bug with multiple allies.

If multiple allies could see a fleet then merging would take the
last allies' view of the fleet or your own view of the fleet in
preference to the scan data of the owning player. Fix it so that
if you have a scan from the owner, that view takes precedence over
all others, providing the detailed scan data with a full order set.

commit 97f953b1caaed198942f6dd352483c40c9d9cacb

Update column header to ↑S for clarity.

In the research screen, it seemed like ΔS wasn't intuitive
enough so try out ↑S instead. The column means how much science
that researcher needs to reduce delivery time.

Add help text to clarify it as well.

commit 8d11311471c8b1aa64bcb5fa3ca1b4b02f709704

Fix cache bug at tick rollover.

The sense of tickness was backwards so that the tick passing
wasn't triggering a refresh of the cache, resulting in scan
data up to 5 minutes out of date just after the tick. Fixed
it so that as soon as the tick passes the scan data are
invalidated and therefore always fresh

commit 24405e4def165430011f671c50ddf979394d0009

More detail in the research report.

The research report now shows progress for each researcher
as well as their total science and the upgrades needed (ΔS) to
achieve the research level 1 tick sooner.

commit 0b8ff256a291248bf161200969d568772d11b8bc

For turn based games, fix the submit button on refresh.

The submit button would reappear on UI refresh, sometimes even
at startup. Hook the event to fix it any time that happens.

commit 286102f9d22ff910034361fd717a1e540352ab1e

Fix wrong event wiring so screens aren't re-executed.

The event handling for the reports screen was accumulating at the
top level of the UI causing the screens to be rerun as many times
as the UI has previously been displayed. For most screens this was
fast enough to be close to imperceptible but for the new heavy
reporting screens they get decidedly sluggish after being in the
client for a while.

Hooking up the event properly means calling the report exactly once
and is pretty snappy.

commit 6a83add82a79d2524dfd95fc1c20a8c71ec48325

Overhaul API data fetching.

Consolidate the three spots that used to use API keys to fetch
scan data into one function, using a modern fetch call instead
of a sketchy synchronous jQuery ajax request.

Also fix the time drift when merging API keys and an bug where
incoming visible stars took priority over already visible stars.

commit ee3063c78a366159fae126b850cbbfbdb8ea001e

Fix time not to shift on merge of API keys

commit 9b12b4601e02c8f5b63222d95ebdb1e09faffa30

Two fixes: pickiness update, and immediate format.

My previous attempt to be pickier about --- occurrances was not
correct, and is now hopefully fixed.

The <br> tags inserted into comments are different on the client
side than on the server side, update the split to use a regex that
works on both so that things are properly formatted the first time
round (notably tables).

commit c5c88fbbe212a0aef6293f7d12b0ec47bc8e2053

Fix help button not to navigate back to controls

commit 46cd261a593f7f55dddbb76d522ffbf2a94f3b5f

Style NPA buttons with CSS since the JS isn't used.

Osric

Today v2.1.5 was published with a high-priority bug fix for the compose messages screen. In prior releases, if you had the ticking clock time view (the default) selected with the % key, every 29th second your input field in compose would lose focus and the next keystroke would likely trigger a hotkey response taking you away from your message. Workarounds included just going back to the message or back to the new message compose screen, or using a different time base. Since I always use a different timebase view it took until two αλφα users reported it before I realized how bad it was! I am sorry.

This version also fixes a long-standing bug in the HUD where multiple enemy arrivals would show them all as losing in the HUD even if the long fleet report showed correctly who was the new owner of the destination star. Now the HUD also acknowledges the winning fleets even if they win after landing on the star in a multi-stage combat instead of crediting the win to the star.

Also v2.1.5 contains a new auto-ruler feature I’d really like feedback on. It is especially useful in turn-based games, where certain moves are invisible to others. For any star you click on, it will show you the nearest enemy star’s attack ruler, and all possible defence rulers. The defence vectors will be grey if the defence cannot possibly be launched in time, as often happens even in scenarios like this in turn based:

Normally you’d see this in real-time and think “no problem, Alniyat can defend Fez”. But in fact, the attacker will appear at the mark on the red arrow for the first time, a mere 7 ticks away from the destination and it cannot be defended even though moves between it and Alniyat are invisible because they are less than the 10 tick jump. So the arrow is grey, as is the next closest defender Gomeisa.

I would really appreciate feedback for this feature. So far I am very bullish, it seems really helpful to me and the lowest power level setting is on by default. Press 8 to turn it off and 9 to turn it up.

So, the release notes for v2.1.5:

commit 535cf0a69f064f5a9e313eb1137e40b5d9bf67f1

Fix frustrating focus stealing bug.

Every :29th second when the UI refreshed, I would steal the focus
from the input field in message compose and then the next key would
often trigger a hotkey response instead of continuing compose,
interrupting the user's flow. This was only happening in 'relative'
timebase which I never use but thankfully αλφα users were able to
report it.

commit 878f26735a6deaed6941b12f2b935506b6d3f015

Add arrowheads to the auto ruler and fix up the buttons.

The buttons were just labeled '8' and '9' instead of having
a nice name, fix them to say '+ Rulers' and '- Rulers' so
users have a fighting chance of figuring it out from the
controls screen.

Add arrowheads to the rulers to make direction of intended
travel crystal clear.

commit 21ce2f4fceb463cae0aa12aceddc34d6cc2573fa

Handle ruler cases where the world is rotated upside down.

In the drawing code when we're flipped the arc for visibility needs
to be drawn on the other side.

Also use real distances for deciding whether to say it's invisible,
rather than drawing distances which are cut short to look nicer and
make longer ranges (9 ticks) look invisible accidentally in the
previous iteration.

commit d81718045eaac1943a63ac2ac880af3b4c505312

Change the look of the auto ruler.

Add an arc that shows where the fleet becomes visible and
an invisible warning if the travel time is shorter than the
tick jump (a common issue in turn based games).

commit 9502b006129ab220acff8d197be9244ed5a00d6d

First iteration of the auto ruler.

The auto ruler shows you the nearest enemy attacker of a selected
star and the nearest defender by default. If the defending star
can see the attack in time to launch defense its defense line is
shown in green, but if it can't make it in time its defense line
is shown in grey.

Pressing 8 will turn auto ruler power down to 0 and show nothing.
Pressing 9 will turn up auto ruler power and show you all closer
defending star candidates; and every other level adds another level
of attacker distance.

The setting of the auto ruler is not yet persisted and defaults
to power level 1.

commit eca067590ec53848fb7ef8797516230c3e5903d0

Fix multistage combat to credit the winner in the HUD.

The HUD would see that defense won and say "Loses!" for all
incoming fleets, but in a multi-stage battle one of the attackers
could be playing defense by the end. Recognize this case and say
Wins! for the attacker if they are the defender by the end of
combat.

Osric

The auto ruler looks like an especially useful feature for me! I’ll have a play around with it when the new Flying Swiss Tournament starts.

1 Like

v2.1.6 is now available for Firefox, iOS, MacOS, and in review for Chrome. As usual expect Chrome to auto-update in about 24-48h.

This release contains a bugfix for the accounting screen, which previously would occasionally fail to load the first time or be slow loading the first time. Now it should be consistently fast, always pulling data from your local storage rather than the server, and always come up the first time you invoke it.

The auto-ruler has been “completed” for now, with grey text instead of green for ineffective defence vectors and correct calculation of which stars are closest including their warp gates. Previously the arrow shown would be correct for warp gates, but physically closer stars would be considered “closer”; now the stars with the shortest travel times are “closer” and results are correct as of the warp gate state your client has (note the other player can always surprise you by building or tearing down a gate that you’ve planned around).

The “Submit Turn” and “Submitted” buttons were still out of z-order on Safari and MobileSafari even though they were fixed on Chrome and Firefox. This is fixed for Safari now, too.

Timebase, territory display, colour yourself white, and auto ruler power level are now all persisted and consistent across reloads and games so that you can set up the view the way you wish it to be and get the same view each time you return to the game.

This version will be the release candidate for v2.2.0 stable. Please report any and all bugs!

commit 963513e7ffe74aa502f51789c78b6d0a540cef2c

Rework how the message cache gets loaded.

Use the new fetch API rather than jQuery for the POST request,
and rearrange the async flow to work properly and prioritize
getting events from the cache.

In the past there was a problem behaviour where the first load
of the accounting screen could be slow or even fail outright. In
the fixed async flow, this should never happen; the accounting
screen should be instantaneous or nearly so in all cases, except
if the player joins a very old game from a new client. Even then,
the player might never experience a slowdown as the events will
get cached when they first join the gaem.

There is some noisy log output for now in case there is a problem
with this change but other than that no negative side effects.

commit 62da0aaaf44634587d1bdc337d80abbc37213b4a

Fix submit button zIndex on safari.

For reasons that aren't clear to me the submit button is in a
different place in the DOM on safari. Fix the code to set the
zIndex correctly for Safari too. Verified that it is already OK
on firefox.

commit b89862a1cc9b41f8ae3e6a4b86faf3a90dd48126

Redo color choices for text.

After some use it just seemed that the red text was never easy
to read, but the grey color for ineffective support was really
helpful. So change it so that all autoruler text is green except
for the ineffective support which continue to use grey. Stays in
the theme of the HUD colouring (same as the scan grey/green
distinction) and makes it easy to tell what support works and
what is ineffective.

commit 7daf8795f508d92f4eaf63d6da7860ea706c208a

Draw autoruler text in the color of the arrow.

Specifically to make it easier to ignore/recognize the grey arrows,
which indicate invalid/impossible defence responses (the enemy
doesn't have time to defend from there, unless they anticipate your
attack and launch simultaneously).

commit d44d71d83ded2efa47085505d8b8a0c9dd4db078

Persist all the settings that I think you'd want to stick.

The settings that stick and are consistent across games are:

- timebase
- recolor to white
- territory display
- auto ruler power

When you reload the game or switch games, these settings will
now be read from the database and be the way you left them.

commit 9d211991137dc8d3e70a22d1169d5786b53afb72

Add autoRulerPower to settings.

commit abf6c42fe982c98b903fe20eaafa40a31cb1f52f

First working typescript settings creator.

After much futzing, figured out how to convince typescript what
the types of individual settings are and be able to add them on
the fly. They get loaded from the database on initialization and
updated each time they are written, but otherwise function as
locally cached variables throughout for efficiency.

There may be a race condition here and there's a console.error in
case that ever happens, but even if hit the effect is minor for the
one or two settings that exist at the moment. This race might require
more though to get right.

commit 7dac7380d379a75d298ca3389fc320be6cd3620c

Abuse pre-version info, making it represent a 4th level.

Fourth level patches like 2.1.0a are not supported by extension
manifests, and fourth level patches like 2.1.0.1 are not supported
by semver. Semver supports "pre-" versions like 2.1.0-rc1 or
2.1.0-1.

Abuse this functionality to map "pre-" versions on to 4th level
patch versions, so that after releasing stable you can create a
patches branch on which you take hotfixes in via git cherry-pick
and then run

npm version 2.1.0-3

which will create a manifest with version 2.1.0.3 in it, that
firefox and chrome stores will accept as legitimate.

commit 7d77ff84e4d277c8861e64fef933e0cdc21cb929

Fix a bug where gates weren't being used in the initial sort.

When I switched to a sorting strategy for distances, I failed to
realize that the sortedStarSprites don't contain gate information
so the nearest defender was being found without considering warp
effects. Fixed it to use stars so that the calculations
are as accurate as possible given the current game state.

Osric

Well v2.2.1 is bound to earn the alpha label … but I couldn’t wait to put this out there and see if people like it. Introducing the NP Time Machine:

If you generate your API key with NPA v2.2.1 running, your game state will be accumulated for you on the new npaserver and synced to any client that has merged that API key. From there you get two new reports: a star ownership report that makes it easier to discover who is attacking who, and an activity report that tells you when the selected player definitely made manual upgrades or moves so you can tell who is active and who is not. Finally, you can use the arrow keys to travel backwards and forwards in time from the time you generated the API key to the present.

This functionality is bound to contain bugs and I would appreciate reports of any issues. Hope everyone else is as excited as I am for time travel!

commit f25bdd1454f22f58fe156685738a1c47d241365e

Initial version of the time machine.

Now that the client has the game state going back to when the
API key was generated, make the arrow keys allow the user to
enter a time machine to show prior game states. Watch combat
predictions from the past, see what carriers were flying through
space, generally see anything you might have missed because you
have a life.

I recommend not having a life for this game. But if you do, you
can now go back and see what you missed...

commit aa6259ca6c07e06cf01e07683e1ee86fa4576a66

Add explorers and activity report.

When star ownership has nothing to show you, show exploration
of neutral stars instead for start of game intel.

Add an activity report that shows the activity timestamps for
the player who is currently selected on the map, or for yourself
if nobody else is selected. Show the tick, alias, and upgrade
status for each active timestamp.

commit f0ae95878f763120f5a5d88aff96f2e4d31b37a7

Make ownership report track abandoned stars.

Rather than ignoring captures of previously abandoned stars,
explicitly track abandonment and subsequent recapture so that
allied cooperation is easier to spot.

commit 78f5f080fe9df69e2e8daa9e9867585a420b0d18

Register for historical data for each new API key.

When a new API key is generated register for historical
data with NPA server.

commit 2e483338743d2a0d227a24d9f9bc92e07c63e6ba

First cut of using npaserver for game history.

Game snapshots are copied into the local database from npaserver
once in bulk at the start, and as they occur thereafter, so that
every client has a complete log of the game changes.

The first report built on top of this is "Star Ownership" which
shows all star ownership transitions and makes it easier to figure
out who is at war with who and who is abandoning stars for who.

Osric

And indeed that was buggy, but v2.2.4 is better. v2.2.1 didn’t load at all on firefox, and displayed wrong times in the time machine display. v2.2.4 fixes these two problems. I haven’t had any feedback on the time machine so I imagine I’m the only one using it but it’s very cool to be able to review the game states you missed when you were disconnected, and the activity reports and star capture reports really give you insight into what’s happening with the other players, like in this case of a clear star handover.

There are still bound to be bugs if you regenerate your API key. But if you generate it once all should be well. I will dig into the multiple keys cases next.

Also if you put in a vanilla youtube URL like

[[https://www.youtube.com/watch?v=GdAlCXNPlCk]]

in messaging, it will now get embedded in the message with a link under it to open in a new tab if the recipient doesn’t want to play it inline.

commit 8d550734d9fe29b48703d62e68242ebc1c31fc1a

At long last, the time display for time machine looks good.

After endless futzing trying to figure out the right approach,
I think this covers it. Time travel to a prior tick puts you
at the start of that tick, all times in the HUD display correctly
as if you really were at the beginning of the tick from the past
and you can replay and see everything update as you'd expect.

Meanwhile, enhance the time machine timestamp to be special and
know that if you're time traveling you're not really at relative
tick 0 but actually offset from the true tick. So when it is
displaying relative measures it gets to break the illusion and
show you -1h or -1 tick instead of 0 all the time.

The only thing that maybe isn't the display you'd expect is the
time to production. Since you time travel to the _beginning_ of
the historical tick, it's always 59m to production at first,
even if you know the real production time is coming up soon. This
seems OK to get all the other times looking perfectly consistent.

commit d7847eb2c3883c1b1b8fa5372a5c616d1873f8c3

Remove stray line in background.js

commit 11f2eee451e59116c6b21f8f9abdcb1ade1dcf34

Add tree-shaking in an attempt to make firebase ok.

Firebase (presumably) adds huge overhead to the extension. Tree
shaking made it small enough for firefox to accept it but there
is still work to do to fix this properly.

commit bd5c798d15052af4e7317af8a6091cc80c5262ed

Attempt to fix packagedist for firefox.

The code data URL got too long for the old sed approach. See
if this hack will fix it up.

commit cf181610680ee69735ef545b19a6f961aa0d2d3e

2.2.2

commit bac9401a8156c0e38bca377ba79afa05ac2f4a6a

Add youtube embed support.

commit d5f7ae35de119e17321c45af4630bf331031c679

Fix an infinite loop in time travel.

When a tick is missing from the history, time travel would
loop endlessly back and forth across the void that should
contain it instead of just skipping over it in the direction
the user is currently going.

Also relative times couldn't be formatted if negative; fix
it to format them as positive times with a leading -

Osric

v2.2.6 is up with a variety of bug fixes.

Now, homeworlds are marked on the map:

and the current tick number appears above the version info:

image

and you can choose your style for territory display from four choices:


image
image

and this choice is persistent.

Whiteout (recolour your empire) is now much faster, and the overall extension size dramatically shrunk fixing bugs on each of those fronts. Absolute time to next production was slightly broken by recent time machine changes and is fixed again.

commit f2164bdb4dc4beb65f66a5ba4fdb3341c961e8b0

Mark homeworlds on the map.

The eye button in the UI already pans to the user's homeworld but
it is not always obvious which star it is. Add (Homeworld) to the
owner's name so that all the homestars are easy to spot on the
map.

commit dca1dfd46555f8aef35eb7fb4116db33d7497897

Display current tick number above version.

In the same spot as we'd display unreal contexts like API merges
or time machine, show the current tick number for the real map.

commit 79b38bbd21eb2f03aa8114268b9c70a2f4398b21

Avoid needless readback of intermediate draws.

Though the eventual starSrc has to be read back in order to avoid
disturbing the rest of the client code, the individual pieces of
the sprite can be much more efficiently drawn directly into the
canvas, so avoid needlessly reading them into an image and painting
them the slow way.

The speedup on the whiteout functionality is marked.

commit adadeecfaa15febf2a096297561d4e1a650def96

Remove sourcemap to fix size problem in prod.

commit 9928ddd748c123d7d42800849348a68fde6357b1

Passing just galaxy.now wasn't adding elapsed time.

Elapsed time needs to be added to get the production time correct
when set to absolute values; in fact the prior change probably
broke all absolute value times by a little bit (the amount of time
you've been in the UI specifically).

commit ff84a0db8946b973badde926f1a88251efc2c9ed

Add a fourth territory display style.

Now the choices are: dim haze, bright haze, outlines only, and
high-contrast outlines around black mode. Hopefully one of these
will suit any user :-)

commit f70f94b88d7fc873bab80c49cfa57b056fc53b68

Add a territory display style.

Provide two brightness settings and a high-clarity outline mode
so that the user can choose the style they prefer for the territory
display. Persisted and remembered separately from whether or not it
is toggled on/off.

Osric

v2.2.7 is up focused on a few Proteus bug fixes. A known bug remains where the autoruler uses triton rules between warp gated stars.

In proteus, whiteout would recolour all players who shared your colour. Now this is fixed so it only affects your own empire. Also, if you were a circle shape, your warp gates would disappear, and that is fixed now.

In Proteus, trading costs are level^2 * 5 but were being calculated as level*15; fixed now.

The outlined styles for territory display have been changed so that the scan range bubble has a dashed line to distinguish it from the fleet range bubble.

For time travel, if there are missing ticks in your data the code is more robust to that and will let you navigate through whatever ticks you have now. Additionally the star report handles darkness better
and should work to show you increasing info in dark galaxies. There was a server side bug that was missing ticks that motivated these changes and it too is fixed now. Multiple API keys are still a problem for time travel.

commit ae7a5d335bcf50032898961640e2e0b05da7a0fc

Fix bug with fleet order colours.

The colorMap change didn't affect fleet paths any more. Fix it
up so that those render correctly again.

commit 661650e3077e97113933f33b826c777d161de7ec

Fix trading cost computation for proteus.

commit 3768e40b912c6ed6221230a62a2cd905f5cf8b3d

Use map pixel ratio to make the dashes a bit shorter.

commit 6cf39d992d4a0e649edf80269af820ef350a365b

Fix warp gates for circles.

In proteus, circles were being seen as undefined (becuase 0
is falsy) and so their warp gates weren't being drawn for them;
fix it to explicitly look for undefined and get the right warp
gate glow in all other cases.

commit 294119563ede4d9e3ce278a926e4af1543fcb145

Use a new strategy for keeping track of colors.

Instead of having different approaches for Proteus and Triton,
have a single palette that maps from the player's UID to their
intended colour and use that everywhere. Use the full_universe
order to set the color mapping correctly if it is a proteus game,
and use the default colour map (hardcoded) for triton games.

At some point, it will be trivial to change it to load this color
map from local storage, so the user can set their own colors for
any player and the approach will still work nicely for that. So
this sets up well for the longer term feature, too.

Of course this wasn't just for fun: before this proteus would recolor
everyone who shared your colour instead of just you, and that was no
good. Now, proteus recolor works properly, too.

commit 82cdd3568e6fac24b58112a719022ae2c24d3792

Update the star report to handle darkness.

Accumulate keys in the star report from each tick rather than
using only the keys from the first tick, so that as darkness
lifts the keyset gets larger. Also should have the side effect
that if you lose sight of systems, ownership is presumed
unchanged, which will be mostly right (and is the best you can
do as you can't see the activity anyway). If when you regain
visibility ownership has changed, it'll be reported as happening
then.

commit a75ee0f7e1c8384487ca625df09668e1c42bfa3b

Draw scan range with a dashed line.

When drawing outlined bubbles, use a dashed line to distinguish the
scan range border from the fleet range border.

commit 87621451289cff8c2236a7d0cd063fc97853c2ae

Make time travel more robust in the face of missing ticks.

The server side is having a problem where we are dropping lots of
ticks and the client wasn't prepared for that. Now it more robustly
skips over tick#s where no data are available making it possible to
at least review what you have even if the data store isn't perfect.

Osric

v2.2.8 is up with what might be a working version of the historical time machine! It’s tremendously fun to play with … please give it a shot!

The main changes in this version are that historical data for any API key that has been messaged to you in in game messaging is accumulated for you, and used to power the time machine’s view of the galaxy, so that when you step through time you can see all the information that was available to you for that tick in the past. If no data are available, it will tell you the tick you have navigated to has missing data in the lower right corner of the HUD. Using the hotkeys control-, and control-. you can step through the entire game if you generated your API key at the start.

This release also contains two Proteus bug fixes: one where a fleet arriving on a system would sometimes show “NaN” ships if another fleet was departing from there at the same time; and another to fix the autoruler for the changed warpgate rules in Proteus.

A help button has been added to the top of NPA UI and a help entry in the dropdown too, since it was rather hard to find the help before.

In the past when you merged scan data if you had very recent new orders of your own they would disappear from the display. The new merge code avoids doing this so you can
always see your own most recent orders and warp gates.

Players who have conceded are no longer listed among your allies.

Finally, on the galaxy upgrade screen requests do not actually get issued as you click the hyperlinks. There is a 5 second grace period where requests are batched and if you reload they will be lost. Display the 5s countdown in the HUD in the lower right so that you either know to wait for your requests to actually take, or you can reload if you have made a misclick to “undo” the mistake.

commit 1d15d4af1999fefdefd619add3a88dd0d5526eee

Have the time machine report missing data

commit 8adba2198c72cd9969735706ca3a1a647e533430

Fix : hotkey to say shift-; so it formats the button

commit 7c3e49e0daf9a402881954551789e789de15bd30

Add a help button to NPA UI.

commit 5bccedeecda8079507b0d7a6510c84731d307579

Don't merge your own scan data.

Since the scan cache doesn't show you all the orders you know about,
merging everyone's keys would lose track of your in flight orders and
show you stale data about your own empire. Change the merge code to
recognize if you're not in time machine and not merge your own data,
so that merge all shows you the full state that you have including
orders other people can't see.

If you want to be sure of what others can see, use the view link
on your own API key to see what that is serving to others.

commit fec033ce17473672844c3d270588818ee15a4552

Make time travel to merge all known scan data for historical ticks.

So control-left and right didn't seem to work so now it's c-,
and c-. as those keys usually have < and > printed above the
punctuation.

Change time travel to find all scans for the desired destination
tick and merge those into the display. This default seems the most
desirable as it shows you all the historical data you have for any
given tick.

commit e3099e236b0bce24d412f230bcb2badc345b5275

Gather history for all known API keys.

Using the new inverted index, gather history for any API key
that was sent properly formatted in an in-game diplomacy message
and present that info in the key report (k`).

Next up, these keys can get automatically merged by the time
machine so that you see as much game state as possible during
time travel. Also change the time machine hotkeys from left and
right arrow to Control-Arrow keys to avoid clobbering the arrow
key functionality in empire view.

commit 779142ee1b50597e55d5bec0052c42d88b30a1bf

Reshow ruler toolbar to force it to refresh on %.

commit 7e81356f99b913cc19330600a34729970dbc4155

Build an inverted index on all diplomacy messages.

Build an ivf on diplomacy messages, and as a proof of concept use
it to console.log all the API keys this user has seen to the
javascript console. This can become the basis for recovering from
regenerating your API key for history as well as enabling the
tracking of all shared API key history for the extension, fixing
the one major bug with the time machine at the moment, which is
that it can't handle regenerated API keys, and adding the one major
missing feature, namely the ability to use the time machine with
merged keys.

commit 1866aa00d2cbca31a6807e8115ea2b5c2aecc714

Remove old duplicates from game_diplomacy cache.

While starting to index diplomacy messages, decided that I should
fix stale entries in the cache so that actively commented threads
don't appear multiple times in the list.

commit a2f0d30b913194a07424bb1b43c7d9e088f5e9d6

Second version of message comment caching.

I think I got all the edge cases this time, loading only those
messages the DB is missing and always loading the full message
set for never before seen threads. So the DB should now have a
complete record of all game diplomacy ready for use.

commit 4008914c33e9317c4755f4084f338cd3167b980b

First version of diplomacy caching.

With a probable bug where if you start using NPA mid-game the cache
will exclude comment thread history for threads > 10 messages, this
first implementation will cache all diplomacy in the database so
that it can later be searched for various features.

Built on top of the same infrastructure as the event cache, with
one 'group' per message key, this should work neatly to enable finding
old API key or searching messages to find that hard to find thread.

commit 93912c450cdcc606285baf451c8fdaad690385a6

Make updating events use the correct date.

When a message header has been updated, don't use the creation
timestamp, use the activity timestamp. Failing to do so causes
needless cache misses based on original message order, but doing
it this way hits the cache as expected.

commit ac6ea7fe4d66de1761b234cf1730983995a9b393

Update event/message caching to handle messages.

In the event log the entries are immutable, so it is OK to rely
on the key alone to disambiguate where the overlap is and use set
on the db to verify that each new incoming record is in fact new.

On message threads, the top level event that contains the thread
is mutated each time a new comment comes in. There is an activity
timestamp and a comment count either one of which could be used
to detect this situation. Use the comment count to accept duplicate
diplomacy events and write the with put() so that the database will
update calmly whether it is new or an update.

As a result of this change, the client now has the entire game
event history and the header message of every thread. What remains
is to also cache and index the comment messages to enable a whole
host of messaging based features.

commit 043ddfc16a5ab98acb5ee72709124bfaab28cdbd

Proteus doesn't have fractional ships defined.

In 03b98bb7 I had found one instance of this problem but missed
this one; this time I checked for all stars[k].c and fixed the
one I missed.

commit 2b5bfc6d947d4b73bfa094056fcfe1b5a5852e3b

Filter out conceded players for reports.

Don't show conceded players as allies for trading and research
reports.

commit 081a673cabf01c5380e4b65e6aa897ea37d37887

Display batched requests to the user in the HUD.

Unbeknownst to many users, when upgrading econ, industry, or
tech orders are batched for 5s and it is possible to cause them
not to be delivered by, for example, closing the tab. Show the
pending orders in the HUD so that the user can choose to wait.

commit 42584017e29d7e3fb812a19641e15483385ea4c7

Fix darkness for exploration phase.

In a similar issue to darkness for star ownership, avoid showing
stars that are unknown as 'Abandoned' at the start.

commit c912c6ee1b3898fed24adb0349c5b3b30c4a2918

Fix autoruler for proteus warp gate rules.

Osric