Jul 22, 2019

Pathery Map Generator

This blog post is a help document for Pathery's Map Editor's Map Generator. This document assumes you already know how to use the editor before it had BlockCode. At time of writing, the feature isn't released yet.

6.6.5.Testmap...:2,y1.,y1.2,s1.1,y1.,y1.4,y2.,y2.1,f1.2,y2.,y2.2,y12.,y1.,r1.,y21.,y12.,y21.,y13.,y2.,r1.,y21.
The above is an example of Pathery BlockCode. The upper four rows in this example are the base map, declaring a few start locations, an end, and two selector groups. The lower three rows is the block code that manipulates the map for a desired generator outcome. An example outcome of this generator is:


Lets dive into this one line at a time.

ReplacePoint 1 Rock EndOfLine
ReplacePoint [FromBlock{1}] [ToBlock{1 or more}] EndOfLine
The ReplacePoint Command looks for blocks matching the FromBlock type, and randomly replaces them with the ToBlocks. In the example above, the top right 1 selector was replaced with a rock.

(Note to self: Known bug: If a user attempts to place out more blocks then their selector FromBlock has spaces for, the page will bug out due to extra text provided in the AJAX return.)

Fill 2 Rock EndOfLine
Fill [FromBlock{1}] [ToBlock{1}] EndOfLine
The Fill Command looks for blocks matching the FromBlock type, and replaces all of them with the ToBlock's type. In the example above, the six lower rocks are from this fill command.

Empty EndOfLine
Areas without commands are fine. Above these two blocks is an example of empty space existing before a command block. If non-BlockCodes are provided before a command, they will be ignored.

ReplacePoint Start Void Void Void EndOfLine
ReplacePoint [FromBlock{1}] [ToBlock{1 or more}] EndOfLine
FromBlocks are allowed to be any map placeable block (all standard blocks and the selector BlockCode. In the above example, three of the start locations were replaced with void spots.



SurroundPoint 1 Rock EndOfLine
SurroundPoint [FromBlock{1}] [ToBlock{1}] EndOfLine
The Surround Point Command select a random FromBlock and places it's ToBlock type in the four orthogonal directions. This will replace whatever block is on those squares, pre-existing or placed by BlockCode earlier. Blocks to be placed that would be off the map are ignored instead.

(Note to self: Known bug: If a user attempts to use a FromBlock that doesn't exist, the page will bug out due to extra text provided in the AJAX return.)
The last component you need to know to create the majority of maps on Pathery is the OR and Percent BlockCode. The following image and BlockCode is an idea from 是我人 to combine both Normal and Complex into a single map. This includes OR blocks, which are equal chance options of multiple command blocks, as well as percent chance sections appearing after the last ToBlock of a command set, which gives a chance that a given command set won't fire. This also has dynamic waypoints, allowing the 1 section to have 1 or 2 waypoints, allowing the 2 section be the next waypoint (either B or C), then 3 to 5 more waypoints after that, correctly selected starting at C or D based on the previous rolls.

(Note to self: Fix wall count so that it works, allow it to softly fail, document it.)

(Note to self: Document how to view the soft errors via JS's console view, or code it into the UI to naturally view it. Document Multi ORs. Document Last % and NotLast %. Make icons for these two.)

(clicky for big)

19.39.33.NormalAndComplex...:,s1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,t1.,y2.,r3.,s1.1,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,t1.,y2.,r3.,s1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,t1.,y2.,r3.,s1.1,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,t1.,y2.,r3.,s1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,t1.,y2.,r3.,s1.1,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,t1.,y2.,r3.,s1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,t1.,y2.,r3.,s1.1,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,t1.,y2.,r3.,s1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,y1.,t1.,y2.,r3.,r3.,r3.,r3.,r3.,r3.,r3.,r3.,r3.,r3.,r3.,r3.,r3.,r3.,r3.,r3.,r3.,r3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12.,y1.,r1.,r1.,y18.,y6.,y10.,y21.,y12.,y1.,r1.,r1.,y18.,y4.,y10.,y21.3,y12.,y1.,r1.,r1.,y18.,y2.,y10.,y21.11,y12.,y3.,r1.,r1.,r1.,r1.,t3.,u3.,r1.,y21.,y12.,y3.,t4.,u4.,y18.,y3.,y3.,y21.1,y12.,y3.,r1.,r1.,r1.,y18.,y8.,y10.,y21.2,y12.,y1.,z5.,z5.,y18.,y3.,y21.1,y12.,y3.,r1.,r1.,r1.,y18.,y6.,y10.,y21.2,y12.,y1.,t2.,u2.,y18.,y3.,y21.1,y12.,y3.,r1.,r1.,r1.,y18.,y4.,y10.,y21.10,y12.,y3.,r1.,r1.,r1.,y18.,y2.,y10.,y21.10,y12.,y3.,z5.,z5.,y18.,y8.,y10.,y21.11,y12.,y3.,z5.,z5.,z5.,y18.,y2.,y10.,y21.10,y12.,y3.,z5.,z5.,z5.,y18.,y2.,y10.,y21.10,y12.,y3.,z5.,z5.,z5.,z5.,y18.,y1.,y10.,y21.9,y12.,s1.,r3.,r3.,r3.,r3.,r3.,r3.,r3.,r3.,y21.8,y11.,y1.,y5.,y19.,y2.,y2.,y21.12,y11.,y1.,y1.,y19.,y1.,y1.,y21.


[ToAdd: SurroundBlock, OR blocks, Percent block]

Jun 12, 2019

2d10 + the absolute difference between the two dice

I pondered what 2d10 + the absolute difference between the two of them would be. After thinking though a few of the rolls, I realized that 3 isn't a possible outcome. The lowest roll would be 2, at a 1% chance (two back to back 10% chances). The max roll was from either 10 10 or 1 10.

Typed it up into Anydice.
function: sum plus difference of A:n and B:n {
    C: [absolute A - B]
    result: A + B + C
}

output [highest 1 of 2d20]
output [sum plus difference of d10 and d10]


Turns out, it is really similar to having advantage in DnD 5e, aka Higher 1 of 2d20 (image is the same graph as above, with "at most" selected). If on the advantage though, you "rounded up" odds to evens, it is the same.

I had hoped that this would have resulted in an upper bell curve, seen below in green. Blue is the standard 3d6 bell curve for comparison.