YAVSRG / Prelude

The rhythm game framework that powers Interlude
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Refactor: Store note rows as a NoteType array #21

Closed percyqaz closed 2 years ago

percyqaz commented 3 years ago

Current bitmap solution was ill-tough-out by 18 year old me and was maintained for backwards compatibility purposes

Since I am refactoring a lot, might as well revisit this code which I think can be made a lot more understandable with not a huge time cost

Setup

Each row of notes in a beatmap consists of several bitmaps, one for notes, hold heads, hold middles, hold tails, mines, etc. "easy" to enumerate a specific kind of note

Solution

Proposed format: Just an array of note types. Add a new note type called NOTHING

Current format permits two kinds of things to be in the same column at the same time, on the same row Proposed format eliminates this possibility so more accurately fits the domain (where this should be impossible)

All operations will now be very readable Proposed format fairly easy to compress still

percyqaz commented 3 years ago

current reluctance has been due to oob errors if you interpret a 4k chart as 5k, for example current bitmapping system means that column is blank and everything works proposed system may break some things

then again this is exactly why the change should be made/enforcing domain expectations, and it won't hurt to try as it's only a couple hours of work

percyqaz commented 3 years ago

refactor done, need to redesign hashing + saving/loading to a more sensible format (at the moment it's backwards compatible for testing)