Jump to content
Evah Baxton

Scripting TOS

Recommended Posts

Attempting to build a server based NPC management system.

I've written a script that downloads and buffers a set of future actions from a server based on the object's UUID and ownership.

It's set to check the list for new actions every 30 seconds and buffers the next 30 seconds of actions.

It uses a 1 second interval timer. 

If you tell the object you want it to move to some far away location, the object picks up that action. It splits the movement into 1 second intervals so that you can move smoothly across long distances. (working on adding character properties for pathfinding).

You can also tell the object to talk or do other things like apply an animation for animesh.

Since it's location is stored on the server, the objects interact with each there instead of in SL. The server sees where all objects will be in the future so actions can be sent down to the object (like talking) 30 seconds ahead of time.

You can control the objects from the server.

My questions:

Are 1 second intervals bad?

Most importantly, is the ability to control objects outside of SL scripting against some scripting TOS? Anything I've mentioned here set off alarms?

I don't want to continue if it's going to get banned.

Thanks!

Edited by Evah Baxton
  • Like 1

Share this post


Link to post
Share on other sites
50 minutes ago, Evah Baxton said:

My questions:

Are 1 second intervals bad?

Most importantly, is the ability to control objects outside of SL scripting against some scripting TOS? Anything I've mentioned here set off alarms?

I don't want to continue if it's going to get banned.

Nothing you've said indicates anything ban-worthy. The server just processes some data for the script which is absolutely a normal thing to do and even vital for some scripts.

A one-second timer isn't inherently bad, what matters is what exactly you're doing every second, and even then it really only matters to your script's performance because the sim will just not schedule the time for your script even if you do some "supercomputing." The fastest timer you can / are allowed is 0.022s, which is one server frame and some things (like the control event) produce that many events on no matter what you do.

  • Thanks 1

Share this post


Link to post
Share on other sites

I don't see anything in your proposal that would causer issues. The thing to be careful of is what the objects to be controlled are going to be doing, and here you might want to look through the rules about follower or capture prims. Having  a hollowed hemisphere move wherever a certain avatar is detected so that they could not move freely outside the radius of the hemisphere would not be a good idea, as an example.

It might be worth your looking at variable-rate timers, or timers triggered by certain events such as moving_start. It the object is just sitting there then checking it every second is just wasting time. If you have a list of things that you want to monitor such as movement, sitting-upon, being collided with, etc, then you could have a set of these events that all start the 1-second timer going only when monitoring is actually needed?

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
9 minutes ago, Wulfie Reanimator said:

 and some things (like the control event) produce that many events on no matter what you do.

Unless you specify a larger delay value via llMinEventDelay. I've done that on a few vehicles to deliberately slow the responsiveness of the control event.

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
2 hours ago, Evah Baxton said:

Attempting to build a server based NPC management system.

I've written a script that downloads and buffers a set of future actions from a server based on the object's UUID and ownership.

It's set to check the list for new actions every 30 seconds and buffers the next 30 seconds of actions.

It uses a 1 second interval timer.

If you're making HTTP requests at too fast a rate, those may be throttled. Once every 30 seconds should work fine. 1 second timers in LSL are not a problem.

I have NPCs with timers running at various speeds. I increase the timer period when not much is happening. So, for example, they check for moving vehicles which might hit them every 2 seconds. If there's anything in range, the sensor interval drops to as low as 0.1 second, so the incoming threat is evaluated frequently. Once there's no threat, the sensor interval goes back to 2 seconds.

If you're moving along a precalculated path, use keyframe animation. That behaves very well under load. During keyframe animation, you can still detect collisions with avatars and physical objects, so you can stop when necessary. You can also do ray casts.

A planning horizon is definitely the way to go. If you try for a purely reactive system, it breaks down under high script load. That's what's part of what's wrong with the built-in pathfinding system, which tends to overshoot goals and go into walls during heavy load. I design for "works fine with 50% scripts running, continues to work adequately down to 20% or so, gets sluggish below that."

  • Like 2

Share this post


Link to post
Share on other sites
38 minutes ago, animats said:

If you're making HTTP requests at too fast a rate, those may be throttled. Once every 30 seconds should work fine. 1 second timers in LSL are not a problem.

Perfect. I will keep on working on it then.

42 minutes ago, animats said:

If there's anything in range, the sensor interval drops to as low as 0.1 second, so the incoming threat is evaluated frequently.

This is a great idea.

Thanks for the feedback. I'll keep you updated.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...