Diary 2019-05-18

Tags:
By Max Woerner Chase

Today, I was really tired all day, which wasn't great. Anyway, I finished moving the GameMap into the ECS, and now it's only really awkward in the places that I haven't yet refactored, like the core game logic and the rendering code. I also made some changes to how the repository is handled. Instead of ignoring the generated source code, I added a pre-commit hook to update the generated code, and addremove the generated files. I also added an alias to diff that excludes the generated files. The hook implementation has me a little nervous, but I prefer it to the possibility of taking a build system update that just completely wipes out the build.

Anyway, my next priority is adding the RNG into the save files, which will allow me to get perfect replays. My current plan for that is to allow saving numpy's Mersenne Twister data structure (already done), and incorporate it into the code that relies on randint. Basically, the Game object would have one, and pass it into the generator code, and also use it to seed new ones to pass into the item use functions, where they could then be used by stuff like the Confused AI. I'm kind of sad I don't have the ability to express Rust-style ownership here; I'd really like to be able to be all "pass it in here as a mutable borrow, and this class here needs to take it by owner, so you have to make a new one". What it comes down to is, I haven't yet worked out the exact way I want this to look, so I can't make the change yet, because I don't know what change I want. Maybe this would be more obvious if I put the replay stuff on hold, and went to following along with part 11. I'll sleep on it and see what I think in the next few days.

For now, I'm going to try to wrap up sooner than I did last night. Good night.