Monday, March 5, 2018

It Runs as Long as You Don't Pick Up the Phone.

Matching loading/saving of each member
What a fun day. I can consistently load saved games and start the few missions I can throw at it. I tooled around a solar system for a bit and then went back into Visual Studio to write the code to save the game. (I was using saves I generated in DOSBox from the original version.) This required me to go though about 600 lines and make sure all the data members I was loading was being saved in the same order with the same type. Once again again I was hit by off-by-one errors. I have to match the bit width of the read, write, and the original struct data member. I'm sure I have a few misalignments still.

Loading the first mission. HD Stars!
I was able to make a new fleet commander, add him to a mission and then start the mission. This means almost all the functionality on the "101" main screen is done and I have to start working the bugs in the game proper. The big one is when I try and send a communication to another ship and ask for an acknowledgment, the game bombs out with a null pointer. Same thing happens when I fire my weapons. This is happening with the saves from the both the DOS version, and ones I make myself. Also new games do it too so it doesn't seem to be a data load issue. I'm guessing that computers deal with null pointers differently nowadays and causing issues. In the 90s, nulling a pointer just set it to top of memory. I think in newer systems it's simply invalidated because moving a pointer outside protected memory will cause an exception fault.

Once I get things stable I will be making that enemy builder for the artist. I'm still eyeballing the new TTF system font too. Some of the lag is coming from rendering text. I want to move off of the legacy color stuff but I would like to have a stable platform first before I rip out another core Nermal function.

Shields up, and target acquired.
I can see ships now. This means I'll have to fire up Blender and remodel them in HD like I did the puzzle pieces. The good news is there are graphics that show the ships in different angles so I'll be using that as a template.  There are also a few icons that look a little USS Enterprise-ish I have to change too.

There is a lot of commented out and #ifdef'd debug code for comms, looks like it was a pain to implement when it was being developed. I've left the debug flags in the game, but been too scared to turn them on I'll chase down the null pointers first and if people still refuse to chat with each other I may have to get that old cranky code working too.




No comments:

Post a Comment