Inside3D!
     

FSW-style Squad Movement

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



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

PostPosted: Fri Sep 07, 2007 8:57 pm    Post subject: FSW-style Squad Movement Reply with quote

Hey,
I'm trying to code a Full Spectrum Warrior style mod in DP. Basically how the game play is that you control a squad of 4 bots which you can position tactically in places of cover (having cover where ever u go is always a good idea.) The problem I'm having i need to move the move cursor near a window and all the cursors lock into the best position lined up along the wall.

This is what FSW-style movement looks like:
http://s33.photobucket.com/albums/d75/GiffE1118/?action=view&current=Launcher2007-09-0417-11-58-51.flv

Here is a pic of a possible senarior


I've coded all the simple things such as the camera view and the bots(although they need some better brains) mainly i just need some help on the movement (getting them to line up along a wall near a corner if the cursor is near one.

Logically this is what I THINK i need to do:
Trace to wall
then get the length of the wall to the right/left
the prime spot is the first spot on the corner which can fit the dimensions of a player.
Then find the remaining spots to the right/left (evenly spaced)

BTW i just need to find the origins that i will be sending the bots to, "spots" = origin

Any idea how to do this or some psuedo code on how to make a FSW style movement.

Thanks,
Gif
Back to top
View user's profile Send private message Visit poster's website
Entar



Joined: 05 Nov 2004
Posts: 422
Location: At my computer

PostPosted: Sat Sep 08, 2007 4:12 am    Post subject: Reply with quote

This mod sounds a little like Quake Matt's Reinforcers, which was really cool - http://quakematt.quakedev.com - but it looks like you're taking the pathfinding / cover a step further...
_________________
woh... feelin woozy... too much cider...
http://entar.quakedev.com
games fascination - My Game Development Blog/Journal
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
GiffE



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

PostPosted: Sat Sep 08, 2007 10:55 am    Post subject: Reply with quote

I was actually using quakematt's mod as an example.
so pretty much yea Smile except with 4 guys moved with 1 command and they can have some better positioning.

I think i could solve this if I could find the corner of a wall then move over about the size of a player (so he can squeeze in there)
Back to top
View user's profile Send private message Visit poster's website
Quake Matt



Joined: 05 Jun 2005
Posts: 129

PostPosted: Sat Sep 08, 2007 11:48 am    Post subject: Reply with quote

Thanks for the feedback!

The most effective way to do this, I think, would be to edit the map and place two 'cover_location' entities at the corner. Then you can find all nearby entities of this kind an move to the best one.

Of course, if editing the map's not possible, there's another approach you could try. Whenever you run a traceline command, Quake will generate a vector called 'trace_plane_normal' which, as you'd expect from a normal, will point directly away from the wall, perpendicular to the surface. If you then run the code

makevectors(vectoangles(trace_plane_normal));

the global v_right vector will be set so it runs parallel to the surface. You can then run some subsequent tracelines at several points along this vector to check where (and if) the wall ends, and move to that point instead.

If it'd help, I'll try to draw a picture of what I mean.
Back to top
View user's profile Send private message
GiffE



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

PostPosted: Sat Sep 08, 2007 12:11 pm    Post subject: Reply with quote

Quake Matt wrote:
Thanks for the feedback!

The most effective way to do this, I think, would be to edit the map and place two 'cover_location' entities at the corner. Then you can find all nearby entities of this kind an move to the best one.

Of course, if editing the map's not possible, there's another approach you could try. Whenever you run a traceline command, Quake will generate a vector called 'trace_plane_normal' which, as you'd expect from a normal, will point directly away from the wall, perpendicular to the surface. If you then run the code

makevectors(vectoangles(trace_plane_normal));

the global v_right vector will be set so it runs parallel to the surface. You can then run some subsequent tracelines at several points along this vector to check where (and if) the wall ends, and move to that point instead.

If it'd help, I'll try to draw a picture of what I mean.


I thought about doing map ents but i think it will be to labor intensive for the mapper. so i've been trying to use a coordination of traces to find where the wall ends, then plot the guy there.
eg:
Code:

      local vector wallang;
      local vector right;
      local float counter2;
      wallang = vectoangles(trace_plane_normal);
      counter2 = 1;
      makevectors(wallang);
      while(counter2 < 5 && trace_fraction != 1.0)
      {
         right = org + (v_right * (POINTER_DISTANCE*counter2));
         traceline(right, right + (v_forward*-10), TRUE, self);
         counter2++;
      }
      self.pointer1.origin = org + (v_right * (POINTER_DISTANCE*(counter2-1)));
      self.pointer1.angles = wallang;


(this was just a test to see if i looked at the wall it would go 4 spaces to the right/left or stop if there was a corner there)

above that i just traced to the wall.

it doesnt exactly work though
Back to top
View user's profile Send private message Visit poster's website
GiffE



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

PostPosted: Sat Sep 15, 2007 2:03 pm    Post subject: Reply with quote

I need to do something like this:
http://s33.photobucket.com/albums/d75/GiffE1118/?action=view&current=darkplaces-sdl2007-09-0815-32-17-79.flv
without using entities.

Basically i need to figure out the origin in which the wall ends (the corner), once i have that i can do the rest.

Any code example of how to find that origin would be much appreciated.
Back to top
View user's profile Send private message Visit poster's website
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Sat Sep 15, 2007 6:41 pm    Post subject: Reply with quote

why not Rainbow Six Lockdown style?
Back to top
View user's profile Send private message
GiffE



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

PostPosted: Sun Sep 16, 2007 2:21 am    Post subject: Reply with quote

...
Not really helpful leileilol
Back to top
View user's profile Send private message Visit poster's website
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