on commence l'interface là ouais
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Pieces storage
|
||||
# Files format
|
||||
|
||||
## What is stored
|
||||
## Pieces
|
||||
|
||||
If you don't know what a polyomino is, check [this other file](Pieces_representation.md#what-are-polyominoes).
|
||||
|
||||
@@ -8,8 +8,6 @@ Generating polyominoes of size n is exponential in regard to n. Because of this,
|
||||
|
||||
We want the pieces to be always sorted in the same order, always attributed the same block type, and always set at the same spawn position, no matter how they were generated. We also want them to be separated in 3 categories : convex, not convex but without a hole, and with a hole. Theses problematics are already resolved internally, but will be calculated before storage as to not need extra calculcations upon load (except for the block type which is trivially computed).
|
||||
|
||||
## How is it stored
|
||||
|
||||
Pieces are stored in binary files. Each file simply contains every polyomino of one size, one after the other. Since each file contains all polyominoes of the same size, we know how much stuff to read and don't need delimiters. We know we've read all pieces simply when we reach the end of file character.
|
||||
|
||||
Each piece is stored as follows:
|
||||
@@ -18,3 +16,32 @@ Each piece is stored as follows:
|
||||
|
||||
The current implementation only allows to generate polyominoes up to size 16, but can be upgraded by storing coordinates on 8 bits instead of 4.
|
||||
It has been currently choosen to use pieces only up to size 15 for this game.
|
||||
|
||||
## Config
|
||||
|
||||
When compiling a release version, default files will be used, theses will then be impacted by the user and used for their next sessions.
|
||||
|
||||
### Keybinds
|
||||
|
||||
The games has 4 keyboard configs by default that never changes, and a modifiable 5th one, but theses are all stored the same.
|
||||
|
||||
Each keybinds files has the the following format:
|
||||
|
||||
- The number of the action (converted from an Enum), stored with 1 byte
|
||||
- The number of each binded keys (also converted from an Enum), stored with 1 byte
|
||||
- A separator characters which is 0xFF
|
||||
|
||||
_Repeat for every avaible actions._
|
||||
|
||||
### Settings
|
||||
|
||||
The settings file has the following format:
|
||||
|
||||
- The number of the chosen keybinds (from 0 to 4), stored with 1 byte
|
||||
- The size multiplier of the window, stored with 1 byte
|
||||
- The number of the last selected gamemode (converted from an Enum), stored with 1 byte
|
||||
- The last selected width of the board, stored with 1 byte
|
||||
- The last selected height of the board, stored with 1 byte
|
||||
- The uniformity mode (0 for default distribution, 1 for uniformous distribution, 2 for custom distribution), stored with 1 byte
|
||||
- If custom distribution is set, store the proportion of each size (15x1 byte total)
|
||||
- Every selected pieces, using 1 byte for the type of selection (once again converted from an Enum) and 1 byte for the actual value
|
||||
@@ -26,6 +26,8 @@ Then the rest of actions will be tested in the list's order.
|
||||
Finally, gravity and lock delay are applied last.
|
||||
Moving and soft dropping can be held but hard dropping, holding and rotating needs to be released and pressed again to happen.
|
||||
|
||||
Menu navigation is managed by the UI and uses static keybinds to prevent the user from softlocking themselves.
|
||||
|
||||
## ARR and DAS
|
||||
|
||||
The sidewise movement of the piece is defined by two parameters: DAS and ARR.
|
||||
|
||||
Reference in New Issue
Block a user