Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

FSW-style Squad Movement

| Inside3d Forums Forum Index -> QuakeC Programming

View previous topic :: View next topic
Author | Message
--- | ---
GiffE Joined: 08 Oct 2006 Posts: 141 Location: USA, CT |

Posted: Fri Sep 07, 2007 8:57 pm Post subject: FSW-style Squad Movement |

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 |

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

Posted: Sat Sep 08, 2007 4:12 am Post subject: |

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 |

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

Posted: Sat Sep 08, 2007 10:55 am Post subject: |

I was actually using quakematt's mod as an example. so pretty much yea 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 |

Quake Matt Joined: 05 Jun 2005 Posts: 129 |

Posted: Sat Sep 08, 2007 11:48 am Post subject: |

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 |

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

Posted: Sat Sep 08, 2007 12:11 pm Post subject: |

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 |

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

Posted: Sat Sep 15, 2007 2:03 pm Post subject: |

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 |

leileilol Joined: 15 Oct 2004 Posts: 1321 |

Posted: Sat Sep 15, 2007 6:41 pm Post subject: |

why not Rainbow Six Lockdown style?

Back to top |

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

Posted: Sun Sep 16, 2007 2:21 am Post subject: |

... Not really helpful leileilol

Back to top |

Display posts from previous:

| 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