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
3 registered members (ozgur, TipmyPip, AndrewAMD), 1,209 guests, and 5 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
Bounding Boxes, Collisions, and Sinking #31607
08/03/04 05:19
08/03/04 05:19
Joined: Jan 2002
Posts: 644
USA
tesanders Offline OP
Developer
tesanders  Offline OP
Developer

Joined: Jan 2002
Posts: 644
USA


My models seem to keep sinking into the floor and walls, despite my having tried the following:
  • Manually setting min_x, max_x, etc. to large values (~256).
  • Compiling a level with large -narrow and -fat flags (~256,256,256).
  • Manually setting the entity to .fat=1 and .narrow=0.
I'm using ent_move(), and at the moment, can't switch over to c_move(). Can anyone offer any pointers?

Thanks,
tesanders

Re: Bounding Boxes, Collisions, and Sinking [Re: tesanders] #31608
08/04/04 09:08
08/04/04 09:08
Joined: Aug 2003
Posts: 275
Germany
kopitzki Offline
Member
kopitzki  Offline
Member

Joined: Aug 2003
Posts: 275
Germany
If you set -fat or -narrow values to "256,256,256", there will be huge collision boxes. So, if you set ".fat/narrow=on;", you'll need huge rooms to move in.
Look at your model's first frame in MED. Where is the centre?
Look at your model in WED, it's properties, its bounding box.
Look at your model in WED, zoom it in, move your mouse vertically/horizontally from edge to edge. What's the mathematical difference shown in the menu bar? That's the size you should base on with hull (level-building) or min/max (scripting) values.
Not sure if that helps.

Re: Bounding Boxes, Collisions, and Sinking [Re: kopitzki] #31609
08/04/04 15:43
08/04/04 15:43
Joined: Jan 2002
Posts: 644
USA
tesanders Offline OP
Developer
tesanders  Offline OP
Developer

Joined: Jan 2002
Posts: 644
USA
Thanks for the info. The models in question are (I believe) 64x64x64, and have only one frame. I figured 256-cubed would be a good test to see if I could make absolutely sure that it never clipped into the walls, but it still seems to clip as though I'm using the default settings.

Am I missing something?

Thanks,
tesanders

Re: Bounding Boxes, Collisions, and Sinking [Re: tesanders] #31610
03/27/05 10:59
03/27/05 10:59
Joined: Sep 2003
Posts: 281
Arkansas\USA
raiden Offline
Member
raiden  Offline
Member

Joined: Sep 2003
Posts: 281
Arkansas\USA
It would be really cool if someone could give a step by step process to setting hull sizes in the build options and in script, and explain what they will do for collision in wed. Some pictures to go along with it would be awesome. I seem to be struggling with this myself.

Thanks

-raiden


"It doesn't matter if we win or lose, it's how we make the game."
--------------------
Links: 3DGS for Dummies
Re: Bounding Boxes, Collisions, and Sinking [Re: tesanders] #31611
03/28/05 11:34
03/28/05 11:34
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
I'd realy like to see how you both have your model set up in MED and the script your using to move your entity. I honestly have never realy needed to mess with an entities min_ max_ values

most the time that Ive had problems with an entity falling though the floor was because of 3 reasons

1 on terrains where the poly faces were realy too big to handle collision detection

2 when calculating hight from the floor (trace) don't compinsate for where the models orgin is... normaly this results becuse forgot UDE_BOX in the trace

3. my model is messed up in MED in respect to the origin. example I had similar problems with my cbabe model lately where she was half ways into the floor. what the problem was the FIRST frame was orintated correctly to the origin, but all the animation frames cbae was far below the origin. after realigning all my frames to the origin corectly the model works fine (selected frame 1 of the animation set frame range from frame 1 to last frame then moved the entity to correct location fixed all frames).

EDITED:

here is a simple pic how you should orintate your model to the origin in MED for ALL frames. You can rarely go wrong with the model if you keep it as centered on all 3 axis as possible



here is a simple move script I use for test levels for moving entities ( not including camera script) that works every time. if it doesn't work first thing to check is your entity.

Code:
 

var video_mode = 7;
var video_depth = 16;
var video_screen = 1;
var d3d_anisotropy = 2;
var mip_shaded = 10;
var shadow_stencil = on;

var move_vec[3] = 0,0,0;
var idle_percent = 0;
var walk_percent = 0;
var run_percent = 0;
var temptilt = 0;


action player_move
{
my.trigger_range = 20;
player = me;

wait(1);
camera.genius = player;
shift_sense = 2;
my.shadow = on;
my.albedo = 50;
my.ambient = -20;

while (me != NULL)
{

move_vec[0] = (key_force.y)*4 *time;

vec_set(temp.x,my.x);
temp.z -= 4000;
trace_mode = ignore_me + ignore_passable+USE_BOX;
player.z -= trace(player.x,temp.x);
player.pan -=key_force.x*3*time;

move_mode = IGNORE_YOU + IGNORE_PASSABLE + IGNORE_PUSH + ACTIVATE_TRIGGER + GLIDE;
ent_move(move_vec,NULLVECTOR);

If (move_vec[0] == 0 && move_vec[1] == 0)
{
idle_percent = (idle_percent +5*time)%100;
ent_animate(me,"idle",idle_percent,ANM_CYCLE);
}
else // our movement animations will go here
{
if (key_shift) // either shift key is being pressed
{
run_percent = (run_percent + sign(move_vec[0])*5*time)%100;
ent_animate(player,"run",run_percent,ANM_CYCLE);
}
else // shift key is NOT being pressed so we are walking
{
walk_percent = (walk_percent + sign(move_vec[0])*5*time)%100;
ent_animate(player,"walk",walk_percent,ANM_CYCLE);
}
}


// camera updates
//1st_3rdcameras (); // insert your own camera code here instead

wait(1);
}
}


//////////////////////////////////////////////////////////////////////////////////////////////////
// mouse.wdl mouse control
//////////////////////////////////////////////////////////////////////////////////////////////////
BMAP arrow = <arrow.pcx>; // image of mouse pointer this image is in templates folder
//BMAP d_font = <digifont.bmp>; // same in template folder
font d_font = <digifont.bmp>,0,14;

///////////////////////////////////////
function mouse_on() // turn mouse on
{
mouse_range = 10000;
MOUSE_MAP = arrow;
MOUSE_MODE = 2;
while (MOUSE_MODE == 2)
{
MOUSE_POS.X = POINTER.X;
MOUSE_POS.Y = POINTER.Y;
wait(1);
}
}
///////////////////////////////////////
function mouse_off() // turn mouse off
{
MOUSE_MODE = 0;
}
//////////////////////////////////////////////////////////////////////////////////////////////////


function main()
{
max_entities = 5000;
freeze_mode = 1;
level_load ("temp7.wmb"); // edit to your level name here
wait(2);
mouse_on(); // turns mouse on
freeze_mode = 0;
bg_color.red = 12;
bg_color.green = 12;
bg_color.blue = 12;
detail_size = 8;
//init_cameras(); // remove this line as it's part of my camera script

}



Last edited by Grimber; 03/28/05 11:41.

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