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
Category | Description | Max Damage/sec |
---|---|---|
Side Arms | Handguns | 20 |
Rifles | Compact tactical, slung, sniper | 50 |
Specialty | Heavy weapons, grenade and rocket launchers | 75 |
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.
Category | Class | Max Armor | Max System Damage/s |
---|---|---|---|
Guns | Light | 700 | 240 |
Medium | 1000 | 360 | |
Heavy | 1800 | 500 | |
Missiles | Light | 800 | TBD |
Medium | 1200 | TBD | |
Heavy | 2000 | TBD |
*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.
Class | Description | Max Scale LxWxH (m) | Max Armor | Max Damage/s | Max Speed (m/s) |
---|---|---|---|---|---|
Light | Interceptors & Civilian Shuttles | 6x4x3 | 750 | 150 | 48 |
Medium | Heavy Fighters & Light Support Craft | 9x6x4 | 1500 | 300 | 36 |
Heavy | Gunships & Support Craft | 12x8x5 | 3000 | 450 | 24 |
Stellar | Medium Combat & Support Vessels, Freighters & Transports | 25x15x8 | 25000 | 1250 | 12 |
Nova | Large Sub-Capital Combat & Support Vessels, Freighters & Transports | 50x25x12 | 50000 | 2500 | 6 |
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.