Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008565opensim[REGION] Physics Enginespublic2019-07-19 15:262019-07-22 14:42
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0008565: At high velocities (>200m/s), you can no longer hit objects reliably at close ranges
DescriptionAs above, with the minimum range increasing linearly above that speed, up to around 9000m/s, where you can no longer hit any object in the sim, nor do your bullets render.
Steps To ReproduceCreate a testbed object that fires an object at a given speed. Create a target object that reports a collision, with the dimensions of 1x1x1.75, the average avatar hitbox size.

Fire object from a distance of approximately 10m. Increase speed. Observe how the minimum distance becomes >10m at 800m/s, which is the average modern rifle velocity.
Additional InformationThis report is forwarded on behalf of one of my users Syrinx
TagsNo tags attached.
Git Revision or version number0.9.1
Run Mode Grid (1 Region per Sim)
Physics EngineubODE
Script Engine
EnvironmentMono / Linux64
Mono Version5.x
Attached Files

- Relationships

-  Notes
Total Sorbet (reporter)
2019-07-22 05:53

Expected behaviour. Rez max velocity seems to be capped somewhere around 200 to 250m/s but its long time since i've tested. Values beyond this are practically certain to produce what you have reported. Internally physics engine runs at 11 fps.. So even if it were possible to rez an object moving at 9km/sec it would have to jump 818 meters 11 times in one second. Its these huge jumps that makes it miss your 1x1x1.75m object.
RoyaleMobian (reporter)
2019-07-22 11:52
edited on: 2019-07-22 12:06

On SL it is maxed out at about 200 to 250m/s and is enforced to that limit, anything set faster then that is forced to the max limit. on ubode however, it has no limit enforced but the physics engine appears to top out at about 9000m/s as Syrinx has discovered. Having a limit in place even if it is configurable in the OpenSim.ini is better then having no limit.

like how osSetOwnerSpeed can be currently configured to change the max speed it can set for example.

Total Sorbet (reporter)
2019-07-22 13:44

I don't understand why you would want to cap this. You already have the ability to set a velocity when rezzing from script.
AliciaRaven (manager)
2019-07-22 13:53

The reason the speed is often capped is due to a physics effect known as "Tunneling". The physics engine tests for collisions every frame. So the faster an object moves, the more chance there is that that object will pass through another object between frames and therefore not be detected as a collision.

There are methods to fix this, but they are very complex and add extra overhead to the system and slow the physics tests down considerably. There is a trade off between efficiency and accuracy when it comes to mitigating the tunneling effect. Fast moving prims are often considered an outside edge contingency so performance is prioritize. Games that rely on bullets and guns, obviously take the issue more seriously.
AliciaRaven (manager)
2019-07-22 13:57

One work around I have used in the past when writing Gun scripts, is to make the projectile (ie bullet rocket etc) as LONG as possible. This means that even when its moving fast, it will be inside an object longer so increase the chance of a collision event registering. Or u can make a target larger, deeper. Not a fix, but might help understand and find a possible work around even if its temporary
Total Sorbet (reporter)
2019-07-22 14:03
edited on: 2019-07-22 14:04

Another option would be to use llCastRay() and do away with the bullet altogether

AliciaRaven (manager)
2019-07-22 14:10

That is a well known work around for tunneling. But to perform a ray cast every physics frame comes back to performance again. For what is considered an outside case to most users, ray casting between every frame its a large hit on performance. I think OS needs to handle the tunneling effect better, its just finding that balance between accuracy and performance. A lot of issues come down to a compromise and finding a balance. But again, yes I think OS is too serseptable to this error, both uODE and BulletSim.
Total Sorbet (reporter)
2019-07-22 14:15

There is no requirement to ray cast on every frame. Just once when gun is fired is sufficient.
AliciaRaven (manager)
2019-07-22 14:19

What if prims move between fire and impact? If its an instant collision, its simple. But you want a moving object, set speed, direction, impact with moving targets? A rocket with a non linear trajectory spiraling or heat seaking? Streat line instant shot is simple, but that cuts out the projectile prim, so just use ray casy in lsl not a prim in motion
Total Sorbet (reporter)
2019-07-22 14:27

I suggested ray casting because the OP was looking at using high speed projectile which would be difficult to see anyway. As an alternative I would consider ray casting valid in this case.
AliciaRaven (manager)
2019-07-22 14:29

Ah yes, Ray casting as ll script rather than a moving projectile. Not doing raycasting on the server for moving objects in physics as i thought
Total Sorbet (reporter)
2019-07-22 14:32

hehe that would be just.. horrible :p
UbitUmarov (administrator)
2019-07-22 14:42

Physics engines frame time is around 20ms.
ODE engines don't have Continuous Collision Detection Algorithms. Bullet has it off, because those are very heavy.

- Issue History
Date Modified Username Field Change
2019-07-19 15:26 RoyaleMobian New Issue
2019-07-22 05:53 Total Sorbet Note Added: 0035493
2019-07-22 11:52 RoyaleMobian Note Added: 0035494
2019-07-22 12:06 RoyaleMobian Note Edited: 0035494 View Revisions
2019-07-22 13:44 Total Sorbet Note Added: 0035495
2019-07-22 13:53 AliciaRaven Note Added: 0035496
2019-07-22 13:57 AliciaRaven Note Added: 0035497
2019-07-22 14:03 Total Sorbet Note Added: 0035498
2019-07-22 14:04 Total Sorbet Note Edited: 0035498 View Revisions
2019-07-22 14:10 AliciaRaven Note Added: 0035499
2019-07-22 14:15 Total Sorbet Note Added: 0035500
2019-07-22 14:19 AliciaRaven Note Added: 0035501
2019-07-22 14:27 Total Sorbet Note Added: 0035502
2019-07-22 14:29 AliciaRaven Note Added: 0035503
2019-07-22 14:32 Total Sorbet Note Added: 0035504
2019-07-22 14:42 UbitUmarov Note Added: 0035505

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker