Sunday, May 12, 2013
Summary
Today I made a very hasty and last-minute change to LTP 1.1 that I hope I won't regret... After getting fed up with the inaccuracy of automatic targeting, I tried playing with the simulation frequency of the world, and realized that upping the frequency to 60 Hz fixed most of the targeting problems (at least with beam and pulse weapons). It would seem that discrete simulation error is to blame. For an hour or so, I went back and forth between saddling up and preparing for a careful assault on the simulation code to make sure that it maintains high accuracy in the face of low simulation frequency, and saddling down and just turning up the frequency. Although I don't usually like to opt for quick/hacky fixes, in this case I did...the latter was just so much more appealing But the truth is, writing all of the simulation code to be reallyyyy careful about order-of-simulation and minimizing discretization error is just...not what I want to spend a week doing. Instead, I would much rather up the core frequency, and spend some time profiling and optimizing to make the engine capable of handling the higher computation.
So that's what I did! As an added bonus, the game now feels a bit more responsive, because the input latency is (theoretically) halved. Previously, it might take up to 33 milliseconds before the game responded to input (if it had just finished a simulation step when it received the new input). Now it's down to 17, which is what we've all come to love and expect from 60FPS games. But, again, it comes at a price of a higher CPU load, so I had to pull out the profiler and do some dirty work to allow large battles to maintain performance. I do hope I haven't broken the performance for anyone...I guess we'll find out! In the end, I think this will be a good choice.
Even though I said I finished the 1.1 updater, I went just a bit further today to improve it some more. I implemented a backup / restoration system for patch application, so that patched files will be restored to their former versions if patching fails at any point in the process. I also added a few error messages to indicate different types of failures, although I hope we don't see any of them crop up!
At the end of the day, I sent out the LTP 1.1 patch to a few generous volunteers, who ran the patch and confirmed that it worked. So far, no major issues...yay! We did learn that it requires admin privileges on certain systems, which I should have guessed in the first place given that it writes to the Program Files directory. I did some last-minute reading online to figure out how to make an executable that automatically requests these privileges, so now there should be no issues. Looks like that's solved!
Also, I can feel myself longing to write a compression algorithm. It is only a matter of time, as I already have all of the symptoms: obsession with filesizes, random wikipedia excursions to read about LZW, LZMA, and, really, anything I can find that starts with LZ. Just a warning, as I feel like one of these days this longing is just going to blow up and consume the whole day Wouldn't be a total loss, as we could use some savegame compression.
Hour Tally
Coding: 3.19
Internet: 4.93
Testing: 1.37
Total Logged Time: 9.50
Post
Sun May 12, 2013 11:58 pm
#1
Week of May 12, 2013
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford