.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening > Scenarios, Maps and Mods

Reply
 
Thread Tools Display Modes
  #1  
Old January 11th, 2007, 08:14 PM
Jack_Trowell's Avatar

Jack_Trowell Jack_Trowell is offline
Second Lieutenant
 
Join Date: Oct 2006
Location: Toulouse, FRANCE
Posts: 436
Thanks: 150
Thanked 21 Times in 13 Posts
Jack_Trowell is on a distinguished road
Default [Perl] need beta testers for map file parsing

Project : creation of a Perl function library for use to easily parse and edit/create map files (in the first version), and later mods.

Currently, I've just finished the parsing function, that read a .map file (*any* map file, can be from a normal random map to a manually edited one with tabulations, comments, and others nastiness usually not welcomed by scripts, or at least it should work with these) and returna perl hash structure with all the map informations (included : lists of commandes, features, terrains types (and not the code, but the list of all terrains types and specials like 'manysites'), ...)

I planned to make the output function too before this week-end and release both for beta testing, but I now have other plans for the days to come, so I pre-release the parsing part , and I would need some brave people to test my script and check if there's map commands/infos that are not recognized or parsed correctly.

What do you need to do to help me ?

1°) install Perl if you don't already have it (for windows, you can use ActivePerl, see http://www.activeperl.org/Products/ActivePerl/ and don't worry, activeperl, the core install, is free)

This first version doesn't need any non standard perl module, but later version will require some, buth they will be easy to install with activeperl

For Unix/Linux/BSD users, hell you already have Perl on your machine, and you probably don't need any help to compile/install new modules (but if you really need, I can help)

2°) Inside the archive (see attachment), There will be 5 files :

JTmap.pm => the library/package itself (.pm stand for Perl Module)

test.pl => a small test script that use the library, and parse a map file

Forgotten Cliffs.map => a map file (from a map released on this forum) that I choose as an exemple because it use most map commands (but not all, that's why I need your help guys).

test.bat => an exemple batch file for windows that call the perl script with "Forgotten Cliffs.map" as the map to parse, andthem pause (the windows won't close once the script is done, it will wait for you to press a key, so you can read any potential error message from the script and report them)
This is this file that you will edit (to change the map file) and execute to test the script.

output.txt => currently as the ouput function is not available yet to create another .map file, I print to this file a dump of the full perl structure parsed. Even those that don't know any programming langage should be able to recognize familiar informations from the original map.
In the archive an exemple result parsed from the "Forgotten Cliffs.map" file is provided, so those that want can loo without even having to run the script.

What I need testers for :

- run the script with any map you can (the more diverse the better), and report any error during parsing
- when the parsing run without any message/error, check the output.txt file and check the "leftover" value. There should only be there comments and others informations not directly depending from the map itself.
If commands are in the leftover value, please reports them (provide the original .map file or a link to download it, so I can test myself)
- if there's no error, and the leftover ha only comments, check the map structure itself to see if there's nothing important missing or invalid.

Thanks in advance for the help.


For other Perl programmers out there : if some want to participate, with those files you will already have the perl map structure, and so you should be able to make your own function to add/edit/remove any province or commander or general map settings.

If you have questions I will be pleased to answer (I can also give advice to Perl beginners if needed)
Attached Files
File Type: rar 486490-JTmap.rar (11.9 KB, 117 views)
__________________
Q: "How many Vorlons does it takes to change a lightbulb ?"
A: "Yes !" <stranges noises>
--
Dominions Map validator and randomizer : http://dominions.realites.org
Dominions Map editor v0.75b : http://dominions.realites.org/map_editor
Reply With Quote
  #2  
Old January 11th, 2007, 11:35 PM

aldiss0 aldiss0 is offline
Private
 
Join Date: Oct 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
aldiss0 is on a distinguished road
Default Re: [Perl] need beta testers for map file parsing

Ran it successfully under cygwin on two different maps.

A modified version of the huge and wonderful oerth map from the forum on which it missed a few commands. The second is a slightly edited version of the largest Faerun with special sites, this from the Dom2 forum, on which it didn't like quite a few of the special site commanders and units.

Map files and output attached.
Attached Files
File Type: rar 486559-ParserTests.rar (67.5 KB, 104 views)
Reply With Quote
  #3  
Old January 12th, 2007, 06:30 AM
Jack_Trowell's Avatar

Jack_Trowell Jack_Trowell is offline
Second Lieutenant
 
Join Date: Oct 2006
Location: Toulouse, FRANCE
Posts: 436
Thanks: 150
Thanked 21 Times in 13 Posts
Jack_Trowell is on a distinguished road
Default Re: [Perl] need beta testers for map file parsing

Thanks for the feedback.

Let's see what has been ignored :

@specstart 0 257 --Southern Escarpment

??? shouldn't it be #specstart and not @specstart
Is it another usable syntax ?


'#commander "Wizard"',
'#bodyguards 5 "Summer Lion"',
'#units 7 "Hydra"',

Ok, forgot that units could be set with their name and not only their ID. Will be easy to fix.

'#maptextcol -1.00 -1.00 -1.00 -1.00

Ok, didn't think of negative value, easy to fix.

'#knowfeature "Assassins Guild"

Isn't it supposed to be
"#knownfeature" and not "#knowfeature" ?
Error in the original mal file, or are both syntax usable ?

'#startspell 68 "Acashic Record"',
'#startspell 68 "Charm"',
'#startspell 68 "Enslave Mind"',
'#startspell 68 "Cloud Trapeze"',
'#god 68 246',
'#nostart 1214'

Hum, ... those should have worked. There must be an error in the regular expressions.


----

OK, just finished a new version


- Reported errors should be fixed now.
- comments no longer put in 'leftover', they now get they own 'comments' key in the map structure
- new script : map_validator.pl (and the corresponding map_validator.bat)
This script parse the map file, and if there are leftover commands not recognized, he list them.
- test.pl updated to work the same as map_validator.pl, but will still create the ouput.txt file with the full structure.


In Included both map files you provided in the archive, as they are both good exemples for the map validator.
(Faerun has several syntax errors)
Attached Files
File Type: rar 486626-JTmap.rar (62.1 KB, 106 views)
__________________
Q: "How many Vorlons does it takes to change a lightbulb ?"
A: "Yes !" <stranges noises>
--
Dominions Map validator and randomizer : http://dominions.realites.org
Dominions Map editor v0.75b : http://dominions.realites.org/map_editor
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 07:47 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.