Back from Italy and straight back into the rewrite. If I had realised before I started just how huge this would turn out to be, I might have never started
The easiest way to describe my progress is through a description of the performance tests I have been running in my own Trans-Newtonian campaign. I decided to use that rather than start a new one because I wanted to test the changes in a reasonably well-developed campaign. I have only been testing short timescales so far because I am almost at the point of firing at alien invaders in the Salt Lake system but a 5 second turn and a 1 hour turn aren't very different in terms of the code that is executed.
A basic 5-second increment for the Trans-Newtonian campaign now runs in about 3.5 seconds, including loading all of the fleets, ships, sensors, contacts, orders, missiles, pops, into memory, saving any changes after movement and combat, setting up all the NPR movement and combat, checking default and conditional orders, etc.. Where it gets interesting is that a 30 second increment with 6 sub-pulses only requires 4 seconds and a 2 minute increment with 24 sub-pulses is 5.8 seconds. In other words, once the basic requirements of the code are achieved, additional sub-pulses require approximately 0.1 seconds each.
This has considerable implications for running the game. Rather than being reserved for occasional use, sub-pulses can become the standard, enabling many detection cycles to take place during a increment and reducing the chances of NPRs or missiles appearing on top of one of your task groups. Other types of interrupt events will shorten the increment as they will be checked during each sub-pulses, which will enable much more efficient use of your fleets. The question that I am now pondering is whether to leave sub-pulses up to the player or just remove the sub-pulse buttons (which is my preference) and instead add an intelligent number of sub-pulses automatically. For example, if the turn is less than say 30 seconds, there would be no sub-pulses. For a one hour turn, perhaps 30x2 minute sub-pulses and for a one-day increment, perhaps 48 or 72 sub-pulses for 30 or 20 minute pulses. Maybe for a 5-day increment the sub-pulses could be an hour (120 sub-pulses). This means that players wouldn't have to worry about setting sub-pulses or using the wrong number and new players wouldn't even have to know they exist. I am interested to hear opinions on this idea.
I still have a check for inbound missiles that may shorten the turn, although I won't be checking detection by the target. Instead, each missile salvo is checked against its target (or any onboard sensors are checked to find a target) and the maximum turn length is based on how long the missile will take to arrive, assuming the target is on a reciprocal heading. If the increment size is reduced due to the projected missile flight time, it will be divided in many small increments allowing a lot of detection chances (by the target and any other forces nearby) as the missiles approach.
Steve