
JavaScript Cold War simulation - simonswain
https://simonswain.com/coldwar
======
akama
The author also worked on a deep space simulator [1] which has been on hacker
news [2] before. Another very interesting simulation.

[1]
([https://github.com/simonswain/deepspace](https://github.com/simonswain/deepspace))
[2]
([https://news.ycombinator.com/item?id=8837204](https://news.ycombinator.com/item?id=8837204))

------
masswerk
For "authorized" advice, see
[https://www.youtube.com/watch?v=q2v0YuDatpc](https://www.youtube.com/watch?v=q2v0YuDatpc)
(Declassified USAF training material, 1958), alternate source:
[https://archive.org/details/AirForceSpecialFilmProject416pow...](https://archive.org/details/AirForceSpecialFilmProject416powerOfDecision)

(Amazing actors' performance included.)

~~~
simonswain
SAGE is the inspiration for this...

[https://www.youtube.com/results?search_query=sage+computer](https://www.youtube.com/results?search_query=sage+computer)

This thing was off the hook...

~~~
masswerk
I once included this video in something similar (also relating to SAGE) as the
help option, see this easter-egg:
[http://www.masswerk.at/google60/?q=list%20games](http://www.masswerk.at/google60/?q=list%20games)
(option 4)

(Edit: Similar just intention-wise, else much simpler, since just in ASCII,
meant to be EBCDIC.)

BTW: "System Technology" (SDC, 1960) is also an impressive source in this
context:
[https://www.youtube.com/watch?v=Yqu3YX2cLA8](https://www.youtube.com/watch?v=Yqu3YX2cLA8)

~~~
simonswain
Nice Easter Egg!

~~~
masswerk
On "System Technology": See esp. at 17:00, ca., this is very similar to the
view conveyed by your rendition (note the swarming aircrafts).

------
pjc50
People who like this might like the very similar PC game "DEFCON"
[http://www.introversion.co.uk/defcon/](http://www.introversion.co.uk/defcon/)

------
beefsack
This is a hot war simulation, is it not?

~~~
simonswain
Technically, yes. It's meant to escalate from cold to hot as munitions
stockpiles build.

But that doesn't make for a very interesting presentation, so it goes direct
to Hot.

~~~
larrydag
I think WWIII sim is probably a better description. Or could go with the 1985
War Games "Global Thermonuclear War". Just nitpicking. The simulation is
awesome.

------
hopfog
The creator held a talk about simulations at JSConf.Asia 2014. Highly
recommended:
[https://www.youtube.com/watch?v=0HJPilemNns](https://www.youtube.com/watch?v=0HJPilemNns)

------
graeham
Really cool - would be good to have a quick instructions drop down - I started
with clicking things and hitting keys until I realised it was a simulation on
initial conditions only.

The bombers seem too effective in anti-fighter measures, and has been said,
the sats are very effective at anti-ICBM, but seem invincible themselves?

Interesting how quickly the tide turns from stalemate to dominance once a few
factories or bases fall. And also how long it takes to really finish the
opponent off (probably my launch_max is too low).

Also interesting the 'fronts' or lines of bombers that form between
oppositions. This happens in naval and ground battle, but I'd think a major
air war, with high speed relative to density of fighters would avoid this?

Would be cool to involve some sort of strategic element? I'd hoped the
fighters would protect the bombers more, but it seems they are more defensive?

Well done!

~~~
simonswain
Yep. All that will be there one day. This is v0.1

------
gruez
Can you give an explanation about what each type of unit does?

~~~
cshimmin
Seems like:

    
    
      - circle: city
      - triangle: factory
      - square: military base
      - big plane: bomber
      - little plane: fighter
      - things with rocket trails: ICBMs
      - floaty diamond things: satellites (which shoot down ICBMs)
    

The square in the middle of each team represents the current defcon. Assuming
you start at defcon 5, when an enemy unit crosses the big blinking circle,
drop to defcon 4. When a unit crosses the next blinking circle, drop to defcon
3. I haven't figured out yet how the escalation proceeds after that.

~~~
simonswain
Bang on.

The dust coming up out of the bases (and to a limited amount, the other
assets) are ABMs, trying to take out incoming ICBMs.

Goes to Defcon 2 on enemy bombers reaching city limits (the radius Cities and
Bases are at).

------
zachrose
Yikes! Is this realistic? There seems to be a doctrine that ICBMs will only be
launched upon receiving a complete nuclear strike, and once that happens it's
pretty much game over.

This makes fighter jets a critical buffer because the only way a defense can
prevent mutually assured destruction is to prevent non-ICBM first strikes.

~~~
smacktoward
If you're looking for realism in your apocalyptic nightmare scenarios, there's
an ooooold DOS game called _Bravo Romeo Delta_ you should track down. I wrote
a little bit about it here: [http://jasonlefkowitz.net/2014/11/choreographing-
armageddon-...](http://jasonlefkowitz.net/2014/11/choreographing-armageddon-
bravo-romeo-delta/)

It's fallen into abandonware hell, so you can't buy a copy at GOG or anything
like that, but _cough_ I'm sure you could find a copy if you looked on the
right sites.

~~~
simonswain
This is awesome... so much detail.

------
guard-of-terra
Real Cold War is more of this: Two side point lethal nukes at each other, but
at a point one side falls on its face and proceeds selling factories for
scraps, while other one forgets near-death experience in a whim deriving no
lesson from it.

Not so fun to simulate mind you.

------
apaprocki
This was a presentation at JSConf US 2 weeks ago. I'm sure everyone will enjoy
it much more with the video once it winds up online.

~~~
frutiger
It wss a fun talk. My only regret is that Simon didn't use an [apropos
quote]([http://www.imdb.com/title/tt0086567/quotes?item=qt0453844](http://www.imdb.com/title/tt0086567/quotes?item=qt0453844))
during the talk.

~~~
simonswain
The BBS login at the start of the talk said: "Greetings, Simon".

------
artmageddon
Reminds me a lot of the game Defcon. I love it!

~~~
cyorir
Reminds me of Missile Command

------
lifeformed
I love the dual side/top view setup.

------
jjar
The game also becomes interesting and easier to watch the escalation by
turning it straight to Defcon 3 and then reducing the number of bombers.

This leads to skirmishes between fighters and a few stray icbm's in the
beginning, but once one hits the situation escalates extremely rapidly.

------
caio1982
This was super fun to play with and the visuals are very cool! One minor thing
though, the Star Wars program simulation seems too good: once you have around
5 sats going around you're safe for a long long time that it starts becoming
boring (and I'm pretty sure it wouldn't be the case IRL). Like, I watched a
game for 30min and all sats were too effective and nobody could really hit
each other no matter how many attacks they did. Maybe make sats attack each
other while in orbit? Perhaps only in specific timed cases, sort of during an
orbit apogee or perigee or whatever, just to make them a bit less effective or
durable?

~~~
ethbro
_> Maybe make sats attack each other while in orbit?_

Just add ASAT. If they've got ICBM technology and especially if they've got
ABMs, they can certainly knock a satellite out of orbit.

------
dspillett
Reminds me somewhat of DefCon
([http://www.introversion.co.uk/defcon/](http://www.introversion.co.uk/defcon/)).
No one wins. Try to be the one who loses least...

------
nacs
The author's Github contains the source for this:

[https://github.com/simonswain/coldwar](https://github.com/simonswain/coldwar)

------
hliyan
I wish the parameters were url parameters. Comparing simulations would have
been possible.

(I'm currently running a conventional war scenario -- bombers and fighters
only - no icbms or sats).

~~~
simonswain
Yep. Need the ability to save and share scenarios. Coming.

------
hermitcrab
Very impressive. As a crusty old desktop programmer I am amazed how smoothly
it runs in the browser. A few questions (didn't see them answered below):

1\. What Javascript frameworks/libraries did you use (if any)? 2\. Do the 2
sides always have to be symmetric?

It would be great if you could add some brief notes explaining what is going
on (even if you just copy and paste some of the below).

~~~
jjar
It was definitely something compiled to JavaScript, I can tell you that.

[https://simonswain.com/coldwar/assets/pub-
script-14324351717...](https://simonswain.com/coldwar/assets/pub-
script-1432435171707.js)

~~~
vabole
That's plain JavaScript, only minified.

------
zatkin
>Doing heavy lifting with JavaScript in IE8 is just not fun.

Please force your customers to upgrade their browser. You'll do the better
good for yourself, your customers, and mankind in general. :)

------
eclipxe
I spent an hour playing with this - very enjoyable! Would love an iOS app with
something similar. Recommendations?

------
Already__Taken
Slight bug, If there's any bombers on the field at all the other sides
fighters won't shoot any fighters.

If side A has fighters on side B. A has a bomber just launched. B fighters
just try to fly at the bomber, dieing to the B fighters.

------
janci
Joshua, is that you?

~~~
junto
Wouldn't you prefer a nice game of chess?

------
rogeryu
Reminds me of Minestorm on the Vectrex!

------
Thiz
Reminds me of Atari Missile Command.

Good ol' days.

------
romanovcode
Every time the same team wins over and over again, when I change some values
other team keeps winning all the time.

------
y0ss
Awesome!

------
anti-shill
the only winning move is .....

~~~
evilotto
To play, perfectly, waiting for your opponent to make a mistake.
([https://xkcd.com/832/](https://xkcd.com/832/))

~~~
ricree
Alternately, watch SMBC's more explicit version
[https://www.youtube.com/watch?v=TFCOapq3uYY](https://www.youtube.com/watch?v=TFCOapq3uYY)

------
lotusko
need more visual

------
ForFreedom
@simonswain - You should avoid the bright flashes when the game is over, some
people might have health issues.

~~~
vacri
Meh, the flashing-lights-in-games thing is waaaaaay overrated as a public
health concern. Most photosensitive (=~'flashing light') epileptics require
flashes in the range of ~8-18 Hz (mostly in 12-16 Hz), and even then it almost
always takes some time to build up, and even then it's a fraction of
epileptics that are susceptable. And flashing lights by themselves don't make
non-photosensitive epileptics have seizures (or non-eplieptics). Only about
15% of people epilepsy with are photosensitive. A photosensitive epileptic
will know to look away if they see their kind of triggering flash.

By the time you narrow it down to the mere handful of epileptics that will
have a seizure from one or two flashes (ever hear anyone complain of a single
camera flash and epileptics?), you're in a very rare group. At which point,
nothing is safe - I heard of one epileptic who had seizures due to orange
circles. Other colour circles were fine, other orange shapes were fine, it was
just orange circles (which mean no driving...). Another patient had seizures
when ice touched their lips. They do exist, of course, but at that point
you're optimising for an incredibly rare user. If you're going to optimise for
that, there's plenty of usability optimisations that hit way more people that
you should be doing first :)

Source: spent four years doing several EEGs on neuro patients per day, each of
which had a 5-minute session with a strobe light at various frequencies. Most
of those patients were there for epilepsy or suspicion of epilepsy, but not
all, of course. Seeing a photosensitive response at 8Hz was uncommon, but not
rare. Some people had some response to single flashes (well, 1Hz) but it never
built up to a dangerous level - I never saw someone in danger of having a
seizure from 1Hz flashes.

/rant (sorry, nothing personal, I just keep seeing this (largely) urban myth)

~~~
pjmlp
> I just keep seeing this (largely) urban myth)

It is reinforced by those warnings in all games.

~~~
vacri
A fair point - they're just doing CYA because of public hysteria on the issue.
Game designers are rarely biologists, let alone neurologists, and it's a topic
that the public knows little about :)

