Problem with Run Armature. BGE

Hi, I want to make a snake to play some loop motion, but I like it to adapt to every terrain and every location I want it to be, and have several copies or instances around the level. I came out with a solution using several cubes, that use a script making them follow the exact same location of previous cube but 10 frames behind, and the first one is the only one that has the real motion. Then the bones have constrains to copy loc and rot from these cubes. Everything works really fine, with one snake at a time, when I copy several of them, sometimes some snakes disappear, other times the whole game and blender crashes. I’ve seen that if I turn off the run armature actuator, nothing bad happens, but that obviously itś not a solution. If someone can find what could be happening with this? or have a better idea to accomplish the snake I want to make, I would really appreciate that. Thanks.
BTW i’m using 2.76b
SnakeProblem.blend (883.8 KB)

I got this crash info

# Blender 2.76 (sub 0), Commit date: 1970-01-01 00:00, Hash unknown

# backtrace
blender(BLI_system_backtrace+0x30) [0x1361b10]
blender() [0x97a98e]
/lib/x86_64-linux-gnu/ [0x7f0ad49e24c0]
blender() [0x169d467]
blender(_ZN6btDbvt6updateEP10btDbvtNodeR12btDbvtAabbMm+0x12) [0x169dfa2]
blender(_ZN6btDbvt6updateEP10btDbvtNodeR12btDbvtAabbMmRK9btVector3f+0xea) [0x169e10a]
blender(_ZN16btDbvtBroadphase7setAabbEP17btBroadphaseProxyRK9btVector3S4_P12btDispatcher+0x5df) [0x15d074f]
blender(_ZN20CcdGraphicController19SetGraphicTransformEv+0x4d) [0x14f2ffd]
blender(_ZN7SG_Node15UpdateWorldDataEdb+0x3e) [0x15c7d9e]
blender() [0x15281d6]
blender(_BaseMathObject_WriteIndexCallback+0x23) [0xdb4533]
blender() [0xdbee8e]
/usr/lib/x86_64-linux-gnu/ [0x7f0adb9e88e4]
/usr/lib/x86_64-linux-gnu/ [0x7f0adb9e92ff]
/usr/lib/x86_64-linux-gnu/ [0x7f0adbaf9d30]
/usr/lib/x86_64-linux-gnu/ [0x7f0adbb8ec6c]
/usr/lib/x86_64-linux-gnu/ [0x7f0adbb8ed43]
/usr/lib/x86_64-linux-gnu/ [0x7f0adbaf694b]
blender(_ZN20SCA_PythonController7TriggerEP16SCA_LogicManager+0x104) [0x15a2274]
blender(_ZN16SCA_LogicManager10BeginFrameEdd+0xa3) [0x159d333]
blender(_ZN15KX_KetsjiEngine9NextFrameEv+0x27a) [0x1533e3a]
blender() [0x14ada87]
blender(StartKetsjiShell+0xc00) [0x14ae8f0]
blender() [0xa707a0]
blender() [0x9844a2]
blender() [0x98588d]
blender() [0x985cbf]
blender() [0x9861a8]
blender(wm_event_do_handlers+0x5f6) [0x9868e6]
blender(WM_main+0x18) [0x97cfd8]
blender(main+0xef4) [0x95ce04]
/lib/x86_64-linux-gnu/ [0x7f0ad49cd840]
blender(_start+0x29) [0x97a2b9]

Hi run armature it hard process for bge/upbge, need control all run armatures if distance to armature high need stop process run armature for save resurs game engine, if distance high you never see gow snake use run armature and move to the ground. Not make copy game object - assign object in group and add in scene how initialization groups - this analogy copy objects or duplicate, this get for you ready game models, you always get objects in group or stand alone object

    obj = scene.addObject("Group", own, 0)
    child = obj.groupMembers
    if 'Cube' in child:
        cube = child['Cube']

it simple example how get object from add group, for control distance to objects use for i in scene.objects: and parameters search - property in objects, switch name, and own.getDistanceTo(object) for check distance for off run armatures in long distance. I use ragdoll run armature in test scene and get 9-12 ragdoll models for units dead animation all work nad fps fall to 30-37 frames if all ragdoll armatures run, else i off armatures in long distance to camera and fps return to 55-60, if suspend physics for rigid body colliders this upgrade fps for game

So, the system can’t handle several armatures running. I don’t need them all at the same time, may be that will work.

yes you need activate only near to camera, because if activate all armatures in scene this drop fps - just check distance and property
for i in scene.objects:
if own.getDistanceTo(i)<5.000 and ‘run_armature’ in i:
#assign property or use armature run

I tried your file and I didn’t experience any crashes, up until I started messing around with the subsurf modifiers (setting one of them to 0 or disabling it). Maybe you could try disabling or removing them all to eliminate variables.

Yes, thank you. I deleted the subsurf, because there´s no reason to keep them, I made some changes in the way the first cube moves to have more control. Now the motion and the run armature actuator only happens if the snake is on camera. I think now everything works for now.

Here’s a video demo.

1 Like

video looking good - good job, i recommend for you dont use modificator if this modificator not apply because this get more errors - visual errors, physics error, and crushing game, only one modificator support in game this armature modificator

1 Like