Puzzle Editor

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(as image below) 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 / Start With FEN String

In ChessPuzzleEditor scene, under the ChessGameObjectBase scene gameobject, there are ChessPuzzleEditorGUI script component attached to it. The UI presentation of the component on the inspector is made by custom editor script.

1) The refresh button is for placing all pieces on the board as if provided by the text from the Fen String input text field. While the board is at edit board mode, tick the Start With Fen toggle and hit the Refresh button and the board will automatically place all pieces as exactly as the Fen String provided.

2) The create button is to 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) The load button is to load any puzzle scriptable object into the board, even if it has data in it, making editing puzzle data easier than ever.

4) The save as button is to 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

Last updated