| Creating new boards for HeroScribe
Designing boards for HeroScribe might seem hard, but with the following walkthrough and some luck you will manage it. It basically takes three editing steps:
- Vector's: HeroScribe/Icons/Vector/Europe/Board_EU.eps.gz and HeroScribe/Icons/Vector/USA/Board_US.eps.gz
- Objects.xml's: HeroScribe/Objects.xml
- Raster's: HeroScribe/Icons/Raster/Europe/Board_EU.png and HeroScribe/Icons/Raster/USA/Board_US.png
That will do it if your board doesn't feature complex objects; otherwise, you will need to give a look at more complex drawing functions.
Vector editing
Vector information for the basic HeroQuest board is stored inside HeroScribe/Icons/Vector/Europe/Board_EU.eps.gz and HeroScribe/Icons/Vector/USA/Board_US.eps.gz, in .eps files compressed in a .gzip archive (we suggest 7-Zip to manage such files); these .eps files include PostScript info that will be converted in .eps or .pdf by Ghostscript, within HeroScribe. Extract Board_EU.eps from the .gzip file, then open it with NotePad++, or TextEdit.
In order to create a new board for HeroScribe you will need to get used to the code used in PostScript; these boards are usually simple to draw, but it could seem hard to understand how this process works: it is not, actually, but it needs some practice. We will not be focusing on every detail here, as we just want to easily create a new board for HeroScribe; so the essential sections we will look into are the following:
While working on your board, you may want to see how it looks like after your edits: if that is your case, save Board_EU.eps inside Notepad++ / TextEdit then drag it into Board_EU.eps.gz, overwriting the original one; now open HeroScribe and export a blank quest as .pdf. Give it a look to see how your map is coming up.
Once the European version of your board is ready, head to the Objects.xml editing Section to complete your board creation. We will now have a full look at the HeroQuest board .eps files; the most interesting parts are colored as such:
- blue: differences between European and North-American map layouts
- red: drawing functions we should not care about
- green: vital info we (may) need to modify
To deepen such colored parts, hover your mouse on them and carefully read their explanations. Here we go, please do not panic:
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 538 404
%%HiResBoundingBox: 0 0 537.6 403.2
%%LanguageLevel: 2
% Made with/for HeroScribe
% The board layout is (C) Milton Bradley Company
% This eps file is (C) 2003-2014 Flavio and Valerio Chierichetti
%/adjacentBoardsOffset offset def
/x 26 def
/y 19 def
/Unit { 19.2 mul } def
/Border 0.15 def
/RoomStroke 1.3 def
/GridStroke 0.1 def
/BorderRGB { 0 0 0 } def
% European version only, BEGINNING
/DarkRGB { 0.8 0.8 0.8 } def
/CorridorRGB { 1 1 1 } def
% European version only, END
% North-American version only, BEGINNING
/DarkRGB { 0.7 0.7 0.7 } def
/CorridorRGB { 0.9 0.9 0.9 } def
/TrapRGB { 0.976 0.486 0.200 } def
% North-American version only, END
/BoundingBox {
% Width, Height
exch
dup
1 sub adjacentBoardsOffset mul
exch
x 2 add mul
add Unit
exch
dup
1 sub adjacentBoardsOffset mul
exch
y 2 add mul
add Unit
2 array astore
<< /PageSize 2 index
>> setpagedevice
pop
%Ghostscript only
%mark /MediaBox [ 0 0 x 2 add Unit y 2 add Unit ] /PAGE pdfmark
%mark /CropBox [ 0 0 x 2 add Unit y 2 add Unit ] /PAGE pdfmark
} def
/horizontalline {
0 rlineto stroke
} def
/verticalline {
0 exch rlineto stroke
} def
/HorizontalLineTo {
% length > 0
currentlinewidth exch currentpoint
% lw length x y
currentlinewidth 2 div sub exch
% lw length (y - lw / 2) x
currentlinewidth 2 div sub exch
% lw length (x - lw / 2) (y - lw / 2)
2 index currentlinewidth add
currentlinewidth
% lw length (x - lw / 2) (y - lw / 2) (length + lw) lw
0 setlinewidth
rectfill
pop
setlinewidth
% [empty]
} def
/VerticalLineTo {
% length > 0
currentlinewidth exch currentpoint
% lw length x y
currentlinewidth 2 div sub exch
% lw length (y - lw / 2) x
currentlinewidth 2 div sub exch
% lw length (x - lw / 2) (y - lw / 2)
2 index currentlinewidth add
currentlinewidth
exch
% lw length (x - lw / 2) (y - lw / 2) lw (length + lw)
0 setlinewidth
rectfill
pop
setlinewidth
% [empty]
} def
% eventual, more complex functions
/RectStroke {
% xs ys width height
3 index 3 index moveto
1 index HorizontalLineTo
3 index 3 index moveto
0 index VerticalLineTo
3 index
3 index 2 index add
moveto
1 index HorizontalLineTo
3 index 2 index add
3 index
moveto
0 index VerticalLineTo
% xs ys width height
pop pop pop pop
} def
/Grid {
gsave
1 Unit 1 Unit translate
BorderRGB setrgbcolor
0 setlinejoin
GridStroke setlinewidth
0 1 x 1 sub {
gsave
Unit 0 translate
0 0 moveto
y Unit verticalline
2 1 10 {
gsave
12 div Unit 0 translate
0 0 moveto
-1 Border mul Unit verticalline
0 y Unit moveto
Border Unit verticalline
grestore
} for
grestore
} for
0 1 y 1 sub {
gsave
Unit 0 exch translate
0 0 moveto
x Unit horizontalline
2 1 10 {
gsave
12 div Unit 0 exch translate
0 0 moveto
-1 Border mul Unit horizontalline
x Unit 0 moveto
Border Unit horizontalline
grestore
} for
grestore
} for
% eventual corridor, dark and grid areas that are more complex
0 0
x Unit
y Unit
% Use RectStroke (the function previously defined) instead of ``rectstroke''
% for using PDFs of this file as converted by ghostscript with Illustrator
rectstroke
0 Border sub Unit
0 Border sub Unit
2 Border mul x add Unit
2 Border mul y add Unit
rectstroke
RoomStroke setlinewidth
% Central Room
10 Unit 7 Unit 6 Unit 5 Unit rectstroke
% Lower-Left Rooms
1 Unit 1 Unit 8 Unit 8 Unit rectstroke
9 Unit 1 Unit 3 Unit 5 Unit rectstroke
5 Unit 1 Unit 4 Unit 5 Unit rectstroke
1 Unit 5 Unit 4 Unit 4 Unit rectstroke
5 Unit 6 Unit 2 Unit 3 Unit rectstroke
% Upper-Left Rooms
1 Unit 10 Unit 8 Unit 8 Unit rectstroke
1 Unit 10 Unit 4 Unit 8 Unit rectstroke
1 Unit 15 Unit 8 Unit 3 Unit rectstroke
9 Unit 13 Unit 3 Unit 5 Unit rectstroke
% Lower-Right Rooms
14 Unit 1 Unit 4 Unit 5 Unit rectstroke
18 Unit 1 Unit 7 Unit 4 Unit rectstroke
21 Unit 1 Unit 4 Unit 8 Unit rectstroke
17 Unit 6 Unit moveto 3 Unit verticalline
17 Unit 9 Unit moveto 4 Unit horizontalline
% Upper-Right Rooms
14 Unit 13 Unit 3 Unit 5 Unit rectstroke
17 Unit 10 Unit 8 Unit 8 Unit rectstroke
17 Unit 14 Unit 8 Unit 4 Unit rectstroke
17 Unit 10 Unit 4 Unit 8 Unit rectstroke
grestore
} def
/Dark {
DarkRGB setrgbcolor
0 setlinewidth
3 index Unit
3 index Unit
3 index Unit
3 index Unit
rectfill
pop pop pop pop
} def
/Trap {
% North-American version only, BEGINNING
TrapRGB setrgbcolor
0 setlinewidth
3 index Unit
3 index Unit
3 index Unit
3 index Unit
3 index
3 index
3 index
3 index
gsave
rectclip
rectfill
Grid
grestore
% North-American version only, END
pop pop pop pop
} def
/Corridor {
% North-American version only, BEGINNING
CorridorRGB setrgbcolor
0 setlinewidth
3 index Unit
3 index Unit
3 index Unit
3 index Unit
rectfill
% North-American version only, END
pop pop pop pop
} def
/StartBoard {
% Column Row
exch
dup
adjacentBoardsOffset mul
exch
x 2 add mul
add Unit
exch
dup
adjacentBoardsOffset mul
exch
y 2 add mul
add Unit
gsave
translate
} def
/EndBoard {
grestore
} def
/HorizontalBridge {
% bottom
dup
CorridorRGB setrgbcolor
Unit
x 1 add Unit
exch
2 adjacentBoardsOffset add Unit
1 Unit
rectfill
BorderRGB setrgbcolor
GridStroke setlinewidth
Unit
x 1 add Unit
exch
2 adjacentBoardsOffset add Unit
1 Unit
rectstroke
} def
/VerticalBridge {
% left
dup
CorridorRGB setrgbcolor
Unit
2 adjacentBoardsOffset add -1 mul 1 add Unit
1 Unit
2 adjacentBoardsOffset add Unit
rectfill
BorderRGB setrgbcolor
GridStroke setlinewidth
Unit
2 adjacentBoardsOffset add -1 mul 1 add Unit
1 Unit
2 adjacentBoardsOffset add Unit
rectstroke
} def
% width height BoundingBox
% Deactivating showpage and setpagedevice
% We have to reactivate them before the end
% 2 dict dup dup /showpage {} put /setpagedevice {} put begin
%
% column row StartBoard
%
% x1 y1 width height Corridor
% ...
% x1 y1 width height Dark
% ...
% Grid
%
% EndBoard
Objects.xml editing
Before making any change to your Objects.xml, you first need to repack the European layout of your board.
Rename Board_EU.eps (e.g. DewayneBoard_EU.eps, or anything else), then open Board_EU.eps.gz (with 7-Zip, remember?) and drag in there your new, hypothetical DewayneBoard_EU.eps; while still in 7-Zip, right click on the original Board_EU.eps and delete it. Now close 7-Zip and rename Board_EU.eps.gz to DewayneBoard_EU.eps.gz. You are half way on your vector board editing!
Now open NotePad++: is there the Compare menu, under Plugins? If there is, jump to the next paragraph. If there is not, close Notepad++ and download the plugin (go with the UNI version), then copy the extracted ComparePlugin.dll inside C:\Program Files\Notepad++\plugins.
Now, open HeroScribe/Icons/Vector/Europe/DewayneBoard_EU.eps with Notepad++, then go in HeroScribe/Icons/Vector/USA/, extract Board_US.eps from Board_US.eps.gz and open it too with Notepad++; you should have now both DewayneBoard_EU.eps and Board_US.eps opened in Notepad++. Click on Plugins -> Compare -> Compare and copy the edits done in DewayneBoard_EU.eps to paste them inside Board_US.eps (be sure to paste them in the same file region!). Once again: rename Board_US.eps to the hypotethical DewayneBoard_US.eps (or the one you chose, but it should be exactly like the European's), insert it into Board_US.eps.gz, delete Board_US.eps from inside Board_US.eps.gz and finally rename Board_US.eps.gz to DewayneBoard_US.eps.gz. Your vector board editing is done! Let's move on to your Objects.xml.
Open it up with Notepad++ / TextEdit and give the <board></board> section a look:
<board width="26" height="19" borderDoorsOffset="0.08" adjacentBoardsOffset="-0.5">
<icon region="Europe" path="Europe/Board_EU" />
<icon region="USA" path="USA/Board_US" />
<!-- Border corridors -->
<corridor left="1" top="1" width="26" height="1" />
<corridor left="1" top="19" width="26" height="1" />
<corridor left="1" top="1" width="1" height="19" />
<corridor left="26" top="1" width="1" height="19" />
<!-- 2x7 corridors -->
<corridor left="13" top="1" width="2" height="7" />
<corridor left="13" top="13" width="2" height="7" />
<!-- 10x1 corridors -->
<corridor left="1" top="10" width="10" height="1" />
<corridor left="17" top="10" width="10" height="1" />
<!-- 1x7 corridors -->
<corridor left="10" top="7" width="1" height="7" />
<corridor left="17" top="7" width="1" height="7" />
<!-- 8x1 corridors -->
<corridor left="10" top="7" width="8" height="1" />
<corridor left="10" top="13" width="8" height="1" />
</board>
If your board features corridors more complex than simple rectangles do not worry, we will look into other complex funtions later.
Your Objects.xml editing is done! Let's move on to your board's raster editing.
Raster editing
You now need to work at the raster version of your board, the one used in HeroScribe as the quest's background. Open HeroScribe and export a blank European quest as an .eps named eu.eps; then change the layout to North-American and export a blank American quest as an .eps named us.eps; you may now close HeroScribe.
To export in .eps/.pdf HeroScribe needs Ghostscript: that's the software we will use to rasterize your board. Locate the bin folder of your Ghostscript (ours' at C:\Program Files/gs/gs9.04/bin) and there past the two .eps files you have just extracted (eu.eps and us.eps); now start up your command line (Start -> Run, then type cmd) and enter this command:
cd c:\program files/gs/gs9.04/bin
From there give the following command (copy and paste it by clicking on the upper left icon then Edit -> Paste):
gswin32c -dMaxBitmap=2147483647 -sDEVICE=pngalpha -r125 -sOutputFile="eu.png" -dNOPAUSE -dEPSCrop "eu.eps"
European version of your raster board is ready! Now type Ctrl+C to exit the command and return to the terminal, then type (or copy and -> Edit -> Paste):
gswin32c -dMaxBitmap=2147483647 -sDEVICE=pngalpha -r125 -sOutputFile="us.png" -dNOPAUSE -dEPSCrop "us.eps"
North-American version of your raster board is done! You may close Ghostscript. Now move the two raster files (eu.png and us.png) to their respective folders (HeroScribe/Icons/Raster/Europe/ and HeroScribe/Icons/Raster/USA/) and rename them after their Vector files (DewayneBoard_EU.png and DewayneBoard_US.png).
That's it, even the raster version of your board is ready! Open HeroScribe and have fun. Or head to the more complex drawing functions to panic a bit.
More complex drawing functions
The original HeroQuest board features simple polygons: in most cases they are just rectangles and squares, otherwise single lines. That's not always the case: you may need to draw more complex boards, such as this one from Dragon Strike©:
To draw such board you would need new functions like: colors, fills, paths, oblique lines, arcs and ellipses. As long as we are talking about corridor and dark areas, or grids, you should be coding this at this point of the .eps; if you need to draw rooms, instead, just do them in the room section of the .eps.
- Setting colors: in case you need to draw more complex corridor or dark areas, editing your Objects.xml will not be enough; you would need to draw them directly inside the board. To do that, select the matching color:
DarkRGB setrgbcolor You may choose which one from the colors section, or pick a new one by converting its classic RGB code with this online calculator, then setting it like this:0.3 0.3 0.3 setrgbcolor Then, you would need a function to fill the color with.
- Rectangle filling: similar to RectStroke, this function needs the coordinates for the starting square and the rectangle size:
10 Unit 1 Unit 2 Unit 5 Unit rectfill This way you are filling the 2x5 rectangle starting at 10,1 with the previously configured DarkRGB color.
- Path filling: this function draws a complex polygon made of coordinates:
newpath 1 Unit 1 Unit moveto 2 Unit 3 Unit lineto 3 Unit 1 Unit lineto closepath fill With this, you would be drawing a triangle (whose vertices are at 1,1 - 2,3 - 3,1) filled with the previously configured DarkRGB color. Paths can be build by any number of coordinates:newpath 1 Unit 1 Unit moveto 2 Unit 3 Unit lineto 3 Unit 4 Unit lineto 5 Unit 6 Unit lineto 3 Unit 1 Unit lineto closepath fill
- Setting strokes: in case you need to draw more complex grids, select the right stroke's size:
GridStroke setlinewidth You may choose which one from the strokes section in the .eps. Then, you would need a function to draw the stroke with.
- Oblique line drawing: this function draws an oblique line, getting over the more simple horizontal and vertical lines:
1 Unit 1 Unit moveto 4 Unit 4 Unit lineto stroke You are drawing an oblique line from 1,1 to 4,4; no filling this time, just a line.
- Arc drawing: this function draws an arc, partial or not:
11 Unit 8 Unit 3 Unit 0 360 arc stroke You are drawing a 3 squares-radius circle, its center being in 11,8. 0 being the anticlockwise begin of the stroke (3 o'clock) and 360 being the anticlockwise end of the stroke (3 again): a full circle, as shown in the Dragon Strike© City board. Let's say you want a partial circle filled for the third hour quarter (12:30 to 12:45), you would code it this way:11 Unit 8 Unit 3 Unit 180 270 arc fill Please note that 0 means the start of the circle (3 o'clock), 360 the ending.
- Path and arc drawing: you may draw a complex path which includes an arc:
newpath 11 Unit 8 Unit 3 Unit 180 270 arc 11 Unit 8 Unit lineto closepath stroke You are now drawing a closed, partial arc; again, you could fill it by replacing stroke with fill.
- Room drawing: in order to draw room borders, be sure to pick the right stroke size (RoomStroke setlinewidth) then choose any of the known functions to start drawing.
- Ellipse drawing: this function draws an ellipse, partial or not. In order to be able to use it, you will need to insert the following code at this point of the .eps:
/ellipse {
/endangle exch def
/startangle exch def
/yrad exch def
/xrad exch def
/y exch def
/x exch def
/savematrix matrix currentmatrix def
x y translate
xrad yrad scale
0 0 1 startangle endangle arc
savematrix setmatrix
} def
That said, you may now draw an ellipse:11 Unit 8 Unit 2 Unit 4 Unit 0 360 ellipse stroke You are drawing a full 2 squares tall, 4 squares wide ellipse, its center being in 11,8. 0 being the anticlockwise begin of the stroke (3 o'clock) and 360 being the anticlockwise end of the stroke (3 again).
- Text: this function lets you write texts on your board. In order to be able to write, you will need to insert the following code at this point of the .eps:
/simplecj {dup stringwidth pop 2 div
4 -1 roll sub neg 3 -1 roll moveto show} def
That said, you may now write:/Times-Bold findfont 7.5 scalefont setfont 9.5 Unit 9.5 Unit (Text On My Board) simplecj showpage You are writing "Text On My Board" at 9.5,9.5.
That's it, you are ready to draw your own HeroScribe board! You may want to give a look on the boards available in the Just Boards Icon Pack from the Icon Packs Section; just extract the Vector board files (HeroScribe/Icons/Vector/Europe/xBoard_EU.eps.gz and HeroScribe/Icons/Vector/USA/xBoard_US.eps.gz) with 7-Zip, then open them with NotePad++, or TextEdit. | |