
TANX: online multiplayer tank battle using WebGL and Node.js - MayorOfMonkeys
http://tanx.playcanvas.com/
======
angersock
Assuming that it's full of HNers... _y 'all_ are terrible at this game. Move
and shoot, folks. Move and shoot. Control items.

Jeez, it's like you've never played Quake or Soldat before.

~~~
pmontra
It's very difficult with a touchpad unless one is left handed. Keys on the
right, aim on the left: bad for the 90% of us. I should look for my mouse. I
know I have one somewhere.

~~~
Too
It's not only hard, it's impossible to play with my touchpad. It has some kind
of anti-interference detection so that it can't be moved/clicked shortly after
typing on the keyboard, "smart-check" they call it. This "feature" can't be
turned off completetly! It just has a slider going from min-max where max
requires almost one second delay after typing and min only prevents
simultaneous motion/typing, which is what you need if you want to move+shoot
simultaneously in this game. Lenovo+synaptics crap.

------
bch
Memories of BZFlag...
[http://en.wikipedia.org/wiki/BZFlag](http://en.wikipedia.org/wiki/BZFlag)

~~~
jjoonathan
And bolo!
[http://en.wikipedia.org/wiki/Bolo_%281987_video_game%29](http://en.wikipedia.org/wiki/Bolo_%281987_video_game%29)

Speaking of which, the Bolo guy went on to do the multicast DNS stuff at apple
(Rendezvous/Bonjour/MyMacBook.local). I was just paging through the RFC the
other day. Small world!

~~~
justsee
Ah bolo - so many schooltime lunches engrossed in the magic of network gaming.

It was nice to see it got ported to Windows / Linux too:
[http://www.winbolo.com/](http://www.winbolo.com/).

And of course, JavaScript:
[http://stephank.github.io/orona/bolo.html](http://stephank.github.io/orona/bolo.html)

------
imaffett
Playcanvas is doing amazing work with WebGL. The Mozilla team showed off a
version of this at GDC -
[https://www.youtube.com/watch?v=dVAw_an6NBQ](https://www.youtube.com/watch?v=dVAw_an6NBQ)

Check out the SeeMore demo Will and his team were showing off at GDC -
[http://malideveloper.arm.com/demo-
showroom/gaming/seemoreweb...](http://malideveloper.arm.com/demo-
showroom/gaming/seemorewebgl/)

------
ehmorris
I found steering a little confusing since it's not correlated with the current
direction of the tank, but still very fun.

~~~
Retr0spectrum
Yeah, it seemed especially un-natural for me since I've spent so long playing
tanktrouble.com

------
dubcanada
The shooting is a little weird, I fired several times at a tank, and the
bullet went right through him. And other times I fired and completely missed
and he got hit.

~~~
daredevildave
That's network gaming...

~~~
sebular
A well-written game can account for lag and prevent those kinds of glitches
from happening...

~~~
atomical
There isn't browser support for UDP. This makes glitches much more likely.

~~~
shurcooL
There is, you can use WebRTC Data Channels to achieve it. It's not trivial,
but it's possible.

~~~
mrmoka
WebRTC is not supported by Apple platforms nor by most mobiles where this
problem is most visible. Solution would be to have servers on local data
centres as well as good implementation of dead reckoning. Although networking
code been written in less than 8 hours initially, and since then not reviewed
:)

------
ffn
Hey this is awesome! Really love your grid. Any chance you can share with us
what frameworks you used? I'm particularly interested in what you used to
build your 3d grid.

~~~
mrmoka
Thanks. We've used PlayCanvas free tools (editor) and node.js for server-side
code. Check out here: [https://playcanvas.com/](https://playcanvas.com/) and
source code of client
[https://playcanvas.com/project/45093/overview/tanx](https://playcanvas.com/project/45093/overview/tanx)
as well as server code:
[https://github.com/Maksims/tanx](https://github.com/Maksims/tanx)

~~~
curiously
what's the license behind this? can I fork it to create my own spin on it or
contribute to this project?

~~~
mrmoka
It is MIT, do whatever you want with it. You contributions would be really
appreciated! If you have questions, feel free to mail me: core[at]moka.co

------
mizzao
I open this (Chrome, Linux 3.18) and just get the two carets on an orange
background. WebGL works on other sites. Broken?

~~~
TD-Linux
Firefox Nightly on Linux, I get this in the console: uncaught exception: Error
loading script from '[http://apps.playcanvas.com.s3-website-eu-
west-1.amazonaws.co...](http://apps.playcanvas.com.s3-website-eu-
west-1.amazonaws.com/hsrBBBIB/d26b395fwzu5fz.cloudfront.net/3.2.3/keen.min.js')

~~~
mp3geek
Basically when they decided to host it, they forced the tracker "keen" to be
used. Its fixed now, but forcing trackers on users seems very negative.

~~~
mrmoka
It is free and open project, and made as experiment for users to play. It is
reasonable enough to collect simple data about interaction with game, in order
to identify how to improve it and get experience that we keen to share with
anyone.

------
jarrettch
Really enjoyed this! Although, I did get killed right away after spawning.
Maybe make the spawn zone a temporary safe zone while new players figure out
the controls or so current players can't camp out?

------
nsxwolf
Pretty awesome overall, hit detection kind of sucks though. I thought I had to
lob my shells at first.

Looks like 60fps, on my new low end Mac Pro. Is there a frame counter?

~~~
drhayes9
I was thinking the same thing but I chalked it up to lag.

------
kf5jak
Doesn't seem to be loading for me. Just the PlayCanvas logo. Not seeing any
errors in JS console. Using Chrome Version 41.0.2272.104 (64-bit).

EDIT: Tried another game from playcanvas.com and I get a banner saying 'This
page requires a browser that supports WebGL.' However, it is enabled.

This is just an FYI for the developer, but is probably just a problem on my
end.

~~~
lvs
So, you probably have hardware acceleration turned off in the settings, or
else chrome doesn't like your graphics card driver and has disabled webgl.
Check chrome://gpu

------
roybarberuk
5.4.3.2.1.0 but then nothing happens :(

~~~
MayorOfMonkeys
Try again.

------
nogridbag
Cool game, but it's hampered by the 3D and controls (tank takes too long to
change direction). If this was a 2D top down shooter it would be much better.
Everyone playing appeared to be clueless. My last match was 28 kills to 0, 0,
0 before I got a phone call ;)

------
nni
those glow effects are sweet - the whole thing is inspiring and motivating

------
aceperry
Wow, doesn't do anything. All I see is a playing field with the orange
rectangle in the center. Wish there was more to it.

~~~
mrmoka
Server went down, should be good now :)

~~~
aceperry
Thanks, was down for a long time. Now I have to figure out how to play it. :-)

------
jsd1982
Damn you, GUEST!

------
ianstallings
This was fun. The only thing missing was a chat for some _smack talk_ because
I just _OWNED_ a couple people.

l2p noobs ;)

------
fit2rule
Great work! A bit monotonous after about 30 seconds, but definitely a neat
demonstration of what can be done ..

------
bvanvugt
This is an amazing experience and a ton of fun.

I loved being instantly put into a game. I was able to immediately recognize
that I was on a team and dive face first into the battle.

Sure, the controls and hit detection are a bit flakey, but experiencing this
for the first time was a lot of fun. Great job :)

------
stevedekorte
cool graphics - would prefer all keyboard controls

------
wazoox
Non US keyboard + trackpad = hopelessly unplayable. Please, needs controller
settings :)

------
tlarkworthy
The general who is skilled in defense hides in the most secret recesses of the
earth

\-- Sun Tze

(attack from underneath)

------
rihegher
It miss key configuration panel for people who doesn't use qwerty keyboard

------
Trumpet6
The shield is completely OP, camp that and you'll win every match.

------
groby_b
My first reaction: This is #@$)( _@#, totally $_ (#)$, hit detection is
broken.

That means it's an awesome game, I just hate losing. Congrats to the makers
for sinking an hour of my day! ;)

~~~
seivan
Network lag?

------
Globz
very neat! Love the game! great work!

~~~
mrmoka
cheers! what you would love to see in this game implemented?

~~~
Globz
A chat would be great! And a way to pick our team without creating a stack
team, probably balance out the availble spots and restrict stacking.

------
nsxwolf
I don't know if the developer has been tinkering with the game since I first
played it, but the tanks move at a snail's pace now.

------
touristtam
need gamepad control if not implemented already :D

------
danielweber
Why do some tanks look much larger than others?

~~~
MayorOfMonkeys
Perspective? :)

------
tvararu
Opened this on my iPhone and it started running at 60 FPS with on screen
controls and everything. Holy.

Brilliant.

------
Mikeb85
Wow, it's actually pretty fun. Can't wait for the next generation of browser
games.

------
borgia
Was the sound flaky for anyone else? It was pretty erratic for me on Firefox
on OSX

------
uptownhr
I cannot go right, is "D" not bound? Where can i configure key binds?

~~~
daredevildave
Using a non-US/UK keyboard?

~~~
gknoy
They might have wanted to use 'wsad' for movement rather than arrow keys.

------
jaxn
That is much easier to play on the iPhone than on my MacBook with touchpad.

------
codezero
I'm amazed this works great on my iPhone and had great touch controls.

------
codeulike
Whats the deal with the flag in the middle, what do you have to do?

~~~
mrmoka
It's a shield, gives you extra points to handle damage.

------
danuker
You should have chat

~~~
mrmoka
Indeed.. :)

------
zaroth
Failed to load resource: net::ERR_INSECURE_RESPONSE ?

------
bencollier49
It's great fun, good game!

------
zetahunter
Looks fairly broken to me.

~~~
daredevildave
Try again now

------
pfraze
Green team rules the day!

------
yummybear
Well done. Fun game.

------
tylerpachal
Jeremy and I were carrying the orange team haha fun game!

------
dash2
DAMMIT PANZER!

------
hkon
Awesome!!

------
phaed
Been killing everyone hahahah.

------
gocard
omg, i just owned a bunch of you guys. l2p noobs

------
curiously
holy hell that is one of the most fun multiplayer game I played!

would love to know more about the engine and development process.

this is what games should be. just hop in and play. no bullshit sign in with
your facebook or earn dumb achievements or buy textured guns for money etc.

~~~
MayorOfMonkeys
The engine is PlayCanvas. It's an open source game engine. Check out the repo
on GitHub here:
[https://github.com/playcanvas/engine](https://github.com/playcanvas/engine)
There's high level editor tools (kind of a blend of Google Docs and Unity)
here: [https://playcanvas.com/](https://playcanvas.com/)

~~~
curiously
Interesting...so does it only work on modern browsers?

~~~
mbrubeck
Yes. Most importantly it uses WebGL, which isn't available on any versions of
IE before IE11:
[http://caniuse.com/#feat=webgl](http://caniuse.com/#feat=webgl)

List of officially-supported browsers:
[http://developer.playcanvas.com/en/user-
manual/introduction/...](http://developer.playcanvas.com/en/user-
manual/introduction/#supported-browsers)

~~~
curiously
can I contribute to this game or fork it? God I can't stop playing it!

~~~
mrmoka
You can indeed, feel free to do so. Here is source of server side code:
[https://github.com/Maksims/tanx](https://github.com/Maksims/tanx) And here is
client side:
[https://playcanvas.com/project/45093/overview/tanx](https://playcanvas.com/project/45093/overview/tanx)
And my email if you want to contact directly: core[at]moka.co

------
curiously
I played on the blue team for the last 15 minutes or so...one like 10 times

spawn kill is a huge flaw in this game. for example, i just lurk around the
spawn and just kill anything..

------
johntaitorg
At last, someone has found a use for the world wide web!

~~~
mrmoka
That is very amazing thing to hear.

