Realism and Fairness Guidelines

Purpose For This

There are a lot of builders, a lot of weapons and a lot of different ways of doing things in SL. The purpose of these guidelines is to suggest some limits and simple methods to ensure maximum possible compatibility, and maintain a certain level of “realism” and fairness for those using these systems.

These guidelines, however, go beyond avatar combat. The calculations and formulas outlined here, we believe, are the simplest and most efficient methods of dealing with non-avatar damage in SL. It requires only basic LSL functions to record and measure hit points, and does not require any special scripting in ammo. As well, the damage rating system we propose below balances projectile size/mass to damage inflicted so that ammo scale is appropriate to the ship/weapon and  armor/shield values.


Builders Guidelines

Weapons & Damage

All Stellar Systems and Quandry Industries builds use the formula Mass*Velocity=Damage to determine the “damage hit points” of a projectile. The benefit of this is that it can be done with very basic LSL functions. Also it is widely compatible as it does not require any special scripting in weapons, just a physical bullet.

Your weapons should inflict scale appropriate damage. For example, a hand held gun should not be firing rounds that do 25 damage. As well you should seek a realistic balance. If you make a huge gun that does a lot of damage per shot, it should have a proportionally slow rate of fire and/or a lower velocity. Think about it, the cannons on a battle ship are devastating, but cannot fire 10 rounds per second.

NOTE: The suggested maximum velocity on all projectiles is between 75 and 100  meters per second. SL cannot consistently detect objects faster than 100 m/s. Anything faster tends to pass through objects before collision can be detected.

Recommended Damage Ranges

Here are some suggested damage ranges using the Mass*Velocity=Damage formula:

Handheld & Ship Weapons

CategoryDescriptionMax Damage/sec
Side ArmsHandguns20
RiflesCompact tactical, slung, sniper50
SpecialtyHeavy weapons, grenade and rocket launchers75

Turrets & Defense Placements

Turrets & Defense placement damage is rated for the entire system, i.e. all turret/launcher units rezzed. The total damage the system as a whole can bring to bare.

CategoryClassMax ArmorMax System Damage/s
GunsLight700240
Medium1000360
Heavy1800500
MissilesLight800TBD
Medium1200TBD
Heavy2000TBD

*At this time there is no developer API for non-physical damage.
NOTE: The Stellar damage system limits maximum damage from a single shot to 100.

Recommended Ship Specs

The general rule here is, more armor = less speed and maneuverability. As well, larger ships have bigger power cores and thus can support more fire power. Remember it’s not about creating the ultimate weapon, it’s about a balance that encourages strategy. NOTE: Speed is calculate as llVecMag(llGetVel())

Max damage is defined as the maximum damage that can be inflicted on the target per second under optimal circumstances when the trigger is pulled.

ClassDescriptionMax Scale LxWxH (m)Max ArmorMax Damage/sMax Speed (m/s)
LightInterceptors & Civilian Shuttles6x4x375015048
MediumHeavy Fighters & Light Support Craft9x6x4150030036
HeavyGunships & Support Craft12x8x5300045024
StellarMedium Combat & Support Vessels, Freighters & Transports25x15x825000125012
NovaLarge Sub-Capital Combat & Support Vessels, Freighters & Transports50x25x125000025006

Efficient Scripting (Basics)

We cannot, and would not want to try to, enforce script standards. We can only suggest that you learn good general coding practices  Read the LSL Resource Usage wiki page and LSL Portal for a better understanding of memory usage and try to optimize your scripts. The following are some basic scripting suggestions.

  • Reduce scripts. How your distribute you code is really what matters. If one script does the job without needing multiple state changes, extraneous functions and variables, then go for it. But a single script is not always the best solution. If you have two scripts doing the same thing in different prims, then combine them and use link targets to accomplish the same task.
  • Don’t Duplicate Functions. Try not to repeat functions through multiple scripts. Make a simple API to pass important values to other scripts that need them.
  • Don’t make functions you don’t need. Only make something a function if you use it in more than one place in the script. I know it makes the code body cleaner to move complex stuff into functions, but it also uses more memory.
  • Avoid resource hogs. The three biggest resource hogs in LSL are listeners, collision detection, and sensors.
  • Collisions Aren’t for Avatars. Collision detection is tied to SL physics and can be resource expensive. Only use collision when you functionally need it, such as in weapons or damage systems. Don’t use it to detect avatars.
  • Use Reasonable Sensors. Sensors are very useful, but often over powered.
    • Use parameters to filter what you are detecting.
    • Only use scan ranges that you absolutely need.
    • Keep your sensor repeat time as low as possible. Avatar don’t more very fast, you do not need to scan every .1 seconds.
  • Be smart about listening. Listeners are perhaps the most over used, and resource offensive function in LSL.
    • Try not to put more than one listener in anything.
    • Use script logic to filter your results. For example: if you are listening for a message for Thing1 and Thing2, send something like “thing1:variable” and thing2:variable”, then use the llParseString2List() function or llGetSubString() to extract the data.
    • Turn the listener off when not used. llListenControl() is an amazing function that I rarely see people use. You can disable a listener when not being used.
0