Author Topic: BoniMaps  (Read 562 times)

Bonifarzia

  • Hydlaa Notable
  • *
  • Posts: 718
    • View Profile
BoniMaps
« on: June 26, 2011, 10:55:15 am »
A while ago, I searched these boards for various key words,
and I was amazed by the number of matches for "mini map" in the wish list and complaint department.

Agreed, the widely used game feature does not really fit into the concept and world of PlaneShift,
but if a player really wants this sort of OoC information, why should he or she not make a simple tool to get it.
That's probably not much more than a one liner in gnuplot and awk, I said to myself, and gave it a try.
And here is the first result:

BoniMaps.1.0 (Thanks to LigH for hosting.)



A screenshot of a surface plot. The samples are incomplete,
so this is no spoiler. The plot is freely rotatable and the red dot
will follow your position.


Below I just post the Readme file, which may be a bit lengthy, but should cover all questions about this package.
I just realize that this is much text for such a minimalistic tool.

Notice that this is not a PlaneShft mod, nor a tool to generate in-game maps (xml sketches).
If you are looking for that sort of utility, there are some very interesting threads on this "mods" board,
for instance Derula's SVG to sketch converter or Tontow's MapMaker

I hope some of you will find this useful.
Feel free to leave productive comments
or send me a PM if you have any technical problems with this tool.


Code: [Select]
About BoniMaps
--------------

BoniMaps is a simple set of gnuplot/shell scripts to generate a minimap when
playing PlaneShift in windowed mode.
The scripts are very short and should be easy to customize.
The maps are plots of data you collect with the /pos command. (Use shortcuts.)
No actual geometry data will be contained in this package.
The minimap will show your latest /pos on a plot of the matching zone.
The zone plot can either be a 2d or 3d map made of lines connecting /pos data,
or it can be a colored surface gnuplot fits to your /pos data on a given grid.



How to Install
--------------

All needed tools should be available in most linux distros.
Gnuplot may need to be installed on Mac or Windows systems.
On Windows, the shell scripts will need a software package like MSys/MinGW.

Quotes about related software:

Gnuplot is a portable command-line driven graphing utility for linux, OS/2,
MS Windows, OSX, VMS, and many other platforms. (from http://www.gnuplot.info/)

A shell script is a script written for the shell, or command line interpreter,
of an operating system. (from http://en.wikipedia.org/wiki/Shell_script)

MSYS is a collection of GNU utilities such as bash, make, gawk and grep
to allow building of applications and programs which depend on traditionally
UNIX tools to be present. (from http://www.mingw.org/wiki/msys)



Contents
--------

find.log.sh               self explanatory. Needs to be edited once.            
extract.all.zones.sh      Collects all /pos data to generate zone files.      
extract.named.zones.sh    Same as above, but only for zones given as arguments.
get.minimap.2d.sh         Needed by minimap.2d.gplt to generate outline maps.
get.minimap.3d.sh         Needed by minimap.3d.gplt to generate 3d line maps.
get.minimap.surface.sh    Needed by minimap.surface.gplt to generate 3d maps.
minimap.2d.gplt           Gnuplot script to keep drawing an outline minimap.
minimap.3d.gplt           Gnuplot script to keep drawing a 3d line minimap.
minimap.surface.gplt      Gnuplot script to keep drawing a 3d surface minimap.



Getting started
---------------

The following instructions will help you learn about BoniMaps step by step.


Extract above contents in some working directory of your choice.

Be sure that your system tab is logged. See the game options.

Make a shortcut for the /pos command if you do not already have one.

Open the file "find.log.sh" in a text editor. Fill in the name ending (suffix)
of and exact path to your system logs, as specified in the game options.

Test the script "find.log.sh". It should return your latest log file.
To run any script, open a terminal and enter: sh scriptname.sh

Collect some /pos data. For now, the data can be a meaningless test set.
For your first tests, try to stay in the same zone. Zones are the names
of areas returned by the /pos command.

Run extract.all.zones.sh. It should write files named after zones for any
/pos data it finds in your system log file. If you feel your log flooded
with old pos data, you may want to use grep -v 'Your current position is'.

Run the gnuplot script minimap.2d.gplt.
To run any gnuplot script enter: gnuplot scriptname.gplt
From gnuplot's command line, you can use: load "scriptname.gplt"

You should see some zig-zag lines that follow the /pos data you just
collected, with a red cross at the end of the line pattern.

Move around and get some more /pos data.
The red cross should follow your position.

Kill the gnuplot script by selecting its command line and pressing Ctrl-C.
If you don't like this type of loop, open the gnuplot scripts in a text
editor. You will see an alternate setting to refresh the plots only when
requested. Graphical versions of gnuplot will use a dialogue button that
also serves to leave the minimap ("Cancel").

Edit the zone file of your current test in a text editor.
Enter a blank line somewhere. This should remove the connecting line
between two positions somewhere in the minimap.

Making a good map using lines can be difficult. If your /pos data is
a bit chaotic, you will most certainly prefer a surface plot. This is
especially suitable for outdoor areas with height field geometries.

Test the gnuplot scripts minimap.3d.gplt and minimap.surface.gplt.
Use your mouse to rotate, zoom and scale the 3d map.

Open the file minimap.surface.gplt in a text editor. Experiment with
different settings for the grid to get a good compromise of speed and
resolution, of smoothness and sharpness.

Play around with the other scripts and customize them to your liking.
Happy minimap making!
« Last Edit: June 26, 2011, 10:58:27 am by Bonifarzia »