Message Boards Message Boards

[WSS19] Tabletop RPG Map Generator

Posted 5 years ago

The Backstory

This July I was lucky enough to be a participant of the Wolfram Summer School. My project was to develop a function that would generate tessellations of space and assign a value to each cell- all of this so that I could visualize higher-dimensional CAs. I can proudly say that I was somewhat successful and the end result of my work can be found here. You may be wondering why on earth do I bring this up. Well, on the flight back home I was thinking about how I could further develop my code, and I realized that with only a few minor tweaks I could make something REALLY useful. Something that I'm sure many people who frequent these forums would be happy to use. Something to play tabletop RPGs.

The Big Idea

One of the things my TesselationPlot function could do is generate a hexagonal grid- a tabletop map waiting to happen! I got rid of a lot of unnecessary code, added some quality of life improvements, and came up with the following:




The input is a matrix, where the entry in each cell is the type of land you want in that place on your map. So, for example, running:

smallWorld = {{grass, grass, mountains}, {grass, forest, 
   mountains}, {grass, forest, forest}};

would generate the the following map:

A small map.

The Images

The terrain graphics were hand-painted for this project by my talented fiancée, Maria Czarnecka. Currently there are 9 terrain types: grass, ocean, desert, mountains, volcano, swamp, ice, lake, and forest. We plan to add at least a few more (city, village, road, river, ravine). All of them are available for you to download from my GitHub. You can also make as many new ones as you like yourself- feel free to share ideas and images in the comments! However, you can create some pretty nice maps using just what's available at the moment: enter image description here

Some Final Thoughts

When I have some time this week I plan to add auto-padding to the code, so the input won't have to be a full rectangular array. It might also be a good idea to add a "space" terrain tile to create nice world boundaries. Let me know in the comments if you have any other suggestions or ideas!

POSTED BY: Jack Heimrath
5 Replies
Posted 4 years ago

It would be nice if instead of generating hex content arbitrarily one could use a real map. That would be good for historical games; enter a hex size and then produce the Google Earth image at a specified scale with a hex array on top of it.

POSTED BY: trinko

If you use a real map, wouldn't it basically be a hex grid placed over the real map? Or do think the overlapping hexagons is related to this?

POSTED BY: David Whitten

What would the syntax look like to generate a hex grid as opposed to a hex grid with overlaps? The idea of hex grids with overlaps strikes me as cool because it is a way to view a continuous map as in a overlapping digital form while giving up the idea of one-to-one correspondence between some of data locations in the continuous map and the hexes of the overlapping view. It feels like this would allow a natural scaling when increasing detail in the continuous map in a computer visual tool, while still having a digital representation.

Dave Whitten 713-870-3834

POSTED BY: David Whitten

One idea might be to make the hexagons about 10% larger than currently, but with the same spacing between their centers, so that they overlap. Then, across each overlap, combine/overlay the images in a gradual transition of x(image 1) + (100-x)(image 2) where 0<x<1 is the fraction of distance across the boundary overlap traversed (with different logic for the region around nodes where 3 images intersect). (Not familiar enough with image combination to know how that would look exactly in code, but hopefully the idea's clear.)

That might keep it easy to visually identify what terrain type is in each hexagon, but reduce the abrupt transitions across hexagon boundaries and make it look more "realistic".

POSTED BY: Andrew Walters

enter image description here - Congratulations! This post is now featured in our Staff Pick column as distinguished by a badge on your profile of a Featured Contributor! Thank you, keep it coming, and consider contributing your work to the The Notebook Archive!

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract