Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Quad), 748 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Probleme mit dem gravity code/problems with gravity #457499
01/20/16 00:04
01/20/16 00:04
Joined: Jun 2010
Posts: 212
tagimbul Offline OP
Member
tagimbul  Offline OP
Member

Joined: Jun 2010
Posts: 212
GERMAN: hei i have this problem here

ENGLISH: hey ich habe dieses problem hier

https://www.youtube.com/watch?v=2sCFtbuN-Mk

GERMAN: wie kann ich steuern, ab welcher höhe der bounding box er diesen "jump" ausführt?

ENGLISH: How can I control from which height of the bounding box, he executes this "jump"?


meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Re: Probleme mit dem gravity code/problems with gravity [Re: tagimbul] #457500
01/20/16 00:52
01/20/16 00:52
Joined: Feb 2012
Posts: 371
Dico Offline
Senior Member
Dico  Offline
Senior Member

Joined: Feb 2012
Posts: 371
maybe you need this move_min_z = 0.4; add it to your main

Re: Probleme mit dem gravity code/problems with gravity [Re: Dico] #457502
01/20/16 06:44
01/20/16 06:44
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Hi.

As I see, you are using the code from Superku's TipOfTheWeek series. As far as I remember, small box like BBOX was part of the 'setup', so making it as big as your player's model will mess things up. You probably edited this lines in your code:
Code:
vec_fill(my.min_x,-32);
vec_fill(my.max_x,32);

And I think, you shouldn't do that. I'm pretty sure Superku will give a better reply about his code.
Anyway, this is how it should look like to work correctly (as in his example and as in your first part of the video):




Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Probleme mit dem gravity code/problems with gravity [Re: 3run] #457504
01/20/16 08:33
01/20/16 08:33
Joined: Jun 2010
Posts: 212
tagimbul Offline OP
Member
tagimbul  Offline OP
Member

Joined: Jun 2010
Posts: 212
i have set the bbox..

by the first part of the video is the bbox zu small by the second part ist the bbox on this size tath i want but if i move on a block he bzg/jump upside and i need to controll this

look on 0:39
https://youtu.be/2sCFtbuN-Mk?t=39s

if the BBOX to high, he jump upside.
i want the BBOX on this size and i want control the bug/jump high with a variable...

I struggle with this problem for a long time period
but it could never solve


meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Re: Probleme mit dem gravity code/problems with gravity [Re: tagimbul] #457507
01/20/16 10:36
01/20/16 10:36
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: tagimbul
i have set the bbox..

by the first part of the video is the bbox zu small by the second part ist the bbox on this size tath i want but if i move on a block he bzg/jump upside and i need to controll this
That's the thing I'm trying to tell you. This code won't (probably) work with rectangular BBOX! You have to use square BBOX (as on the picture from original source I've posted above and as in the first part of your video!). To make sure, you have to wait for Superku's reply, cause he is the one who made that gravity code, and I'm pretty sure he made square BBOX for a reason.

Originally Posted By: tagimbul
if the BBOX to high, he jump upside.
i want the BBOX on this size and i want control the bug/jump high with a variable...

I struggle with this problem for a long time period
but it could never solve
This caused by ellipsoid shape of collusion bbox ( READ MANUAL ), and we all suffering from this :< You can try and change 'move_min_z' parameter as Dico suggested, but I'm sure it won't help (it may reduce the stepping height, but will cause to other issues that you'll need to fix), cause there is no ONE variable that will solve that problem, it's pretty tricky to get working collusions properly. It may sound really frustrating I know this on my own, cause I'm been suffering from Acknex's OBB collision engine for years. You may want to check physX engine too, but it's also undone and tricky (and out-dated as hell). Take a look at the contribution I've made here:
PhysX Movement (RIGID BODY)


Best regards.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Probleme mit dem gravity code/problems with gravity [Re: 3run] #457508
01/20/16 11:51
01/20/16 11:51
Joined: Jun 2010
Posts: 212
tagimbul Offline OP
Member
tagimbul  Offline OP
Member

Joined: Jun 2010
Posts: 212
slowly I understand it ...
with an ellipsoid and move_min_z I can choose, at what level he skips the stairs?
you mean this?



A = skip the stair. while the normal contact is okey
B = no skip . while the normal kontakt is to big?
and i can set it with move_min_z ?


meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Re: Probleme mit dem gravity code/problems with gravity [Re: tagimbul] #457509
01/20/16 12:41
01/20/16 12:41
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: tagimbul
slowly I understand it ...
with an ellipsoid and move_min_z I can choose, at what level he skips the stairs?
you mean this?



A = skip the stair. while the normal contact is okey
B = no skip . while the normal kontakt is to big?
and i can set it with move_min_z ?
Quote from manual:
Quote:
By default the ellipsoid can move up any slope, no matter how steep it is. To restrict this motion you can alter the global variable move_min_z. If the contact normal's Z axis is less than this minimum value no gliding along Z will take place at all. Hitting the ground plane will result in a normal.z value of 1.0 (pointing straight up). Hitting the ceiling will yield -1.0 (straight down) and a head on collision with a perpendicular wall will have a normal.z value of 0. The default value of move_min_z is -1 which allows gliding at all angles. If you were to set it to 0.5 instead all slopes steeper than 60 degrees (=acos[0.5]) would cause the entity to stop and not glide up. This example is valid only for a spherical hull. For an ellipsoid some trial and error is required to find the right value. Rather than relying on move_min_zit is recommended that you place invisible entities in front of steep walls to block them off.
It means that 'move_min_z' determines the angle of the slope entity can step on. You have to know, that those 'black' obstacles in your picture, will affect normal.z too, as you try to step on them they will return 0 (probably). So playing around with 'move_min_z' may help, but as the manual says it's not a thing to rely on. It will cause other problems anyway at the end, probably cause to get that 'normal.z' value, you have to collide with those 'obstacles' at first, and after that they are too steep entity won't step on them.. I tried to find german manual, to make quote from it (instead of english version), but I couldn't find it. Read more about collision engine, you'll find out that it's really tricky to get properly working movement code :<

I tried to explain how it works via this picture:

The red silhouette that goes down from the entity is the 'c_trace' with USE_BOX flag set on, you have to know that it's using ellipsoid as well. Also, to understand what 'move_min_z' sets you have to imagine a slope going more and more steeper from flat ground (pointing straight up) which has angle 0 to a vertical wall, that has angle 90 (let's say), in this situation setting 'move_min_z' to 0.5 will prevent entity from GLIDING (this is very important) up on the slope, which's angle is steeper than 60 degrees (as the manual says, you can convert those 'move_min_z' values (1-0) into the angle of the slope by 'acosv' function, f.e. acosv(0.5) will equal to 60). Prevent from GLIDING means, that it will get stuck on moving up on the slope, and that is something that will result to unwanted results at the end. I tried my best to explain grin Keep it up!


My best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Probleme mit dem gravity code/problems with gravity [Re: 3run] #457555
01/22/16 12:01
01/22/16 12:01
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
"This code won't (probably) work with rectangular BBOX! You have to use square BBOX"
The code theoretically works with all kinds of bboxes, square or not.

The problem is, as already identified, the OBB collision system. Because of that you can move the player's hull at least to some degree over a corner, and the USE_BOX trace, starting from let's say the middle of the player position, will then hit the ground on the downward trace.
As 3run already said this is a tricky one to solve - or at least to find workarounds -, especially in three dimensions. Maybe a separate small collision hull (entity) near the feet with a separate c_move could do the trick (then limit the player's movement/ c_move call accordingly).


"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: Probleme mit dem gravity code/problems with gravity [Re: Superku] #457556
01/22/16 13:08
01/22/16 13:08
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: Superku
"This code won't (probably) work with rectangular BBOX! You have to use square BBOX"
The code theoretically works with all kinds of bboxes, square or not.
Well, maybe I used few wrong words to explain myself there. It will be MORE tricky to make it work with rectangular BBOX grin


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Probleme mit dem gravity code/problems with gravity [Re: 3run] #457558
01/22/16 13:26
01/22/16 13:26
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Yeah that's true.

If the level geometry is mostly grid aligned (meaning few diagonals and such) you can for example put min_x/max_x to something small (0.01) temporarily, do a trace in x-direction, reset min/max, same for y, and use "target" positions to limit player movement. I do something like that in my sidescroller as it emulates a box (or in 3D cylindrical) trace more or less easily.


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

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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