12 ms·
Old school RPG style map in HTML5 canvas using websockets.
Works in firefox or chrome, chrome only for websockets. Flickers bad in firefox.
http://rp.eliteskills.com/html5.php
- timruffles 16y agoGreat work!
- JimmyRuska 16y agoHere's source http://github.com/jimmyrcom/websockets-RPG-map-thing http://github.com/jimmyrcom/websockets-RPG-map-thing Gotta fix the flooding issues, there's still something that can make it crash too.
- dan11 16y agoYeah, that's me. var a = 1; function d() { $('#say').val(a); say(); a++; } setInterval("d();", 100); Not exactly hard.
- JimmyRuska 16y agoIt 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.
- dan11 16y agoI'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.
- daralthus 16y agoJust 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.
- user24 16y ago> 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.
- user24 16y agobetter: javascript:var a=prompt('message to spam');setInterval(function(){$('#say').val(a); say();},100);
- revoltingx 16y agoShould 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.
- JimmyRuska 16y agoI 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
- revoltingx 16y agoAh ok, perhaps if you add microsecond information?
- chipsy 16y agoWorks fine in newest Minefield.
- glhaynes 16y agoVery cool, "Webmaster". Thanks.
- messel 16y agoInteresting 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 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-optional-feature/ http://www.victusspiritus.com/2010/04/09/choice-is-an-option... Just wanted to say thanks for your input.
- glhaynes 16y agoHey thanks, I appreciate it.
- agentultra 16y agoHere I was expecting some hexes and cryptic symbols... Neat. Good job. :)
- swannodette 16y agoSorry for being slow, how is websockets being used here?
- labria 16y agoFor the chat and transmitting player movements.
- swannodette 16y agoAhh I wasn't seeing anything under Chrome 6 or nightly WebKit.
- messel 16y agoHey 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?
- JimmyRuska 16y agoJust view source, it's not obfuscated. If there's interest I can post the erlang code for the server on github.
- skorgu 16y agoPlease do.
- elliottcarlson 16y agoWould love to see the source for this on the server side - really slick!
- labria 16y agoDid you draw the sprites yourself? Or is there a open collection somewhere?
- sarenji 16y agoThe 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 http://en.wikipedia.org/wiki/Chrono_Trigger
- JimmyRuska 16y agoTiles 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
- labria 16y agoI 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.
- jacquesm 16y agoIt doesn't 'flicker' in firefox at all, it just shows a steady image with a message that I should use chrome.
- fookyong 16y agothis is awesome! would love to see it on github :) edit: oh and FYI works great in Safari too
- ritonlajoie 16y agoclicky http://rp.eliteskills.com/html5.php http://rp.eliteskills.com/html5.php
- ritonlajoie 16y agoPretty cool, reminds me of Landstalker (but not isometric) on Sega megadrive. But I could not go past the first screen ?
- dmix 16y agoIt's ChronoTrigger from SNES (and later PSONE).
- user24 16y agoTeleport: javascript:void(you.y=1); javascript:void(you.x=1); (enter into browser addressbar)
- mikepurvis 16y agoAny 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.
- cnlwsu 16y agoNo XSS checking on say. Amazing though I love it.
- deleted 16y ago[deleted]
- paulitex 16y agoComment 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. */
- zavulon 16y agoThis 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 ..
- aupajo 16y agoChrono <3
- revoltingx 16y agoCool, and powered by Erlang too. Neat. I've been working on my own MMORPG using Erlang (http://developingthedream.blogspot.com/ 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.
- robwgibbons 16y agoYou'll be waiting a pretty long time.
- jorisvoorn 16y agothis looks really cool, history repeats itself in the future :)
- gilbax 16y agoGreat 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.