Talk:Eternia Crystal Stand
Reverse engineering the Eternia Crystal Stand checks[edit source]
From a look at the decompiled code, the following algorithm is used to place the portals. The algorithm starts at the base of the crystal stand, horizontally level with the point clicked (not necessarily the centre of the crystal stand) and runs once in each horizontal direction: east and west.
It should be noted that platforms, open doors or trap doors and inactive blocks do not count as solid. Ice blocks created by the Ice Rod do count as solid, and will disappear as normal after the event starts. Background walls are ignored.
- Step down up to 4 tiles, or until a tile with solid ground below it is reached.
- Repeat the following up to 120 times:
- If the current tile is solid, step up at most three tiles until we reach a non-solid tile.
- If the tile below the current tile is non-solid, step down one tile.
- If the tile below this tile is also non-solid, and there is no solid tile up to 6 tiles below it, end the loop.
- If the current tile is solid or there is a solid tile within 9 tiles above the current tile, end the loop.
- Step across one tile.
- When the loop ends, if it was stopped by tiles in the way or a too-deep drop, the current tile will be horizontally level with the obstruction or above the drop, so step back one tile.
The algorithm is run in the east and west directions, and the point clicked is a valid starting point if at least 60 complete iterations of the loop were made in each direction. A portal appears at each of the two points where the algorithm ends, which can be at least 60 tiles and up to 120 tiles horizontally away from the starting point.
I would like other opinions on whether this description is clear and understandable enough to add to the page.
The screenshots in this section were created by enabling debug code that is present in the game, but never normally run.
- The large blue dot shows the starting point of the loop.
- Red dots appear when the game determines that the current tile is free of obstructions and the loop can continue. They show the current tile and the 10-tile volume checked for obstructions.
- Blue dots indicate drops checked by step 2.3.
- Green dots indicate the current tile after each iteration of the loop.
- White dots indicate the two end points where the portals would appear.
If correct, "either side" should be changed to "both sides" for the "what counts as a large open area" section[edit source]
From all screenshots I have seen and personally trying it myself, it seems that both sides need the 61 block sections of free space for the crystal to be placed. Also, although it is heavily implied, it could be stated that it needs "blocks of free space" or "blocks of empty space" or something instead of just 61 "blocks". Lastly, perhaps it should also be included that the background layer/walls don't affect the requirements (since most other requirements are explicitly stated). -- MatthewTh0 (talk) 00:45, 7 June 2020 (UTC)