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
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, AndrewAMD), 1,076 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Ruckeln bei c_move und Kollision mit anderen Entities #236720
11/16/08 02:47
11/16/08 02:47
Joined: Aug 2005
Posts: 343
Germany
HPW Offline OP
Senior Member
HPW  Offline OP
Senior Member

Joined: Aug 2005
Posts: 343
Germany
Ich habe seitdem ich auf lite-c und dem neuen Kollisionssystem (OBB) gewechselt bin ein problem mit c_move.
Das Problem tritt auf, wenn mein Player mit c_move bewegt wird und mit einer andere Entity kollidiert. Wenn ich dann den Player weiter in Richtung der Entity laufen lasse, dann ruckelt die Bewegung des Players (dauernd weg von der Entity und wieder hin). Je nachdem wie hoch die Laufgeschwindigkeit des Players ist, desto heftiger ruckelt die Bewegung.
komischerweise kommt es bei mir nicht nur mit meinem eigenen movement Code vor, sondern auch mit dem aus dem Manual oder weiteren die ich hier im Forum gefunden und ausprobiert habe.
Daher nehme ich nun an, dass es entweder ein generelles Problem sein muss oder ich einfach nur was (ausserhalb meiner movement Funktion) falsch mache bzw. nicht weiss.

Meine Init Funktion für Engine Variablen:
Code:
function myInit()
{
  d3d_triplebuffer = ON;
  pos_resolution = 0;
  move_friction = 0.25;
  move_min_z = -1;
  disable_z_glide = 0;
  enable_polycollision = 2;
  fps_max = 60;
  fps_min = 16;				
  fps_lock = ON;
}


Mein Movement Code für den Player:
Code:
#define WORLD_GRAVITY 30
VECTOR* eb_vec_relSpeed = {x=0; y=0; z=0;}
VECTOR* eb_vec_absSpeed = {x=0; y=0; z=0;}
VECTOR* eb_vec_absforce = {x=0; y=0; z=0;}

function myPlayer()
{
  my._speed = 10;
  wait(1);
  c_setminmax(me);
  reset(my, SHADOW | POLYGON | PASSABLE | TRANSLUCENT);
  my.flags2 |= UNTOUCHABLE;
  while(1)
  {
    my._force_x = my._speed * maxv(minv(key_w-key_s, 1), -1);
    my._force_y = -my._speed * maxv(minv(key_d-key_a, 1), -1);
    my._force_pan -= 10 * mouse_force.x * time_step;

    // Player Drehen...
    c_rotate(me, vector(my._force_pan,0,0), IGNORE_PASSABLE | IGNORE_PUSH);

    // Player Bewegen...
    vec_set(eb_vec_relSpeed, vector(0,0,0));
    vec_set(eb_vec_absSpeed, vector(0,0,0));
    if (my._height > 3) // In der Luft
    {
      my._friction = 0.05;
      my._force_x *= 0.2;
      my._force_y *= 0.2;
      accelerate(eb_vec_absforce.z, -WORLD_GRAVITY*3, 0);
      eb_vec_absforce.x = 0;
      eb_vec_absforce.y = 0;
    }
    else // Auf dem Boden
    {
      my._friction = 0.7;
      vec_set(eb_vec_absforce.x, vector(0,0,0));
    }

    vec_accelerate(eb_vec_relSpeed.x, my._speed_x, vector(my._force_x * time_step, my._force_y * time_step, 0), my._friction);

    eb_vec_absSpeed.x = eb_vec_absforce.x * time_step;
    eb_vec_absSpeed.y = eb_vec_absforce.y * time_step;
    eb_vec_absSpeed.z = accelerate(my._speed_z, eb_vec_absforce.z * time_step, my._friction);

    if (my._height < 3) {eb_vec_absSpeed.z = -maxv(my._height-1, -10);}
    c_move(me, nullvector, eb_vec_absSpeed.x, IGNORE_PASSABLE | IGNORE_PUSH);
    c_move(me, eb_vec_relSpeed.x, nullvector, IGNORE_PASSABLE | IGNORE_PUSH | GLIDE);

    // Kamera bewegen...
    myCamera();
    wait(1);
  }
}


Ich habe die Movement Funktion aus mehreren Funktionen zusammen kopiert und hoffe nichts vergessen zu haben.
Wie gesagt denke ich nicht das es direkt an dieser Funktion liegen mag, da es mit anderen Funktionen auch ruckelt.
Die gleiche Funktion (nur mit älteren Befehlen) hatte in älteren 3DGS Versionen (AABB Kollision) noch einwandfrei funktioniert.

Zunächst würde mich mal interessieren ob nur ich das Problem habe oder es bei anderen auch auftaucht?

Da ich das Problem nun einige Zeit mit meinem Projekt rumschleppe und schon mir alles Erdenkliche ausprobiert habe, suche ich nun nach Rat in der Community.

Mein Player Modell ist übrigens im WED Editor 4 kleine Kästchen groß und auf 1.000 skaliert.
Bei Kollision mit Levelgeometrie kommt keine ruckelnde Bewegung des Players vor.
Das Level wurde aus einem FBX Model in WED importiert und mit "Build BSP MAP" und "Create Meshes" erstellt.

Last edited by HPW; 11/16/08 02:52.

Evil Blood (v. 0.52) RPG
Commport.de (Social Network Community)
Re: Ruckeln bei c_move und Kollision mit anderen Entities [Re: HPW] #236751
11/16/08 11:33
11/16/08 11:33
Joined: Jan 2002
Posts: 300
Usa
Rich Offline
Senior Member
Rich  Offline
Senior Member

Joined: Jan 2002
Posts: 300
Usa
Sorry to reply in English but I can not speak German (I translated the post with google).

I have had this problem too, and while it has gotten better in newer versions of the engine, it still happens. I find it has something to do with "GLIDE".


I have found two alternative solutions:

1) Don't use GLIDE with c_move (if you remove GLIDE the problem does not occur in my tests).

2) Use a Box model for your entity (that is the same height and width of your entity) and set POLYGON. Make the Box Entity invisible and attach a passable "dummy" object to it (your original model) that displays the animation. You will have two entities then, one for collision and one as an "avatar".

One other idea that I haven't tried is to slow down the entity on impact or when it is within a certain range (or disable glide within a certain range).

Good luck.

Last edited by Rich; 11/16/08 11:34.

A8 com / A7 free
Re: Ruckeln bei c_move und Kollision mit anderen Entities [Re: Rich] #236758
11/16/08 12:43
11/16/08 12:43
Joined: Aug 2005
Posts: 343
Germany
HPW Offline OP
Senior Member
HPW  Offline OP
Senior Member

Joined: Aug 2005
Posts: 343
Germany
You are right. Without GLIDE it does not happen. But I really need GLIDE to avoid stucking while move in direction of a wall or an entity and let the player jump.

Your second solution was also one of my ideas to avoid this. But never tried it and hoped to get a solution without to use more entities. But I'm glad to hear this works. I can do it in this way while the problem still exists in A7.

Thanks for the answer.


Evil Blood (v. 0.52) RPG
Commport.de (Social Network Community)
Re: Ruckeln bei c_move und Kollision mit anderen Entities [Re: HPW] #236765
11/16/08 13:33
11/16/08 13:33
Joined: Aug 2005
Posts: 343
Germany
HPW Offline OP
Senior Member
HPW  Offline OP
Senior Member

Joined: Aug 2005
Posts: 343
Germany
Hmmm, the movement is also jerky with use of a bounding box model (cube) and set his POLYGON flag.

Have you tried it with success before?
I used only for my player model a bounding box model and polygonal collision. Should I use this for any entity (also for the fixed objects like a table or a chair)?


Evil Blood (v. 0.52) RPG
Commport.de (Social Network Community)
Re: Ruckeln bei c_move und Kollision mit anderen Entities [Re: HPW] #236774
11/16/08 14:50
11/16/08 14:50
Joined: Jan 2002
Posts: 300
Usa
Rich Offline
Senior Member
Rich  Offline
Senior Member

Joined: Jan 2002
Posts: 300
Usa
I have done this before with success using the box on both entities, both having their Polygon flag set. I believe the c_move function also needs "USE_POLYGON" flag if you haven't set it already. It seems to function Ok performance wise, being that the object is just a cube and not a complex shape.

So any entity would use its actual polygon shape or need to have collisions handled with the box model (polygon vs polygon collision, always).

I've been looking into other solutions so I wouldn't have to pass so much information from one object to the next (saving more memory as well), but the collision box model did work well for me.

Hope that works for you, good luck.

Last edited by Rich; 11/16/08 14:56.

A8 com / A7 free
Re: Ruckeln bei c_move und Kollision mit anderen Entities [Re: Rich] #236776
11/16/08 15:03
11/16/08 15:03
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
how many entwtiws are in your lvl in total because the camera begins to jek if there are to many entities if moving


"empty"
Re: Ruckeln bei c_move und Kollision mit anderen Entities [Re: flits] #236964
11/17/08 11:56
11/17/08 11:56
Joined: Aug 2005
Posts: 343
Germany
HPW Offline OP
Senior Member
HPW  Offline OP
Senior Member

Joined: Aug 2005
Posts: 343
Germany
Ok, I test it with USE_POLYGON flag for the c_move but I hope not all entities need polygonal collision. I hope it's enough to set polygonal kollison for moving entities only.

Originally Posted By: flits
how many entwtiws are in your lvl in total because the camera begins to jek if there are to many entities if moving


This is why I don't want to many entities. I have tested with diffrent numbers of entities are visible and invisible. But the results are very bad with invisible, too.
Now I must show how much slower it is with polygonal kollision and double entitie count.
I'm thinking about an array list system to hide entities to far away and let them only display if the camera is in the near. But the really problem is the count of entities on screen.


Evil Blood (v. 0.52) RPG
Commport.de (Social Network Community)
Re: Ruckeln bei c_move und Kollision mit anderen Entities [Re: HPW] #236982
11/17/08 14:31
11/17/08 14:31
Joined: Jan 2002
Posts: 300
Usa
Rich Offline
Senior Member
Rich  Offline
Senior Member

Joined: Jan 2002
Posts: 300
Usa
You might need to play with it a bit, testing different flags. Maybe not using POLYGON with c_move, but setting all of the moving entities with a collision box to POLYGON, and using OBB for the rest.

I hope you find a way to achieve what you are trying to do, and hopefully things will change in the future to where we won't need to use this work-around. I remember you posting something in the bug hunt forum about this issue last October HPW, I didn't realize it was you until I checked my old messages.

Well, keep testing and good luck.


A8 com / A7 free
Re: Ruckeln bei c_move und Kollision mit anderen Entities [Re: Rich] #237212
11/18/08 23:20
11/18/08 23:20
Joined: Aug 2005
Posts: 343
Germany
HPW Offline OP
Senior Member
HPW  Offline OP
Senior Member

Joined: Aug 2005
Posts: 343
Germany
I have tested it now and it's only possible if all entities have a model bounding box.
Now I write me a function to do it automatically with all entities with a action attached and for fixed entities (objects) I think I could use a invisible second model for collision of buildings with the fixed objects.

Much more work but it's better than nothing to do. wink

Last edited by HPW; 11/18/08 23:23.

Evil Blood (v. 0.52) RPG
Commport.de (Social Network Community)
Re: Ruckeln bei c_move und Kollision mit anderen Entities [Re: HPW] #237581
11/20/08 19:46
11/20/08 19:46
Joined: Aug 2005
Posts: 343
Germany
HPW Offline OP
Senior Member
HPW  Offline OP
Senior Member

Joined: Aug 2005
Posts: 343
Germany
Hmmm, I found this remark for the POLYGON Flag in the Manual: "Only one of the objects involved in a collision should have a polygonal hull. Do not set this flag for moving objects or for animated models."

http://www.conitec.net/beta/aentity_polygon.htm

Why shouldn't we use more than one POLYGON Flag? And why not for moving objects?


Evil Blood (v. 0.52) RPG
Commport.de (Social Network Community)
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