Legions physics

Aki

Member
So the blog about the netfix got me thinking about some things. So did my bad aim. Mostly my bad aim.

From the blog, I learned that the game client sends input to and receives updates from the server about every 15 ms. If I did my math right, this means that at 90km/h (OD speed, right?) a player who is traveling in a straight line will move about .017 meters per update. Which is great--that is a negligible amount of space even at 90 km/h. As we all know, most fly-by's happen at relative velocities of about 200 km/h, but most knife fights happen under 50 km/h. That means our aim can actually count for something! Well, not mine.... Way to go, guys!

To help my horrible aim, I've been pondering a mod which would basically mimic the LCOS gun sights used in modern fighter jets. For those who've NEVER played a good flight sim, LCOS is basically a big circle with a bullseye in the middle that floats around the HUD to show where your bullets will fly. Some systems tie a line between the bullseye and the gun cross (which is effectively a bore-sight) that shows where bullets will be at different time increments. It's pretty handy, and for the modern fighter pilot absolutely essential (especially if their plane has no radar and therefore no EEGS, which is arguably better in some cases and worse in others).

The trouble with implementing something like that in a video game that's already made is that I have no idea how the physics engine works. I can see the effects, but I have no way of quantitatively understanding any of it. From playing the game, I get these impressions:

There is no air resistance;
Gravity is similar to Earth gravity;
Gravity only effects grenades, flags, and players--bullets and rockets go in a straight line until they exterminate;
Bullets and rockets do not go any faster or slower in response to how fast you are going when you shoot, but grenades and flags do;
All projectiles will be effected by any momentum you have going to the side, i.e. rockets will travel a bit sideways if you are flying really fast and shoot perpendicular to your flight path (though not nearly as much as they would in real life--grenades and flags excepted);
Players, flags, and grenades are subject to impulse (bouncing off of things after collision);
Your jets exert a constant force while you hold down the jet key (and therefore produce a linear acceleration).

If all of this is true, then I think the math will be pretty simple. Making things even better is the network architecture described in the blog. Since the server updates your position at intervals, you can make your frame of reference completely static--we get to treat everything as if it's not moving. It's just a simple matter of accounting for all the forces and velocities and making a prediction of where the object will be in 15 ms.

If I understood correctly, the client will be sending packets to the server that show user inputs with timestamps. Given those inputs, the server does a swift calculation and voila, you start accelerating on everybody's screen. This goes on about 67 times a second, which is good because it's fast enough to fool the human eye into thinking it sees smooth movement.

The calculations that get sent back to the client should include your character's movement vector and position vector--how fast in what direction you're moving and how far from and to what side of a certain point on the map you are. You aim and shoot, and the client sends a packet with the shoot input, which gun you're using, and a vector that represents where you are aiming. The process repeats again.

Back to the LCOS: if the client could handle doing a little math of its own, it would be incredibly simple, I think, to write the equations into the source code for the client program and have the client display a circle over where the client thinks the shots will go. Implementing this for the grenade launcher would be a lot more difficult since the grenades follow a ballistic path instead of a linear path, but I only see use for a LCOS with the chaingun, anyway. Rocket launcher, meh, maybe, but it might remove too much need for skill to keep the RL fun.

The problem for me is that I'm not a programmer. I couldn't implement this myself even if I had the source code. Mostly I just wondered if my theory is correct and if anyone else thinks it would be an okay mod (or new feature?).

PS
Also I suck at math and would probably never get a functioning LCOS on my own for that reason alone.
 

Volt Cruelerz

Legions Developer
And then when you combine this with some some additional calculations based on your position and others, you have just created an aimbot. Congratulations. And if you do the LR, all you need are your position, enemy positions, enemy velocities, and your ping and you'll probably hit every shot.
 

Velocity

Member
Like Volt said, that would be an aimbot... and gives you an advantage over other players. Which is CHEATING.
 

Volt Cruelerz

Legions Developer
Honestly, once you crack the executable open and have access to all the locations and whatnot, I'd personally be able to make the aforementioned aimbot (the math is really simple for it, especially for the LR, as mentioned) and there are pro... Actually, I'm not gonna finish this. The fewer the people that know how to make aimbots the better.
 

Aki

Member
Whoa, guys. This is not aimbot. Aimbot AUTOMATICALLY aims for you. I'm talking about a pipper on the HUD that shows where your rounds will go based on your direction of travel. That is NOT the same thing. I'm talking about a client-side algorithm that doesn't even talk to the server--it doesn't need to, unless you want to cheat. Once the client has your vectors from the server, the algorithm runs the math and puts a little dot on your HUD that shows where your bullets should end up relative to you. It's still up to the player to put that extra dot on an enemy and keep it there for three seconds while dodging rockets and the like.

I dunno what happened; IA's last big update before it went to *chocolate cookies* seemed to change a lot of mechanics in a subtle way and I haven't been able to hit jacksheit with the CG ever since. Before that update, I was knocking out flag runners from a decent distance going at 150 or higher. I don't know what changed, if anything even did, but I came back after a couple weeks and suddenly couldn't hit anything. Yes, I am trying to compensate with a visual aid, but I wouldn't dream of writing an aimbot--assuming I had the technical skill to do that at all--let alone use it in a game I actually enjoy playing for the skill challenge.
 

RainPilot

stinky bear
I think I know what he's trying to say. Basically, a marker that show's you where to aim, but doesn't aim for you. This old game reminds me of what he is trying to say, skip to the middle and you'll see a red marker where you have to aim.
 
Nicely written post. However, this 'mod' will take a huge amount of skill out of the equation (='cheating'). And for that reason I can't see this being implemented into the core game either. I'd think the devs want to make players aim for themselves as much as possible.
 

Darklord

Private Tester
Your numbers are a little wrong; the shown speed is meters per second, not km per hour. 88m/s is 316.8 km/h, 250 m/s is 900 km/h

He is right, this wouldn't be an aimbot. It would however be pretty close, and definitely not something that should be in the game.
 

Aki

Member
http://www.youtube.com/watch?v=0C3ePqCI-b8 is more like what I'm talking about. In the first few seconds, the pilot switches to gunsights and you can see the floating bullseye and the line going up to the gun cross.

I can see no one is going to agree with me that it would be kinda neat to have a LCOS-similar system for the CG, but I do still want to know if my appraisal of the game's physics is accurate or way off base.

I forgot to include in op that jets make the player frictionless and that walls are also frictionless.

I always thought our speedometers were in km/h :p . Well, having it in m/s would make it easier, anyway. No unit conversions to do. In that case, a player going 90 m/s should move about 1.35 meters every update, or about 4.43 ft. Not bad :D .

I'm curious to know if the ballistics model for the GL uses basic kinematics or more advanced calc-based stuff that I haven't even seen yet. I suppose only one of the devs could answer that one :p .
 

WildFire

Warrior of Linux
The grenade launcher is shot in a parabolic arch, just as a note. I don't know the math behind it though
 

Aki

Member
What would you guys think about having CG rounds be subject to gravity? Say it takes 200 yards for there to be any serious droppage. Would make flag chasing much harder.

Another interesting thought would be: what if CG damage were scaled to player speed? As in the faster you're going relative to your target, the more damage your shots do. Obviously not a feature that we need in this game, just an interesting thought.
 

Daphinicus

Private Tester
Aki, you seem to like coming up with ideas, which is awesome. One thing you might start considering is what new weapons might be added to the game. Right now we only have four, and there's constant discussion about them. Eventually, though, other roles will need to be filled. it might be worth spending some of that brainpower thinking up what some new weapons might be. =)
 

RainPilot

stinky bear
What would you guys think about having CG rounds be subject to gravity? Say it takes 200 yards for there to be any serious droppage. Would make flag chasing much harder.
Flag chasing with the chaingun is already very hard, you can only do so much damage from close to medium range before overheating and switching to your rocket launcher. It's very hard to kill someone who has below 20% from 200 yards just because the chaingun spread would be all over the place.

Another interesting thought would be: what if CG damage were scaled to player speed? As in the faster you're going relative to your target, the more damage your shots do. Obviously not a feature that we need in this game, just an interesting thought.
I thought if we go at a certain speed, our CG cools down a bit. I'm not sure about this, but I thought I heard someone saying this and my CG lasted a bit longer while going 100+.[/quote]
 

Daphinicus

Private Tester
I thought if we go at a certain speed, our CG cools down a bit. I'm not sure about this, but I thought I heard someone saying this and my CG lasted a bit longer while going 100+.

I don't know what the official word is, but I've definitely experienced this so it's in-game in some form.
 

Mhi200

Member
I know that entering OD (or at least iOD) cools cg from experience, but whether it's the OD itself or the speed I'm not sure.

One thing you might start considering is what new weapons might be added to the game.

Are there any weapon possibilities that haven't been shot down?lol
 
I don't know what the official word is, but I've definitely experienced this so it's in-game in some form.

In old Legions regular CG used to have no over heat if going above a certain speed. That's probably what your thinking of.

In relation to the "Its not an aimbot, aimbots aim for you, this would show you where to aim" Its pretty much the same thing.
 

Aki

Member
My experience is that CG takes longer to heat up at speed. Above 120, I used to be able to shoot off half my ammo before it finally overheated. I dunno if it's still true.

The reason I don't come up with new weapons is two fold: I've yet to see a weapon idea that wasn't shot down, and I have a huge tendency to overthink things... like bullet drop for CG.
 

Astrum

Super Special R&D
This would hardly be anything like cheating, an aim bot, or similar. It's merely a HUD overlay showing where you're actually firing, rather than the crosshair which is almost universally wrong. It has no concept of depth, enemy location, or anything like that. If there's a crosshair in the middle of your screen, then the LCOS style crosshair would float around the fixed center point crosshair showing the initial trajectory that the projectile will go towards, which in most cases will not be the center point crosshair. This has little to do with leading your target or targeting in general and more to do with where you're actually aiming relative to the world frame rather than the player frame. Of course I'm assuming projectiles have the same velocity and trajectory in the player frame when fired regardless of a players motion relative to the world frame thereby making any projectile "inherit" the velocity of its parent (player) in the world frame, which I'm sure is the case for the most part ;).

This could be extended to show the projectiles path through space (perhaps even with collision detection). About the only example I can come up with at the moment is throwing a grenade in Section 8 where it'll show you the projectiles parabolic trajectory. This definitely would make the game a bit easier as far as aiming at targets, but only in the close to mid-close range given the nature of the jetpacks and ease of changing trajectories as a player. This is also the reason that aimbots would do relatively poorly in games such as Legions because only one gun is a hitscan weapon. Now I'm not saying it would be useless as I've seen aimbots in games such as Bad Company 2 which takes bullet drop and travel time into account and can easily decimate an opposing team, but the travel time is also extremely fast compared to Legions projectiles. The RL and GL would only really be useful at close/mid-close range with an aimbot, the chaingun slightly further still, and the LR would be effective until the damage drop-off. Of course such a HUD would have no knowledge of enemy player location so couldn't be made into an aimbot (unless the programming easily allowed it I suppose, but Mabe is smarter than that).

A third possibility would be to do away with the 2D crosshair (and dynamic 2D LCOS style crosshair) and go with two projected crosshairs in 3-space showing a small subinterval of the projectiles trajectory. This would be better than method one and less "cheaty" than method two and as a bonus would fix the problem of firing down over a ledge in third person where the crosshair shows the projectile will clear the ledge, but in reality you'll just shoot your feet off.

Now as far as what I think about this in terms of gameplay, implementation, etc... The Tribes player in me doesn't like this idea at all, probably because I spent the better part of my teens training myself and committing aiming techniques to muscle memory. The technical side of me hates the traditional crosshair and thinks these are interesting in their own right. However, the main question is would this fit into Legions? I think method 2 would not. It would be cool, but I don't think it'd work out. Method 1 could work and I don't really see a huge downside to it and would allow newer players to get used to how aiming actually works. Though at the same time it would only help them hit people tangentially as there's still a lot of human side prediction that goes into getting an MA, though ground pounding would be easier. Method 3 is something I'd actually prefer and would function similarly to method 1, only be a bit more easy to understand conceptually.

Of course this assumes the game can even handle such things, and I can almost guarantee you that it doesn't. Even assuming the most simple method, number 1, it will need data to actually determine where to draw the LCOS style crosshair so it's accurate with respect to the world frame. It almost certainly does not have this information available to it (I could be wrong though). Given that this is a community developed project with limited resources, time, and manpower I'm going to say that even though I think this idea has some merit, it would never get done. Clearly then IAC needs to make the community dev team into a full game studio and pay them ;).
 
Top