
Show HN: Sparklin Wars, multiplayer Web shooter I built over 2 nights - elisee
http://wars.sparklinlabs.com/
======
elisee
I built this little Web game with Node.js, Three.js, Socket.io and various
other libs. I wrote an overview of the tech used here:
[http://sparklinlabs.com/2013/04/craftstudio-beta-release-
dat...](http://sparklinlabs.com/2013/04/craftstudio-beta-release-date-
sparklin-wars/)

If you have any particular questions about how anything was built, I'd be
happy to detail it.

EDIT: By request, I just made the repository public. It's not open source but
feel free to check it out if you want to see how it was made -
<https://bitbucket.org/sparklinlabs/sparklinwars/>

~~~
mik3y
Nice job, thanks for opening the repo.

Simple though the gameplay is, and knowing very little little about
{Node,Three}.js, I have to admit the game changed my mind a little about what
is possible in "only" javascript.

~~~
thenonsequitur
Another game in a similar vein that came up on HN a couple months ago is
<http://bombermine.com/> \-- that's the game that changed my perspective about
the possibilities for javascript MMOs.

Bombermine's source code is not open though, so it's nice the source code for
this one is open, to dig in and see the mechanics behind it!

------
mkilling
Most people just ran around team killing, and I suggest this is because they
didn't realize it's a team game at all.

Some suggestions:

* At the beginning of the screen show a message that tells the player 'You are on team RED'

* Add a message for players who are team-killing - like a huge 'TEAMKILL' popping up on their screen.

* Also add a penalty to prevent people from team-killing (like a 10 sec respawn delay)

~~~
elisee
Fair points. I already started mitigating this by disabling friendly fire for
players with -1 score (that is, as soon as a player has team killed once and
made no valid kills, they won't be able to teamkill again until they make one
legit first).

Instead of hurting players (-20 health) with friendly fire, I thought it would
be fun for teamkillers with -1 score to actually give their teammates +1
health by shooting them. I think some players have started using it as a way
to have a "healer class", which is kind of a fun emergent behavior.

~~~
mkilling
Oh I see. I was pretty confused why some people wouldn't hurt me with their
friendly fire and others would.

It's hard to tell whether the guys shooting at me were really trying to heal
me though.

------
olivier1664
Quite funny, but (being in asia) it lags. It is visible when pressing a key
and have somthing like 500ms delay before my avatar move. Maybe should you
cheat me a little and make me believe my avatar has moved (even if he will
continue to be in the butllet trajectorie and take damage).

I love the simple easy-zelda-top-view: it is easy to understand what's going
on. It has also a very good cooperative feeling: when you meet a teammate,
follow him, you will be stronger together. It's easy to understand :)

May I suggest to add a 2nd shoot (as in Realm of the Mad God). A shoot on
right click (or space) that start a a basic shoot, but finish on an explosion.
This super shoot would be limited by a long cooldown or a mana bar (or any
kind of limitation).

~~~
elisee
The server is located in France and it's all TCP (because WebSockets) so the
lag might get pretty bad. Like you say, client-side prediction would help a
lot with hiding that. Right now I'm just doing some interpolation on the
position (no extrapolation at all) so any latency > 200ms becomes quite
noticeable.

A secondary weapon would be nice indeed :)

------
PavlovsCat
I love the lack of communication, and that people have to interact and learn
through "body language". That captures one of my favourite aspects of
multiplayer gaming for me, cooperation between total strangers without any
detailed planning beforehand, so I wish there was more game elements to apply
this to and more rewards for cooperation than just killing and not being
killed (capturing a flag that spawns in the middle maybe?). But I enjoyed it
very much already, I like the lack of guide & tutorial, the learning by doing,
even the friendly fire, and hope you keep that minimalism :D

------
Udo
That was a fun start of the day, thanks so much for making this!

I always wanted to make something similar on an RPG basis but never got around
to do it...

~~~
elisee
Glad you had fun with it! :) - Speaking of Web-based multiplayer RPG, did you
try Mozilla's BrowserQuest? <http://browserquest.mozilla.org/>

~~~
Udo
No, I didn't. Ah the tragedy: everything I want to do has been done before ;)

~~~
elisee
Make your own anyway and have fun doing it :)

------
elisee
Well... the server is getting hammered and the player list is like... more
than full. Going to add some player limit to avoid ruining the game for
everybody.

EDIT: OK, server restarted, game is now limited to 20 active players, should
help with lag a bit.

EDIT: Lowered the limit to 16, improved some inefficiencies in the network
code. Looks like it's running fairly well now.

~~~
davidw
> EDIT: Lowered the limit to 16, improved some inefficiencies in the network
> code. Looks like it's running fairly well now.

Might be a fun excuse to play around with an Erlang port:-)

------
pbiggar
I spent a lot of years using wasd and the mouse, but I no longer have a mouse.
Anything you can do for us trackpad users?

~~~
elisee
I'm afraid the game is pretty much designed to be played with a mouse as it
requires precise shooting. I'd love to add gamepad support later on though,
should work well with dual sticks ([https://developer.mozilla.org/en-
US/docs/API/Gamepad/Using_G...](https://developer.mozilla.org/en-
US/docs/API/Gamepad/Using_Gamepad_API))

------
andrewljohnson
Very cool, my biggest issue with the game play was just catching on corners. I
think it could be very successful with a lot of iteration, richer graphics,
and storyline. The basic fun factor is there, which isn't true of many
commercial games.

~~~
elisee
:)

I hope to do something more serious with it in the coming months. If anyone
cares to be updated, you can follow me on Twitter at
<http://twitter.com/elisee>

------
siliconc0w
You can tell the ex-counterstrike players who bait their teammates.

------
pastylegs
It took me 3 kills to realise I was team killing! Nice game

------
creativename
I really had wayyyy too much fun playing this, for how "simple" it is. I'm
very impressed with what was possible in just two nights. Thanks a lot for
sharing!

~~~
elisee
Glad you enjoyed it, thanks for the kind words! :)

------
BHSPitMonkey
Awesome! Now just add first-person view, and a 3D map, and different weapon
loadouts, and classes, and... I may be getting carried away.

~~~
elisee
Haha yeah, there's a lot I could do: Capture the Flag mode, player skins,
Twitter/FB authentication to keep scores across games, various weapons, more
powerups, ... I'll see how it goes :)

~~~
BHSPitMonkey
> Twitter/FB authentication to keep scores across games

This is a tech demo of open web standards. Persona! :P

------
sekm
Nice work, amazing that you could crank this out in a couple of nights.
Inspirational!

~~~
elisee
Thanks :). I spent a huge amount of time working with those techs lately so
I'm pretty familiar with them. It's not like I could have done that from
scratch.

Over the last few weeks I wrote a Web player with Three.js / Lua.js to be
released with the Beta of my cooperative game-making platform (next week) -
<http://craftstud.io/>, and last year I wrote a Google Wave-like thing with
Socket.io.

~~~
tharshan09
Thanks for releasing the source code. Could you give some background info on
what the important files do? Such as the ones in the lib folder. Some methods
can be guessed from code, but it would be nice to hear an overview from you.

------
ssabev
This doesn't seem to work well on my MBP. I can't rotate with my trackpad...

------
sunnybunny
I love simple games like this, reminds me of the good ol' days. =)

------
akimc
Good job for this little game, really funny and addictive continue the good
work !

-sequel

A.

~~~
elisee
Thanks :)

------
colemorrison
Very cool!

------
hydralist
rip trackpad users

