Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 662 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: c_trace problem [Re: jcl] #399917
04/23/12 10:29
04/23/12 10:29
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Well AFAIK c_updatehull is mostly used to (re)calculate the collision mesh of a different frame. When I'm back home, I will test the speed of this instruction when the frame hasn't changed. If it's slower than c_move, it's useless in my case.

Quote:
However, normally you can avoid such a situation anyway by proper coding, f.i. tracing an object before and not after displacing it.

Not really, see the following situation:
A platform that moves vertically between two points up and down. It does not need collision detection when moving and should not be blocked by anything, so setting the z-position directly sounds logical. When the (PROC_LATE) player stands on the platform and performs his gravity code, he will get the position of the invisible collision mesh that is still at the position of the last frame.
Thus, because of the 1-frame-lag, he will either hover above the platform when it moves down or sink into it when the platform moves up.
To avoid this, I use c_move (instead of my.z = ...):
vec_diff(temp,new pos, old pos);
c_move(me,nullvector,temp,IGNORE_PASSABLE | IGNORE_MODELS | IGNORE_WORLD);
This updates the position of the collision mesh and the player and other objects on the platform don't lag one frame behind, but I think it's an unnecessary c_move call.
Btw. I've tried
c_move(me,nullvector,temp,IGNORE_SPRITES | IGNORE_MODELS | IGNORE_WORLD);
but it does not update the collision hull, I don't know if that is skipped on purpose or not.


"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: c_trace problem [Re: Superku] #399920
04/23/12 11:23
04/23/12 11:23
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The normal way to move a platform is c_move with ignoring all obstacles. Moving something by setting its coordinates is normally not recommended. Coordinates are only for placing something at a different position, f.i. for teleporting.

Anyway, at a first glance I see no reason why the collision tree is not updated when you set IGNORE_SPRITES. In my opinion, it should. Can you upload an example for this?

Re: c_trace problem [Re: jcl] #399924
04/23/12 12:58
04/23/12 12:58
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Hm I've tried to make an example, but it in fact works with (IGNORE_SPRITES | IGNORE_MODELS | IGNORE_WORLD) set. If you haven't changed c_move since ~January 2011, I was simply wrong - although I remember the issue as if it were yesterday.

Ok, then I will (continue to) use c_move with the said movement mode.


"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
Page 2 of 2 1 2

Moderated by  HeelX, Spirit 

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