Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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 (AndrewAMD), 1,534 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Sticking, c_move(), ellipsoids, and my.poly. #129354
05/11/07 02:45
05/11/07 02:45
Joined: Aug 2002
Posts: 681
Massachusetts, USA
Ichiro Offline OP
User
Ichiro  Offline OP
User

Joined: Aug 2002
Posts: 681
Massachusetts, USA


Howdy. I am having sticking issues with c_move, and can't seem to figure it out. My player entity (using OBB; .poly=0) is moving around stationary models (.poly=1), and can easily get stuck within them (video -- WMB, 3MB). I have enable_polycollision=2. Any thoughts?

Thanks.


Dejobaan Games - Bringing you quality video games for over 75 years.
Re: Sticking, c_move(), ellipsoids, and my.poly. [Re: Ichiro] #129355
05/11/07 08:08
05/11/07 08:08
Joined: Jun 2005
Posts: 656
G
Grafton Offline
User
Grafton  Offline
User
G

Joined: Jun 2005
Posts: 656
You may be doing this already, but if there is any rotation of the player, you
must use c_rotate to do it. Even though you are using c_move to move in a
linear direction, if you use something like "my.pan" to rotate, sticking will
still occur.



Not two, not one.
Re: Sticking, c_move(), ellipsoids, and my.poly. [Re: Grafton] #129356
05/11/07 16:05
05/11/07 16:05
Joined: Aug 2002
Posts: 681
Massachusetts, USA
Ichiro Offline OP
User
Ichiro  Offline OP
User

Joined: Aug 2002
Posts: 681
Massachusetts, USA
I double-checked that on your suggestion, and I'm actually not rotating the player object at all. Nuts.


Dejobaan Games - Bringing you quality video games for over 75 years.
Re: Sticking, c_move(), ellipsoids, and my.poly. [Re: Ichiro] #129357
05/12/07 00:54
05/12/07 00:54
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline
Expert
A.Russell  Offline
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
Yes, it's a bug. One that has been in the collision system for a long time, and will probably not go away soon. I get the same thing.

A couple of solutions that I have seen posted are:

*Use a simple, invisible cube model for the collision model.

*Try to keep the moving entity at least three quants away from other geometry.

Re: Sticking, c_move(), ellipsoids, and my.poly. [Re: A.Russell] #129358
05/12/07 01:01
05/12/07 01:01
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Havn't resolved it myself yet, even using rotate rather than pan despite the collision system used. (Mind you, thats not saying much as my comprehension regarding scripting is rudumentary, even after 4 years!)
Very interested to find a solution with current version.

Re: Sticking, c_move(), ellipsoids, and my.poly. [Re: Nems] #129359
05/12/07 01:34
05/12/07 01:34
Joined: Aug 2002
Posts: 681
Massachusetts, USA
Ichiro Offline OP
User
Ichiro  Offline OP
User

Joined: Aug 2002
Posts: 681
Massachusetts, USA
Bummer. Thanks for the suggestions.


Dejobaan Games - Bringing you quality video games for over 75 years.
Re: Sticking, c_move(), ellipsoids, and my.poly. [Re: Ichiro] #129360
05/12/07 08:11
05/12/07 08:11
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Here's a possible solution;

Create an entity, attach to object .x , set texture flag to 'none' to obtain an invisible collision bounding container.

I think this may work for you.

Woops and HAH! didnt read A.Russels post properly, he already says that.

Last edited by Nems; 05/12/07 08:28.
Re: Sticking, c_move(), ellipsoids, and my.poly. [Re: Ichiro] #129361
05/12/07 08:16
05/12/07 08:16
Joined: Aug 2001
Posts: 2,320
Alberta, Canada
William Offline
Expert
William  Offline
Expert

Joined: Aug 2001
Posts: 2,320
Alberta, Canada
For my movement I use a cube for collision, and then a passable model for the actual detail. This also allows my passable model to have independent rotation and the such. I keep the cube off the ground at all times using trace with the set_box flag. Some people believe it's best to let your entity drag along the ground, I haven't tried this so cannot comment. But I find that tracing downwards, and just changing your angle depending on ground normals work well. Also, have the movement friction set very low. It works quite well, and have not had any problems with the majority of static geometry.

- Be sure to use c_rotate() for any rotations.
- Be sure to use c_move() for any movement, that includes any z movement or changes in your z pos. I know when I had problems with the model catching, it often was from me moving, even subtly, the model without c_move().

Heres what I set in the begging of function for the collision cube:


//my.fat = on;
//my.narrow = on;
c_setminmax(my);
ph_setgravity(vector(0,0,-gravity));
my.polygon = off;
move_min_z = -1;
move_friction =0.25;
Disable_Z_Glide = 0;

Heres what I use for my static geometry:

wait(1);
my.fat = on;
my.narrow = on;
c_setminmax(me);
my.polygon = on;

wait(300);
my.dynamic = off;


And if you want your model to update it's collision realtime(only for per-poly models):

while(1)
{
c_updatehull(my, 1);
wait(1);
}

I basically have 1 c_rotate and 1 c_move() in my collision cubes function, all the different forces add up into the vector I use to move/rotate by, I also use movement in absolute coordinates:

move.tilt = ang(you.tilt - my.tilt);
move.roll = ang(you.rroll - my.roll);

you.kturn_speed = turn_direction * turn_gear * turn_sharp * skid_turn * air_turn; you.kturn_speed *= player_lock;
move.pan = turn_direction * turn_gear * turn_sharp * skid_turn * air_turn * you.ion_puller * time;

c_rotate(my,move.pan,ignore_passable + ignore_passents + glide);

move.x = run_speed * run_direction * air_speed * skid_forward * time;
move.y = skid_slide * time; you.kslide_speed = skid_slide;
vec_set(temp.x, nullvector); temp.pan = my.pan; temp.roll = you.rroll; temp.tilt = my.tilt;
vec_rotate(move.x, temp.pan);

move.z = z_movement;

c_move(my,nullvector,move.x,ignore_passable + ignore_passents + glide + ignore_content);

Hopefully this helps. The collision system works quite well, it just takes a while to get the code right. The physics engine though, well, I wouldn't recommend it for bigger projects, best to just use c_move().


Check out Silas. www.kartsilas.com

Hear my band Finding Fire - www.myspace.com/findingfire

Daily dev updates - http://kartsilas.blogspot.com/
Re: Sticking, c_move(), ellipsoids, and my.poly. [Re: William] #129362
05/12/07 10:00
05/12/07 10:00
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline
Expert
A.Russell  Offline
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
Quote:

The collision system works quite well




I'm not sure about the collision system, but c_move/ c_rotate certainly don't work well. If it worked correctly, it would never get stuck against static objects; regardless of the shape of the model.

Re: Sticking, c_move(), ellipsoids, and my.poly. [Re: A.Russell] #129363
05/13/07 06:28
05/13/07 06:28
Joined: Aug 2001
Posts: 2,320
Alberta, Canada
William Offline
Expert
William  Offline
Expert

Joined: Aug 2001
Posts: 2,320
Alberta, Canada
Yeah, I guess I can't assure that for every project, as there all different. It also took me quite a while to get it all working smoothly with mine...


Check out Silas. www.kartsilas.com

Hear my band Finding Fire - www.myspace.com/findingfire

Daily dev updates - http://kartsilas.blogspot.com/
Page 1 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