Didn’t set out to, but after a few hours of struggling to find a grip to get started working yesterday I finally gave in and just let my brain take the day off. Rest of the night, I just watched some anime, played with the dog, and generally didn’t work. Was still feeling shifty and unfocused, so when I went to bed I turned the alarm off so I could just sleep until my body decided it was ready to wake up. 11 hours later, I felt much better.
I remember a time when I was younger, not even that much younger, that I was virtually incapable of sleeping for 11 hrs straight, no matter how exhausted I was to begin with. Even if I pulled an all-nighter one night, the next night I’d sleep for at most 8 hours, and through my teens and 20s, I always functioned best on about 6 hours of sleep a night. That is still my general habit, but I’m afraid it’s not enough anymore.
It’s funny, when I’m caught up with a project, I don’t even think about it; I don’t feel like I’m falling behind on rest until my fatigue reaches critical mass. Even then, my natural tendency is to try to shake it off, to maintain whatever momentum I have and let sleep take care of itself later.
It was fantastically frustrating at the time, not being able to focus and get anything done yesterday; I kept trying to fight it, to force my mind into a work mode, but no joy. In hindsight, I realise it had been three weeks since I took a day off, and in all of 2011, I’ve taken all of 3 days off; every other day this year, for at least 8 and usually for 12-16 hours, I’ve been at my desk, programming. Before spring is over, I should take a whole weekend off at some point. But oh well.
Update on project status, Sunday I finished reworking the mu clients and server to use the new message interface instead of sending packets directly, and stripped the public interface for sending packets out of the Stockings lib entirely. Not much to show for yesterday, but did get a hacked version of network movement going, which I hope to finish today. Tho I’m not sure how much, if any, of the code from yesterday’s hacked version will say; the hack was terrible, but was about the best I could manage given my mental state yesterday, and it did work perfectly.
Also implemented a SafeList<> class sunday night, which had been on the plan for a while and proved necessary to fix a thread conflict bug. It’s not the most robust class, but it gets the job done for now. Toyed with designing a very robust SafeList template, which supported per-element locking and would allow multiple threads to iterate (forward-only) the same list at the same time. But ultimately I decided that was overkill for the immediate need, and besides, arguably the code shouldn’t have been doing what it was doing at all, and the bug should be fixed by a refactor of how those threads communicate rather than with a fancy thread-safe list class.
Goal for tonight: refactor the movement code to be more network-friendly (hack just sends new position every frame – like I said, it works, but it’s terrible!) and implement walking through exits (i.e., automatic room-changes). After that it’s time to nail down the design for the system to manage events and their effects. I wanted to stick with something close to the MUSH model – attributes which define messages and actions related to events – but there are quite a few more values necessary here, and the collection of derived messages ought to be filtered by client, as I already filter the results of Loo