|
2 registered members (TipmyPip, izorro),
556
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: collision problem after 6.40.5 update
[Re: demiGod]
#80701
07/17/06 21:30
07/17/06 21:30
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
Senior Expert
|
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
The issue involves fps_max in windowed mode. The jerkiness increases in fullscreen mode. I haven't done anything with collision at all yet, however. For 32 fps, SRV is 31.3 ms at most (assuming the others are at zeros). With entities, blocks, and other objects being rendered, SRV will go down while the others go up still keeping the 32 fps. As to using gravity higher than the -421, use your own gravity code instead.
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
Re: collision problem after 6.40.5 update
[Re: ulillillia]
#80702
07/17/06 22:47
07/17/06 22:47
|
Joined: Sep 2002
Posts: 8,177 Netherlands
PHeMoX
Senior Expert
|
Senior Expert
Joined: Sep 2002
Posts: 8,177
Netherlands
|
A LOT depends on the size of your model too, your ball is too small to act properly at high speeds. That's why it a. doesn't bounce (the bigger ball does, I've tested it) and b. it's getting stuck in the wall. Try to scale it like at least 3 times as big. Even better results with high speeds when the model is 6 times as large as yours. I've also changed some values in your code, not so sure though if any of that has fixed it. I've only scaled up your model at the very end of trying a few things out.  Not that it matters, but I would say set the gravity in the main function. Code:
//////////////////////////////////////////////////////////////////////// // A6 main wdl: // Created by WED. ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////// // The PATH keyword gives directories where template files can be found. //path "C:\\Programas\\GStudio6\\template_6"; // Path to A6 templates directory //path "C:\\Programas\\GStudio6\\template_6\\code"; // Path to A6 template code subdirectory //path "C:\\Programas\\GStudio6\\template_6\\images"; // Path to A6 template image subdirectory //path "C:\\Programas\\GStudio6\\template_6\\sounds"; // Path to A6 template sound subdirectory //path "C:\\Programas\\GStudio6\\template_6\\models"; // Path to A6 template model subdirectory
///////////////////////////////////////////////////////////////// // Filename of the starting level. string level_str = <testBallPhysics.WMB>; // give file names in angular brackets
//////////////////////////////////////////////////////////////////////////// // Included files //include <gid01.wdl>; // global ids //include <display00.wdl>; // basic display settings
var d3d_triplebuffer = 0; var video_mode = 9; // screen size 640x480 var video_depth = 32; // 16 bit colour D3D mode var video_screen = 1;
///////////////////////////////////////////////////////////////// // Desc: The main() function is started at game start function main() { time_smooth = 0; fps_max=60; fps_min=20; fps_lock = on; ph_fps_max_lock = fps_max; // set some common flags and variables // freeze all entity functions freeze_mode = 1; // no level has been loaded yet... //gid01_level_state = gid01_level_not_loaded;
// entry: Warning Level (0,1, or 2) // entry_help: Sets sensitivity to warnings (0 = none, 1 = some, 2 = all). warn_level = 2; // announce bad texture sizes and bad wdl code
// entry: Starting Mouse Mode (0, 1, or 2) mouse_mode = 0;
// wait 3 frames (for triple buffering) until it is flipped to the foreground wait(3);
// now load the level level_load(level_str);
wait(2); // let level load // level should be loaded at this point... //gid01_level_state = gid01_level_loaded;
//+++ load starting values
// un-freeze the game freeze_mode = 0;
// save start of game here wait(6); // allow time for functions that wait for "gid01_level_loaded" to load file_delete("start0.SAV"); // remove any old savefile wait(1); if( game_save("start",0,SV_ALL) <= 0) { diag("\nWARNING! main - Cannot save 'start' of level (ignore on restarts)."); } else { diag("\nWDL: main - Game 'start' saved."); }
// main game loop /*while(1) { if(gid01_level_state != gid01_level_loaded) { freeze_mode = 1; // pause the game while(gid01_level_state != gid01_level_loaded) { wait(1); } freeze_mode = 0; // resume the game } wait(1); }*/ ph_setgravity(vector(0,0,-422)); }
// Desc: this is the function used to restart the game. function main_restart_game() { // wait 3 frames (for triple buffering) until it is flipped to the foreground wait(3);
// freeze the game freeze_mode = 1;
if( game_load("start",0) <= 0) { diag("\nWARNING! main_restart_game - Cannot load 'start' of level."); } else { diag("\nWDL: main_restart_game - Game 'start' loaded"); }
// un-freeze the game freeze_mode = 0; }
// Desc: this is the function used to quit the game. function main_quit() { //+++ // save global skills & strings exit; }
///////////////////////////////////////////////////////////////// // The following definitions are for the pro edition window composer // to define the start and exit window of the application. WINDOW WINSTART { TITLE "3D GameStudio"; SIZE 480,320; MODE IMAGE; //STANDARD; BG_COLOR RGB(240,240,240); FRAME FTYP1,0,0,480,320; // BUTTON BUTTON_START,SYS_DEFAULT,"Start",400,288,72,24; BUTTON BUTTON_QUIT,SYS_DEFAULT,"Abort",400,288,72,24; TEXT_STDOUT "Arial",RGB(0,0,0),10,10,460,280; }
/* no exit window at all.. WINDOW WINEND { TITLE "Finished"; SIZE 540,320; MODE STANDARD; BG_COLOR RGB(0,0,0); TEXT_STDOUT "",RGB(255,40,40),10,20,520,270;
SET FONT "",RGB(0,255,255); TEXT "Any key to exit",10,270; }*/
///////////////////////////////////////////////////////////////// //INCLUDE <debug.wdl>;
/////////////////////////////////////////////////////////////////
//***
entity* ball;
//pretend to be a soccer ball physics... action fisicaBola { wait(1); ball = my; my.bright = on; my.ambient = -50; my.albedo = -50; my.shadow=on; phent_settype(Ball,PH_RIGID,PH_SPHERE); phent_setmass(Ball,1.0,PH_SPHERE); phent_setfriction(Ball,30.0); phent_setelasticity(Ball,75.0,100.0); ph_setcontacts(vector(100000, 0,0), 0,0,0); phent_setdamping(Ball,30.0,5.0); phent_addvelcentral(Ball,vector(2,2,0)); //*** doesn´t bounce
while(1) { camera.x = my.x - 1500; camera.y = my.y; camera.tilt = -35; camera.z = 1000; camera.arc = 20; wait(1); } }
function applyBallSpeed() { phent_addvelcentral(Ball,vector(500,0,150)); }
on_f=applyBallSpeed;
Like highlighted in red, you didn't use marco's advice in the code. Cheers
|
|
|
Re: collision problem after 6.40.5 update
[Re: PHeMoX]
#80703
07/17/06 23:33
07/17/06 23:33
|
Joined: Mar 2006
Posts: 752 Portugal
demiGod
OP
User
|
OP
User
Joined: Mar 2006
Posts: 752
Portugal
|
Hi Phemox, thank you very much for your reply. Well, i think i must agree with you. I already had tried with a scaled up ball model and the result was much better, however, i never tought i needed scale up all my level where i´m working on (such a hard work!), because this problem didn´t existed in 6.31.4 version with a ball model at exact same scale and at high speeds. And btw, i´ve tried ph_setcontacts and the problem is the same, but like jcl said now i´m not using it. See please http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/670300/an/0/page/0#Post670300 If this is the answer for the problem, i have a hard update to do, if i want to use version 6.40.5 now...
|
|
|
Re: collision problem after 6.40.5 update
[Re: demiGod]
#80704
07/17/06 23:54
07/17/06 23:54
|
Joined: Sep 2002
Posts: 8,177 Netherlands
PHeMoX
Senior Expert
|
Senior Expert
Joined: Sep 2002
Posts: 8,177
Netherlands
|
No problem at all. I think I've read somewhere that the forces and it's corresponding collision might have different effects in A6.40.x. Did you notice an increase of overall speed of the ball in your game in progress? Normally only very high speeds will get you into trouble. Maybe also try lowering your small ball model's z height and lower the gravity force (not 0,0,-400 or something, but 0,0,-280 or something), I haven't tested this, but normally this would mean a less fast falling down from the little ball I think. Anyways, for more reliable results though, it's probably best to increase the overall size of your level.  Cheers
|
|
|
|