Forum

Tutorial request: Guided Missiles (MGS style).

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Tutorial request: Guided Missiles (MGS style).

Postby MDave » Mon Jun 02, 2008 6:30 pm

I'm reaching the limits of my quake c abilities so I've decided to ask for help on how to make guided missiles like the ones seen in metal gear solid (the nikita missiles specifically).

Basically, a controllable first person view of a rocket that is constantly moving forwards, slows down to a crawl when turning and slowly speeds up again when not turning the view.

The code I have is a mess/hacky and dosn't work, so I'd rather start off on a good foot :)

I think it would be a pretty fun weapon :D

- Thanks for reading.
User avatar
MDave
 
Posts: 76
Joined: Mon Dec 17, 2007 7:08 pm

Postby Orion » Tue Jun 03, 2008 5:20 pm

[url]ftp.gamers.org/pub/idgames2/quakec/weapons/guidemis.zip[/url]

It's a mod from another guy, qc files are included, you can give'em a read! :wink:

If you see the files you'll notice that it should do some hacks, I don't understand that changing point of view thing very well... But notice that it copies every player's stats...
User avatar
Orion
 
Posts: 476
Joined: Fri Jan 12, 2007 6:32 pm
Location: Brazil


Postby MDave » Tue Jun 03, 2008 7:54 pm

Thanks a bunch! I promise I'll show the fruits of my labour after I've finished a demo up :)
User avatar
MDave
 
Posts: 76
Joined: Mon Dec 17, 2007 7:08 pm

Postby Wazat » Wed Jun 04, 2008 5:25 pm

For those of you who have played Super Smash Bros Brawl, Snake's missile launcher is similar to what he wants (but he wants a first person view). The missile travels rather fast unless it's turning, in which case it travels quite slowly.

MDave: To do the "slowing down during a turn" thing, simply keep track of your last orientation and watch for differences:

*If you track angles, you can do an angle comparison to see if you've turned more than a certain threshold and slow yourself down.

*If you track a direction instead of angles you can do a dot product (which is easier than angle compare imo) by multiplying the current direction and the old direction (make sure both are normalized). The result is a number from -1 to 1, where -1 means they're opposite, 0 means they're perpendicular, and 1 means they're exactly the same. A threshold of 0.95 or so ought to do.

Example:

Code: Select all
// check if I'm turning
dot = self.mangle * self.v_angle;
if(dot < 0.95) // if I've turned too much
{
  // slow me down
}

// track last angle
self.mangle = self.v_angle;


Hope that helps.
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Postby MDave » Fri Jun 06, 2008 12:27 pm

Most helpful, thanks Wazat :)
User avatar
MDave
 
Posts: 76
Joined: Mon Dec 17, 2007 7:08 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: Bing [Bot] and 1 guest