Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
2022-05-18 Server Crash, Elapsed Timers, Underwear
#1
Server Crashed Adding Effect
A server crashed while adding a special effect to an object.

The object that caused the crash was in an unusual state. This resulted in a null pointer that crashed when it was referenced.

Fixed that code.

Elapsed Timers
Time objects are used extensively throughout the code. In most cases, these time objects are used to measure elapsed time; the precise UTC time is rarely important.

Qt added an elapsed timer object to their library, for use in such cases. The elapsed timer object is much faster than the time object. It cannot be converted to an actual time and it cannot be stored or shared between computers, which works fine for most of my use cases.

The first major wave of changes happened in a previous update, converting time objects into elapsed timer objects. The resulting drop in server load was shocking. Server loads dropped by at least 50%.

The update today contains the second wave of the conversion of time objects to elapsed timers. This wave is not likely to have the dramatic results of the first wave but every little bit helps. No CPU instruction is free. This is the final wave of the timer changes. If any remaining candidates for conversion remain, they will be scattered here and there, not a big juicy target like the first two waves.

Underwear
In the solo game all naked people wear minimal "underwear". Deantwo suggested this be an option in the multi player game.

Rather than add an option, I made all naked sentient beings wear underwear unless they are copulating.

Incidentally, the underwear color is based on avatar id. I updated the avatar display widget at login to know your id, so underwear is generated in the appropriate color for the avatar.

Server Crashed Creating Ship
Yesterday was a day of server crashing insanity. It was one of those crashes that moves on to the next server after it crashes the server that executes it.

The problem was due to a story script creating a ship. The blueprint for the ship was not ready in the cache and the code was not prepared for that circumstance. This was not a problem before the universe reset because the ship referenced by the script was also a pirate ship design.

Blueprints are loaded when needed and they are unloaded when no longer in use. An exception is made for designs that must be available all the time, such as pirate ships and buildings. Those designs are loaded when the server starts and they are never unloaded even if nobody is using them.

I expanded the exception mechanism to query the story engine for ship and building designs that are referenced by story scripts. Now those designs are always available when needed.
Reply


Messages In This Thread
2022-05-18 Server Crash, Elapsed Timers, Underwear - by Haxus - 05-18-2022, 03:47 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)