Jump to content

Mollymews

Resident
  • Posts

    5,768
  • Joined

Posts posted by Mollymews

  1. 8 hours ago, Love Zhaoying said:

     a "roll your own" handle:

    is an interesting problem this. Giving it some more thought

    pcoding a roll-your-own I think might be doable, without overly burdening performance (given the alternatives)
     

    key requestA;
    string uidentA;
    
    integer uidents;
    
    
    requestA = llRequest...
    uidentA = (string)(10 + (++uindents % 90));  // a longer life 1000 ... % 9000, 1000000 ... % 9000000, etc
    
    
    dataserver(key id, ...)
    {
       if (requestA == id)
       {
          string handle = uidentA;
     
         ... process ...
       }
    }

    in this method uidentA will be assigned before the dataserver event fires (code in the current scope executes first)

    problem is that two or more llRequest... can be issued before dataserver event fires. Which will orphan the first request (its uidentA will have been overwritten) and also is no guarantee that the dataserver event while fire in the order requested

    so we would need to buffer requestA + uidentA, and perform a lookup

    as we not using lists then a string buffer

    key requestA;
    string uidentA;
    
    integer uidents;
    
    
    requestA = llRequest...
    uidentA += (string)requestA + string)(10 + (++uidents % 90));
    
    dataserver(key id, ...)
    {
       if (requestA == id)
       {
          // lookup id in uidentA buffer
          integer pos = llSubStringIndex(uidentA, (string)id);
          if (~pos) // we are good
          {        
             // the uident for id is at pos + 36, and is 2 length
             string handle = llGetSubString(uidentA, pos + 36, pos + 37);
          
             // remove from buffer
             uidentA = llDeleteSubString(uidentA, pos, pos + 37);
          
             // we might want to prepend the uident/handle to the data here
             data = handle + data;
    
             ... process json handle, data ...
          }
          else // we are not good. there is no uident for id
          {
             .. deal with not good exception
          }
       }
    }

    this is for a single script application

    if we going to have multiple scripts in our app then we can include a constant identifying each script (sub-application)

    uidentA = SUB_APP + (string)(10 + (++uindents % 90));


    extending this to individualising for agent. Do a one-time agent key2packed (+9 chars) on sub-application start for agent

    uidentA += SUB_APP + string)(10 + (++uidents % 90)) + PackedAgent;

    adjusting the buffer lookup/remove positions accordingly

     

    should hardcoding SUB_APP become problematic then we can use our app uuid server to assign a APP_SUB value. Which would only need to be done once - on script start.  Our sub-application (script) thereafter managing uuid/handle assignment within its APP_SUB domain

    when these hit the datastore (experience/web) then they will be uniquely identifiable by application, sub-application, transaction/handle (and agent or interactive object)

       

     

    • Thanks 1
  2. 19 minutes ago, Rowan Amore said:

    DO NOT engage in any way with ... anyone who even mentions this other avatar

    yes this too.  Is a good chance that the random anyone avatar is the griefer trolling as well

    and if is a person on our friend list gushing to tell us what the troll is doing, then tell them to shut the bleepty up or they be for the cancel friend button as well 

    • Like 2
    • Thanks 1
  3. 2 hours ago, Love Zhaoying said:

    Anyway, the "string data" parameter will be:

        Success/Error flag  (1 character), + "," (Comma) + Error Code (if failure) / Experience call result Data (if success).

     

    i see what you mean

    you don't have a lot of choices

    1) use the uuid as is (36 chars)

    2) losslessly encode the uuid down to 9 chars

    3) use a trim or hash of the uuid and gamble against a collision

     

    if you can find a way to afford the 36 chars then go with 1)

    i personally would not go with 3). I would not want to make gambling a component of this kind of application. A bet that will lose. A loss from which you will have to work out how to recover or settle for ignoring the loss as if it never happened

    we can ignore losses in some situations. Like a visitor greeter that greets a visitor twice and ignores the other visitor. But am pretty sure you are not making a visitor greeter

     

     

    • Thanks 1
  4. Linden can take a while to do these kinds of investigations, so best we can do in the meantime is try to not let what has happened influence us

    is best to not engage with this person ever. Do not let this person troll you into doing something that is against your best interests

    so block them, ban them from your lands, add them to your security orbs. If you are using a TPV viewer then derender them. Don't engage with them in any way

     

     

    • Like 2
    • Thanks 2
  5. 24 minutes ago, Cinos Field said:

    I've always felt like neko is more closely connected to the various anime-themed communities on SL than furries. It's sort of like convergent evolution; superficially the furry and neko look similar, but they evolved separately due to different cultural influences. One from western scifi and cartoons, the other from anime and manga

    yes I agree

    i have always been a SL neko and identify more with anime than anything else. Ever since I worked out how to make a tail out of flexi prims and ears out of tortured spheres in the Help Island sandbox.  In my those days starter avatar Harajuku

    • Like 1
  6. when we want to keep the JSON handles short and unique then is best to maintain the handle ident method ourselves, encoding this as the 1st element of the data returned in the dataserver event. Example:
     

    dataserver(key id, string data)
    {
       // JSON handle is the first two chars of data in the range ["10".."99"] which rolls over. Range managed by data source
       string handle = llGetSubString(data, 0, 1);
    
    
       ... write json ... handle ... data  
    }

    i would leave the handle in the data, so that should we want to extract the data from JSON as a chunk, the handle can readily accompany the data. Parsing the handle from the data chunk as necessary

    i would also set the unique ident counter to 10 rather than 0, increment to 99 then rollover to start again at 10. So to not have to left pad a leading "0" for the numbers less than 10

     

     

     

    • Thanks 1
  7. i am a big fan of data-driven scripting

    a thing I wrote ages ago now when Experiences came was for a single object couples sit with only one script

    it was designed to be a data (notecard) driven scene/experience manager

    like a person clicks on the console (dance post for example). They get a HUD from the console (auto-attached).  Click the HUD and get a list of nearby people who also are in the Experience. Use HUD to invite them (via dialog) to dance. They click  Yes Please!  and voila they are dancing with the inviter.  It works by the console rezzing a invisible dual-prim plate (2 sit targets to make it easy) at the feet of the inviter. The dancers are auto-sat on this. Neither has to try to manually sit on rez poseballs. The console then playing the dances on them in response to HUD request

    and then being data (notecard) driven could describe different scenes based on this design

    like a chase game.  Both players go thru a portal/gate. One runs, the other chases. When the chaser catches/bumps (collision) then rez plate, auto sit both, menu select animations. Options for either/or to control the animations

    the rules to trigger rez/collision/request/etc being in the notecard

    i never did anything with this other than give it to a friend, who used it for adult-y things on their private region. But was quite interesting for me to make

     

    ps. So Love if you want to take this basic idea to another level then I think would be at least a little bit commercial upside. I don't do commercial so is not like I am going to do anything more with it

     

    • Thanks 1
  8. 8 hours ago, Quistess Alpha said:

    maybe this discussion would be best for an efficiency/ optimization thread . . .
     

    is probably better to start a new thread yes

    this thread is more for quick tips/statements rather than a general discussion on inlining code

    inline code is a large topic and quite varied, and the question to do or not do is often circumstantial. I think is worth having these more indepth discussion in its own thread, about the various methods and techniques that can optimise when we do inline code

    and much of what we are currently discussing also touches on logic programming. So the discussion we can also have in its own thread can be about about how and where we can use logic programming methods to achieve some measurable gain for our scripts, be that in execution speed or memory savings

     

    ps. Repost your last in  a new thread as is quite interesting. Is also a thing about using equality vs logical operators which is also worth talking about 

  9. 14 hours ago, Quistess Alpha said:

    Also, as I think @Mollymews tested at one point, inline list construction is quite inefficient

    about inline lists, was Qie prompted by Wulfie who showed that a var list is significantly more performant than a const list

    they showed that is best to go with a var list as an parameter for llList2... rather than a const list
     

    // do this
    
    list args = ["No", "Yes"];
    
    string result = llList2String(args, condition); // where condition is TRUE or FALSE
    
    // and not
    
    string result = llList2String(["No", "Yes"], condition); // where condition is TRUE or FALSE.

     

    14 hours ago, Quistess Alpha said:
    integer x /*= ...*/; 
    // clamp x to be max if x>max, and min if x<min
    { // brackets can be used to isolate the scope of a 'working variable'. In this case, we only need i for this calculation.
      integer i = (x>max)-(x<min);
      x = (min*(i==-1)) + (x*(i==0)) + (max*(i==1));
    }

     

     

    i really really like this

    about the only thing I could add to it is that when we compare a variable to a const in LSL Mono then is a bit more performant to place the const on the left. Whyam not exactly sure, something something stack handling

    x = (min * (-1 == i)) + ( x * (0 == i)) + (max * (1 == i));

     

     

    • Thanks 1
  10. 7 minutes ago, Quistess Alpha said:

    Is there any specific case you can think of where a function that is "worse" than O(1) would be better when used empirically?

    no. Is just that some algorithms are better than O(1) when we know that the inputs are not evenly distributed

    or say we have a near star and a distant star. If the time to travel to the distant star takes the same time to travel to the near star, then we can consider this method of travel to be O(1). Which is kinda cool, travel anywhere in the universe no matter how near or how far in the same constant time

    yet when we parse this then in the totality of all trips on the infinite line then is inefficient. Like Star A is 1 step away. Star B is 2 steps away.  If it takes 2 steps to reach Star A then the total time on the infinite line is greater than it needs to be.  2 + 2 = 4 vs 1 + 2 = 3   

    about not evenly distributed inputs.  in a previous conversation about Love's IIF function then we can see this. I gave an example of  a IIF O(1) algorithm for multiple inputs, no matter how near or how far the inputs are then the algorithm takes the same time for each. Yet if we know that some inputs are more likely than others then we can process them first and exit early, obtaining 1 + 2 = 3. Instead of 2 + 2 = 4

    • Like 1
  11. 12 hours ago, Quistess Alpha said:

    Oh yup, I had a bit of 'off by one' thinking in my head.

    i was thinking that as well when I start to read thru your algorithm

    to evaluate whether my thinking is correct (or not) then I do a matrix and see. And do the same when prompted by someone else (in this case you Quistess) to rethink my thinking

    and as the matrix shows then my thinking was wrong, and that your thinking was correct. So I am change to your way

    and then I thought about it some more and went with a O(1) algorithm. I have a preference for O(1) algorithms, which tbh is not always the best method in every situation. Is just a personal preference 

    • Like 1
  12. 1 hour ago, Qie Niangao said:

    I'd just add that the NUX bodies must achieve some level of success, and be retained by users for some interval, in order to apply that much-needed pressure

    am pretty sure that it will come down to how many skins and clothes compatible for the body is going to made available for sale by creators

    if there is not much stuff to obtain/buy for it then people will move to the 3rd-party bodies

    • Like 2
  13. 1 hour ago, Quistess Alpha said:

    Your method is slightly biased (diminishing bias as magnitude increases) to previous+1. The "correct" way would be to exclude the middle:

    i see what you mean about my method. The next number produced is biased. Magnitude = 3 matrix

    mag pre rnd ret
     3   0   0   1
     3   0   1   1
     3   0   2   2
     3   1   0   0
     3   1   1   2
     3   1   2   2
     3   2   0   0
     3   2   1   1
     3   2   2   0

    if the previous number is 0 then next = 1 is twice as likely as next = 2. Same bias for the other previous numbers in the set

    whereas the matrix for your first method is:

    mag pre rnd ret
     3   0   0   1
     3   0   1   2
     3   1   0   0
     3   1   1   2
     3   2   0   0
     3   2   1   1

    which is what we want

    ps. add

    i think your method can be simplified a bit. I think it can go, which is still unbiased and pretty nice

    integer rand(integer magnitude, integer previous)
    {  
       integer result = (integer)llFrand(magnitude-1);
       return result += (result >= previous);
    }

     

     

     

    • Like 1
  14. just add this for completeness

    return a random number in [0 < magnitude] not the same as the previous

    integer rand(integer magnitude, integer previous)
    {
       integer result = (integer)llFrand(magnitude);
       if (result == previous)
         return (++result) % magnitude;
       return result;
    }

     

  15. according to the SLB19 Linden conversation summaries then the answer is No, not on any forseeable roadmap at this time

    if you do want to see how a different engine can work-ish then have a look at this OpenSim project here

    https://github.com/opensim/opensim-viewer

    which is built on the Stride/Xenko engine found here

    https://www.stride3d.net/blog/xenko-opensource-mit/

     

    • Like 2
  16. it doesn't have to be an either/or situation

    Linden (if they don't have the time in-house to do it all themselves) could commission an addon/plugin as a work-for-hire for both Maya and Blender.  The commissions could be done independently by different work-for-hire developers with a Linden person coordinating the projects

    not sure how the Avastar, MayaStar, others? developers would be placed to take on such a commission if this were to happen.

    also never know, Patch Linden might decide to make Moles out of those interested/capable of doing this

    • Like 3
  17. 9 hours ago, Quistess Alpha said:

    If you have a lot of animations, real random doesn't always "feel" random. I'd probably randomize the list with llListRandomize() and loop through it once (if body&animesh animations need to be paired, use a 2-strided list), or if you want to make it feel more random than that, make the list have 2+ copies of each animation (pair).

    i am a fan of randomly-ordered sequences as well. So that animations never play twice or more in a row

    a thing for people reading to think about when doing this is to not have the first animation after randomising/shuffling the list, be the same as the last played animation. A workround for this in longhand goes something like

     

    list anims = [a,b,c,d,etc...];
    
    string anim;
    integer index;
    integer length;
    
    state_entry
    {
       length = llGetListLength(anims);
       index = length - 1; // set index to length-1 so that list will shuffle on first time
    
       llSetTimerEvent(.. some time...);
    }
    
    timer()
    {
       string next;
       
       index = (++index) % length;
       if (index)
       {
          next = llList2String(anims, index);    
       }
       else // index == 0
       {
          // shuffle
          anims = llListRandomize(anims, 1);
          
          // check previous anim against next
          next = llList2String(anims, 0);
          if (anim == next)
          {  // move 'next' to later in the queue
             integer i = 1 + (integer)llFrand(length - 1);
             anims = llListInsertList(anims, [next], i);
             anims = llDeleteSubList(anims, 0, 0);
             // get now new next
             next = llList2String(anims, 0);
          }
       }
       ... play 'next' animation ...
       ... stop previous 'anim' ...
    
       anim = next; // next is now current anim
       
       .. reset timer event if variable length animations ...
    
    }

     

    • Like 2
  18. 3 hours ago, Ceka Cianci said:

    THIS!!!!

     

    Bleh, this sounds so much like my job, let alone how they do things at my work.

    you end up with getting bumped as they call it , but really it's just more workload..

    You end up with 4 or five job titles never leaving any of them and having to do 4 or 5 different jobs while earning one salary which never ads up to the amount you end up having to do..

    Meanwhile just as qualified people stand around watching you do the extra work load..

    This is one of the big reasons I'm looking for another job on top of many other reasons.. Let alone, not counting how they have handled my work injury, but i was already beyond the point of return before that happened.. I would have been long gone if I didn't get hurt.. There isn't a number they could coem up with unless it was one year lifetime payment of never having to work again amount of money..

    I swear this job just won't let me go. it actually keeps pulling me back in!

     

    ETA: We need a, THIS!!!! button , because liking a post sometimes just isn't enough..

    I had to come back in and add the , THIS!!! because  your post reminded me so much of my job that it distracted me from doing a, THIS!!!

     hehehehe

     

     

    i feel for you

    if you can try and get a job elsewhere. Nobody needs to work in a place where the extra work piled onto them is neither recognised nor remunerated

    if you can't leave then try to advocate for a formally recognised preceptor and coaching roles within the organisation. Preceptors and coaches who are not the formal trainers. Those who lead formal training sessions tend not to work on the floor. Their role is to educate employees on how to work safely, how to operate/maintain a machine, how to write up work notes, etc

    coaches and preceptors work on the line. Preceptors work with new employees on the line after they have been thru orientation and basic training. Preceptors get the new employees up to speed, by showing them how to work efficiently, so that the line doesn't falter. Coaches take older employees and teach them how to be preceptors while also working on the line, and keeping the line running at production speed

    is the same in construction. There is a supervisor who runs the work schedule. Then there is a leading hand(s) who does the work alongside the crew memebrs in their team, teaching/coaching as the work proceeds .  Same in a hospital. Charge nurses, senior nurses, junior nurses. Each supporting the layer below them, and getting paid to do this while also doing the work. And just as importantly (often more so) being formally recognised by the employer thru job titles, descriptions, authorities and remuneration 

    • Thanks 1
  19. 8 hours ago, Kiera Clutterbuck said:

    I like this team approach. Is it used much in the US do you know?

    i am not from the USA, so don't know much about work practices over there

    as a general discovery rule tho, take a town which has a number of large employers. Look at the staff churn rates for each

    the employers that have low staff churn will pretty much always have formal work practice recognition processes and remuneration schedules that bring out-of-scope practices in to scope

    • Thanks 1
  20. 25 minutes ago, Frionil Fang said:

    The server doesn't even know what the animations your avatar is playing look like, so it definitely could not be involved in any kind of physics calculations of attachment physics based on your movement. Same goes for flexiprims, the sim doesn't know or care about what's going on with them, it just lets your viewer know the details and do the calculations, so the same approach would have to be used for physics/flexible mesh. So no fear, you wouldn't be murdering the server, you'd just be murdering yours and everyone's viewers instead.

    you are right about avatar body animation. The avatar physics being a solid block.  So no collision for animated limbs as you say.  The little balls inside the containers (as would the containers themselves) tho would be physics enabled, so would impact the server

    which kinda raises, client-side physics for attachments. Which would only impact the client viewer, probably quite negatively as you say. And tbh I wouldn't be able to help myself, I would find what would sound like a good reason to me (even when it isn't) and max it out. Same with attachment points now. II often run out of them already. Lag monster me

    so altogether I agree that flexi-mesh be the way if were to go down the flexi path. I would quite like this. Be able to have flex cloth

    i sometimes wonder about how this might be done. Probably best if there was a viewer option - similar to Avatar Cloth option box in Preferences \ Graphics. People able to turn off/on as best suits them

  21. 11 minutes ago, Love Zhaoying said:

    Only slightly off-topic, I've preferred the non-cone (single prim) tails due to occasional unsightly visibility of the cones / layers. That, and the "tufted" tails tend to have "tuft separation". Luckily, the gravity / wind / etc. options work with both cone and non-cone tails. I basically script mine to switch gravity settings on a timer.

    single cone tails are pretty ok. I have a few animation-driven mesh tails like this which are quite nice. But I have always preferred horse tails myself and pretty much stick with the olde style multi-cones as I like my tail to be bushy as well

    back on topic tho

    am going to have a play with what OP has shown in the vid. The swing bridge is way cool, and am pretty sure that other people on seeing the vid are going to make them also. Like an actual real swing bridge across a ravine for example that responds to the avatar on it.  Rope ladders and climbs as well most likely I think

    • Like 1
    • Thanks 1
  22. 4 minutes ago, Love Zhaoying said:

    Would this act kind of like flexi-hair?

    i never thought physical prim spheres within a container would ever act as they do on the other parts of the linkset, til I saw the vid. 

    at the moment my neko tail, is 27 flexi prim cones each with different gravity, so that when I walk the prims flow behind me at different levels of 'droopiness' due to the independent gravity of the prims. And they move/flex independently at different rates when I flick my tail because of the same independennt link prim gravities

    if we could have physics attachments, then I would make 40 or 50 maybe more hair braids using the method shown in the vid (the swaying bridge being the closest example of how I would make the braids, just a whole lot more of them per braid)  The cool thing being that when the braids hit my avatar body then they would be repelled, and the little balls would continue to jiggle, while at the same time also trying to slave (gravitate) toward the ground. Then of course I would use about 300 or 400 braids to make hair with. which would also be repelled by avatar shoulders, arms, chest, back etc

    be way cool if I could make this kind of thing. Not that Linden will ever tho, as I probably murder the region server all by myself, nevermind 40 of us all at the same time   

     

     

    • Thanks 1
  23. On 6/23/2022 at 2:09 AM, Quinavery said:

    Can someone explain to me what is going on here with the Prim Attributes?

     

    my only explanation is as has been mentioned in the vid already, which Ardy touches on also.  The repel force when two prims collide can be greater than the prim's mass and gravity. Gravity in Second Life is not constant, is prim (and/or script) dependent. So two other-wise identical prims can be made to fall down at different rates of speed

    with what you are showing here tho, I now want physical avatar attachments. I be able to make hair and neko tail that wouldn't intersect my avatar body. I probably end up being a worse physics lag monster than a sion chicken but would look pretty cool

    • Thanks 1
×
×
  • Create New...