T
T
The Chess
Search
K

Puzzle Editor Introduction

Introduction to the usage of ChessPuzzleEditor scene
The commonly used words.
1) Fixed move is moves imported. Most of the time is mentioned with move.
2) Move variant is moves made by controller.
3) Puzzle move is preset valid puzzle moves contained in puzzle data.
Edit Board Mode
This feature is made as an alternative to start board position by FEN string, having the advantage of visualizing and editing the board on the go.
1) Change the color of player to take the first turn after clicking the Edit Puzzle button.
2) The configurable castle setting allow setting available castle moves on edit puzzle mode. The game logic included adjustment for invalid castle setting when first enter edit puzzle mode. So, it's safe to have invalid castle settings set on these toggles.
3) The Editor pieces that can be used to spawn pieces on the board. Deselect any selected editor pieces by clicking them again to be able to drag pieces on the board again.
4) Enter edit puzzle mode, in edit puzzle mode, the chess game logic will become serious, and no messing around action can be done, just like usual chess game.
Edit Puzzle Mode
This is where editing valid puzzle moves starts.
1) UI for fixed moves, any pointer(green color button) pointing in this UI mean only for view mode, disabling the ability to move even if it's legal, unless it's pointing at the last button, which the next move will considered as move variant. The data in this section will have the same effect when loading on Puzzle scene, it's for viewing purpose only. Just some extra feature.
If you think you will never use or need it, simply set this UI and Cut button inactive, and remove any UI in ChessBaseUIs' ChessUIManager attached script that's unused.
2) UI for move variant, recording all the manual move made by the controller, this UI is essentially same as the one used in ChessPGN scene. It will replace all subsequent move variant as of which the pointer is pointing at when the controller made a move.
3) Migrate move variant and all of its previous move, starting from the pointer up to the bridging button(gray color button), to fixed moves UI, the underlying game logic does so as well, if only if the pointer is pointing at any button in move variant scroll view. If the pointer is at fixed move scroll view, the migrate target will be fixed moves, to the last button from the pointer, back to move variant UI. All of the saved variant will be process accordingly, any saved move variant that cannot match the sequence that was being cut will be asked to be removed, to prevent any illegal move from happening.
4) Back to edit board mode where all the data in edit puzzle mode will be wiped out and the board will go back to its original placement where edit board mode left off.
5) Containing all the saved move variant data from clicking the Save Variant button, can be saved into scriptable object and will be converted to puzzle data on Puzzle scene. In Puzzle scene, to pass puzzle, all move variant made has to be exact sequence to any saved move variants data.
Manage puzzle scriptable object data
1) While the board is at edit board mode, place all pieces on the board as exactly as the Fen String provided. The toggle Start With Fen has to be ticked for it to work.
2) Create a new puzzle scriptable object in path Resources/ScriptableObjects/ChessPuzzle/Levels. Or the another way is by right clicking on the project tab and select Create -> TheChess -> Puzzle -> PuzzleLevel.
3) Load any puzzle scriptable object into the board, even if it has data in it, making editing puzzle data easier than ever.
4) Save the data in edit puzzle mode to the scriptable object, for the data in 1) and 5).
Tips : Removing piece is allowed by just dragging a piece on the board and replace another piece