public/map/dungeons/originals/*/*.png do #./gdal2tiles-leaflet/gdal2tiles.py -l -p raster -z 0-9 -w none. See the script for regening the dungeon tiles here: 1 These are then all passed back through gdal2tiles-leaflet, which creates scaled tiles, these ensure that we can work with them in leaflet. If you want to skip all the steps above, these are available here. The result of all of this means I have high resolution, blank images of every dungeon in Runescape. There is a script between this and the next that I won’t go into detail about but essentially it processes all the images to have a consistent black background and center the dungeon inside of it, ensure all dungeons are too the same scale in the final result. This tool by far the longest time, but the resulting script looks like this essentially taking 5 parameters, an x y for the top left corner, an x y for the bottom right corner a label to name the map and a z index we need: 1Ĭp outputz$zIndex/$x/$y-$x.png $name/$(printf "%04d" $y)-$(printf "%04d" $x).pngĬonvert $name/*-$(printf "%04d" $x).png +append $name/row-$x.pngĬonvert $(ls $name/row-*.png | tac) -append locations/$name.pngīelow is a sample of what this looks like in the final file, see the full script here: known_spots.sh 1 Now I had my sources tiles I had to stitch together. #Create a folder for each dungeon level (Basically runescape has map layers under the overall layers I do not promote botting or any other uses this map may have, but I will say the data it supplied openly was invaluable.įrom this map I was able to write the following hacky bash script, that would get all the tiles generated from Exply’s Map and store them locally for futher processing, I did this at the highest level zoom level possible. Here is where things get more dicey, I wanted to apply the same logic as above, but couldn’t find a reliable source for a map containing all dungeons, that was until I found Explv’s Map. These tiles are fed into leaflet and hey preseto you have a map of Runescape! The Basic Tiles (Dungeons) The result of this command is a series of broken up tiles stored in public/map/genderated/.png. This command is basically just taking the downloaded osrsmap in public/map/original, -z 0-9 just means do all renderings between zoom level 0-9, -p raster says to use the raster cutting profile, -w none is just saying generate no webview. This is a python script that will take an image, then based off a zoom level and an original image file would generate the leaflet tiles. Thankfully, someone much smarter than me is way ahead, with gdal2tiles-leaflet. My initial investigations were into coming up with a way to break down the world map image into tiles, which could then be displayed on leaflet. React.js (A js framework for displaying the result).Leaflet (A js library for rendering maps).This project is based of a few key base tools, to build the map and process the data. With the goal being to make a world map for the web browser that could be just as powerful as the in game one developed by Mod Ash The tools used What is RSMapįor those not hip enough to be playing a game from 2007, Old School Runescape is a re-relase of the popular MMORPG Runescape as it was in 2007, with constant updates and a growing community, I recommend it to anyone to this day. So don’t expect any react.js explanations hhere. Which should make it adaptable to anyone else’s work and also help show the amount of work that went into the creation of it. This one might get abit lengthy, but my goal is to avoid too many ‘cut and paste code snippets’ and just talk more about how this method could be applied in any project.
0 Comments
Leave a Reply. |