Discussion:
One-Page Dungeon format in groff?
(too old to reply)
Laurens Kils-Huetten
2022-08-13 08:40:11 UTC
Permalink
Hello Dungeon Delving UNIX Afficionados,

yesterday I once more discoverered, how ridiculously fast groff
is compared to other typesetting toolchains like LaTeX, Python +
weasyprint or whatever.

Since I enjoy using fast UNIX tools to build some dungeons in my
spare time, I wonder how much work it'll take to reproduce the
classic One Page Dungeon layout in groff. Just in case you don't
know, the layout would simply look like this:

-------------------------------
| --------------- Table with |
|| | random |
|| Map of the | encounters, |
|| | various |
|| Dungeon | general |
|| | descriptions|
|| Level | of the level|
|| | And finally |
| --------------- a key with |
| descriptions of each |
| individual room of the |
| dungeon. Basically it's a |
| page, with one top-left |
| aligned image and text |
| floating around the image. |
| That shouldn't be too hard. |
| Nothing fancy really ... |
--------------------------------

The text might extend to the facing uneven page, thus creating a
two page spread for the level.

Of course I tried what groff seems to deliver out of the box, but
I find that displays typically use up a page width, or column
width, with text continuing below the image, but not floating
around the image like i've shown.

So, any ideas how to do this in groff? Maybe one of the common
macro packages already supports this kind of layout, only I
haven't discoverered it, yet?

Thanks in advance,
cheers,

~lkh
--
https://sdf-eu.org/~lkh
Laurens Kils-Huetten
2022-08-13 22:26:47 UTC
Permalink
Post by Laurens Kils-Huetten
Since I enjoy using fast UNIX tools to build some dungeons in my
spare time, I wonder how much work it'll take to reproduce the
classic One Page Dungeon layout in groff. Just in case you don't
-------------------------------
| --------------- Table with |
|| | random |
|| Map of the | encounters, |
|| | various |
|| Dungeon | general |
|| | descriptions|
|| Level | of the level|
|| | And finally |
| --------------- a key with |
| descriptions of each |
| individual room of the |
| dungeon. Basically it's a |
| page, with one top-left |
| aligned image and text |
| floating around the image. |
| That shouldn't be too hard. |
| Nothing fancy really ... |
--------------------------------
So after some digging around in the archives, and cracking open
*UNIX Text Processing* by Dougherty and O'Reilly, here's my basic
proof of concept: Loading Image...

Macros follow, cheers! ~lkh

.\" Macros to typeset One Page Dungeons
.\" in groff
.\"
.de opdMap \" start with the map
.br
.mk a \" Mark current position
.PSPIC -L \\$1 4i \" insert map image 4 inches wide
.br
.mk b \" Mark lower edge of map
..
.de opdSB \" start the side bar
.sp |\\nau \" move back to mark a
.in +4.2i \" increase indent by 4.2 inches
. \" left margin is now just right
. \" of the map
.ft R
..
.de opdH \" section header for opd stuff
.sp 1v
.ft B
..
.de opdLB \" opd begin entries
.ft R
.in +1.3
.br
..
.de opdLI \" opd list entries
.br
.ti -1.3
..
.de opdLE \" opd end list
.in -1.3
.br
..
.de opdEN \" end of special opd stuff
.br \" break line, just to make sure
.sp |\\nbu \" move to mark b
. \" that's the lower edge of the map
. \" we marked above
.sp 1v
..
Frotz
2022-08-16 20:06:36 UTC
Permalink
Post by Laurens Kils-Huetten
Post by Laurens Kils-Huetten
Since I enjoy using fast UNIX tools to build some dungeons in my
spare time, I wonder how much work it'll take to reproduce the
classic One Page Dungeon layout in groff. Just in case you don't
-------------------------------
| --------------- Table with |
|| | random |
|| Map of the | encounters, |
|| | various |
|| Dungeon | general |
|| | descriptions|
|| Level | of the level|
|| | And finally |
| --------------- a key with |
| descriptions of each |
| individual room of the |
| dungeon. Basically it's a |
| page, with one top-left |
| aligned image and text |
| floating around the image. |
| That shouldn't be too hard. |
| Nothing fancy really ... |
--------------------------------
So after some digging around in the archives, and cracking open
*UNIX Text Processing* by Dougherty and O'Reilly, here's my basic
proof of concept: https://ttm.sh/qhr.png
Macros follow, cheers! ~lkh
.\" Macros to typeset One Page Dungeons
.\" in groff
.\"
.de opdMap \" start with the map
.br
.mk a \" Mark current position
.PSPIC -L \\$1 4i \" insert map image 4 inches wide
.br
.mk b \" Mark lower edge of map
..
.de opdSB \" start the side bar
.sp |\\nau \" move back to mark a
.in +4.2i \" increase indent by 4.2 inches
. \" left margin is now just right
. \" of the map
.ft R
..
.de opdH \" section header for opd stuff
.sp 1v
.ft B
..
.de opdLB \" opd begin entries
.ft R
.in +1.3
.br
..
.de opdLI \" opd list entries
.br
.ti -1.3
..
.de opdLE \" opd end list
.in -1.3
.br
..
.de opdEN \" end of special opd stuff
.br \" break line, just to make sure
.sp |\\nbu \" move to mark b
. \" that's the lower edge of the map
. \" we marked above
.sp 1v
..
I always forget about troff/groff, but it's such an obvious choice. Your
proof of concept looks great - the next time I feel compelled to create
a "Planet Eris"-style OD&D campaign book I will give it a shot.

Thank you for sharing the macros - these are great!
Frotz
2022-08-16 20:07:19 UTC
Permalink
Post by Laurens Kils-Huetten
Post by Laurens Kils-Huetten
Since I enjoy using fast UNIX tools to build some dungeons in my
spare time, I wonder how much work it'll take to reproduce the
classic One Page Dungeon layout in groff. Just in case you don't
-------------------------------
| --------------- Table with |
|| | random |
|| Map of the | encounters, |
|| | various |
|| Dungeon | general |
|| | descriptions|
|| Level | of the level|
|| | And finally |
| --------------- a key with |
| descriptions of each |
| individual room of the |
| dungeon. Basically it's a |
| page, with one top-left |
| aligned image and text |
| floating around the image. |
| That shouldn't be too hard. |
| Nothing fancy really ... |
--------------------------------
So after some digging around in the archives, and cracking open
*UNIX Text Processing* by Dougherty and O'Reilly, here's my basic
proof of concept: https://ttm.sh/qhr.png
Macros follow, cheers! ~lkh
.\" Macros to typeset One Page Dungeons
.\" in groff
.\"
.de opdMap \" start with the map
.br
.mk a \" Mark current position
.PSPIC -L \\$1 4i \" insert map image 4 inches wide
.br
.mk b \" Mark lower edge of map
..
.de opdSB \" start the side bar
.sp |\\nau \" move back to mark a
.in +4.2i \" increase indent by 4.2 inches
. \" left margin is now just right
. \" of the map
.ft R
..
.de opdH \" section header for opd stuff
.sp 1v
.ft B
..
.de opdLB \" opd begin entries
.ft R
.in +1.3
.br
..
.de opdLI \" opd list entries
.br
.ti -1.3
..
.de opdLE \" opd end list
.in -1.3
.br
..
.de opdEN \" end of special opd stuff
.br \" break line, just to make sure
.sp |\\nbu \" move to mark b
. \" that's the lower edge of the map
. \" we marked above
.sp 1v
..
I always forget about troff/groff, but it's such an obvious choice. Your
proof of concept looks great - the next time I feel compelled to create
a "Planet Eris"-style OD&D campaign book I will give it a shot.

Thank you for sharing the macros - these are great!
Laurens Kils-Hütten
2022-08-18 07:52:49 UTC
Permalink
Post by Frotz
I always forget about troff/groff, but it's such an obvious choice. Your
proof of concept looks great - the next time I feel compelled to create
a "Planet Eris"-style OD&D campaign book I will give it a shot.
I'm looking forward to that one :D
Post by Frotz
Thank you for sharing the macros - these are great!
It was fun getting this to work. The macro made it to one of the "official"
groff example pages:

https://www.froude.eu/groff/examples/one-page-dungeon.html

Cheers,

lkh
--
https://octodon.social/web/@lkh
IRC: lkh on Libera.chat and others
Discord: lkh#2319
kyonshi
2022-11-30 19:22:13 UTC
Permalink
Post by Laurens Kils-Hütten
Post by Frotz
I always forget about troff/groff, but it's such an obvious choice. Your
proof of concept looks great - the next time I feel compelled to create
a "Planet Eris"-style OD&D campaign book I will give it a shot.
I'm looking forward to that one :D
Post by Frotz
Thank you for sharing the macros - these are great!
It was fun getting this to work. The macro made it to one of the "official"
https://www.froude.eu/groff/examples/one-page-dungeon.html
Cheers,
lkh
How does that actually look like in the end? Do you have a sample for that?
Laurens Kils-Hütten
2022-12-06 17:43:52 UTC
Permalink
Post by kyonshi
How does that actually look like in the end? Do you have a sample for that?
yes, it's here: https://ttm.sh/qhr.png
--
Laurens Kils-Hütten
https://sdf-eu.org/~lkh
kyonshi
2022-12-06 18:54:51 UTC
Permalink
Post by Laurens Kils-Hütten
Post by kyonshi
How does that actually look like in the end? Do you have a sample for that?
yes, it's here: https://ttm.sh/qhr.png
that looks very neat, if a bit basic. But that doesn't have to be bad. I
think this could be useful.

Loading...