6th of December presents: a new ice age
-
Ho, ho, ho everyone.
Tomorrow large parts of Europe fancy St. Nicholas. And I hope you got out your boots out already, because he will be bringing presents.
But is it really St. Nicholaus? Or is it Santa Claus? This ancient debate will never be settled, but this time... it's neither, because:

Why are we still riding this dead horse, you might ask? Actually there's 2 reasons.
- The faf-pioneer, the designated replacement of the java ice adapter unfortunately showed not the massive improvement we were hoping for. Users complain about lags, connection issues or WebRTC generally not working in Russia. So we would be trading one issue for the other.
- With the power of Claude, it is easy to make any changes to the ice adapter. But there was absolutely no way to verify whether things actually improve.
Enter the little helpful elves from the Curtin University in Australia. Organized by @legendofthestars we kicked of multiple FAF related student projects, that all have been finished by now. Next to a new clan management solution (still to be integrated) and the new FAF user control panel (still to be advertised), the hardest project was the FAF test harness. This project created an application that behaves similar to the Forged Alliance game in terms of network connectivity and allows setting up scenarios like lost connections, packet loss etc.
Finally we had the capability of testing the ice adapter and a larger scale and as a result, I throw Claude at it to built a large battery of close-to-real-world tests.
As a result, Claude identified 3 confirmed bugs in our underlying ice4j library ([1] [2] [3]) - one of them causing a DDoS-alike pattern against our own servers.
So what did we change? Claude wrote you a summary!
Connecting at the start of a game
- One lag spike at the start could cut you off from the relay servers for the whole game. When the adapter starts, it measures the ping to the relay servers and ignores the "slow" ones. A single spike at that moment (map download, Wi-Fi) or simply living far away could get all of them ignored. Anyone you could only reach through a relay then never connected. Now the relay servers are always kept as a fallback.
- Blocked ping slowed down connecting. If your network blocks ping (some routers, firewalls, countries), the adapter waited up to 4 seconds for an answer before starting to connect. Now it waits at most 1 second.
- A slow TURN server could stop you from connecting at all. The adapter waited only 6 seconds for the other player's reply. Under heavy server load or on a slow line that wasn't enough, and the adapter retried forever without ever connecting. Now it waits longer (up to 24 s) when replies are slow, and goes back to quick retries once they're fast again.
- PCs with many network adapters connected slowly. VirtualBox, VMware, Hyper-V/WSL, Docker or Bluetooth all add "virtual" network adapters. With enough of them, the first connection attempt to every player failed, costing about 18 seconds per player. Now the adapter skips adapters that belong to virtual machines, containers and Bluetooth.
- VPNs that players connect through, like Radmin, Hamachi or ZeroTier, are still used.
- The log lists every adapter and whether it was used or skipped.
- The new option --all-network-adapters turns the skipping off. (Needs to be added to the client yet)
During the game
- One hiccup kept you on the relay server for the rest of the game. After a short disconnect, every reconnect attempt used fewer connection types, until only the relay was left, even when a direct connection would have worked again. Now each reconnect tries everything again and goes back to a direct connection when possible.
- Reconnects that could never succeed. After a failed attempt the adapter sometimes sent the other player an empty list of ways to reach it, so the reconnect was doomed. That can no longer happen.
- Silent dead connections between dual-stack players. With both IPv4 and IPv6, the adapter could send game data down a different path than the one both sides had agreed on. The other side threw that data away, the connection looked dead and didn't come back. Now game data always goes over the agreed path.
- Garbage data sent to the game. During a reconnect, a leftover chunk of old data could be passed to the game, which caused "message too long" errors. Fixed.
- Broken ping display. A malformed packet could mess up the adapter's latency measurement for a player. Now such packets are ignored.
- Lost connection to your own game. In rare cases, such as an error while reading from the game or the game being restarted, the adapter quietly stopped passing your game's data on while everything still looked connected. Now it handles this properly.
- Faster detection of a dropped player (configurable). How long the adapter waits before declaring a silent player "gone" (10 seconds by default) can now be set. That's the time everyone else is frozen before the game offers to continue without that player.
Starting and closing
- The adapter kept running after you closed the client. It sometimes didn't notice that the FAF client was gone and stayed in the background. Fixed.
- Crash when the client closed while a game was starting. The adapter's info window crashed instead of showing up. Fixed.
- Smoother handling of relay servers. An update of ice4j, the connection library underneath, fixes a freeze when closing connections and stops endless retries on relay-server errors. Closed games now release their slot on the relay server right away instead of keeping it until it times out.
Behind the scenes
Most of these bugs were found with a new test lab. It simulates players behind different home routers, mobile carriers and strict networks, with lag, packet loss, disconnects and changing IP addresses, in lobbies of up to 16 players. This lab now runs automatically on code changes, so these problems shouldn't come back unnoticed.
How good will connectivity get?
Unfortunately I can't promise you anything. I had my machine running ten thousands of connection tests for many many hours. But it's only virtual machines on the same machine where the network is not flaky.However, the errors that we already found were real. So there should be some kind of notable improvement at least.
So how/when will you get it?
Here's more good news: If you are on the latest FAF client, it automatically pulls the latest ice adapter for you. No more bundling of FAF client releases with ice adapter releases.So how will we continue from here?
The ice adapter is still a stinking pile of architectural garbage that nobody wants to touch. But now we can finally test things and avoid making thingd worse as some release in the past did. This hopefully the game changer we were waiting for.The pioneer will not die. Due to architectural reasons its the only way Galactic War can work right now. But we might try to merge some approaches. The first step there is to migrate this new testing capabilities to the Go side of things.
The ice adapter might be massively refactored with Claude. But improving connectivity first was the more important task for now. We also might add new telemetry, logging and debugging features in the near future. (For example the pioneer can upload logs directly to the FAF servers - a very powerful feature).
How can you help?
Give feedback! (We will open a general feedback thread in the general forum soon)With Claude we finally have unlimited capabilities to actually read the logs! Before that it was basically impossible. So if we have some tester groups here that play together and encounter connectivity issues, then send me logs from all players!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login