Mapping/Spawn Patterns

Adding a pattern

 * 1) Select your map
 * 2) Click Other -> Open Folder
 * 3) Create folder "spawn-patterns"
 * 4) Inside the folder create anyname.txt file, one file is one pattern, create as many as you want
 * 5) Copy/paste file format from below and save

File format
v1 AllowReversed true ConstantTbbScale -1 ChanceToUseIfPicked 100 MinMaxTbbDifferences 0.75_1.25 0.75_1.25 Table -- --14-- --32-- --

Result:

B8x8fvKWNWI

File format description
v1 AllowReversed true or false - allows spawn table/pattern to be reversed, if true then there's 50% to start spawn pattern from last position (4 in this case) and go in reversed direction ConstantTbbScale -1 - default is -1, can be changed to 1 to make pattern not change its shape with music loudness and Time Between Beats, in general leave it at -1 ChanceToUseIfPicked 100 - value between 0 to 100, more later (think of it as 100% to pick) MinMaxTbbDifferences 0.75_1.25 - first value is min ratio, second is max ratio, more later 0.75_1.25 Table - this marks start of spawning table/pattern, table can use any separators, numbers mark targets positions, unlimited width/height -- --14-- --32-- -- In this case pattern would look like:



Patterns selection/matching to beat
While playing the game generator calculates time between targets for up to next 10 beats. These values are used to check if any available pattern matches the beat. If that's the case then one of pattern is picked randomly and then ChanceToUseIfPicked value is used to finally confirm the pick.

MinMaxTbbDifferences are used to see if beats match a pattern. It is a ratio of next tbb to previous tbb (time between beats).

For example our pattern with 4 points would have to match 4 beats:
 * 1st beat spawns
 * 2nd beat spawns 200ms later
 * 3rd beat spawns 190ms later (relative to 2nd beat)
 * 4th beat spawns 210ms later (relative to 3rd beat)

As you can see we have 3 time between beats (think of it as paths of our pattern) and we are going to have only 2 ratios:
 * 190ms/200ms = 0.95
 * 210ms/190ms = 1.105

These values or not smaller and bigger than MinMaxTbbDifferences defined as:
 * min: 0.75 max: 1.25
 * min: 0.75 max: 1.25

In this case we are going to have a match and our patter will be picked for sure as ChanceToUseIfPicked was set to 100.

Why?
It may be a bit hard to understand but this way a pattern can be used in any map with any bpm or tbb settings. Spawn table is only used as directions and MinMaxTbbDifferences in a way define distances between points.

Other example: Table -- -2-4-- -1-3-- -- To get this pattern to work correctly path 2-3 has to be a lot longer than 1-2 and 3-4. You can image that path 1-2 and 3-4 would take 200ms and 2-3 400ms. We could define MinMaxTbbDifferences as MinMaxTbbDifferences 1.50_2.50 - 400ms/200ms would be 2.00 but we want to match similar beats otherwise there will be very low chance to get this pattern 0.35_0.65 - 200ms/400ms would be 0.50 but we want a bit bigger range In other words these values define how longer is next path relative to previous one:
 * Path12 * 2 = Path23
 * Path23 * 0.5 = Path34