- Learn
- Tutorials
- Algorithms
- Dijkstra’s Algorithm
- Appendices
- D Tuning Tables
Appendix D — Tuning Tables
The numbers that make Weighted Maze play the way it does. Change them to remix the game: the game’s Logic reads them from here. Try one change at a time, and run the game after each. If something stops working, put the old number back.
D.1 Data Tables
D.1.1 Maze Cells
One row for each cell of the map, in reading order: Cell 00 is the top-left cell, and the numbers grow to the right, then down. A cell’s number is its row’s position in this table, counting from 0. cost is what it costs to enter the cell (-1 is a Wall). distance is the cheapest cost found so far from the Camp (1000000 means not reached yet). parent is the cell that cheapest route came from (-1 for none). settled is 1 once the cell’s distance is final. routeOrder is the cell’s place on the finished Route, counted from the Tower (-1 when it is not on the Route). The costs written here are the supplied map: Restore Defaults puts them back while the game runs.
11000000-10-111000000-10-111000000-10-1D.1.2 Maze Settings
The rules of the map. columns is how many cells a row of the map holds. rows is how many rows the map has; columns times rows must be the number of Maze Cells rows. startCell is the Camp’s cell and goalCell the Tower’s. maxCost is the largest cost a cell may have. unreached is the distance a cell has before the search reaches it; it is larger than any real route can cost. tickSeconds is how long Find route waits between two Steps.
121001199910000000.045D.1.3 Maze Layout
Where the map is drawn, in screen pixels. originX and originY are the center of Cell 00 (the top-left cell), measured right and down from the top-left corner of the screen, the numbers the Scene editor shows. spacing is the distance between the centers of two cells side by side; it is the width a Map Cell is drawn (64 px), so the cells touch. slideSeconds is how long the Marker takes to move one cell. markerOffset is how far right of and below its cell’s center the Marker stands, so it sits on the cell’s lower-right corner. campFrame and towerFrame are the Terrain Tiles pictures drawn on the Camp and the Tower.
56154640.21645D.1.4 Terrains
The four kinds of cell the learner can paint. cost is what entering that cell costs (-1 means a Wall, which cannot be entered). frame is its picture in Terrain Tiles. A cell whose cost matches no row is drawn as Road.
103162-13D.1.5 Messages
Every line the Status text can show. Each row is one situation; words is what the player reads. ready shows when the map opens and after every Reset, before the first Step. cellSettled goes between the name of the cell just settled (its Maze Cells row) and its distance, as in “Cell 52: cost 8”. noRoute shows when the search runs out of reached cells before the Tower is settled. wrongMapSize, wrongSettings, wrongEndpoints, wrongCost and blockedEndpoint are the input rules Check Maze Input asks before a search begins; their words name what to fix. buildingRoute shows when the Tower is settled, followRoute when the whole Route is traced, and invalidRoute when a traced link cannot be trusted. noCost is what the Cost readout shows until the Tower is settled. cheapestRoute shows when the Marker has walked the whole Route to the Tower. searching shows when Find route starts or goes on, and paused when the learner pauses it with the Find route button. findCaption and pauseCaption are what the Find route button reads while Find route is stopped and while it runs.
Paint terrain.: costNo route.Fix columns and rows.Check search settings.Check start and goal.Use costs 0 to maxCost.Unblock S and G.Building route...Follow the route.Invalid route.--Cheapest route.Searching...Paused.Find routePauseD.1.6 Directions
The four directions in which a cell has neighbors, in the order the search looks at them: Up, Right, Down, Left. columnStep and rowStep say how many columns and rows away the neighbor is. Rows count down from the top row of the map, so Up is rowStep -1.
0-11001-10D.2 Logic Numbers
The numbers and colors each Logic Component keeps in its Shared Variables and Per Instance Variables, with the Starting Value its card gives. A value set on its Object, under Variables in the Properties, or on a placement in the Scene, wins over the value here.
CHOOSE TERRAIN
chosenTint ................. #dab674
plainTint .................. #ede2cd
STEP TRIAL
maxCostLimit ............... 99
unreachedLimit ............. 1000000000
SHOW SEARCH OUTLINE
frontierTint ............... #32e9ed
settledTint ................ #64afff
currentTint ................ #ffffff
routeTint .................. #ffe043
SHOW ROUTE LINE
lineTint ................... #ffeb55
