[11914] Add new scripts and windows binary files for extraction

This commit is contained in:
Schmoozerd 2012-01-30 18:49:53 +01:00
parent d83c7d8c8c
commit 9c9e3a0e0d
9 changed files with 351 additions and 1 deletions

View file

@ -0,0 +1,162 @@
#!/bin/sh
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
## Expected param 1 to be 'a' for all, else ask some questions
## Normal log file (if not overwritten by second param
LOG_FILE="MaNGOSExtractor.log"
## Detailed log file
DETAIL_LOG_FILE="MaNGOSExtractor_detailed.log"
## Change this to a value fitting for your sys!
NUM_CPU="2"
## ! Use below only for finetuning or if you know what you are doing !
USE_AD="0"
USE_VMAPS="0"
USE_MMAPS="0"
USE_MMAPS_OFFMESH="0"
if [ "$1" == "a" ]
then
## extract all
USE_AD="1"
USE_VMAPS="1"
USE_MMAPS="1"
else
## do some questioning!
echo
echo "Welcome to helper script to extract required dataz for MaNGOS!"
echo "Should all dataz (dbc, maps, vmaps and mmaps be extracted? (y/n)"
read line
if [ "$line" == "y" ]
then
## extract all
USE_AD="1"
USE_VMAPS="1"
USE_MMAPS="1"
else
echo
echo "Should dbc and maps be extracted? (y/n)"
read line
if [ "$line" == "y" ]; then USE_AD="1"; fi
echo
echo "Should vmaps be extracted? (y/n)"
read line
if [ "$line" == "y" ]; then USE_VMAPS="1"; fi
echo
echo "Should mmaps be extracted? (y/n)"
echo "WARNING! This will take several hours!"
read line
if [ "$line" == "y" ]
then
USE_MMAPS="1";
else
echo "Only reextract offmesh tiles for mmaps?"
read line
if [ "$line" == "y" ]
then
USE_MMAPS_OFFMESH="1";
fi
fi
fi
fi
## Special case: Only reextract offmesh tiles
if [ "$USE_MMAPS_OFFMESH" == "1" ]
then
echo "Only extracting offmesh meshes"
MovemapGen.sh offmesh $LOG_FILE $DETAIL_LOG_FILE
exit 0
fi
## Obtain numbe ob processes
if [ "$USE_MMAPS" == "1" ]
then
echo "How many CPUs should be used for extracting mmaps? (1-4)"
read line
if [ "$line" -ge "1" -a "$line" -le "4" ]
then
NUM_CPU=$line
else
echo "Only number between 1 and 4 supported!"
exit 1
fi
fi
## Give some status
echo "Current Settings: Extract DBCs/maps: $USE_AD, Extract vmaps: $USE_VMAPS, Extract mmaps: $USE_MMAPS on $NUM_CPU processes"
if [ "$1" != "a" ]
then
echo "If you don't like this settings, interrupt with CTRL+C"
read line
fi
echo "`date`: Start extracting dataz for MaNGOS" | tee $LOG_FILE
## Handle log messages
if [ "$USE_AD" == "1" ];
then
echo "DBC and map files will be extracted" | tee -a $LOG_FILE
else
echo "DBC and map files won't be extracted!" | tee -a $LOG_FILE
fi
if [ "$USE_VMAPS" == "1" ]
then
echo "Vmaps will be extracted" | tee -a $LOG_FILE
else
echo "Vmaps won't be extracted!" | tee -a $LOG_FILE
fi
if [ "$USE_MMAPS" == "1" ]
then
echo "Mmaps will be extracted with $NUM_CPU processes" | tee -a $LOG_FILE
else
echo "Mmaps files won't be extracted!" | tee -a $LOG_FILE
fi
echo | tee -a $LOG_FILE
echo "`date`: Start extracting dataz for MaNGOS, DBCs/maps $USE_AD, vmaps $USE_VMAPS, mmaps $USE_MMAPS on $NUM_CPU processes" | tee $DETAIL_LOG_FILE
echo | tee -a $DETAIL_LOG_FILE
## Extract dbcs and maps
if [ "$USE_AD" == "1" ]
then
echo "`date`: Start extraction of DBCs and map files..." | tee -a $LOG_FILE
ad | tee -a $DETAIL_LOG_FILE
echo "`date`: Extracting of DBCs and map files finished" | tee -a $LOG_FILE
echo | tee -a $LOG_FILE
echo | tee -a $DETAIL_LOG_FILE
fi
## Extract vmaps
if [ "$USE_VMAPS" == "1" ]
then
echo "`date`: Start extraction of vmaps..." | tee -a $LOG_FILE
vmapExtractor3 | tee -a $DETAIL_LOG_FILE
echo "`date`: Extracting of vmaps finished" | tee -a $LOG_FILE
mkdir vmaps
echo "`date`: Start assembling of vmaps..." | tee -a $LOG_FILE
vmap_assembler.exe buildings vmaps | tee -a $DETAIL_LOG_FILE
echo "`date`: Assembling of vmaps finished" | tee -a $LOG_FILE
echo | tee -a $LOG_FILE
echo | tee -a $DETAIL_LOG_FILE
fi
## Extract mmaps
if [ "$USE_MMAPS" == "1" ]
then
MovemapGen.sh $NUM_CPU $LOG_FILE $DETAIL_LOG_FILE
fi

Binary file not shown.

View file

@ -0,0 +1,149 @@
#!/bin/sh
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
## Syntax of this helper
## First param must be number of to be used CPUs (only 1, 2, 3, 4 supported) or "offmesh" to recreate the special tiles from the OFFMESH_FILE
## Second param can be an additional filename for storing log
## Third param can be an addition filename for storing detailed log
## Additional Parameters to be forwarded to MoveMapGen, see mmaps/readme for instructions
PARAMS="--silent"
## Already a few map extracted, and don't care anymore
EXCLUDE_MAPS=""
#EXCLUDE_MAPS="0 1 530 571" # example to exclude the continents
## Offmesh file
OFFMESH_FILE="offmesh.txt"
## Normal log file (if not overwritten by second param
LOG_FILE="MoveMapGen.log"
## Detailed log file
DETAIL_LOG_FILE="MoveMapGen_detailed.log"
## ! Use below only for finetuning or if you know what you are doing !
## All maps
MAP_LIST_A="1 37 543 595 289 572 529 562 531 269 47 649 650 599 548 559 429 230 573 349 13 25 409 229 43 48 546 553 547 604 545 90 576"
MAP_LIST_B="571 628 560 509 723 532 607 600 668 33 585 566 389 601 369 129 550 189 542 70 109 554 632 552 555 540 598 450 558 249 35 624 557"
MAP_LIST_C="0 631 609 534 533 619 469 602 329 580 615 578 36 556 44 565 544 34 617 608 618 449 616 42 451 582 584 586 587 588 589 590 591 592"
MAP_LIST_D="530 169 575 603 309 574 30 564 568 209 724 658 489 593 594 596 597 605 606 610 612 613 614 620 621 622 623 641 642 647 672 673 712 713 718"
MAP_LIST_D1="209 724 658 489 606 610 612 613 614 620 621"
MAP_LIST_D2="169 575 603 309 574 30 564 568 622 623 641 642 647 672 673 712 713 718"
MAP_LIST_D3="530 593 594 596 597 605"
badParam()
{
echo "ERROR! Bad arguments!"
echo "You can (re)extract mmaps with this helper script,"
echo "or recreate only the tiles from the offmash file"
echo
echo "Call with number of processes (1 - 4) to create mmaps"
echo "Call with 'offmesh' to reextract the tiles from offmash file"
echo
echo "For further fine-tuning edit this helper script"
echo
}
if [ "$#" == "3" ]
then
LOG_FILE=$2
DETAIL_LOG_FILE=$3
elif [ "$#" == "2" ]
then
LOG_FILE=$2
fi
# Offmesh file provided?
OFFMESH=""
if [ "$OFFMESH_FILE" != "" ]
then
if [ ! -f "$OFFMESH_FILE" ]
then
echo "ERROR! Offmesh file $OFFMESH_FILE could not be found."
echo "Provide valid file or none. You need to edit the script"
exit 1
else
OFFMESH="--offMeshInput $OFFMESH_FILE"
fi
fi
# Function to process a list
createMMaps()
{
for i in $@
do
for j in $EXCLUDE_MAPS
do
if [ "$i" == "$j" ]
then
continue 2
fi
done
./MoveMapGen $PARAMS $OFFMESH $i | tee -a $DETAIL_LOG_FILE
echo "`date`: (Re)created map $i" | tee -a $LOG_FILE
done
}
createHeader()
{
echo "`date`: Start creating MoveMaps" | tee -a $LOG_FILE
echo "Used params: $PARAMS $OFFMESH" | tee -a $LOG_FILE
echo "Detailed log can be found in $DETAIL_LOG_FILE" | tee -a $LOG_FILE
echo "Start creating MoveMaps" | tee -a $DETAIL_LOG_FILE
}
# Param control
case "$1" in
"1" )
createHeader $1
createMMaps $MAP_LIST_A $MAP_LIST_B $MAP_LIST_C $MAP_LIST_D &
;;
"2" )
createHeader $1
createMMaps $MAP_LIST_A $MAP_LIST_D &
createMMaps $MAP_LIST_B $MAP_LIST_C &
;;
"3" )
createHeader $1
createMMaps $MAP_LIST_A $MAP_LIST_D1&
createMMaps $MAP_LIST_B $MAP_LIST_D2&
createMMaps $MAP_LIST_C $MAP_LIST_D3&
;;
"4" )
createHeader $1
createMMaps $MAP_LIST_A &
createMMaps $MAP_LIST_B &
createMMaps $MAP_LIST_C &
createMMaps $MAP_LIST_D &
;;
"offmesh" )
echo "`date`: Recreate offmeshs from file $OFFMESH_FILE" | tee -a $LOG_FILE
echo "Recreate offmeshs from file $OFFMESH_FILE" | tee -a $DETAIL_LOG_FILE
while read map tile line
do
./MoveMapGen $PARAMS $OFFMESH $map --tile $tile | tee -a $DETAIL_LOG_FILE
echo "`date`: Recreated $map $tile from $OFFMESH_FILE" | tee -a $LOG_FILE
done < $OFFMESH_FILE &
;;
* )
badParam
exit 1
;;
esac
wait
echo | tee -a $LOG_FILE
echo | tee -a $DETAIL_LOG_FILE
echo "`date`: Finished creating MoveMaps" | tee -a $LOG_FILE
echo "`date`: Finished creating MoveMaps" >> $DETAIL_LOG_FILE

View file

@ -0,0 +1,36 @@
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Copy the content of this directory into your client directory.
Then just run ExtractResources.sh
On Windows, you can run the file within the "Git bash" (which should be shipped with your Git software)
by invoking "sh ExtractResources.sh"
This file will ask you what you want to extract.
You can chose from the following:
* Extract DBCs/ maps (required for MaNGOS to work)
* Extract vmaps (expected for MaNGOS to work)
* Extract mmaps (optional, and will require very long time to create)
* Update mmaps with data from offmesh.txt (suggested after updates of this file)
In case you want to extract mmaps you will be asked how many processes should be used for mmap-extraction;
Recommanded is to use the number of CPUs
By default the scripts will create log files
MaNGOSExtractor.log for overall progress of the extraction, and
MaNGOSExtractor_detailed.log which includes all the information about the extraction.
If you want to toggle some parts in the extraction process, there are a few internal variables in the extraction scripts, that can be modified.
Consider the Readme's in the directories extractor, vmap_assembler, vmap_extractor_v3 and mmap for further information about detail.
Also especially related to mmaps updating you might be interested in using the MoveMapGen.sh script.

Binary file not shown.

View file

@ -0,0 +1,3 @@
0 31,59 (-14429.889648 450.344452 15.430828) (-14424.218750 444.332855 12.773965) 2.5 // booty bay dock
562 31,20 (6234.545898 256.902100 11.075373) (6230.961914 252.127274 11.180979) 2.5 // Blade's Edge Arena
562 31,20 (6243.081543 266.918854 11.059557) (6246.507324 271.623505 11.230524) 2.5 // Blade's Edge Arena

Binary file not shown.

Binary file not shown.

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11913" #define REVISION_NR "11914"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__