
The Internet Sucks: Or, What I Learned Coding X-Wing vs. TIE Fighter (1999) - rcsorensen
http://www.gamasutra.com/view/feature/131781/the_internet_sucks_or_what_i_.php
======
patmcguire
Always incredible to read about how problems were first solved. Things like

Lesson Two: TCP is evil, don't use TCP for a game...

Lesson Three: Use UDP...

and the like are all "of course" solutions now, but they weren't then. How do
you build something fast and reliable over something slow and creaky? Who
knows.

The shoulders of giants have gotten a lot taller since then.

~~~
RyanZAG
TCP is very widely used by multiplayer gaming today. It turns out you can just
tweak it a little bit and it works fine.

~~~
nhaehnle
I can confirm this, having been mostly responsible for the network code in
Widelands. We exclusively used TCP with parallel simulation (i.e., only player
actions are transmitted), and it worked just fine as early as 2007 even
without any special tweaks. There are two factors that matter, I believe:

First, Widelands is a real-time game but with a slow pace, so relatively high
latency is easy to tolerate. Second, the internet is simply more reliable
today than it was 15 years ago, especially if the bandwidth that you use is
small relative to the Mb/s connections that are common today.

~~~
mcguire
Did you use a server, rather than peer-to-peer communications between players?

~~~
nhaehnle
One of the players acted as a server, though this was actually more to avoid
the headaches associated with NAT rather than for bandwidth reasons.

------
terranstyler
I loved the series, I remember in X-Wing there was a complete campaign where
you start with hit'n'run tactics against some containers (!) and end in an
ambush and the first kill of an ISD. This storyline made you feel hopelessly
outnumbered and you just stood (flew) there in awe whenever something bigger
than a Nebulon B arrived at the battle scene. Your AI wingmen just panicked
and ran and so did you, possibly directing all your shield and weapon energy
to your engines if you were unfortunate enough to fly a Y-Wing.

Later on you could count on corvettes and cruisers that reinforced your side
(though they were always late) and you felt the tide of the war turning.

I never got that feeling again, maybe because I am older. Or maybe because DX
11.1b support is much more important for a game and story is considered
overrated.

~~~
pjgomez
I loved this series too. I even remember reading this very article back in the
day when I was learning about game development. Sometimes when I go to my old
room at my parent's house and I see the game boxes in the shelf, I am tempted
to install at least one of them and try to get back that feeling you talk
about. I never have done it because I know deep down it will never be the same

------
malbs
There is a whole generation of people who haven't played XVT and that is a
real shame. XVT has aged well over the course of time. I once dreamed of the
day LucasArts was going to release XVT for the 21st century. Once they hosed
that studio I gave up on the dream.

~~~
72deluxe
Did you ever play X-Wing or Tie Fighter? Tie Fighter was an incredible game.
You could spend days in the training simulator.

X-Wing Alliance was also exceptionally good, including Em-Kay shouting "Check
your mail!" and "There's no point even TRYING any more!"

~~~
riquito
Tie Fighter was marvellous. All in 3 floppy disks if I remember correctly.

~~~
tragic
As someone who's always hated the Star Wars movies (except Empire, natch),
I've nevertheless lost a lot of my life and worn out at least two joysticks to
Tie Fighter. Fantastic piece of work.

~~~
gknoy
I have yet to find a joystick that is half as nice as the (Microsoft!) one I
had back then. Now it seems like either the springs are too hard or force
feedback makes the dead zone all sloppy. I feel like the Goldilocks of
joysticks.

------
tsunamifury
XVT had a two fold problem, half was the poor internet implementation but the
other half was that the product didn't fulfill the genre's expectations.

Its predecessors (Tie Fight and X-Wing before it) had large, complex and well
written story lines which following engaging missions paths. This was 80% of
the game, as the graphics were relatively poor compared to sprite-based
shooters of the time.

I remember the deep disappointment of booting XVT for the first time and
realizing it had no story, and a terrible UX. I was launched into an offline
lobby and only had the option to play some very uninteresting and un-engaging
missions.

Put that on top of a completely unplayable multiplayer mode, it ended being a
poor decision to make a game based on a technology they couldn't support --
when a perfectly valid offline story mode would have made up for it fine. So
instead they charged another 49.99 on top of 69.99 for an add-on (and people
complain about IAP) that gave the features the original box promised.

~~~
pilif
If you like the space shooter genre and you like them to have an interesting
story line, then also take a look at Freespace and Freespace 2.

For me, those two are the pinnacle of the space-shooter genre, even more so as
Freespace 2 was open sourced and attracted a very large community of not just
programmers but also artists which resulted in a game that's still being
active developped with quite current graphics and sound.

You can get the game on gog.com and use the Java-based[1] installer to get the
open source engine and assets installed

[1]: [http://www.hard-
light.net/wiki/index.php/FreeSpace_Open_Inst...](http://www.hard-
light.net/wiki/index.php/FreeSpace_Open_Installer)

------
jcurbo
This is timely as I have been replaying X-Wing lately (specifically, the
Collector's Series version that uses the XvT engine, aka xwing95). X-Wing was
one of the first PC games I played when it first came out (I was in middle
school) and thus I have an endearing love of space sims. (I have high hopes
for Star Citizen and Enemy Starfighter.)

I think an interesting project would be creating a modern graphics engine that
can parse and run the various X-Wing game data files. The XvT and X-Wing
Alliance engines run ok on modern Windows but still have some compatibility
issues (graphics glitches, etc). If a modern graphics engine (written in Unity
or some such) could capture the look and feel of the X-Wing games, that would
be great. It would be even better if it was an official game and not someone's
open source project that never gets finished :(

~~~
Associat0r
Elite: Dangerous with its scientifically accurate 1:1 scale Milky Way galaxy
looks the most promising to me.

[http://elite-dangerous.wikia.com/wiki/Elite:_Dangerous_FAQ](http://elite-
dangerous.wikia.com/wiki/Elite:_Dangerous_FAQ)

------
JacobAldridge
Single page version -
[http://www.gamasutra.com/view/feature/131781/the_internet_su...](http://www.gamasutra.com/view/feature/131781/the_internet_sucks_or_what_i_.php?print=1)

~~~
arsemouflon
Thank you! Those multiple-page madness is even more rageworthy when using an
adblocker.

------
peter94707
LOL! I wrote that for a presentation at the Game Developers Conference way
back when. It was really a post-mortem, where the point is to show others what
mistakes we made so that they wont repeat them. Anyway, its kind of flattering
to see it come to life again... like some kind of Frankenstein internet cat.
Thanks to all the positive commenters, and all you haters can fall into a
timewarp and have to suffer through 28K modem hell all over again. ;) Or worse
yet, be forced to watch Titanic...

------
slacka
It took the video game industry nearly a decade for most games to come out
with network code as effective as X-Wing vs. TIE Fighter's and QuakeWorld's at
hiding latency, packet loss, and bandwidth limits. Even recently, many
fighting and RTS's games struggle on poor connections.

Until I played Killer Instinct, the only decent fighting games that I've run
across have been based on the GGPO. Judging from my own and others experience,
KI's network code is this generation's equivalent of QuakeWorld. I hope the
developers of KI publish a paper like this one, detailing their technique.

------
ggambetta
If you find this interesting, you may want to take a look at a series of
articles and a live demo I wrote on the topic of client-server networking for
games
([http://gabrielgambetta.com/fpm1.html](http://gabrielgambetta.com/fpm1.html))
which is very often cited on gamedev.stackexchange and similar places. It's
more about First-Person Shooters, but most of it applies anyway.

X-Wing, Tie Fighter (and its mission packs) and X-Wing Alliance were awesome.
XvT not so much :(

------
rosser
_We were pretty pleased with ourselves, and thought we must be very clever._

Here be dragons, my friend.

------
jamesaguilar
The article says (paraphrase) that

> On some connections one in five packets are dropped

And then shortly afterwards that

> This would only fail if two consecutive packets were dropped, and this
> seemed unlikely.

Hrm. I think I'm beginning to see the problem here, and it isn't the internet.
Still, fun to read about the battle scars of remote gaming's early days.

~~~
GauntletWizard
You've destroyed an important bit of information in your paraphrasing. The
literal quote:

> It turned out that on some connections, about every fifth packet we sent
> would just disappear into the Ethernet.

Due to the way packet-queueing works, it is actually a reasonable failure-
expectation. If the network is on the edge of congestion, a packet will be
dropped as there's no space in the queue, but another packet will be sent and
clear space in the queue before a second packet has a chance to be lost. In
many near-congestion failure modes, it is literally every fifth or tenth or
twentieth packet that gets dropped. This is actually the basis of how TCP's
congestion-control works, too.

------
mcguire
I realize this is about game development, where missions and what-not are a
major chunk of development. But still, I think most of the problems here are
basic engineering failures: if you have a big infrastructure issue, _get that
issue right before you go crazy on other stuff_. From the article:

" _We actually used the 'synchronous' version for quite awhile. It was good
enough to test with, so finishing the network code was considered a lower
priority than the other issues we needed to address at that stage of
development._"

And the result was, rather predictably:

" _When we finally came back to the network code we were behind schedule, and
that affected some of the decisions we make later in the process. And it meant
we were absolutely committed to the complexity of the missions, and the user
interface._ "

~~~
300bps
I got to the third page before I realized how clueless the person who wrote
that is.

First of all, 1999 was 15 years ago but since I started an ISP from the ground
up in 1996, I know for a fact that the Internet wasn't quite the dark ages at
that time he tries to make it seem. 28.8k modems were around in '94 and by '96
to '97, 56k were standard. And maybe I was just in a lucky area, but I had a
Comcast cable modem in 1996 ([http://corporate.comcast.com/news-
information/timeline](http://corporate.comcast.com/news-
information/timeline)).

Getting beyond that, he complains about everything. TCP sucks, UDP sucks, the
Internet sucks. A clue for anyone with introspection is when you think
everything but you sucks, it's actually you that sucks.

For an example of much more highly skilled engineers working on an arguably
even bigger engineering problem in 1996 on a much larger game, read here:

[http://www.gamasutra.com/view/feature/3094/1500_archers_on_a...](http://www.gamasutra.com/view/feature/3094/1500_archers_on_a_288_network_.php?print=1)

~~~
Rizz
One correction, the 1999 is when the article was written, the game was created
mostly in 1996 and released early 1997. Your point still stands of course.

------
cclogg
For anyone interested, this is also a great article about multiplayer
networking:
[http://www.gamasutra.com/view/feature/3094/1500_archers_on_a...](http://www.gamasutra.com/view/feature/3094/1500_archers_on_a_288_network_.php)

Currently working on an iOS project using a similar system, which so far works
great. A challenge I am facing right now is pathfinding in conjunction with
synchronous multiplayer. Pathfinding can take a decent chunk of cpu time on
lower-end devices, but you can't really multi-thread it since you need all
players to calculate the same paths on the same simulation ticks lol... so
might come down to rate-limiting the amount of units that can re-path on a
given sim-tick.

Making multiplayer games is fun lol... :)

------
TheZenPsycho
it makes me wonder if there's a way of encoding some kind of extremely
compressed lossy version of the entire game state that can patch each player's
state to be incrementally more "correct". Then on slow connections you're
still keeping positions broadly where they should be, while faster connections
will bring the game state to a more precisely correct state. How would you
create such a packet without knowledge of each player's differences?

Just a thought experiment I was having. What if the game state was represented
as a very large N dimensional vector. The most significant bits are sent until
the players report that they match. then the next significant bits. then the
next after that. Adapt the granularity of an update to the current throughput.
If a player disconnects for 10, 20 seconds their game state re-syncs smoothly
and gradually instead of in a jump cut?

------
scott_s
_It was quite common for a re-sent packet to be dropped, and we saw several
cases where the original packet and 4 or 5 re-sends of that packet would all
be dropped. We were re-sending so many packets, we were starting to exceed the
bandwidth of the modem, and then the latency would start to climb, and all
hell would break loose._

That is exactly why TCP has the "slow start" protocol. I am sympathetic to
their problems, though. I understand that the implementations of TCP they had
access to had way too much latency, and that back then, there probably wasn't
much tuning one could do on the outside. What they did is a clever hack
(message _n_ has a copy of _n-1_ ) that takes advantage of the fact that they
don't have to send much data in total.

------
Kiro
> Lesson two: TCP is evil.

Does this mean WebSockets are unusable for most type of multiplayer games?

~~~
exDM69
> > Lesson two: TCP is evil. > Does this mean WebSockets are unusable for most
> type of multiplayer games?

Yes, it means that WebSockets are unusable for _real-time_ multiplayer games
like fast paced FPS games. That may not be "most" multiplayer games, though.

If you're planning a game on top of WebSockets (or TCP), the gameplay should
be tolerant of 3-5 times the network round trip time.

------
DLWormwood
As well written as this article is, I do have a problem with its tone. The
writer seems willing ignorant of _why_ the Internet “sucks” for gaming; it was
not designed for real time small packet transmission. Most of TCP’s design, in
particular, was intended to facilitate the transmission of comparatively
sizable files over FTP, NNTP, and SMTP. Even stuff like IRC was designed not
to be so concerned about timeliness that the chatlog on each end would match
up exactly.

~~~
hapless
The internet wasn't designed for high-latency, high-compression modem
sessions. TCP works just fine over a 56 kbps leased line. It's terrifying on a
56k home modem, despite similar "bandwidth."

The leased line has 50 ms of very predictable latency and 56 kbps of very
predictable throughput. The 56k PPP session has an unpredictable 300-500 ms of
latency and a constantly varying capacity of 2.4 to 56 kbps thanks to high
noise and ugly compression schemes.

Lots of things that worked perfectly well on the relatively crude internet of
the 1980s were real pains in the ass on "high-tech" modems in the 1990s.

\--

edit: a specific example would be X11. An emacs X11 session was totally usable
on a leased line or ISDN, despite the low bandwidth, because they delivered
low latency and packet loss. It was hellish on any kind of a home dial-up.

~~~
mcguire
Don't forget the "Eternal September" effect.

During the late '90's, I was a sysadmin for a fairly major computer science
department. One of my periodic tasks, and my test of Internet health, was to
download and build gcc. When I started, getting gcc took a while. By 1999 and
later, when the Internet had been discovered, downloading gcc took several
hours and frequently several retries.

------
georgeecollins
I remember making a PC game in 1998 with multiplayer.. we had to handle 500 ms
lag in an action game! Later I worked on a game that kept three versions of
the simulated in memory (the old confirmed world, the new confirmed worlds,
and an interpolation) to deal with lag while keeping in sync.

You don't know how easy you have it now!

------
epmatsw
Their implemented solutions at the end remind me of Halo 2, where players
would slide and warp around if they were too laggy and where a bad enough
connection would boot you out into a blue screen until it recovered (or kicked
out the player with the worst connection).

------
Johnwbh
I remember loving the original X-Wing and TIE fighter games. Does anyone know
why space combat games dropped so dramatically in popularity?

------
barbs
> _When we started the X-Wing vs. TIE Fighter project, our goal was to create
> the first multi-player space combat simulator to be playable over the
> Internet._

They obviously hadn't heard of Netrek, the third multiplayer internet game
ever, first released in 1988.
[http://en.wikipedia.org/wiki/Netrek](http://en.wikipedia.org/wiki/Netrek)

~~~
fshaun
Ah, memories. My inspiration to study CS, though probably fortunate that it
was mostly dead by sophomore year, or my college GPA would have been much
worse.

Netrek's macro system was another feature I wish were more widely adopted in
games. Receiver-configurable distresses (RCDs) allowed a sender to publish
named kinds of messages ("help at location, intercepting X, ship status,
bombing planet, etc.) but receivers control the formatting. So I can set up my
client to only show your hull+fuel for general distress calls but more data
based on the kind of message.

~~~
peter94707
Actually, I _loved_ netrek... it was an inspiration! It was more RTS than
flight sim tho. But it was quite possibly the first MMO as well! I never
played it over a modem, tho, just on a LAN... which is definitely not the same
thing as a 28K internet connection circa 1999. But that game was genius, and
quite possibly _would_ have worked over slow, lossy and highly latent
connections, I never tried it.

------
jtchang
I remember trying to get this game to load with himem.sys. Ugh.

~~~
tanzam75
> _I remember trying to get this game to load with himem.sys. Ugh._

Not this game. You're probably remembering _TIE Fighter_.

 _X-Wing vs. TIE Fighter_ ran on Windows 9x and required DirectX. That's why
the article was talking about DirectPlay.

------
morkfromork
This is a 15 year old article. What has this guy done since then?

~~~
LordIllidan
[http://www.gamasutra.com/view/authors/518707/Peter_Lincroft....](http://www.gamasutra.com/view/authors/518707/Peter_Lincroft.php)

~~~
morkfromork
The last one of those games was released 14 years ago. Nothing since then.

~~~
to3m
A google search suggests he no longer works in video games.

