Inside3D!
     

2 Fishies-related questions

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
CocoT



Joined: 14 Dec 2004
Posts: 599
Location: Belly-Gum

PostPosted: Sat Mar 22, 2008 2:51 pm    Post subject: 2 Fishies-related questions Reply with quote

1) I've noticed that, when in water, fish will only follow you when you are totally immersed in it. They will stop and only start chasing again once the player's head is under water level, which, well, doesn't seem to make sense since his legs are still there. Has there been any fix for that anywhere? Or would you know of any quick way to solve this? (the reason I'm asking is because I really suck when it comes to tracelines, monster vision and the likes... Razz)

1) Not code-related, but fishie-related, so... Do you guys know of any good new water monsters for Quake1? Or maybe just new models for the existing fish? The shark model of Frik's Jaws is one monster came to my mind, I was wondering if there might have been others...

Thanks in advance!
_________________
http://www.planetcocot.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dr. Shadowborg
Inside3D Staff


Joined: 16 Oct 2004
Posts: 726

PostPosted: Sat Mar 22, 2008 4:35 pm    Post subject: Re: 2 Fishies-related questions Reply with quote

CocoT wrote:
1) I've noticed that, when in water, fish will only follow you when you are totally immersed in it. They will stop and only start chasing again once the player's head is under water level, which, well, doesn't seem to make sense since his legs are still there. Has there been any fix for that anywhere? Or would you know of any quick way to solve this? (the reason I'm asking is because I really suck when it comes to tracelines, monster vision and the likes... Razz)

1) Not code-related, but fishie-related, so... Do you guys know of any good new water monsters for Quake1? Or maybe just new models for the existing fish? The shark model of Frik's Jaws is one monster came to my mind, I was wondering if there might have been others...

Thanks in advance!


I'm not really sure about #1, but maybe it has something to do with the fact that it's a swimmonster and therefore not allowed to leave the water, coupled with it maybe going after your self.origin directly, and not actually able to reach it or something.

As for #2, there's the Electric Eel from Dissolution of Eternity. I can't particularly think of any others at the moment.
_________________
"Roboto suggests Plasma Bazooka."
Back to top
View user's profile Send private message
Canadian*Sniper



Joined: 03 Mar 2008
Posts: 25
Location: Canada

PostPosted: Sat Mar 22, 2008 11:39 pm    Post subject: Reply with quote

make the fish move like the scrag and if the fish mdl is out of the water, make it jump up a bit Razz Hell make it jump out of the water and start flopping on the ground :]

So ya perhaps the best fix is to just make the fish chase it's target until it finds a new target.
_________________
SmashQuake at whitehot.quakeone.com
NewDM at flanders.servegame.org:26003
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
CocoT



Joined: 14 Dec 2004
Posts: 599
Location: Belly-Gum

PostPosted: Sun Mar 23, 2008 12:50 am    Post subject: Reply with quote

Thanks, guys! I'll look into that tonight Smile
And, yeah, maybe I can try to put my poor coding skills to the task of having them jump out of the water... that'd be pretty fun Very Happy
_________________
http://www.planetcocot.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mh



Joined: 12 Jan 2008
Posts: 910

PostPosted: Sun Mar 23, 2008 2:14 pm    Post subject: Reply with quote

If memory serves, there's code in the engine (one of the sv_ files) that determines if the player is underwater, which QC then uses to react accordingly. It would probably require an engine modification to "fix" this properly, but then you risk changing gameplay and/or breaking compatibility with other mods (not to mention potentially drowning in shallow pools).
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
CocoT



Joined: 14 Dec 2004
Posts: 599
Location: Belly-Gum

PostPosted: Mon Mar 24, 2008 12:19 am    Post subject: Reply with quote

Thanks for the pointer, mh! you totally confirm my suspicions Sad
I tried to play around with it yesterday and could not find an easy solution. At this point, what I've done is make, as Canadian Sniper suggested, fish fly instead of swim, then edit the models so that they appear lower than they are (otherwise they'd kind of hoover above water level, which was weird). It works fine, except of course that the player cannot leave the water, otherwise, the fish would just follow him Razz
_________________
http://www.planetcocot.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Gilgamesh



Joined: 26 Oct 2004
Posts: 67
Location: Brazil

PostPosted: Tue Mar 25, 2008 11:02 pm    Post subject: Reply with quote

... like Piranha II: The Spawning (1981) Laughing Laughing Laughing Laughing
_________________
#EOP
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
CocoT



Joined: 14 Dec 2004
Posts: 599
Location: Belly-Gum

PostPosted: Thu Mar 27, 2008 10:46 pm    Post subject: Reply with quote

Hehehe... that's pretty close to what I'm playing with Wink
_________________
http://www.planetcocot.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
venomus



Joined: 24 May 2005
Posts: 44

PostPosted: Tue Apr 01, 2008 10:42 am    Post subject: Reply with quote

Someone needs to do a Quake fishing sim Rolling Eyes
Back to top
View user's profile Send private message
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Tue Apr 01, 2008 1:39 pm    Post subject: Reply with quote

CocoT: actually, I think you should rather make them walk. That'd ensure that they can't exit the water, as long as there are no stairs and slopes they can use. Make it a pool you have to jump out of, and it'd be fine. Assuming ofcourse the water is shallow in all spots, or the fishy would "drop" to the bottom of the lake Razz

It obviously is possible to switch between different modes, but that requires experimentation and whatnot. Best I can think of is do an onground check, if true, walk, otherwise swim. Also, if players origin is above self origin, and player is in water, then swim (to ensure they don't walk around the bottom of some lake). This should basicly do it, it'd allow fishy to enter walk mode when a slope makes the water shallower, as they'd detect floor when they get close to the edge of the water, and start walking. If the player then goes back into the water, the fishy will walk after him, until the player is at all above the fishy, and thus start swimming again.
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
venomus



Joined: 24 May 2005
Posts: 44

PostPosted: Tue Apr 01, 2008 3:28 pm    Post subject: Reply with quote

Just make the fish chase after a helper entity placed underneath the player when they are on the surface (using a waterlevel check). Provided the entity is still inside the players bounding box the player should take damage when the fish try to nibble it.

Also I should mention that Quoth apparently fixed a number of bugs with monster_fish including not swimming towards a player on the surface, but those people havn't released the source code yet.

http://kell.quaddicted.com/quoth/quoth_tutorial.html#fish
Back to top
View user's profile Send private message
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Tue Apr 01, 2008 3:49 pm    Post subject: Reply with quote

venomus wrote:
but those people havn't released the source code yet.

yeah i mean just think of the evil things that will happen if they release the source i mean goddamn
_________________
Back to top
View user's profile Send private message
Dr. Shadowborg
Inside3D Staff


Joined: 16 Oct 2004
Posts: 726

PostPosted: Tue Apr 01, 2008 6:18 pm    Post subject: Reply with quote

Here's an idea:

1. When the player is not in the water, make the fish find out the direction to it's enemy, but remove the height related part. (i.e. treat it just like if the player were on the same height as the fish)

2. Make the fish try to walkmove in that direction.
_________________
"Roboto suggests Plasma Bazooka."
Back to top
View user's profile Send private message
venomus



Joined: 24 May 2005
Posts: 44

PostPosted: Tue Apr 01, 2008 10:24 pm    Post subject: Reply with quote

Ah screw it, this I think will solve your problems:

Code:

void (float dist) ai_swim =
{
   local vector mtemp;
   local vector org;
   local vector org_flat;
   local vector oldorg_flat;
   local vector oldorg;
   local vector reqvel;
   local float d;

   oldorg = self.origin;
   self.movetype = MOVETYPE_STEP;
   ai_run (dist);
   d = vlen ((self.origin - oldorg));
   self.velocity = '0 0 0';
   if ((d <= (dist + 5)))
   {
      if ((pointcontents ((self.origin + '0 0 16')) == CONTENT_EMPTY))
      {
         self.origin_z = oldorg_z;
      }
      self.movetype = MOVETYPE_FLY;
      reqvel = ((normalize ((self.origin - oldorg)) * dist) * TE_WIZSPIKE);
      setorigin (self, oldorg);
      self.velocity = reqvel;
   }
   if ((pointcontents ((self.origin)) == CONTENT_EMPTY))
   {
      self.velocity_z = -8;
   }
};


(in case you missed the hidden clue, this isn't my code)

EDIT: having actually tried it, this only fixes the bug when the fish get stuck near the water surface. They still won't swim toward you when you have your head above the water. Hmm..
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
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