Forum

Setsize Problems

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Setsize Problems

Postby Mexicouger » Tue Jun 15, 2010 10:02 pm

I want the player to Be about half his height. basically what it's for, Is for The player(Tetra) to Turn into a morphball (yes, off Metroid). But when you turn into it, your the size of the player still, So I gave it this Function:
setsize (self, '-4 -4 -24', '-2 -2 -12');

It's really the Only thing I got to work (well, make the player not so big).
And that code turns the player into basically '0 0 0'. Well, actually, your Still on the ground normal, But you can still go through walls and stuff. So is there A better fix than this? I want the morphball to be about half the players size or less. Or is there a function that Automatically determines the Models height width etc?
Thanks In advance.
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Postby Spike » Tue Jun 15, 2010 10:51 pm

hull sizes... gah.
Collisions with non-bsp entities are always fine.
Collisions with bsp entities (including world) are restricted to specific sizes defined by the q1/hl bsp format.
sizes are point, player, and shambler sizes.
Use any other size and it'll be buggy.

Q2 and Q3 don't have this limitation.

Sadly I'm not really sure what sort of effect it is that you're going for, but point is, you can't clip with the world with any granularity smaller than the player's normal size.

If you set the width to more than 4 (8 or so) then it'll switch to the player sized hull instead of the point sized hull.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Mexicouger » Tue Jun 15, 2010 11:03 pm

So I am assuming I would have to Take some source code from Quake or quake 3 and Apply it to Kurok...
Or I would just have to cut Out Morphball all-together. That really takes away the great feeling of Metroid. I guess a Solution will eventually come to me.
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Postby Spike » Tue Jun 15, 2010 11:16 pm

its a limitation of the bsp format, not just the engine.
As its so small, you may be able to get away with emulating it with tracelines. But that will make physics really hard - things can walk into you.

The near clip plane is generally 4 quake units away. So don't make a player smaller than 8*8*8 (+/- 4), or they'll be able to see through walls.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Mexicouger » Tue Jun 15, 2010 11:24 pm

Crap. I don't know much about tracelines either, except trace_ent.takedamage. That is it. I did pick up a bit on The flashlight code, But still, I got alot to learn about tracelines. It's funny, because qc is cut into sections. Well, In my eyes it is.

ex:
tracelines:
ai:
animations:

My point is that they all have their own things to be learned. Take them one by one. Sorry, that was a bit offtopic.

Anyway, If anyone comes up with a solution, Whether it be by qc or clientside, tell me.

is it possible to change the bsp format to q2 or q3 bsp? don't they all have like their own physics and stuff? Like they are better for vehicles and such?
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Postby Baker » Tue Jun 15, 2010 11:38 pm

MDave edited the player size in his engine AND the map compiler.

Modified compiler + source:

http://bladebattles.com/kurok/files/KurokTxqbsp.rar

Original compiler + source:

http://user.tninet.se/~xir870k/txqbspbjp.zip

Use WinMerge to compare and you can easily find the 3 numbers he changed. Then you change it in the engine. The map compiler can easily be compiled with http://www.microsoft.com/express/vc/

In GLQuake this in gl_model.c but in the PSP engine it is in video_hardware_model.cpp .... it looks like this

Code: Select all
      hull = &loadmodel->hulls[1];
      hull->clipnodes = out;
      hull->firstclipnode = 0;
      hull->lastclipnode = count-1;
      hull->planes = loadmodel->planes;
      hull->clip_mins[0] = -16;
      hull->clip_mins[1] = -16;
      hull->clip_mins[2] = -24;
      hull->clip_maxs[0] = 16;
      hull->clip_maxs[1] = 16;
      hull->clip_maxs[2] = 32;


Hull 1 is player and that is what he changed the sizes of in both the compiler and engine.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Mexicouger » Wed Jun 16, 2010 1:41 am

I don't want the regular player size to be changed. I just want the morphball(An extension) to be changed. Can I add on to those hull_min and hull_max? Like add another height>?

This is so helpful if I am able to edit the player size for the morphball.
A little more information on this would be nice. Here is my code for the morphball To see if I change the engine side, If I can change the qc side as well

Code: Select all
void () CCam;

  void () CCamChasePlayer =
  {
     makevectors (self.v_angle);
     traceline ((self.origin + self.view_ofs),((((self.origin + self.view_ofs)
       + (v_forward * self.camview_z)) + (v_up * self.camview_x)) + (v_right * self.camview_y)),FALSE,self);
     setorigin (self.trigger_field,trace_endpos);
     WriteByte (MSG_ONE,5);
     WriteEntity (MSG_ONE,self.trigger_field);
     self.weaponmodel = "";
  };

  void () CCam =
  {
     local entity camera;
     local entity spot;

     if (self.aflag == FALSE)
     {
        self.aflag = TRUE;
        camera = spawn ();
        spot = spawn ();
        self.trigger_field = camera;
        camera.classname = "camera";
        camera.movetype = MOVETYPE_FLY;
        camera.solid = SOLID_NOT;
        setmodel (camera,"progs/eyes.mdl");
        setsize (camera,'0 0 0','0 0 0');
        makevectors (self.v_angle);
        traceline ((self.origin + self.view_ofs),(((self.origin + self.view_ofs)
           + (v_forward * -64.000))),FALSE,self);
        self.camview = '0 0 -64'; // added
        setorigin (camera,trace_endpos);
        camera.angles = self.angles;
        self.weaponmodel = "";
        msg_entity = self;
        WriteByte (MSG_ONE,5);
        WriteEntity (MSG_ONE,camera);
        WriteByte (MSG_ONE,10.000);
        WriteAngle (MSG_ONE,camera.angles_x);
        WriteAngle (MSG_ONE,camera.angles_y);
        WriteAngle (MSG_ONE,camera.angles_z);
        sprint (self,"Chase Cam On\n");
      self.mballtoggle = self.mballtoggle = 1;
      self.view_ofs = '0 0 8';
        stuffcmd(self,"cl_forwardspeed 800 \n");
           stuffcmd(self,"cl_backspeed 800 \n");
           stuffcmd(self,"cl_sidespeed 800 \n");
      setsize (self, '-4 -4 -24', '-2 -2 -12');
      }
      else
      {
        self.aflag = FALSE;
        msg_entity = self;
        WriteByte (MSG_ONE,5);
        WriteEntity (MSG_ONE,self);
        WriteByte (MSG_ONE,10);
        WriteAngle (MSG_ONE,self.angles_x);
        WriteAngle (MSG_ONE,self.angles_y);
        WriteAngle (MSG_ONE,self.angles_z);
        remove (self.trigger_field);
        sprint (self,"Chase Cam Off\n");
        W_SetCurrentAmmo ();
      self.mballtoggle = self.mballtoggle = 0;
      self.view_ofs = '0 0 22';
      setsize (self, '-16 -16 -24', '16 16 32');
      W_SetCurrentAmmo ();
     }
  }



It works for the most part. Except the size. And there is a major glitch in ad-hoc, where if a player turns into a morphball, They like control the other player and see through their eyes sometimes. It gets very confusing because you Get mixed up in bodies.
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Postby Baker » Wed Jun 16, 2010 10:48 am

Mexicouger wrote:I don't want the regular player size to be changed. I just want the morphball(An extension) to be changed. Can I add on to those hull_min and hull_max? Like add another height>?

This is so helpful if I am able to edit the player size for the morphball.
A little more information on this would be nice. Here is my code for the morphball To see if I change the engine side, If I can change the qc side as well

Code: Select all
void () CCam;

  void () CCamChasePlayer =
  {
     makevectors (self.v_angle);
     traceline ((self.origin + self.view_ofs),((((self.origin + self.view_ofs)
       + (v_forward * self.camview_z)) + (v_up * self.camview_x)) + (v_right * self.camview_y)),FALSE,self);
     setorigin (self.trigger_field,trace_endpos);
     WriteByte (MSG_ONE,5);
     WriteEntity (MSG_ONE,self.trigger_field);
     self.weaponmodel = "";
  };

  void () CCam =
  {
     local entity camera;
     local entity spot;

     if (self.aflag == FALSE)
     {
        self.aflag = TRUE;
        camera = spawn ();
        spot = spawn ();
        self.trigger_field = camera;
        camera.classname = "camera";
        camera.movetype = MOVETYPE_FLY;
        camera.solid = SOLID_NOT;
        setmodel (camera,"progs/eyes.mdl");
        setsize (camera,'0 0 0','0 0 0');
        makevectors (self.v_angle);
        traceline ((self.origin + self.view_ofs),(((self.origin + self.view_ofs)
           + (v_forward * -64.000))),FALSE,self);
        self.camview = '0 0 -64'; // added
        setorigin (camera,trace_endpos);
        camera.angles = self.angles;
        self.weaponmodel = "";
        msg_entity = self;
        WriteByte (MSG_ONE,5);
        WriteEntity (MSG_ONE,camera);
        WriteByte (MSG_ONE,10.000);
        WriteAngle (MSG_ONE,camera.angles_x);
        WriteAngle (MSG_ONE,camera.angles_y);
        WriteAngle (MSG_ONE,camera.angles_z);
        sprint (self,"Chase Cam On\n");
      self.mballtoggle = self.mballtoggle = 1;
      self.view_ofs = '0 0 8';
        stuffcmd(self,"cl_forwardspeed 800 \n");
           stuffcmd(self,"cl_backspeed 800 \n");
           stuffcmd(self,"cl_sidespeed 800 \n");
      setsize (self, '-4 -4 -24', '-2 -2 -12');
      }
      else
      {
        self.aflag = FALSE;
        msg_entity = self;
        WriteByte (MSG_ONE,5);
        WriteEntity (MSG_ONE,self);
        WriteByte (MSG_ONE,10);
        WriteAngle (MSG_ONE,self.angles_x);
        WriteAngle (MSG_ONE,self.angles_y);
        WriteAngle (MSG_ONE,self.angles_z);
        remove (self.trigger_field);
        sprint (self,"Chase Cam Off\n");
        W_SetCurrentAmmo ();
      self.mballtoggle = self.mballtoggle = 0;
      self.view_ofs = '0 0 22';
      setsize (self, '-16 -16 -24', '16 16 32');
      W_SetCurrentAmmo ();
     }
  }



It works for the most part. Except the size. And there is a major glitch in ad-hoc, where if a player turns into a morphball, They like control the other player and see through their eyes sometimes. It gets very confusing because you Get mixed up in bodies.


If you want it work right, you'll have to change a hull. So do hull2 instead which is reserved for monsters -- it doesn't sound like you will be having monsters.

There might be some physics stuffs that need modified in the engine as well, but I'd have to refer you to Spike or one of the other more knowledgeable engine+QuakeC peoples because I don't know how you would specify an entity that isn't using whatever the monster movetype is to live in hull2.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby GiffE » Wed Jun 16, 2010 12:30 pm

Doesn't hlbsp format add a new HULL size? Like a crouching one?
GiffE
 
Posts: 170
Joined: Sun Oct 08, 2006 3:39 pm
Location: USA, CT

Postby frag.machine » Wed Jun 16, 2010 1:41 pm

GiffE wrote:Doesn't hlbsp format add a new HULL size? Like a crouching one?


Yup, that's correct.
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: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby ceriux » Wed Jun 16, 2010 2:14 pm

doesnt the dog have its own hull size?
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Sajt » Wed Jun 16, 2010 2:34 pm

The dog uses the shambler's hull size.

I'm pretty sure Q1BSP has a fourth unused hull slot which you could probably use. (It would be a relatively trivial modification to the map format, compiler and engine.)
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby Mexicouger » Wed Jun 16, 2010 7:53 pm

So when I found it, Would I add this code to The qc?

setsize (self, VEC_HULL_MINS3, VEC_HULL_MAX3);

Of course I would define it inn defs. Baker seemed to know alot about The Hulls. Which File should I look in to find THe HULLS in the compiler? And In the engine, Wouldn't I look in bspfile.h(or c, Can't remember off the top of my head)? Gah. Now I gotta go into 3 Different places just to change the size of something... Ridiculous... But rewarding once it's done.

And on another side note, Is the quake 1 engine coded in c or c++?
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Postby Sajt » Wed Jun 16, 2010 8:22 pm

Well, if you don't even know that, I wouldn't trust you to be able to implement a new hullsize! I managed to add new hullsizes to the map format a long time ago, but I don't remember anything about it. But after a superficial look at the (vanilla) sources, I would point you to the following places to start. From here you SHOULD be able to look around, see how it works, and make your move. (Note: you should also change the version number of the bsp format.)

Compiler: hull_size array (brush.c), CreateHulls() (qbsp.c)
Engine: Mod_LoadClipnodes (model.c/gl_model.c), SV_HullForEntity (world.c)
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby Mexicouger » Wed Jun 16, 2010 9:43 pm

So I edited The stuff, But When I goto Compile in cygwin, Why does it only add world.c that I edited? I edited model.c as well? I mean, wouldn't it include it or what?

ANd also, How Do I compile txqbsp? I went into it's directory and typed make. But nothing happened. How do I compile, ANd So far, this is working like a charm! This is a big part of the game, and Ater this, I will have to debug the crap outta this chasecam code...

But I still need to compile txqbsp...
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest