News for hackers. Stuff that matters.
Re:Old school RPG style map in HTML5 canvas using websockets. by paulitex on Wednesday October 06, 2010 @01:45PM (#1764949)
Comment at top of code:

/* User beware. I don't know javascript. I read mozillas / / reintroduction to javascript, being somewhat familiar with / / actionscript 3, god knows how it ended up working. This code / / is run by tears, wishes and luck. */

Re:Old school RPG style map in HTML5 canvas using websockets. by user24 on Wednesday October 06, 2010 @11:06AM (#1764208)
Teleport:

javascript:void(you.y=1);

javascript:void(you.x=1);

(enter into browser addressbar)

Re:Old school RPG style map in HTML5 canvas using websockets. by mikepurvis on Wednesday October 06, 2010 @02:27PM (#1765161)
Any serious (read: MMO) application of this would be continuously reporting position regardless, so it wouldn't that big of a step to validate them server-side and prevent such hijinks.
Re:Old school RPG style map in HTML5 canvas using websockets. by ritonlajoie on Wednesday October 06, 2010 @11:00AM (#1764172)
Re:Old school RPG style map in HTML5 canvas using websockets. by zavulon on Wednesday October 06, 2010 @02:32PM (#1765182)
This is great. I would love to see a fully functioning old-school RPG created in HTML5 that I don't have to download/purchase CD, can just play in any browser, on my desktop/laptop/iPhone/iPad, with save games instantly available.

One day ..

Re:Old school RPG style map in HTML5 canvas using websockets. by JimmyRuska on Wednesday October 06, 2010 @11:44AM (#1764406)
Here's source http://github.com/jimmyrcom/websockets-RPG-map-thing

Gotta fix the flooding issues, there's still something that can make it crash too.

Re:Old school RPG style map in HTML5 canvas using websockets. by dan11 on Wednesday October 06, 2010 @11:51AM (#1764434)
Yeah, that's me.

var a = 1; function d() { $('#say').val(a); say(); a++; } setInterval("d();", 100);

Not exactly hard.

Re:Old school RPG style map in HTML5 canvas using websockets. by JimmyRuska on Wednesday October 06, 2010 @11:55AM (#1764454)
It does have a flood filter, your thing just spams so it gets in the post every chance. I can only make the flood count longer. That's the problem with javascript, kinda hard to prevent people from screwing around and editing it in-place.
Re:Old school RPG style map in HTML5 canvas using websockets. by dan11 on Wednesday October 06, 2010 @11:59AM (#1764474)
I'm not 100% sure how WebSockets work, but I assume it's going through your server and then sent to everyone else? Could you not do a rate limit of 5 per 30 seconds, or require at least one comment in between yours? Not sure what the best approach would be best.
Re:Old school RPG style map in HTML5 canvas using websockets. by user24 on Friday October 08, 2010 @05:54AM (#1771115)
> That's the problem with javascript, kinda hard to prevent people from screwing around and editing it in-place.

Not if you use a module pattern with private methods.

But the real problem you should be addressing, and one which applies to any internet app, is people directly sending data to the server. Whether it's initiated by JS or flash or anything is not relevant - sure it's sometimes easier to hack about with JS apps, but if you fix people being about to open telnet and spoof the raw data, then you fix all those holes at the server, and that leaves you free to entirely change the way your code works in the future, instead of having to re-code misguided security fixes.

Re:Old school RPG style map in HTML5 canvas using websockets. by daralthus on Wednesday October 06, 2010 @01:42PM (#1764935)
Just kick of the flooders. Btw you could try node.js, then run the same game code on the server too, so there will be no cheating in the game when finished.
Re:Old school RPG style map in HTML5 canvas using websockets. by user24 on Friday October 08, 2010 @05:57AM (#1771121)
better:

javascript:var a=prompt('message to spam');setInterval(function(){$('#say').val(a); say();},100);

Re:Old school RPG style map in HTML5 canvas using websockets. by revoltingx on Wednesday October 06, 2010 @05:00PM (#1765830)
Should be fairly straightforward. Simply 'save' the last time this user has posted a message. Then the next time they attempt to post a message check if the alloted time has passed and process accordingly.

I see you are using dict, so just add a record with that info and you should be set.

Re:Old school RPG style map in HTML5 canvas using websockets. by JimmyRuska on Wednesday October 06, 2010 @07:24PM (#1766264)
I do do that. "LastMessage" var of the tuple in the dict. It's not enough if they make multiple windows all spamming in a loop. Some of the messages get through
Re:Old school RPG style map in HTML5 canvas using websockets. by revoltingx on Thursday October 07, 2010 @02:14AM (#1767007)
Ah ok, perhaps if you add microsecond information?
Re:Old school RPG style map in HTML5 canvas using websockets. by messel on Wednesday October 06, 2010 @10:28AM (#1764025)
Hey that's pretty cool, is the source open? I might have some time tonight, found an error. I can fix it and pop it on github?
Re:Old school RPG style map in HTML5 canvas using websockets. by JimmyRuska on Wednesday October 06, 2010 @10:31AM (#1764036)
Just view source, it's not obfuscated. If there's interest I can post the erlang code for the server on github.
Re:Old school RPG style map in HTML5 canvas using websockets. by elliottcarlson on Wednesday October 06, 2010 @10:53AM (#1764138)
Would love to see the source for this on the server side - really slick!
Re:Old school RPG style map in HTML5 canvas using websockets. by skorgu on Wednesday October 06, 2010 @11:40AM (#1764383)
Please do.
Re:Old school RPG style map in HTML5 canvas using websockets. by jacquesm on Wednesday October 06, 2010 @10:53AM (#1764135)
It doesn't 'flicker' in firefox at all, it just shows a steady image with a message that I should use chrome.
Re:Old school RPG style map in HTML5 canvas using websockets. by labria on Wednesday October 06, 2010 @12:52PM (#1764740)
Did you draw the sprites yourself? Or is there a open collection somewhere?
Re:Old school RPG style map in HTML5 canvas using websockets. by sarenji on Wednesday October 06, 2010 @12:58PM (#1764774)
The main character sprite was ripped directly from Chrono Trigger[1], a SNES game. A lot of gamers I know consider it to be one of the best RPGs ever made.

The tiles are very familiar but I can't for the life of me remember which commercial game they are from. They're used a lot in indie games. A lot of sprites from the SNES era are. :)

[1] http://en.wikipedia.org/wiki/Chrono_Trigger

Re:Old school RPG style map in HTML5 canvas using websockets. by JimmyRuska on Wednesday October 06, 2010 @02:08PM (#1765065)
Tiles are from secret of mana 3 if I remember correctly. Chrono used just because of the sprite availability, it was one of my favorite games as a kid
Re:Old school RPG style map in HTML5 canvas using websockets. by labria on Sunday October 10, 2010 @06:37AM (#1776904)
I know that the main char is from CT, I was just wondering if someone had a free rendering of him, or it was simply a SNES rip.
Re:Old school RPG style map in HTML5 canvas using websockets. by agentultra on Wednesday October 06, 2010 @12:45PM (#1764694)
Here I was expecting some hexes and cryptic symbols...

Neat. Good job. :)

Re:Old school RPG style map in HTML5 canvas using websockets. by gilbax on Thursday October 14, 2010 @06:39AM (#1790463)
Great work ! Do you plan to expand it to a full MMORPG ? There are some great opportunities in HTML5 browser-based games, considering the ease to port to mobile devices.
Re:Old school RPG style map in HTML5 canvas using websockets. by ritonlajoie on Wednesday October 06, 2010 @11:02AM (#1764181)
Pretty cool, reminds me of Landstalker (but not isometric) on Sega megadrive. But I could not go past the first screen ?
Re:Old school RPG style map in HTML5 canvas using websockets. by dmix on Wednesday October 06, 2010 @11:06AM (#1764205)
It's ChronoTrigger from SNES (and later PSONE).
Re:Old school RPG style map in HTML5 canvas using websockets. by fookyong on Wednesday October 06, 2010 @10:55AM (#1764150)
this is awesome! would love to see it on github :)

edit: oh and FYI works great in Safari too

Re:Old school RPG style map in HTML5 canvas using websockets. by chipsy on Wednesday October 06, 2010 @12:13PM (#1764544)
Works fine in newest Minefield.
Re:Old school RPG style map in HTML5 canvas using websockets. by swannodette on Wednesday October 06, 2010 @12:49PM (#1764720)
Sorry for being slow, how is websockets being used here?
Re:Old school RPG style map in HTML5 canvas using websockets. by labria on Wednesday October 06, 2010 @12:53PM (#1764745)
For the chat and transmitting player movements.
Re:Old school RPG style map in HTML5 canvas using websockets. by swannodette on Wednesday October 06, 2010 @01:45PM (#1764950)
Ahh I wasn't seeing anything under Chrome 6 or nightly WebKit.
Re:Old school RPG style map in HTML5 canvas using websockets. by cnlwsu on Wednesday October 06, 2010 @11:16AM (#1764258)
No XSS checking on say. Amazing though I love it.
Re:Old school RPG style map in HTML5 canvas using websockets. by glhaynes on Wednesday October 06, 2010 @12:23PM (#1764580)
Very cool, "Webmaster". Thanks.
Re:Old school RPG style map in HTML5 canvas using websockets. by messel on Monday October 11, 2010 @08:27AM (#1779494)
Interesting options for this form of overhead graphics.

I was catching up on an old post and I came across your HN comment: "Choice isn't (necessarily) beauty. It's one more engineering tradeoff among others, with its own upsides and its own downsides. Giving up choice in favor of the benefits gained from doing so can be pragmatic, rational, and lead to more beautiful results.

I guess I'm just saying: don't fetishize choice. Assign it a value like the one parameter among hundreds which it actually is." from http://news.ycombinator.com/item?id=1108018

Your brief comment turned into a post for me months later."Choice is an Optional Feature" http://www.victusspiritus.com/2010/04/09/choice-is-an-option...

Just wanted to say thanks for your input.

Re:Old school RPG style map in HTML5 canvas using websockets. by glhaynes on Wednesday October 13, 2010 @12:55AM (#1786136)
Hey thanks, I appreciate it.
Re:Old school RPG style map in HTML5 canvas using websockets. by jorisvoorn on Friday October 08, 2010 @06:50AM (#1771195)
this looks really cool, history repeats itself in the future :)
Re:Old school RPG style map in HTML5 canvas using websockets. by aupajo on Wednesday October 06, 2010 @04:36PM (#1765746)
Chrono <3
Re:Old school RPG style map in HTML5 canvas using websockets. by timruffles on Wednesday October 06, 2010 @11:34AM (#1764353)
Great work!
Re:Old school RPG style map in HTML5 canvas using websockets. by revoltingx on Wednesday October 06, 2010 @04:57PM (#1765815)
Cool, and powered by Erlang too. Neat.

I've been working on my own MMORPG using Erlang (http://developingthedream.blogspot.com/) but I'm waiting for the dust to settle in the HTML5/Flash/Capuccino/etc field to choose the editor/game engine to use for the web frontend.

Bookmarked, keep up the good work.

Re:Old school RPG style map in HTML5 canvas using websockets. by robwgibbons on Thursday October 07, 2010 @03:36PM (#1769163)
You'll be waiting a pretty long time.