[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - .float scale

.float scale

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

.float scale

Postby Seven » Sun Mar 16, 2014 10:12 am

Hello Spike (or anybody who can help me),

I could not find documentation about how .scale is handled in FTE.
fteextensions has not much comments (which a beginner like me needs).

Does FTE also has .scale accuracy steps of 1/16th, like DP does ?
Or is FTE free to produce whatever .scale you want ?
That would effect fluent morphing quite much, which is a bit choppy in DP.


Do other engines also support .scale ?
Anybody knows of any ?

Thank you very much for your help.
Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: .float scale

Postby Spike » Sun Mar 16, 2014 10:45 am

aye, 1/16th precision. a byte that scales up to 15.9375 or so.
if you want more precision, use csqc. you should get full float precision then.

I think nehahra might also support scale. I don't know what it uses it for, but I'm sure the demo format has lots of nice large floats on every single entity that are never really used...

hexen2 support added a drawflags field:
self.drawflags = SCALE_ORIGIN_BOTTOM; //=32
this setting will keep the bottom of the entity at the bottom of the bbox, so it won't float around, etc.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: .float scale

Postby Seven » Mon Mar 17, 2014 6:35 pm

Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: .float scale

Postby Spike » Mon Mar 17, 2014 6:57 pm

.scale doesn't affect collisions. which is the problem. because it means that with a scale of 2 or so, the feet of the enemy are clearly inside the floor.

You can fix that with something like the following

self.scale = floor(self.scale*16)/16; //match the engine's scaling.
minz = self.mins_z * self.scale; //determine the new model mins
sizez = self.size_z * self.scale; //determine the new model size
self.origin_z += minz*(1-sizez); //move the monster around to keep its mins_z constant despite the resize
setsize(self, [self.mins_x,self.mins_y,minz], [self.maxs_x, self.maxs_x, sizez-minz]); //and resize it.

bsp/bbox collisions are aligned to the bbox mins value. this means that the mins_z needs to be correct for the new position, and the maxs_z can be almost whatever it wants (although if the scale is too high, you might notice the monster's head passing through walls - which you can generally get away with with good map design). but you can't get away with changing the x+y mins without offsetting that so noticably.

anyway, that's the idea.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: .float scale

Postby Seven » Mon Mar 17, 2014 8:21 pm

Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: .float scale

Postby frag.machine » Mon Mar 17, 2014 9:07 pm

Both solutions will work, but Spike's *theorically* avoid trial-and-error adjusts.
Is there any Quake engine that supports multiple/composite bound boxes ?
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2120
Joined: Sat Nov 25, 2006 1:49 pm

Re: .float scale

Postby Spike » Tue Mar 18, 2014 3:32 am

seven, your code potentially allows people to shoot through the monster's head.
note that your monster's bbox is already 8qu taller than the hull size.
hardcoding is fine if you want less code. its just that you need to hardcode every case and thus quite likely more code in the end.

frag.machine, while it would be possible to simulate larger hull sizes from smaller ones, doing so would require 8 times as much work, and would not aid with crouching. enabling such a feature would likely break a load of mods (like any monster that's defined to be 64qu high placed a qu or two above the ground in a small passageway, for instance).
q2+q3 use brush collisions and thus do not require descrete hull sizes. this is the preferable way to do it, especially as this also potentially allows support for capsules too. taniwha added some poly collision code to quakeforge a while ago which would have the same effect, while tonik has previously made a direct q1bsp->q2bsp converter. the problem with these automatic methods is that they ignore clip brushes, which means the player suddenly gets stuck on all sorts of sticky out bits of the map.
as bbox sizes increase, the axial nature of bboxes gets more and more goofy, so anything that allows ditching aabb collisions completely is a good thing.
I really do wonder what would happen if a qbsp were to generate capsule-shaped hulls instead of bbox ones. theoretically it would be possible to support any convex shape from the qbsp...
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest