Upbge: Segmentation fault on KX_GameObject.collide

Created on 27 Nov 2018  Â·  7Comments  Â·  Source: UPBGE/upbge

I have another crash.
Sorry me for this =)

Creating "little" test .blend files, probably, is not the best idea.
Often can't reproduce, as in case with https://github.com/UPBGE/blender/issues/950
I had code with 100% probability to reproduce, but loosed it.
Also I think now, maybe this issue was causing crash I described in https://github.com/UPBGE/blender/issues/950...

So in this branch I created bookmark with 100% crash:
https://bitbucket.org/new_novel/oasis/src/default/

Steps to reproduce:

  • pull repository: hg clone https://[email protected]/new_novel/oasis
  • move to bookmark with crash: hg update -r bug/upbge/KX_GameObject.colide
    (or checkout to that commit: "dac3134aa664")
  • open scene in upbge: upbge ./scenes/dream_tower/dream_tower.blend
  • press P and see a crash

It's caused by adding next line to code: player_is_on_block = obj.collide (player) [0]
("./scripts/scene_dream_tower/scene_helpers.py", line 137)

When you stay on some other cubes rather than 3-rd - all is OK (no collision).
If you jump on that cube - there is collision with it.
When you jump from that cube - collision disappears and UPBGE crashes.

Video with bug: https://www.youtube.com/watch?v=UP1wFJugDKM

OS: LInux Mint 19 Cinnamon
Kernel: 4.15.0-39-generic
UPBGE: 0.2.4
GPU: Nvidia Geforce GT 840m

bug

All 7 comments

If you are using collision sensor the correct format is

if collision.positive:
    player_on_platform = collision.hitObject

if you are using callback for this I am not sure why but I think that is
causing your crash.
On Mon, Nov 26, 2018 at 5:12 PM Vladislav notifications@github.com wrote:

I have another crash.
Sorry me for this =)

Creating "little" test .blend files, probably, is not the best idea.
Often can't reproduce, as in case with #950
https://github.com/UPBGE/blender/issues/950
I had code with 100% probability to reproduce, but loosed it.

So in this branch I created bookmark with 100% crash:
https://bitbucket.org/new_novel/oasis/src/default/

Steps to reproduce:

  • pull repository: hg clone
    https://[email protected]/new_novel/oasis
  • move to bookmark with crash: hg update -r
    bug/upbge/KX_GameObject.colide
    (or checkout to that commit: "dac3134aa664")
  • open scene in upbge: upbge ./scenes/dream_tower/dream_tower.blend
  • press P and see a crash

It's caused by adding next line to code: player_is_on_block = obj.collide
(player) [0]
("./scripts/scene_dream_tower/scene_helpers.py", line 137)

Video with bug: https://www.youtube.com/watch?v=UP1wFJugDKM

OS: LInux Mint 19 Cinnamon
Kernel: 4.15.0-39-generic
UPBGE: 0.2.4
GPU: Nvidia Geforce GT 840m

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/UPBGE/blender/issues/952, or mute the thread
https://github.com/notifications/unsubscribe-auth/AG25WeaDpBfblnWaBWHiY8yUMft20f1Pks5uzJFzgaJpZM4Y0VM_
.

@BluePrintRandom , thanks, but I'm using Always sensor =)
It moves my block a little bit, and it should check collision with player. If it's present - than move also player a little bit.

then use the bvhTrees. they also detect the collision between geometries.
Your player must have a collision box and you can check the intersection between the obstacle and the collision box testing the bvh every logic tic

Or use a ray and if it hits yourplatform state grab a local,
Local = platform.worldOrientation.inverted()*(player.worldPosition -
platform.worldPosition)

And next frame use stored local to set player position

Player.worldPosition = platform.worldTranform*local

Player key presses on platform manipulate local

On Tue, Nov 27, 2018, 6:40 AM Stefano Romano <[email protected]
wrote:

then use the bvhTrees. they also detect the collision between geometries.
Your player must have a collision box and you can check the intersection
between the obstacle and the collision box testing the bvh every logic tic

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/UPBGE/blender/issues/952#issuecomment-442081639, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AG25WYDYHKmItKPLJkZgjA30n1gLsGpdks5uzU7OgaJpZM4Y0VM_
.

@BluePrintRandom , thanks, I thought about rays too, but hadn't time to make it.

@RomStef , Thank you very much. I was searching a way detecting collisions without physics engine using only their geometries for a long time.
Hope, I could somehow detect intersections of two objects when one will have no physics at all =)

I think that this issue may be somewhat related to #916 (though I'm not 100% sure, it sounds very simillar).

It works OK in current 0.2.5. Thanks for reporting.
Closing now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EndSSgamesStudio picture EndSSgamesStudio  Â·  7Comments

BlenderDoc picture BlenderDoc  Â·  4Comments

Anarchokawaii picture Anarchokawaii  Â·  7Comments

maconbot picture maconbot  Â·  5Comments

denicolas picture denicolas  Â·  4Comments