Source code is at

Question Problem with recent releases of the Animal script

  • Admin
  • Topic Author
  • Thank you received: 258

Problem with recent releases of the Animal script was created by Admin

Posted 20 Feb 2022 11:29 #1817
One of the reported issues with animals has been that they sometimes revert to 0 days old on region restarts and almost always if a region was restored from an OAR file. Because of this I modified the animal script so that instead of saving all the animal status data in the description, it also saved it to a notecard in the animal. This of course does mean you get a more reliable system however one thing that 'slipped my mind' is how the opensim software actually works with regards to notecards.  In opensim (and in Second Life) notecards are immutable, that is once created they never change. So when you do actually edit a notecard, what happens is that a brand new notecard is created with the updated values. The original notecard is not deleted. So, the upshot of this is that every time you update even one value in a notecard, you create a brand new one. Having a farm with a fair few animals that keep their data updated in a notecard can thus end up both filling your database with notecard assets, plus can put undue loading as each update calls the copy/modify/save process.  Having now had this error in the way I elected to save data, I realise it needed a re-think! Due to the various features that have been added to animals since the original code, there is a problem that we can't actually save all the status data in the description of the object, since that is limited to 128 characters and there is now more than that to be saved. One solution could be to save data to an external database and that is something I have been thinking about for a while as a possible way to support large farms and bring more features to the system. However, I release that is something that really should only be an option as not everyone would wish to save their data externally or even be able to if they just run a local sim without permanent internet access.   The solution I have come up with is actually remarkably simple! All animals have their main code in an invisi-prim, which means that every animal is going to be a minimum of two prims. So in the upcoming 5.9 release the data is split and some stored on the animal prim as before (which also gives legacy support) and the rest of the data is stored in the description of the second prim, since we know that this is not used for anything else.  I have also still included the option to save a notecard as a safety backup, but this has been throttled to only save around twice a day. It also is an option that can be enabled/disabled.  OpenSim is a wonderful system but it can easily trip you up when you forget just how it all works!
by Admin

Please Log in or Create an account to join the conversation.

donate Island Beach

opensim logo