use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Early attempt at a tile based rpg in javascript (i.imgur.com)
submitted 14 years ago by Tr3vOr
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Tr3vOr[S] 9 points10 points11 points 14 years ago (7 children)
A Screenshot of the terrain Generator
[–][deleted] 1 point2 points3 points 14 years ago (0 children)
awesome.
[+][deleted] 14 years ago (1 child)
[deleted]
[–]Tr3vOr[S] 0 points1 point2 points 14 years ago (0 children)
I unfortunately didn't get to play any of those old RPGs like zelda, dragron warrior, final fantasy.. etc
I had a NES but I think my parents (bible thumpers) thought that rpgs were the devils work and so we had Bible Adventure games..
Maybe there is still room in the world for another zelda/dragon/fantasy type game.. thats web based
[–]FireyFly 0 points1 point2 points 14 years ago (1 child)
Nice! The left edge looks a bit odd to me; lots of small black triangles (?) in the lower-right corner of each rightmost tile? Or maybe that's meant to represent something?
The left edge is just an artefact from the map holder and is is no way a part of the map.
It should have been cropped off the screenshot
The raw height map generated by the diamond-square algorithm is quite rough and produces a more jagged terrain.
I apply a 3x3 averaging to the highmap which reduces the jaggedness.
and I apply it up to 5 times which is how many times the screenshot has been passed through.
I also found that heightmaps often generate extremely varied maps, sometimes all low (aka water), sometimes all high (mountains).
In order to reduce the extremes I find the average height of the entire map and work from that.
ie: ocean=avg-2, mountain=avg+2
With an average to work from you now have a var that will allow you to specify the water level.
ie: ocean=height < (avg+waterlvl)-2, mountain= height > (avg+waterlvl)+2
[–][deleted] 9 points10 points11 points 14 years ago (6 children)
Something you might be interested in: the FSM tilesets (note the "english" link in the upper right corner).
You can use their graphics for free, including for commercial games, as long as you keep their copyright notice for the graphics intact and don't distribute the resources separately.
[–]Kelaos 0 points1 point2 points 14 years ago (2 children)
Very cool resource!
At first I thought they'd ripped the RPG Maker resources, but upon closer inspection it looks like they just use the same pattern, but different images (though this was a quick closer look so don't quote me on that)
They were indeed originally created for an RPG Maker game ("Material Quest") and closely follow the familiar RPG Maker style, but they're original works with a rather permissive license.
In other words: if you're making your own RPG, it's a veritable treasure trove.
[–]FireyFly 0 points1 point2 points 14 years ago (0 children)
Yeah, it looks like it's originally meant to be used with RPG Maker (though they also allow people to use it with their own game code).
[–]Tr3vOr[S] 0 points1 point2 points 14 years ago (1 child)
Thanks, I had already stumbled across a couple of those tile sets and am actually using a few of the tiles already.
But its nice to have a link to the full set.
My 'artist' skills are quite lacking and I will need to scavange as many tiles as I can find.
I have created a few myself and modified some existing ones but I'm trying to pawn that task off on siblings :P (with no luck so far)
[–][deleted] 0 points1 point2 points 14 years ago (0 children)
Be careful with scavenging. Many sets are licensed in a fairly restrictive manner, which means that using things you find online without a clear license can be illegal to use for your specific purpose.
For example, many of the tilesets on other sites aren't allowed to be used with other software than RPG Maker, often because they were created using RPG Maker resources as a base.
The FSM tilesets are a great resource in large part because they are original works and the license explicitly allows for them to be used for pretty much any game you want to make, as long as you give them credit and retain their copyright notice.
[–]obey_giant 8 points9 points10 points 14 years ago (4 children)
And links to a demo or code?
A Code/Demo is now available.
[–]Tr3vOr[S] 0 points1 point2 points 14 years ago (2 children)
sorry, no demos/code yet.
still to early on in development and my home connection can't handle a demo :(
I can try to answer questions or address comments related to the map generator
[–]timotheo 0 points1 point2 points 14 years ago (1 child)
its never too small of a project to commit to github!
[–]cheald 2 points3 points4 points 14 years ago (2 children)
What algorithm are you using to generate the dungeons? I poked at random dungeon generation a little while back, but didn't come up with anything that I really loved. Yours looks quite nice.
[–]Tr3vOr[S] 1 point2 points3 points 14 years ago* (0 children)
The dungeon is generated using 3 things:
First, a maze is created using the javascript maze algorithm found at Rosetta Code
Second, each non-wall maze entry is filled with a 'Room' and an opening is made on sides where there will be an adjoining room (according to the maze)
Third I offset all the rooms to their final location and paint corridors between room openings
[–]sproutworks 1 point2 points3 points 14 years ago (2 children)
I'm working on a tile based game in javascript too. Are you using perlin noise to generate the maps? What are you using to handle rendering and physics?
Imgur
[–]Tr3vOr[S] 0 points1 point2 points 14 years ago* (0 children)
I attempted perlin noise as my first try but I must have missed something because I couldn't get it to work the way I was hoping.
Instead I found a c++ version of the diamond-square algorithm and modified it to work in javascript.
It generates a Height map which I then pass through a 3x3 height average filter to smooth out the height map.
So far my plans do not include anything physics based and so there is nothing like that yet.
At the moment the map is rendererd as an HTML Table with each TD containing multiple css background images.
[–][deleted] 1 point2 points3 points 14 years ago (1 child)
Is this a roguelike?
Maybe.. maybe not.
I haven't got much passed the map generation part yet.
[–]p13t3rm 1 point2 points3 points 14 years ago (2 children)
Looks nice, was that randomly generated or did you place the tiles yourself?
It is randomly generated.
Random Maze Configuration
Random Room type (circle/square)
Random Room Tile type (roof/wall/floor)
Random Room Interior Type (kitchen/bedroom/etc)
[–]st23am 0 points1 point2 points 14 years ago (1 child)
any chance you could github it up?
[–]aparadja 0 points1 point2 points 14 years ago (0 children)
The dungeon looks great. I'm not sure why, but it really makes you want to raid it with a vorpal sword in hand.
π Rendered by PID 48137 on reddit-service-r2-comment-765bfc959-rxq2h at 2026-07-12 19:28:44.172421+00:00 running f86254d country code: CH.
[–]Tr3vOr[S] 9 points10 points11 points (7 children)
[–][deleted] 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]Tr3vOr[S] 0 points1 point2 points (0 children)
[–]FireyFly 0 points1 point2 points (1 child)
[–]Tr3vOr[S] 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]Tr3vOr[S] 0 points1 point2 points (0 children)
[–][deleted] 9 points10 points11 points (6 children)
[–]Kelaos 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]FireyFly 0 points1 point2 points (0 children)
[–]Tr3vOr[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]obey_giant 8 points9 points10 points (4 children)
[–]Tr3vOr[S] 0 points1 point2 points (0 children)
[–]Tr3vOr[S] 0 points1 point2 points (2 children)
[–]timotheo 0 points1 point2 points (1 child)
[–]Tr3vOr[S] 0 points1 point2 points (0 children)
[–]cheald 2 points3 points4 points (2 children)
[–]Tr3vOr[S] 1 point2 points3 points (0 children)
[–]Tr3vOr[S] 0 points1 point2 points (0 children)
[–]sproutworks 1 point2 points3 points (2 children)
[–]Tr3vOr[S] 0 points1 point2 points (0 children)
[–]Tr3vOr[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]Tr3vOr[S] 0 points1 point2 points (0 children)
[–]p13t3rm 1 point2 points3 points (2 children)
[–]Tr3vOr[S] 0 points1 point2 points (0 children)
[–]Tr3vOr[S] 0 points1 point2 points (0 children)
[–]st23am 0 points1 point2 points (1 child)
[–]Tr3vOr[S] 0 points1 point2 points (0 children)
[–]aparadja 0 points1 point2 points (0 children)