sym_merged
sym_merged copied to clipboard
Add level generator script (Codegen!)
a = World number
b = Stage number
c = Zone number
n = image number (single image can contain multiple zones)
Implement stage-codegen.py
- [x] Generate
game_stage_Wa_Sb.cpp
- [x] Learn to parse
*.tmx
file, which is basically*.xml
file - [x] Restructure
bg_wa_sb_n.tmx
file(s), so that the zone boundaries can be identified with the zone number.- [x] Change Tiled layers so that each zone takes each Tiled layers
- [x] Find the first non-zero cell from the front and back on each zone, to find top-left and bottom-right cell
- [ ] (Optional) Fix the
helper::tilemap::IndexRect
ctor, so that it can take top-left and bottom-right cell - [x] (Optional) Add object template to Tiled object layer
- [x] Parse
bg_wa_sb_n.tmx
file(s) and generategame_stage_Wa_Sb.cpp
- [x] When there is no certain entity available on zone c, generate
constexpr bn::span<ZoneInfo::{EntityInfo}> Zc_{entityInfo}s_
instead ofconstexpr ZoneInfo::{EntityInfo} Zc_{entityInfo}s_[]
- [x] When there is no certain entity available on zone c, generate
- [x] Learn to parse
- [x] Overwrite
game_stage_getter.h
to currently existing stages
Optional things
- [x] Rebuild a stage only when it is edited
- [x] Compare the modified time of generated zone header and the
*.tmx
file(s) of the zone-
os.path.getmtime()
considered helpful
-
- [x] Compare the modified time of generated zone header and the
- [ ] Verify if the stage is valid
- [ ] Check if there is at least one entrance on
Z0_entranceInfos_
(index 0 of it is where the stage starts) - [x] Check if it has only one black hole (stage clear)
- [ ] Check if every
Zc_exitInfos_
is connected to a valid zone number and a valid entrance index of that zone - [ ] Check if every size of the zone is same or bigger than
(30, 20)
cells - [ ] Check if unsupported items present (or simply ignore that one?)
- [ ] Warn unused entrance (exception: Z0_Ent0, where the stage starts)
- [ ] Check if there is at least one entrance on
- [ ] Optimize codegen by generating each
game_stage_Wa_Sb.cpp
asynchronously.