2024-04-19, 23:40 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
Pages: [1]
  Print  
Author Topic: Projectiles  (Read 8764 times)
0 Members and 1 Guest are viewing this topic.
fourier
 
Hans Grosse
*******
Posts: 267

« on: 2007-12-15, 22:57 »

We were talking about this a little bit last night, phoenix, but it is a bit difficult to discuss something in quake.  For non-quake3 projectiles you said you "push" projectiles.

In quake 3, the missile ents are updated every game frame with a simple VectorMA
Code:
VectorMA( tr->trBase, deltaTime, tr->trDelta, result );
So how does it work in the original, and how are you simulating that in generations?  I assume answering this question would provide the reasoning for the sv_fps 40 requirement.
Logged
Phoenix
Bird of Fire
 

Team Member
Elite (7.5k+)
*********
Posts: 8805

WWW
« Reply #1 on: 2007-12-16, 00:06 »

The 40Hz requirement is not just projectile-related.  It also has to do with gun frames and the original Doom running on a 35Hz clock, or 28.57142857 milliseconds per frame.  This means frame time must be < 28.57142857 or you'll have two frame actions occuring in one server snapshot, causing frames to get lost, which is bad because of how I have to handle the frames data transmission.  Quake 3's 20Hz default clock rate and  resulting 50msec frame time is way too large for my purposes.  A 40Hz server frame rate yields 25msec per frame, which means no more than one weapon frame will process in any snapshot under any circumstance for any player class, packet loss not withstanding of course.

Now as for projectiles, Quake 3 uses BG_EvaluateTrajectory and BG_EvaluateTrajectoryDelta to calculate movement.  It basically takes a start point and time (wherever and whenever the projectile spawned) and extrapolates the projectile's old snapshot position at time X (previous snapshot time), and new position at time Y (current snapshot time) and runs a collision check to see if it hit anything between oldsnap and newsnap, but the entire calculation is based on the spawn or bounce position and time of the projectile.  On the client-side, this same math is performed, which makes the projectile follow either a straight line or a curve, depending on whether it's gravity-based or not.  ent->s.pos.trBase and ent->s.pos.trTime are used as the "start point and start time" for the projectile math on both server and client.  It makes for very smooth projectile movement visually.

In Q1 and Q2, projectiles were actually moved through the world as opposed to their movement being extrapolated from their spawn position at "time x" and "time y".  On each server frame, the projectile is moved through the world, Gravity (if any) is applied, and the position is saved and sent to the client.  If it touched anything, a touch function was run for both projectile and whatever it contacted.  The client simply drew the projectile at the new location (Quake 1) or interpolated the entity model linearly (Quake 2 and later Quake 1 source ports).  This means the projectile actually steps through the world in increments of server time.  Quake 2 took 100msec to move a projectile, Quake 1 took 25msec.

Mathematically Q3's system is more accurate, but when you get into wanting to simulate how the old school projectiles behave, that doesn't work using Q3's math and existing functions.  Bounce physics for Q3 projectiles works completely different from Q1 and Q2 projectiles.  There is a different clipping calculation involved with the Q1 and Q2 missiles, and the movement resolution of the projectile in the world affects its "bounciness".  This happens because the bounce code has a check in place for how far the projectile moved between it's last position and impact with a surface.  The shorter this distance, the less rebound the projectile has, and this loss stacks over each bounce.  If you have a longer frame time as with Q2's projectiles, your grenades lose more velocity each time they impact something.  If you have a shorter frame time, as with Q1's projectiles, your grenades lose less velocity.  Q3's method of calculating velocity results in no loss in velocity other than in this explicitly coded statement:  VectorScale( ent->s.pos.trDelta, 0.65, ent->s.pos.trDelta );  Change the 0.65 to 1, and Q3 grenades won't stop bouncing at all except that they explode.  I found that without replicating the math used on the old projectiles precisely I could not replicate their bounce behavior precisely.  I've done extensive testing with "1:1" test map conversions for determining bounce physics to determine that they are accurate.  Now as for moving them through the world, yes, I have coded the Strogg Troopers projectiles to move on a 100Hz timer so they do not advance on every server frame.  I do not see this as any real disadvantage considering the fact that their touch function can be triggered on any frame and that player movement is asynchronous to server frames anyway.

In addition, Q1 and Q2 grenades that are very close to a surface with very little upward velocity after the bounce calculation will "stick" to a floor surface instead of bouncing upward.  Again, the frame resolution for the projectile math has a tremendous effect on this.  If you fire a grenade launcher at a shallow angle, the bounce physics will make the projectiles bounce out to certain distances, a certain number of times, before stopping.  Fire a Q3 grenade and it will bounce like crazy.  There are also some physics tricks that apply to the grenades, such as slope mining with Q1 and Q2 grenades.  If you fire at a shallow angle to a downward slope, the grenades will stick in place like a mine.  If you fire level at an upward sloped surface, grenades will bounce high into the air.

Trying to do all this with Q3 math just wasn't going to work.  I tried it in .99b, and the grenades never were "right".  Rockets and other projectiles never felt right.  Impact timings were off, projectile speeds were off...   The behavior of grenades in general was just attrocious and purist old-schoolers, myself included, did not like it.  The whole point is to try to emulate the old games as close as possible, so I took it upon myself to rewrite the projectile code for Slipgate, Strogg, and (eventually) Earth.  Any class that tossed a grenade other than Arena Gladiators got new projectile code.  Doom and Arena still use Q3-style code.  Doom didn't need a change since he has no grenades to complain of and ran at such a high clock speed that Q3's style of projectile calculation works well enough for Doom.

Right now in .99f the Q1 and Q2 feel isn't down perfect because of the lack of gun frames and also the lack of old-school style particle effects.  In the version we're working on, projectile movement is 100% accurate to the old games, particle effects mimic the old games (though I need to move the particle system out of cgame and into the rendering engine yet), so my goal with the projectiles is accomplished there.  When I load up that version it feels like Quake 1 or Quake 2 but with better graphics.
Logged


I fly into the night, on wings of fire burning bright...
fourier
 
Hans Grosse
*******
Posts: 267

« Reply #2 on: 2007-12-16, 00:58 »

Enlightening and informative, which was I was looking for.  Just to clarify, I didn't intend to imply disadvantages; my only intent was to know the how and why of the problem and solution.  The only thing that made me notice this was the "choppiness" of the q1 rocket.  I made attempts earlier on to mimic the q1 grenade launcher and reached the same conclusion as you with the q3 physics -- it just never felt right.  I told you before I love the q1 grenade launcher.

Now, I'm going to assume for the sake of discussion that you don't use the trajectory_t struct in cgame for lerping, since you will not be using the BG_EvaluateTrajectory to get your lerpOrigins.  Do you have interpolation code for the q1/q2 projectiles?
Logged
Phoenix
Bird of Fire
 

Team Member
Elite (7.5k+)
*********
Posts: 8805

WWW
« Reply #3 on: 2007-12-16, 06:55 »

I use the trajectory_t structure since it's part of entityState_t and thus net transmittable.  I do have interpolation code for the Q1 and Q2 projectiles.  I even have movers able to push items around and items and grenades, etc, can ride on top of movers.

I think part of the problem with the rockets not appearing smooth is the particle trail on the Q1 rocket kind of sucks right now and obscures the projectile's actual movement.
Logged


I fly into the night, on wings of fire burning bright...
Rubilacxe
 
Shambler
*****
Posts: 121

« Reply #4 on: 2007-12-19, 17:37 »

Glad to hear that Quake and Quake 2's projectiles will be quite close to (if not exactly like) the original counter parts in 1.0.  My brother likes this MOD, but always complained that Quake "didn't feel right", mostly in reference to the Rocket Launcher.  I remember once the Slipgate Rocket had to be nerfed a little bit, but am I correct to understand that it will be pretty much exactly like the original in 1.0?
Logged

-JL
Tabun
Pixel Procrastinator
 

Team Member
Elite (3k+)
******
Posts: 3330

WWW
« Reply #5 on: 2007-12-19, 17:59 »

As far as I'm concerned, you are correct. There's a huge difference between the public and private beta's at this point, and in the latter, Slipgate feels really old-school Quakish to play with.
Logged

Tabun ?Morituri Nolumus Mori?
Phoenix
Bird of Fire
 

Team Member
Elite (7.5k+)
*********
Posts: 8805

WWW
« Reply #6 on: 2007-12-19, 18:22 »

And let's not forget "oldschool" mode that will be added fairly soon, which will take the kid gloves off and completely unbalance everything.
Logged


I fly into the night, on wings of fire burning bright...
Angst
Rabid Doomer
 

Team Member
Elite
***
Posts: 1011

WWW
« Reply #7 on: 2007-12-20, 22:20 »

BAHAHAHAHA BLIMP SPAM  Doom - Thumbs Up!
Logged

"Who says a chainsaw isn't a ranged weapon?"
Rubilacxe
 
Shambler
*****
Posts: 121

« Reply #8 on: 2007-12-23, 04:38 »

Phoenix,
 
In regards to old school mode, is Slipgate the most unbalancing class of the 5 (as it was in GenQ2) or is it a combination of classes (Doom would be my next candidate)?
Logged

-JL
Phoenix
Bird of Fire
 

Team Member
Elite (7.5k+)
*********
Posts: 8805

WWW
« Reply #9 on: 2007-12-23, 05:01 »

Doom and Slipgate both are unbalancing, probably Doom more so when you consider he has weapons that can inflict up to near 300 points of damage with a single shot, and I don't mean the BFG9000.  Beyond weapons, both classes get double the armor of the others.  Gen Q2 did not have Doom coded right at all so the Q1 class dominated in the old mod.
Logged


I fly into the night, on wings of fire burning bright...
Rubilacxe
 
Shambler
*****
Posts: 121

« Reply #10 on: 2007-12-26, 03:40 »

I'm guessing your refering to the Combat Shotgun?  Doom - Thumbs Up!

If Generations Arena can be a balanced MOD while coming extremely close to accurate representations of the other 4 classes, I'm satisfied.  Oldschool mode sounds interesting as well, but knowing that Doom and Quake will most likely dominate all the others will probably steer me towards "regular mode" more often than not.

However, being a Doom fanatic, and my brother being a Quake god, I'm sure some very interesting and fun LAN games with Oldschool mode could be had  Slipgate - Thumbs up!
Logged

-JL
Phoenix
Bird of Fire
 

Team Member
Elite (7.5k+)
*********
Posts: 8805

WWW
« Reply #11 on: 2007-12-26, 07:19 »

That's the whole idea.

Not just the Combat Shotgun.  The rocket launcher was not something you wanted to get hit by.  Unlike the other rocket launchers, it does splash damage on direct hit in addition to the direct hit calculation.  The direct hit calculation is 20 x random (1-8), so minimum 20, maximum 160 plus the splash (max 128 for splash).  That's a theoretical max of 288 points, minimum of 148, with an average mean of 208 points, give or take a few points for splash radius not being dead center on the player.  Quakeguy's rockets are dangerous for the huge blast radius and high knockback.  Doomguy's rockets pulverize things on a direct hit, plus have a large bounding box, making them difficult to avoid.  That makes either class extremely dangerous with explosives, but with completely different techniques as to how you want to maximize the weapon's damage potential.

When I look at an oldschool Slipgate vs Doom scenario, two things come to mind to me.  The first is that, overall, Doom has a better variety when it comes to useful weapons.  Slipgaters tend to rely on rockets almost exclusively, with the Thunderbolt as a standby.  Lead and nails tend to be last resort weapons, and grenades usage varies a lot by player.  Doom's Combat Shotgun, Rocket Launcher, and Plasma Rifle are all very devastating weapons, and even the single shotty can dish out some damage.  If Doom catches Slippy without rockets, he's in trouble.  The second thing is armor.  This is where Slipgate is going to have the advantage.  Doom's heavy armor only absorbs 50% of damage taken.  Both classes get 200 armor for their heavy armor pickup, but Doom can only take 200 points of damage unless he grabs health.  Slipgate's armor absorbs more, so he'll be able to take a full 300 points of damage.  In addition, he gets 150 yellow armor, which again absorbs more damage than Doom's green armor, which is merely a 100 point pickup and a measily 33% absorption.  This will lead to a strategy I think that works something like this.  Slipgaters will try to control the armor as much as possible and load up on rockets, trying to tank up and hit the Doomer from far away, using knockback to keep him off balance.  Doomers will attempt to ambush the Slipgater and corner him with heavy firepower to blow through the armor in a single brutal assault.  That armor is tough, but a few well-placed rockets or a point-blank shotgun blast will make for a bad day.  Of course if the ambush fails the Doomer might find himself across the room and respawning shortly after.  It'll certainly be interesting to see how it works out in a real game.
« Last Edit: 2007-12-26, 07:21 by Phoenix » Logged


I fly into the night, on wings of fire burning bright...
~Va^^pyrA~
 

Beta Tester
Spider Mastermind
*********
Posts: 484

Do These Fangs Make My Butt Look Big?

WWW
« Reply #12 on: 2007-12-26, 17:27 »

It might just be player preference, but DooM seems to be the dominating class in general... even outside of this yet-to-be-released Old School Mode. I'm not saying that they're poorly balance, per say, but I do think that people gravitate toward DooM because it is probably the easiest class to kick butt with. DooM is fast and does have a variety of very useful weapons. As opposed to the Strogg who tend to have overly specialized weapons and are obviously on the slow side. The Earth Soldiers don't seem to suffer as much from being even slower because their weapons are largely more general-purpose, despite many being able to deplete you of ALL ammo. Slipgate - Tongue

Just my experience however. DooM seems to get the most fanfare and can kick butt easier than the other classes. Of course, a skilled player can do well with any class, but I've seen newcomers do pretty darn well with DooM when any other class would have simply proved to be more limiting than anything in their introduction to the game.
Logged
Phoenix
Bird of Fire
 

Team Member
Elite (7.5k+)
*********
Posts: 8805

WWW
« Reply #13 on: 2007-12-26, 21:08 »

It's certainly seemed that way from the beginning.  In .99f there are two unbalancing factors with the Doom class that we've fixed for the current in-progress version (normal play mode).  The first is we've toned down the in-flight collision box for Doom's rockets.  This makes them require a little more precision to land a direct hit with, which better eliminate the "blimp" complaints once and for all - except in Oldschool mode of course.  The second is that the damage on the Doom chaingun was too high.  We've reduced it to be more in line with the damage range on the original.  You can still snipe with it, but it's going to take a lot more hits to do the job.

I think of the non-Arena classes, Doom is the easiest to get used to quickly.  You can run fast, and if you can hit the other guy you can hurt him pretty bad.  If all else fails, whip out the chainsaw, rush 'em and pray.  Earth is kind of a quick second. Earth is pretty straight forward - hose the other guy with bullets or fire up close, lob mortars and snipe from far away.  Four of his weapons work the same, just at differing rates of fire, from "annoying gnat" to "portable blender".  Slipgate and Strogg both require a pretty good weapons knowledge and understanding of how their armor stacks, and how their physics work.  Of those, I think Strogg is the more difficult of the two.  That's not to say an experienced Q2 grunt can't best a good Doom player.  Strogg can be extremely powerful, but I think he's the hardest class to master owing to how specialized his weapons are.  Angs7 and myself played a 1 vs 1, Doom vs Strogg match on Eternal Arenas a long while back when we were all playing a lot more regularly.  I was the Q2 grunt, and Angs7 was the rabid Doomer.  I managed to win the match, but I think the score was something like one point difference, and we may have even hit Sudden Death.  Angs7 is no weak player when it comes to the Doomguy, and I've played a great deal of RA2 and Q2 death match.  I'd say that was a pretty good indicator at the time that were were moving in the right direction with class balance.  There's always room to improve, but we're almost there I think with this next build.  Weapons animations and proper particle effects helps a lot I think.

Granted my game with Angs7 was a 1 vs 1 as opposed to a FFA.  In FFA the game balance depends greatly upon player load, how many of what class you have, and the skill level of each player with that class.  If you have 6-player FFA, with 4 Doomers running around, one Earther, and you're the only Q2 grunt, it might lead someone to think Doom is too strong because Doom is always killing you.  That's just a statistical fact owing to the number of Doomers on the server, and is not a true balance problem.  That's a problem I've had to address when considering balance concerns inside the team, and unfortunately it's led to some friction in some cases.  It's when you have a mix of classes and, all other things being equal, one player dominates the server only because of their class, and it's a consistent problem, that a balance concern arises.  In other words, not always the same player with the same class, but a number of players who play at one skill level then, suddenly, start dominating the server as soon as they become class X.  That's a big reason I play random a lot, and I think Tab does as well.  Besides being a challenge, it helps give a feel for how well one class plays vs another, on both the giving and receiving end of damage.

Now as for Doom having such a following.... it's 14 years old and people still play it regularly.  Zdaemon and Skulltag have no shortage of players or servers.  I've played Zdaemon with people from Canada, Chile, Mexico, Russia, and Poland all in the same game.
  Doom - Thumbs Up!
Logged


I fly into the night, on wings of fire burning bright...
Rubilacxe
 
Shambler
*****
Posts: 121

« Reply #14 on: 2007-12-29, 19:20 »

If most of the classes are slightly (or greatly) nerfed from their original forms, its very hard to notice.  Doom and Quake 2 feel dead on as far as accuracy goes, and Quake as well for the most part.  All a testament to your team's dedication and attention to detail  Slipgate - Smile.  I'm excited to see it balanced further in 1.0.
Logged

-JL
Pages: [1]
  Print  
 
Jump to: