Daimonin MMORPG Logo
Daimonin voting system

Recent Posts

[Graphics requests] Canoe by ThePlaneskeeper
Today at 04:07:09 am
[Daimonin project] "Silent" quests by smacky
July 29, 2010, 10:29:23 pm
[Community chat] Social Network - Daimonin Pages by Nite_Star
July 29, 2010, 05:50:17 pm
[Bug discussion] SENTInce AddLink() limit by _people_
July 29, 2010, 05:29:21 pm
[Graphics] Treant Corpse by _people_
July 28, 2010, 07:06:02 pm
[Suggestions] Areas with Dropped Item Saving by UrAvgAzn
July 28, 2010, 03:21:23 pm
[Suggestions] Coin Amount Image Scaling by smacky
July 28, 2010, 11:32:02 am
[Community chat] TPK's Server down for maintenance by ThePlaneskeeper
July 28, 2010, 04:11:07 am

Daimonin Forums

 
Pages: [1] 2   Go Down
  Print  
Author Topic: MapChecker program (Current version V1.8)  (Read 2064 times)
grommit
Raas Army General
*
*
*
*
*
*
*



Posts: 3064
Karma: +44/-7


View Profile
« on: October 15, 2007, 12:16:17 pm »

I have written a Java program to check entire map trees for problems. This has a different purpose to map validation in the Editor, since in the Editor you can only check one map at a time, and it won't tell you about connection problems between maps etc.

You can run the program either by double-clicking the jar file, which brings up a dialog where you can browse for directories, or for pontikiphobes (ποντικι - mouse, φοβια - phobia), you can run it from the command line ;)

In the dialog, in the top window, just browse to the maps folder in your working copy to check all the maps from top level downwards. To just check a subset (like demon_plane, or your own unofficial map set), browse down to that directory.

Then browse in the second window to select the directory and file name for the log file. Then just click the Check Maps button and it will check all those maps and output warnings and errors to the log file.

To exclude warnings of missing floors, check the appropriate box.

If you prefer to use the command line, it's
Code: [Select]
$ java -jar MapChecker.jar map-directory [logfile-directory]
If you omit the logfile-directory, all the output will go to the command window.

Whichever way you run it, the program checks the following (E = error, W = warning):
  • Map tiles (each direction):
    • (E) Referenced map does not exist
      (E) Referenced map does not connect back to this one
      (E) Referenced map connects to a different map
  • Exits:
    • (E) Referenced map does not exist
      (W) Reference is absolute
  • Events:
    • (E) Script file does not exist
      (W) Script path is absolute (does not apply to /scripts or /scripts_private)
  • Waypoints:
    • (E) Referenced map does not exist
      (W) Reference is absolute (may be intentional, though)
  • For each square on each map:
    • (W) Object(s) on square, but no floor
      (E) More than one floor
      (W) Empty spawn point
      (W) Mob/NPC not in spawn point
      (W) More than one object on same layer at map level (ignores layers 0 and 1)
You can download V1.7 from here.

Future versions may check more things as I think of them, or people suggest them. Please reply with comments, suggestions and bugs.

NOTE: You can't check SVN directories (like daiserv and mapserv) directly as the program needs to find the archetypes file - it must be a properly set up working area, such as you run your local server on.
smacky
The Singular Soul of Lom Lobon Tribe
*
*
*
*
*
*
*



Posts: 6774
Karma: +246/-130


View Profile
« Reply #1 on: October 15, 2007, 03:26:37 pm »

Nice job Grommit. :)

But why does it ignore layer 1 for more than one object on same layer?

Smacky the pontikiphobe
grommit
Raas Army General
*
*
*
*
*
*
*



Posts: 3064
Karma: +44/-7


View Profile
« Reply #2 on: October 15, 2007, 04:56:56 pm »

Because layer 1 is floors and it has already checked the floor count (0 is warning, >1 is error).

Which brings me to bug #1 I just found: it doesn't see shop floor (type 68) as a valid floor type.

Thought you'd like the neologism :)  Have you run it from the command line on Linux yet? I'd like to know if it worked as advertised.

Grommit the pontikiphile.
smacky
The Singular Soul of Lom Lobon Tribe
*
*
*
*
*
*
*



Posts: 6774
Karma: +246/-130


View Profile
« Reply #3 on: October 15, 2007, 05:10:19 pm »

Hm, I'm having difficulty:
Code: [Select]

julian@louie:~/daimonin/local$ java -jar MapChecker.jar maps/
Usage: java -jar mapchecker.jar top_level_directory log_file_path
julian@louie:~/daimonin/local$ java -jar MapChecker.jar maps/planes/
Usage: java -jar mapchecker.jar top_level_directory log_file_path
julian@louie:~/daimonin/local$ java -jar MapChecker.jar maps/ log
Map path must contain 'maps' directory
julian@louie:~/daimonin/local$ java -jar MapChecker.jar ./ log
Map path must contain 'maps' directory
julian@louie:~/daimonin/local$ java -jar MapChecker.jar . log
Map path must contain 'maps' directory

log does not exist. I wanted to run it to stdout. Can I? Will it mkdir log if it does not exist?

Gridarta had the not seeing shop floors as proper floors error until recently too. I think Gridarta determines floors by type though. What about shop mats (69)?
tehill
Undead Thunderbird
*
*
*
*
*



Posts: 1049
Karma: +17/-2


View Profile
« Reply #4 on: October 15, 2007, 07:15:16 pm »

If you look at the beginning of the server log you shall see that the server reports an error with the shop floors, and has been reporting that error for months.
grommit
Raas Army General
*
*
*
*
*
*
*



Posts: 3064
Karma: +44/-7


View Profile
« Reply #5 on: October 15, 2007, 07:37:27 pm »

Hmm - shop mats are like exits and should be on a floor anyway.

Re the command line interface - I think the trailing / is confusing it. Are you running the jar file in your top level working directory (i.e. the one containing the maps directory)?

Try a cd to that directory.
It won't mkdir the log directory. (atm)
smacky
The Singular Soul of Lom Lobon Tribe
*
*
*
*
*
*
*



Posts: 6774
Karma: +246/-130


View Profile
« Reply #6 on: October 15, 2007, 07:44:41 pm »

@Tehill: a warning. :P But IIUC Grommit's map checker identifies anything on layer 1 as a floor. Shop floors are layer 1. That warning is that they are also sys_objects.

Perhaps the server/client (not sure which) could be changed to treat shop floors as normal floors (ie, not show them in the below window)? Then there would be no need for them being sys_object.
grommit
Raas Army General
*
*
*
*
*
*
*



Posts: 3064
Karma: +44/-7


View Profile
« Reply #7 on: October 15, 2007, 07:50:03 pm »

As far as I understand the layer system, 0 is invisible system objects, 1 is floors, 2 is floor masks, then anything above is something on top. (Yes I know there is more detail in the definition, like 7 is flying objects but I am not really concerned with anything above).

Oh, and my program uses the type to determine a floor, not the level. That's why it missed shop floors. It's debatable which it should use.
smacky
The Singular Soul of Lom Lobon Tribe
*
*
*
*
*
*
*



Posts: 6774
Karma: +246/-130


View Profile
« Reply #8 on: October 15, 2007, 08:02:47 pm »

It works with ./maps. maps/ or ./maps/ causes the above failure. Also, the logfile has nasty ^M characters in it.
grommit
Raas Army General
*
*
*
*
*
*
*



Posts: 3064
Karma: +44/-7


View Profile
« Reply #9 on: October 16, 2007, 12:22:58 pm »

V1.1 fixes 2 bugs:

#1: Not recognising shop floor as a floor. Now checks layer = 1 for a floor (instead of type).
#2: If an exit or waypoint references a map outside the sub-tree being checked, it reported that the map does not exist, even though it does.

Re ctrl/M in log file: this is a carriage return. Windows line ends are '\r\n', Unix line ends are '\n'. I will see how to determine the operating system and set line ends accordingly.

Re trailing '/' on file spec.: I will check for this and strip it off.
grommit
Raas Army General
*
*
*
*
*
*
*



Posts: 3064
Karma: +44/-7


View Profile
« Reply #10 on: November 18, 2007, 09:02:32 pm »

As of today, we are now up to V1.4. It is now a zip file as it requires another jar file in its lib folder for a wizzy directory tree thingy.

Download http://www.enborne.f2s.com/_daimonin/MapChecker.zip and unzip the whole thing into an empty folder.
grommit
Raas Army General
*
*
*
*
*
*
*



Posts: 3064
Karma: +44/-7


View Profile
« Reply #11 on: December 30, 2007, 01:23:05 pm »

MapChecker has been updated. The latest version is V1.6, dowloaded from the same link as in the previous post.

The short-lived V1.5 adds checks for the integrity of archetypes and artifacts files and also checks each map for references to missing archetypes/artifacts.

V1.6 was a quick addition on top of V1.5, to ignore .svn directories, so you can now run MapChecker directly on SVN repositories without exporting.

If you do this, you will need to take some of the reports with a pinch of salt, since you'll probably get errors saying a script file is missing and so on - which would not happen with a properly-exported working copy. However it does provide a quick check of map validity in situ.
ThePlaneskeeper
Warlord of Moroch Army
*
*
*
*
*
*
*



Posts: 1695
Karma: +63/-27


View Profile WWW
« Reply #12 on: December 30, 2007, 04:47:16 pm »

i'll have to try this after the new year.  I'm always appreciative of things that tell me i screwed up =)
grommit
Raas Army General
*
*
*
*
*
*
*



Posts: 3064
Karma: +44/-7


View Profile
« Reply #13 on: April 23, 2008, 12:43:24 pm »

Updated today to V1.7

Bug fixed: not adding missing object errors to total error count.
grommit
Raas Army General
*
*
*
*
*
*
*



Posts: 3064
Karma: +44/-7


View Profile
« Reply #14 on: October 06, 2008, 03:42:17 pm »

I have re-organised the SVN distribution by putting the sources in a src directory and adding the pre-built jar file with its required library.

Copy the jar file together with its lib directory and then run the jar file.
Pages: [1] 2   Go Up
 
 

Powered by SMF 2.0 RC1-1 | SMF © 2006–2008, Simple Machines LLC
Page created in 0.119 seconds with 22 queries.