I can't find the solution... e.g... Crazy origin on entity [458][weapon_awp]

Hello,

So, I’ve been looking into what the hell is causing this thing but literally I’ve got not one bit of evidence. Is there not way I could like find what is causing it and how would I be able to do that?

Here is the console showing that error:


Removing!
Crazy origin on entity [458][weapon_awp]
Origin: [4832.000000, -4224.000000, -16391.613281]
Angles: [0.000000, 0.000000, 360.000000]
Velocity: [0.000000, 0.000000, -1112.575684]
Angular Velocity: [0.000000, 0.000000, -0.000000]
Defusing!
Removing!
Crazy origin on entity [456][weapon_awp]
Origin: [4320.000000, -4224.000000, -16391.613281]
Angles: [0.000000, 0.000000, 360.000000]
Velocity: [0.000000, 0.000000, -1112.575684]
Angular Velocity: [0.000000, 0.000000, -0.000000]
Defusing!
Removing!
Crazy origin on entity [466][weapon_awp]
Origin: [4608.000000, -1952.000000, -16391.613281]
Angles: [0.000000, 0.000000, 360.000000]
Velocity: [0.000000, 0.000000, -1112.575684]
Angular Velocity: [0.000000, 0.000000, -0.000000]
Defusing!
Removing!
Crazy origin on entity [461][weapon_awp]
Origin: [4320.000000, -4288.000000, -16391.613281]
Angles: [0.000000, 0.000000, 360.000000]
Velocity: [0.000000, 0.000000, -1112.575684]
Angular Velocity: [0.000000, 0.000000, -0.000000]
Defusing!
Removing!
Crazy origin on entity [462][weapon_awp]
Origin: [4448.000000, -4256.000000, -16391.613281]
Angles: [0.000000, 0.000000, 360.000000]
Velocity: [0.000000, 0.000000, -1112.575684]
Angular Velocity: [0.000000, 0.000000, -0.000000]
Defusing!
Removing!
Crazy origin on entity [459][weapon_awp]
Origin: [4832.000000, -4288.000000, -16391.613281]
Angles: [0.000000, 0.000000, 360.000000]
Velocity: [0.000000, 0.000000, -1112.575684]
Angular Velocity: [0.000000, 0.000000, -0.000000]
Defusing!
Removing!

The entity is outside maximum map bounds.

This happens when the Physics engine dies. Restart the server.

A potential cause is returning false in ShouldCollide without calling related functions first.
There are a lot of hooks that if not handled correctly cause this.

Why it is spamming is because the weapons get unattached from the world and will start spazzing around the map. At some point they will fall down and hit the skybox. When it reaches the skybox this error will be shown. (Meaning another fix would be to set the weapons MoveType to MOVETYPE_NONE.)

Oh ok, so would there be a way I could fix it?

[editline]18th February 2017[/editline]

btw, Restarting the server doesn’t fix it permanently. I have restarted it before and it fixes it for a couple of hours.

Wait, could this be caused by a map?

Restarting the server works until you crash the Physics engine again.
It should not be caused by the map but I can not say it can’t be.

You’re going to have to search all Lua files for the hooks ShouldCollide and PhysicsCollide.
These are 2 of the most used hooks.
Look for “return false” in ShouldCollide and for “SetMoveType” in PhysicsCollide.

Will do, Thanks

[editline]18th February 2017[/editline]

What kind of file types should the program look for particularly? (.lua? or maybe all types?)

[editline]18th February 2017[/editline]

Wait, could it be in garrysmod/lua/autorun/properties/collisions.lua ? collisions.lua contains the following:

[editline]18th February 2017[/editline]

I know this is exactly against what you told be but I’m still going to make sure… I found this in the base game mode:

I can see it says return true but could it still be the problem?

You’re looking at default files, instead you should look at third party addons/scripts that you’ve installed

honestly though, in contrast to the information you’ve been given in this thread, I don’t think it would make too much of a difference. Worth a try of course though

The source engine doesn’t like to be ran for extended periods of time due to timer imprecision.

Does this happen on multiple maps? Or is your server always on a single map?

It happens on multiple maps. also, I have recently created a new server with no errors what so ever until I added 2 addons which was when the same error started happening and I think I know which one it is… Could you please do me a big, big favour and tell me if it is the Custom Commands addon? https://forums.ulyssesmod.net/index.php?topic=7268.0 <-- you can download it there. I would really be thankful if you could tell me. I have noticed that it has a ulx.hook or something like that which I don’t really understand anything about.

[editline]19th February 2017[/editline]

Here is possibly only one of the files which are called ulx.hook. This is the whole code that is inside it: http://pastebin.com/2sXjEiBq There are possibly a few more files that contain ulx.hook but I’m not sure about that.

Instead of searching all files for hooks, why not use the console and get Lua to find it for you? You can just put something like this into console:
[lua]lua_run for k,v in pairs(hook.GetTable().ShouldCollide) do PrintTable(debug.getinfo(v)) end[/lua]
Should print information about every function hooked to ShouldCollide, including which addon, file, and line number they are defined.

http://pastebin.com/PrAbsecB

Thank you! The results are:

> for k,v in pairs(hook.GetTable().ShouldCollide) do PrintTable(debug.getinfo(v)) end…
{
linedefined = 181
currentline = -1
func = function: 0x2425fe58
isvararg = false
namewhat =
lastlinedefined = 211
source = @gamemodes/bhop/gamemode/modules/sv_stats.lua
nups = 4
what = Lua
nparams = 2
short_src = gamemodes/bhop/gamemode/modules/sv_stats.lua

The next message I send will show the functions for both of them. and btw the Bhop game mode is what I’m using.

[editline]19th February 2017[/editline]

Here is the function: http://pastebin.com/cz7xVzfd

[editline]19th February 2017[/editline]

[lua]Crazy origin on entity [35][weapon_smg1]
Origin: [3184.000000, -2544.000000, -16401.484375]
Angles: [0.000000, 0.000000, 360.000000]
Velocity: [0.000000, 0.000000, -2442.701416]
Angular Velocity: [0.000000, 0.000000, -0.000000]
Defusing!
Removing!
Crazy origin on entity [37][weapon_smg1]
Origin: [512.000000, -2352.000000, -16399.015625]
Angles: [0.000000, 0.000000, 360.000000]
Velocity: [0.000000, 0.000000, -2442.612061]
Angular Velocity: [0.000000, 0.000000, -0.000000]
Defusing!
Removing!
Crazy origin on entity [36][weapon_smg1]
Origin: [1248.000000, -2352.000000, -16399.015625]
Angles: [0.000000, 0.000000, 360.000000]
Velocity: [0.000000, 0.000000, -2442.612061]
Angular Velocity: [0.000000, 0.000000, -0.000000]
Defusing!Removing![/lua]

is what the console is showing right now at random times as well as this:

[lua]CreateFragmentsFromFile: ‘user_custom/ff/ffffffff.dat’ doesn’t exist.
CreateFragmentsFromFile: ‘user_custom/ff/ffffffff.dat’ doesn’t exist.
CreateFragmentsFromFile: ‘user_custom/ff/ffffffff.dat’ doesn’t exist.CreateFragmentsFromFile: ‘user_custom/ff/ffffffff.dat’ doesn’t exist.[/lua]
http://pastebin.com/PrAbsecB Here are the results for anything that contains ‘origin’, I guess this most-likely won’t come up with anything that could cause it but It’s worth a try. I really appreciate the help too :slight_smile:



    if not IsValid( ent1 ) or not IsValid( ent2 ) then return false end
    if(ent1:IsPlayer() && ent2:IsPlayer()) then return false end


The code is returning false. If the code returns false you need to http://wiki.garrysmod.com/page/Entity/CollisionRulesChanged.
Since there is no indication for when players start colliding You’re going to have to periodically run CollisionRulesChanged on players. (Basically when a player leaves or spawns run the function on everyone.)



local function AntiPhysicsEngineCrash()
    for k, v in pairs(player.GetAll()) do
        v:CollisionRulesChanged()
    end
end
hook.Add("PlayerSpawn", "AntiPhysicsEngineCrash", AntiPhysicsEngineCrash)
hook.Add("PlayerDisconnected", "AntiPhysicsEngineCrash", AntiPhysicsEngineCrash)


Add this to the bottom of that code and see if it helps.
If it does not come back to me. Also you can expect it to still crash some times after ~5 days.

K, Thanks