So, I double checked this again in great detail. Indeed this is a very odd fight. But this does happen in the original game as well and our code is exactly the same as the original and its written twice, once on the server and once on the client. Both of them behaved precisely the same.
Let me explain why this weird an unusual behavior can occur, and the SSD and other low fighter bay ships are particularly prone to events like this.
Warning technical talk to follow:
For each unit of time in a VCR to determine if a fighter is launched host gets a random number between 1 and 20 and then checks to see if that number is <= the number of fighter bays on the ship. If its less, the fighter is launched. This is fine, but where the weirdness comes in is that the random numbers are not actually random, they are picked from a list of 119 values that were hand typed by Tim Wisseman himself. These 119 values are between 1 and 20 but they aren't exactly perfect. In fact, there are only 15 values which are 3 or less.
Each random event, such as charging a beam weapon increments the random number seed, so that when host goes back to the 119 random numbers between 1 and 20 it gets a different value.
But occasionally, depending on how things go, a sort of loop can form, especially when just beam weapons are firing, where the number of random events between one unit of time and the next is not changing and is also a factor of a multiple of 119 so that the same 3, 4 or 5 random numbers are selected out of the 119 between 1 and 20 during each "loop" of this cycle.
That is what happened here. So in your battle, there are 18 beam weapons charging and firing and one fighter bay trying to launch and in this weird loop it only hits 5 different values in the 119 random numbers and none of them are <= 3 so none of the fighters launch. Since no other events occurred, like shooting a torpedo the system kept coming back to those same 5 values. 119 is a prime number, but 238, 357, 476.. are not and it is possible to find factors in those values that then repeat on each loop.
Why do we have this weird 119 random number list? The purpose of this is to enable the host and client programs to calculate the exact same random numbers based on a starting seed number. So that instead of requiring a full recording of all the events in a VCR be sent to the client just the starting values and a starting seed value can be sent and we can replicate the VCR on the client.
There are many other ways this could be accomplished of course, we could simply add another 1000 values or whatever to the 119 to make this all much more smooth and prevent this kind of weird thing. So we could certainly "fix" it. It simply wouldn't be the way that Tim made it. He typed those 119 values, and they come straight out of the original host program. (hacked out long before VGA Planets Nu)
There is some super VGA Planets details for you... :)
|