Friday 5 August 2016

Bug Fixing: TSN Sandbox V4

Today has been a day of bug fixing. After taking some time off tinkering with the Sandbox, I decided today to get back to work with it and take a look at fixing some of the bugs. The two on the list today - the Progress Indicator and supply ships.

The first has been relatively easy to fix. A couple of variables added and some code enabled and the timers and progress indicators seem to work fine. The GM now has the ability to set a timer from 1s all the way to 5 minutes and 59 seconds. When they start the timer, a small indicator appears in the top right of the map and shows a percentage that increases gradually, reaching 100% when the timer is finished. It is something the GMs have wanted in the TSN RP Community to show the progress of mission events like data uploads or downloads or marine boarding actions, as well as other ideas.

The much trickier problem to solve has been the supply ship code. Within the Sandbox, GMs can spawn two "Auxiliary" ships which can resupply player ships with ordnance. One is a light supply ship with stocks of ECMs and homing torpedoes, whereas the other is a normal supply ship with all ordnance bar P-Shock torpedoes. The problem though was they never seemed to resupply a ship that came within range. After combing through the code numerous times, as well as refining it further, I have finally managed to get it working! Now, when a player ship comes within 600 units of a supply ship and slows to less than 80% impulse speed, the supply ship beings transfer torpedoes up to the player ship's maximum limit. It all links in with some changes I made about a month ago to measure the maximum load of torpedoes on a player ship and it seems to be working.... FINALLY! I am yet to give it a full and thorough testing (the shift on Saturday will be when it can be really tested), but I am pretty certain now I have managed to fix the issue. It all boiled down to this: <. The one little sign that was the wrong way around. There were a couple of other bits that needed fixing, but ultimately it was a simple mathematical symbol!

Now that those bugs are corrected and things seem to be functioning properly again, I think I am going to return to creating systems and new features. The "Fighter" mode for the script still needs some work on it. I am still figuring out the details about how to implement it. For example, how should the players select the system and sector to start in? Should the carrier be stationary or move around with comms orders, like a comms officer directing an ally? Should it be a fully GM controlled mode? 

There are a couple of other modes I want to work on too. The "Patrol" mode is working fine, but can easily be expanded upon and improved further. I also have the "Pirate" mode, perhaps one of the more exciting developments. The Pirate mode puts the player in the role of a pirate or mercenary crew from the Euphini expanse, rather than a TSN crew. It is still possible to explore all the systems in the Sandbox, but all the TSN and USFP bases are enemies. I wanted to add some kind of "plunder" system too, so that the crew could receive some kind of money or reward when attacking ships and I have a couple of ideas how to do this. I was thinking that several 'trackers' on the science screen would work to give crews an idea of how many resources that they have stolen. What I need to figure out is how best to code stealing the resource. There needs to be some kind of random spawn when an enemy ship is wrecked, like anomalies. The Pirate mode links in with the Patrol mode as they both use the "Random spawn" code to spawn in enemies and allies so I can probably work on both at the same time. 

Anyway, that is all for now. Hopefully I can get an update released soon. The last release included a "Vanilla" version which didn't require a mod. It took time to create and I doubt I will release another vanilla version. Instead, I am going to focus on the TSN RP version, with a quick change to the ship names for the normal release. To really get the full effect of the Sandbox, it needs to be played with the mod. Without it, there are so many functions lost!