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.
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.