0 registered members (),
1,089
guests, and 10
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
collision system
#210698
06/12/08 11:47
06/12/08 11:47
|
Joined: Feb 2007
Posts: 353
amy
OP
Senior Member
|
OP
Senior Member
Joined: Feb 2007
Posts: 353
|
http://www.conitec.net/beta/ac_move.htmSo far so good but could you also add gravity to this movement example? The troubles with movement start with gravity for me. With problems i mean jittering, getting stuck and not being able to prevent gliding up steep slopes. Compared to some other engines I find the Gamestudio collision system hard to use. Why do I have to use c_trace and canīt simply push the ellipsoid around with gravity and everything? It would be nice if not only ellipsoids but also other collision shapes were available.
|
|
|
Re: collision system
[Re: Joey]
#210717
06/12/08 12:49
06/12/08 12:49
|
Joined: Feb 2007
Posts: 353
amy
OP
Senior Member
|
OP
Senior Member
Joined: Feb 2007
Posts: 353
|
Please show me a simple movement script like on that manual page with gravity. Like I said, I find the Gamestudio collision system hard to use right compared to the ones of some other engines. Itīs not clear how to use it properly. My own try kind of works but I need the floordistance because otherwise i get stuck on some concave floor edges. The floordistance makes it impossible to prevent running up very steep slopes though. I think it would be easiest if it simply were possible always apply gravity to the ellipsoid but for that the collision system doesnīt seem to be robust enough. action movement()
{
var speed = 0;
var speedz = 0;
var friction = 0.75;
var frictionz = 0.1;
var floordistance = 2;
var move
var movez;
my.min_z += floordistance;
while(1)
{
result = c_trace(my.x, vector(my.x, my.y, my.z - 5000), IGNORE_ME | IGNORE_PASSABLE | USE_BOX);
if(result > floordistance)
{
movez = accelerate(speedz, -10, frictionz);
}
else
{
speedz = 0;
movez = floordistance - result;
}
my.pan += (key_a - key_d) * 10 * time_step;
move = accelerate(speed, (key_w - key_s) * 10, friction);
result = c_move(my, vector(move, 0, movez), nullvector, IGNORE_PASSABLE | GLIDE);
wait(1);
}
}
|
|
|
Re: collision system
[Re: amy]
#210721
06/12/08 13:38
06/12/08 13:38
|
Joined: Jan 2003
Posts: 4,615 Cambridge
Joey
Expert
|
Expert
Joined: Jan 2003
Posts: 4,615
Cambridge
|
but for that the collision system doesnīt seem to be robust enough it is. there are thousands of working movement scripts around. the simple truth is that your code is wrong somewhere. my.min_z += floordistance; modifies the bounding box. i see no sense in this statement at all. try to use c_updatehull instead. also you should check return from trace being equal to zero, because that means that nothing is hit. like plenty of people before you you're assuming that the engine is wrong somewhere before looking at your own code. i see why your entity gets stuck on slopes but you haven't asked a question like "why does my movement code get stuck on slopes"? that's my problem. and that is yours. i'd advice you to post a question in the beginner's section or somewhere... joey.
|
|
|
Re: collision system
[Re: Joey]
#210724
06/12/08 13:46
06/12/08 13:46
|
Joined: Feb 2007
Posts: 353
amy
OP
Senior Member
|
OP
Senior Member
Joined: Feb 2007
Posts: 353
|
The simple truth is that you didnīt try to understand my script. I modify the bounding box because if the ellipsoid touches the ground i get sticking problems. Because of this modification I donīt have to check if the c_trace result is bigger than zero but bigger than the amount of the modification. None of the movement scripts I came across works flawlessly. I donīt think i am too picky. Getting stuck should never happen! I would be very grateful if someone would add gravity in the correct way to the example on that manual page. It sounds like every idiot except me can do it so it shouldnīt be that hard!
|
|
|
Re: collision system
[Re: amy]
#210727
06/12/08 14:24
06/12/08 14:24
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
The movement example in the link to the manual contains already gravity, quite similar to that in yours. The floordistance makes it impossible to prevent running up very steep slopes though. I think it would be easiest if it simply were possible always apply gravity to the ellipsoid but for that the collision system doesnīt seem to be robust enough. What you are asking for is actually a physics system. Instead, you could add to your code something like: - get the normal of the ground, - if it is too steep, - push the entity in direction of the normal.
|
|
|
Re: collision system
[Re: amy]
#210729
06/12/08 14:30
06/12/08 14:30
|
Joined: Jan 2003
Posts: 4,615 Cambridge
Joey
Expert
|
Expert
Joined: Jan 2003
Posts: 4,615
Cambridge
|
of course, you're modyfing your bounding box because of sticking problems. that does not make sense at all because why should a smaller bounding box _not_ stick with your faulty code? the point is that you're checking the height for numbers higher than two. but this has nothing to do with the collision ellipsoid. I donīt think i am too picky. well, you are. and i think you're picky with the people who want to help you. since i'm not having your problems i won't make any further efforts to help you. good luck...
|
|
|
Re: collision system
[Re: Joey]
#210732
06/12/08 14:40
06/12/08 14:40
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
of course, you're modyfing your bounding box because of sticking problems. that does not make sense at all because why should a smaller bounding box _not_ stick with your faulty code? That's not true. Read the discussion of clone45, damocles and jcl. It indeed makes much sense to let the box _not_ touch the ground, because it prevents the collision system from unnecessary computings.
|
|
|
Re: collision system
[Re: Joey]
#210733
06/12/08 14:41
06/12/08 14:41
|
Joined: Feb 2007
Posts: 353
amy
OP
Senior Member
|
OP
Senior Member
Joined: Feb 2007
Posts: 353
|
The movement example in the link to the manual contains already gravity, quite similar to that in yours. The example on the manual page doesnīt have real gravity. It sets the entity exactly to the ground every frame and thus avoids all problems. that does not make sense at all because why should a smaller bounding box _not_ stick with your faulty code? My method solves the sticking problem because the c_move ellipsoid doesnīt touch the ground anymore but the disadvantage is that it makes it possible to climb slopes up to 89° and there is no obvious way to prevent that. and i think you're picky with the people who want to help you. You didnīt try to help me but were very condescending right from the beginning.
|
|
|
Re: collision system
[Re: amy]
#210736
06/12/08 14:51
06/12/08 14:51
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
The example on the manual page doesnīt have real gravity. It sets the entity exactly to the ground every frame Ah, okay, I see. You're right.
|
|
|
|