Normally a tile map displays spaces which can be defined in finite terms using a piece of paper. A hypermaze, however, can be defined using a piece of paper, only, if you use a graph to describe how the pieces fit together. This is true for my hypermaze, and I suspect it should hold true for most other hypermazes. A tile map is a lot like a piece of paper, only a lot less powerful; thus in relation to a tile map you should consider the space of hypermaze to be undefined. You can’t measure it, because it doesn’t have a concrete form in 2 dimensions. You might have success defining it in three dimensions, but then you’ll be unable to translate it to the tile map.
So how can a tile map be used to draw an undefined space?
The answer I found was: little by little.
Number Distributions
Number distributions are excessively useful to random number generators. Procedural generation tends to revolve around random numbers, ergo number distributions are immensely useful in procedurally generating data.
With distributions you can easily give some spice to your random number rolls. Give a hero a damage range (eg. damage: 400-800), next calculate the weight of values in that range based on the hero’s level. So now you have a hero at level 1 who will roll more 400’s than 800’s; take a max level hero and they can roll more 600’s or 800’s or whatever number from the range that you want. This type of generation can apply to whatever you’d like though.
Compressing Map Data
If you have a project you’re working on which has memory constraints, you’ll probably consider data compression to some degree or another at some point in development. Memory constraints are usually due to limitations of hardware on your target system/architecture; for reasons, you’re probably looking at anything from cache sizes, to stack memory, or physical memory.
With my rover project, my constraint was stack memory. Developing a recursive algorithm you can easily run out of space, so it becomes almost a base requirement to compress your data.
Extracting Data from Threads
There you are designing a parallel algorithm, and then it occurs to you: How do I return information to the main thread from a child thread?
If you’ve skimmed through half of The C++ Programming Language (4th Edition) by Bjarne Stroustrup like I have, you may recall a section about futures and promises which are related to threads.
Well those are exactly what we need, although I am sure you could create a custom solution. Like perhaps locking and inserting your data into an external container. Perhaps you prefer a standard C++ answer to your problems though? This way it makes sense and you need less comments.
My case was that I wished to learn the “proper” way to do it, and boy did I have a time learning.
Scanning 2D char Arrays
The problem is this: You have a two dimensional grid, and you need to scan the entire thing. Sure, but what does this ambiguous “scan” do? Well this particular post is about a word search puzzle, so the scans need to create strings to be used as search areas for the puzzle words. Scan the puzzle, and it compiles a list of all the columns, rows, and diagonals.
Now, there are a total of 8 directions you can scan a two dimensional grid by. { N, NE, E, SE, S, SW, W, NW – Exactly eight.} Wouldn’t it be nice if we didn’t need to scan all those directions. Well, if you think about it ‘E’ is a reflection of ‘W’ the same as ‘NE’ is a reflection of ‘SW’. Since the thing I just said, we don’t actually need to scan all 8 directions up front. We do need to look at all 8 directions, but we certainly don’t need to create strings for all 8.