Forum

[SOLVED] FTEQW and ode - physics objects are slow

Discuss CSQC related programming.

Moderator: InsideQC Admins

[SOLVED] FTEQW and ode - physics objects are slow

Postby toneddu2000 » Mon Nov 17, 2014 3:44 pm

I encountered a very strange issue with ode physics in FTEQW engine.
1) I created a simple 256x256x4096 (widthxdepthxheight) map and I added at the very top a physics_ball entity in radiant
2) In ssqc I add this:
Code: Select all
void physics_ball()
{
   self.classname = "ball";
   self.movetype = MOVETYPE_PHYSICS;
   self.solid = SOLID_PHYSICS_SPHERE;
   physics_enable(self,TRUE);
   self.mass = 15.4;
   self.friction = 0.4;
   self.bouncefactor = 0.1;
   precache_model("models/ball.iqm");
   setmodel(self, "models/ball.iqm");
   setorigin (self, self.origin);
}

3) Run and... object falls slow, like a feather!


With Darkplaces engine (same map, same code) physics entity falls normal, like a normal physics object. If I query fte with physcs_ode_enable, console says 1, so physics is enabled. I tried every dll possible, but for win32 fte wants ode_double.dll, libstdc++-6.dll and libgcc_s_sjlj-1.dll. With DP I had to rename libode-3.dll(that comes with the darkplaces autobuild package) to libode1.dll to make it work. With dp no other libs was needed for physics.

I also tried to toggle mass, friction and bouncefactor on|off but nothing changed.
Thanks guys
Last edited by toneddu2000 on Wed Nov 19, 2014 4:03 pm, edited 1 time in total.
toneddu2000
 
Posts: 1318
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: FTEQW and ode - physics objects are slow

Postby toneddu2000 » Mon Nov 17, 2014 5:41 pm

Sorry guys, I just now discovered I put this thread in the wrong section. I'm so obsessed with CSQC that I can't think of anything else! :lol:
Could please an administrator relocate it in the Engine section?
Thanks and sorry again
toneddu2000
 
Posts: 1318
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: FTEQW and ode - physics objects are slow

Postby Max_Salivan » Mon Nov 17, 2014 11:21 pm

Maybe problem in mintic and maxtic?
Sorry for my english :)
Max_Salivan
 
Posts: 93
Joined: Thu Dec 15, 2011 1:00 pm

Re: FTEQW and ode - physics objects are slow

Postby toneddu2000 » Mon Nov 17, 2014 11:26 pm

Hi Max_Salivan, I've already read you and Spike talking here about sv_mintic and sv_maxtic but I couldn't figure out if those are cvar or some qc vars to edit.
Could you please tell me more?
Thanks
toneddu2000
 
Posts: 1318
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: FTEQW and ode - physics objects are slow

Postby toneddu2000 » Wed Nov 19, 2014 11:46 am

ok this is a little wierd. I set via console
Code: Select all
sv_mintic 0.07
sv_maxtic 0.1

Don't ask me how I found out these values... I just set and tried... many times! :D
And ball now falls "ALMOST" good (not perfect as DP, however, still a little "cartoonish") but, if I add at the ball entity in quakec
Code: Select all
setsize(self,'-30 -30 30','30 30 30');

The ball doesn't show anymore or it goes through the floor! :shock:
If I comment setsize, compile qc and reload map, physics works again :shock: :shock:

Moreover, if I edit the setsize() function, fte.cfg reloads itself.
What's the purpose of fte.cfg? I mean, if I set on config.cfg or autoexec.cfg sv_mintic and sv_maxtic, engine ignores them.

I had to write them via console or (to make the change permanent) to set them in fte.cfg but this file, if .dat files changes, reloads itself! Where should I put those values? Should I hardcode them? Are those values set right for ode physics? What about sv_limittics?

Too many questions for today! If anyone has ever tried that please reply, thanks
toneddu2000
 
Posts: 1318
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: FTEQW and ode - physics objects are slow

Postby Spike » Wed Nov 19, 2014 1:51 pm

those two cvars MUST have exactly the same value if you are using ODE.
failure to do so can result in instability, like the ball suddenly flying off across the room. Additionally, use smaller values to help prevent stuff from passing through walls (10 fps is far too high, try values like 0.01).

configs are reloaded if the default.cfg appears to be installed in a different location. this is intended to prevent switching gamedirs between total-conversions from messing things up, or something. I'm not going to pretend to know what you're doing to trigger it. It has nothing to do with .dat files changing.
Spike
 
Posts: 2883
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: FTEQW and ode - physics objects are slow

Postby toneddu2000 » Wed Nov 19, 2014 4:03 pm

Thanks a lot Spike, that worked! :D

I set
Code: Select all
sv_maxtic "0.039"
sv_mintic "0.039"
on fte.cfg and it works fine.
If you want to place emphasis on physics object (for properies like .bouncefactor and .friction) I suggest to use something between 0.03 and 0.049. From 0.05 and above, objects seem don't care about physics properties too much (engine ignores pretty much every physics .field).

The problems appear when player press the ball against the wall: the ball reacts for a second to the push force and then disappears.
I think it's something that deals with dynamic collision at low level

I'm not going to pretend to know what you're doing to trigger it.
I'm not triggering anything, I was just trying to understand which cgf using! :D
fte, default, config or default? Woa that's A LOT of cfg! :D

Thanks again for your vital help as alway Spike and thanks to Max_Salivan for the input!
toneddu2000
 
Posts: 1318
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy


Return to CSQC Programming

Who is online

Users browsing this forum: No registered users and 1 guest