Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (degenerate_762), 1,114 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Disparity between entity position and visual mesh #475326
12/02/18 09:19
12/02/18 09:19
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I've been trying to debug a stubborn egg movement code.
In particular it has been "bouncing" vertically seemingly at random, see here: https://i.gyazo.com/b74daf93dac42d5457765f7a2aa3e92b.mp4

As I had issues with a non-uniform OBB I'm moving the entity up by it's vertical ellipsoidal difference (depending on tilt), perform the movement stuff with a round OBB (inner circle, so to speak), then move it back down.
I've been using c_move for height changes to update the collision hull (for the subsequent player movement).

After a while I figured it's not >directly< an issue with my code/ a standard bug that I'd be moving it incorrectly by accident but it's some other issue with the egg's visual mesh instead. The numbers on screen are drawn relative to the entity height, as well as logging the height always shows the same height when it's jerking around: https://i.gyazo.com/3d8b595df946feb1febc31700013a060.png

Is this an engine bug somehow or is there another reason? Is there anything I can do about it? (Hm, just got an idea, use a 2nd entity as a workaround and put it at the original now invisible egg's position?)

Thanks.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Disparity between entity position and visual mesh [Re: Superku] #475336
12/02/18 17:32
12/02/18 17:32
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline
Serious User
jumpman  Offline
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Hey superku, are you changing the entity position more than once per frame?

Can you upload just the movement snippet itself?

Does it happen if you set the entity to passable?

Re: Disparity between entity position and visual mesh [Re: jumpman] #475344
12/03/18 10:05
12/03/18 10:05
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Yes, calling c_move 3 times per frame for the same entity.
Usually I code all movement codes so entities float above the ground via c_trace. For this egg I chose to have constant c_move collision because of the non-spherical shape, which probably wasn't the best idea - it works though, except that glitch. (Implying that I cannot set it to passable without redoing the code.)

The visual glitch seems to appear when the result of c_move is <= 0.

EDIT: Btw. putting a passable copy at the same position and angles does the trick as a workaround.

Last edited by Superku; 12/03/18 10:23.

"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Disparity between entity position and visual mesh [Re: Superku] #475351
12/03/18 17:05
12/03/18 17:05
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Moving it several times per frame could be a problem since the engine does some collision management tasks at every frame, but not inbetween. The passable workaround should fix it, since then the move is a mere displacement.

Re: Disparity between entity position and visual mesh [Re: jcl] #475354
12/03/18 22:41
12/03/18 22:41
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline
Serious User
jumpman  Offline
Serious User

Joined: Apr 2002
Posts: 1,246
ny
I've had a better time using a stand-in entity that handles movement and pathfinding with an agreeable shape for collision, and then a visual entity that handles animation and collision with bullets/weapons. Although there is legwork to do to synchronize the 2 entities on top of simply placing the visual entity in the same spot. You can also smooth out erratic movements when entities collide into each other, by causing the visual entity to smoothly move to it's collision entity. But this is on a per game thing.

@JCL Out of curiosity, what kind of collision tasks are done at the end of every frame? Identifying and resolving boxes that collide then attempt to moving them the next frame?


Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1