Inside3D!
     

Setsize Problems
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Tue Jun 15, 2010 10:02 pm    Post subject: Setsize Problems Reply with quote

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.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Tue Jun 15, 2010 10:51 pm    Post subject: Reply with quote

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.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Tue Jun 15, 2010 11:03 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Tue Jun 15, 2010 11:16 pm    Post subject: Reply with quote

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.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Tue Jun 15, 2010 11:24 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Tue Jun 15, 2010 11:38 pm    Post subject: Reply with quote

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:
      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.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Wed Jun 16, 2010 1:41 am    Post subject: Reply with quote

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:
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.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Wed Jun 16, 2010 10:48 am    Post subject: Reply with quote

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:
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.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
GiffE



Joined: 08 Oct 2006
Posts: 141
Location: USA, CT

PostPosted: Wed Jun 16, 2010 12:30 pm    Post subject: Reply with quote

Doesn't hlbsp format add a new HULL size? Like a crouching one?
_________________
http://www.giffe-bin.net/
Back to top
View user's profile Send private message Visit poster's website
frag.machine



Joined: 25 Nov 2006
Posts: 728

PostPosted: Wed Jun 16, 2010 1:41 pm    Post subject: Reply with quote

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


Yup, that's correct.
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/
Back to top
View user's profile Send private message Visit poster's website
ceriux



Joined: 06 Sep 2008
Posts: 968
Location: Florida, USA

PostPosted: Wed Jun 16, 2010 2:14 pm    Post subject: Reply with quote

doesnt the dog have its own hull size?
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Wed Jun 16, 2010 2:34 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Wed Jun 16, 2010 7:53 pm    Post subject: Reply with quote

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++?
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Wed Jun 16, 2010 8:22 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Wed Jun 16, 2010 9:43 pm    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group