Local Map Stitching Script

Forum for alternative clients, mods & discussions on the same.

Moderator: Phades

Local Map Stitching Script

Postby rilaf » Fri Sep 02, 2011 4:55 am

Hello,

I know there are some scripts that allow you to create a local map of your area but I decided to write my own since the super large map was down.

I intended this program to be very basic. It uses a single flat text file to track your images and it creates one large map out of Ender style minimap images. I intend to polish this program to a great deal yet but this is the result of my programming efforts this evening and it at least works so I figured I would get it out to you guys now.

All that said the code that I am building is going to eventually be moved to a web server and allow you to submit your maps and receive a report about which of your maps were applied to my master and where those pieces fit into the puzzle. Using the report I then provide it would allow everyone to quickly find out where they live.

HOW THIS PROGRAM WORKS

1 file is the most important. That is main.php. The most important thing to do is to update the $ender_maps variable to reflect your maps folder. Look at the example. This has been tested on and it works for MS Windows and Linux.

This program is currently setup to make "sweeps" through your maps directory. It's first sweep it runs a create_db session. It looks through your maps directories from oldest to newest and inside that looks for your tile_0_0.png it then looks at that 0_0 to make sure that it has 4 adjacent minimap images to it. Once it finds that it creates the base image/map. From that point on each time you execute the program it will look through all your maps files for matches with just 2 adjacent images. Why do I require 4 the first time? To establish a good base for your future additions of course. Why do I require 2 adjacent images to any new one in order to be added? This allows me to just automatically expand the map. I do not then have to have the user approve any changes or worry about fuzzy matches making areas inaccurate. That said if you run the program once your map will seem small. With each run after that your map will grow until it has all matches accounted for. You will need to execute it yourself it does not loop at the moment. For now it's best to schedule the program to run using either MS Windows built-in scheduler or cron on our Linux boxes.

OK ALL THAT IS GREAT BUT HOW DO I ACTUALLY RUN IT

extract the files
set $ender_maps variable
php main.php

THINGS I AM AWARE OF AND THAT I WILL BE WORKING ON

Please remember this is literally the first working release I have. I'm releasing it as is that said here is what I am looking as far as must haves to be done yet:
  • Control old and new files so you're map always reflects the most recent minimap image for a true grid. This will be done by looking at the creation time of the file and adding that to the DB along with an Active column to show if the image is in use at the moment. I will also need to implement a different file name tracking system. The idea is to make the application responsible for changes so I or you could look and see what image replaced what image in the process of execution. In order to this I will also then make all PNG files in master named <THEIR MD5>.png and the last process of the script will be responsible to build a map directory with traditional tile_x_y.png named files so you can use the map.html to view it. I will update currentsession.js when I make that change naturally.
  • Whatever else I can think of while I get it up to a web server standard and get a global map published to you hearthlings

CHANGES MADE SO FAR (Download the .zip again if you have it already to get the changes)

  • Now should execute on Linux OS's (damn \ vs /)
  • Added a run.sh for those folks to lazy to open a terminal and type php main.php ... cough me

Screen Shot Walkthrough:
Running HnHLocalMap_PHP.jpg
Screenshot Walkthrough
Running HnHLocalMap_PHP.jpg (233.34 KiB) Viewed 4793 times
Attachments
HnH_LocalMap_PHP.zip
(125.28 KiB) Downloaded 618 times
Last edited by rilaf on Fri Sep 02, 2011 10:10 pm, edited 6 times in total.
rilaf
 
Posts: 22
Joined: Thu Feb 10, 2011 7:23 pm

Re: Local Map Stitching Script

Postby Sitting_Bill » Fri Sep 02, 2011 2:12 pm

This looks cool... do you have any tips on getting the $ender_maps variable set correctly on a Mac? I think its probably very similar to Linux. I've tried setting it to '~/enderMac32/map', 'enderMac32/map', '../enderMac32/map' and all of the above with $ in front (like in your example) but that doesn't seem to work.
in game character: Gunnar of Hlidarendi
Sitting_Bill
 
Posts: 503
Joined: Tue Mar 15, 2011 12:35 am

Re: Local Map Stitching Script

Postby rilaf » Fri Sep 02, 2011 3:27 pm

Sitting_Bill wrote:This looks cool... do you have any tips on getting the $ender_maps variable set correctly on a Mac? I think its probably very similar to Linux. I've tried setting it to '~/enderMac32/map', 'enderMac32/map', '../enderMac32/map' and all of the above with $ in front (like in your example) but that doesn't seem to work.

I no longer have an Apple computer so I can't test it for you but as long as you are able to get PHP5-CLI installed (so you can actually use the php command at the command prompt or make the run.sh work)

As far as your path goes. If you get into the console and move around using the cd command to your ender client's map directory try running the pwd command. It should print out the path that $ender_maps will need to be set to.
rilaf
 
Posts: 22
Joined: Thu Feb 10, 2011 7:23 pm

Re: Local Map Stitching Script

Postby bogbrush » Mon Oct 24, 2011 11:10 am

sorry but i have no idea how to make this owrk.
have downloaded zip, extracted, placed files in main HnH folder, had to downlaod a PHP viewer to open the php, and its just script

so i have to ask, where do i place the files from the zip? master in map folder or main folder?
what current session do i use, oldest or newest
how do i run php
how do i view the finished map stitching

hope these are not silly questions, but you seem to be talking to those that are very tech savvy, and not to us normal users

love the plan tho (windowsXP)
I think I've discovered the secret of life - you just hang around until you get used to it. - Charles M. Schulz
User avatar
bogbrush
 
Posts: 136
Joined: Thu Aug 11, 2011 8:45 pm

Re: Local Map Stitching Script

Postby mvgulik » Mon Oct 24, 2011 12:20 pm

I have not used this script ... but
- Ender's 'map' folder.
- No need, script will do all your sessions. (if I'm correct)
- Install PHP ... see: PHP site, Downloads, Windows binaries. (and read up about PHP use.)
- Open the 'Map.html' file. ... but

Its better to just create a new folder somewhere (like: MergeMapsView). Drop the zip files in there and copy/move your map-sub-folders to there. Run the 'main.php' file. And then open the 'map.html' file in your browser.
mvgulik
 
Posts: 3765
Joined: Fri May 21, 2010 2:29 am

Re: Local Map Stitching Script

Postby bogbrush » Mon Oct 24, 2011 1:27 pm

right, gotcha, thanks for the simple answer :D
Rilaf didnt mention how to use PHP, am trying this now, altho it may take a a few hours (still gives me something to do while server is down)

i will report back my findings in newbie-speak later when i am satisfied.
I think I've discovered the secret of life - you just hang around until you get used to it. - Charles M. Schulz
User avatar
bogbrush
 
Posts: 136
Joined: Thu Aug 11, 2011 8:45 pm

Re: Local Map Stitching Script

Postby secobi » Mon Oct 24, 2011 3:15 pm

Would a map annotation feature be within the project scope?
Image
serenity, subtlety, speed and servitude
User avatar
secobi
 
Posts: 19
Joined: Sun Jul 17, 2011 7:22 am
Location: Texas

Re: Local Map Stitching Script

Postby mvgulik » Mon Oct 24, 2011 6:55 pm

...
Last edited by mvgulik on Sun Apr 15, 2012 2:10 pm, edited 1 time in total.
mvgulik
 
Posts: 3765
Joined: Fri May 21, 2010 2:29 am

Re: Local Map Stitching Script

Postby secobi » Tue Oct 25, 2011 8:00 am

I'm not sure if this module has anything to do with my recent client (presumably) problems. I'd figure this is just a good place to check first. Anyways, I use Ender's 32-bit on two-computers and every since the start of this world six with the simultaneous installation of this stitching script on one computer I haven't been able to log-in twice with the same character on that particular computer without the game entirely locking up after the entire GUI finishes loading. I can start a new character just fine and enter the main world but logging off and re-entering it is the only problem. I have windows vista-64 on the computer that locks-up and XP on the one that doesn't btw. Mainly I'd just want confirmation that the script does interface with my client at the point of 'starting where you last logged out' with or without the exact details.
Image
serenity, subtlety, speed and servitude
User avatar
secobi
 
Posts: 19
Joined: Sun Jul 17, 2011 7:22 am
Location: Texas

Re: Local Map Stitching Script

Postby stepbystep » Fri Oct 28, 2011 9:04 am

Hello. Does this script work for world 6? If yes, then can you explain me more detailed what I must do to make it work? I have downloaded archive and extracted it to my map folder (I use ender's client). I have changed main.php, defined $ender_maps as my map directory. When I run script nothing happens.
stepbystep
 
Posts: 2
Joined: Fri Oct 28, 2011 8:54 am

Next

Return to The Wizards' Tower

Who is online

Users browsing this forum: No registered users and 1 guest