Author Topic: FE & collisions etc.  (Read 3504 times)

Offline Brenjen

  • Silver Member
  • ****
  • Posts: 1514
FE & collisions etc.
« on: May 01, 2006, 11:40:57 PM »
I am not a computer programmer. I am not a complete idiot either. I know how to use & have used the search function.

 That being said hold the "use the search function" snot-nosed comments.

 I have read where HT has stated the "plane towing a target drone" X 2 is how the programming works. I think I understand that the FE or front end is the respective users own PC ( my FE is my own PC ) I have also read the article written about net lag for the warbirds set from here:

http://www.rdrop.com/users/hoofj/netlag.htm

 But just when I think I understand how it works I seem to get confused again. Now, I am not complaining....I rarely have collisions, I am just trying to learn the facts & be sure I know whats going on.

 If, for instance, I am turning for an angle & I end up in a HO with another plane & I see the message: "You have collided with X-pilot" That means that on my FE (my PC) it calculated from the positional information it has available that both aircraft occupied the same place at the same time right?

 So how does it determine I hit X-pilot instead of the other way around?

 Is it a split second communication between my FE & his FE via the HTC server that he was moving out of the way when we hit?

 Or is it a split second communication between the FE on my end & the one on his end via the HTC server that says my view showed me hitting him & his view showed him missing me so I was the collider & he was the collidee?

 I guess it's the lag & the fact that there aren't really two planes (or four as it were) flying in cyberspace hitting each other that's throwing me. I can't get my mind around how I see a collision (or X-pilot sees it) & the other guys sees a 100 yard close miss. Not being a 1's & 0's binary code sort of guy my brain tends to interpret images of this situation as "if I hit him...then he had to have hit me too"

 When in this situation what is really happening is " one of us hit the other one...but the other one didn't"? :huh

 Have I at least got it right that if it says "you have collided with X-pilot" then I have damage & that if the message says "X-pilot has collided with you" I don't have damage?

 Am I really dense or has the discussion of this subject been described above my knowledge level in one thread & dumbed down too much in another? I still can't understand how there can be as many as 4 seconds between the views of the repective pilots & we still see a fluid scene either....dang I feel stupid.

Offline Docc

  • Copper Member
  • **
  • Posts: 150
FE & collisions etc.
« Reply #1 on: May 02, 2006, 12:18:22 AM »
I too have read all the threads and HT's explanation of how he thinks it works.  But I really think there is something wrong with the programming.

I think your question really is:

Why is it when someone collides with me I sustain the damage and he doesn't.......and when I collide with someone I sustain the damage and he doesn't?  (No guns have been fired by either party)

This happens to me as well....95% of the time.

I think the programming should be changed so that the person who the computer says did the colliding is rewarded with the damage and no one else.  This would minimize the current ram mode utilized frequently in the MA.

Offline Pei

  • Silver Member
  • ****
  • Posts: 1903
FE & collisions etc.
« Reply #2 on: May 02, 2006, 01:44:48 AM »
Quote
Originally posted by Docc


I think the programming should be changed so that the person who the computer says did the colliding is rewarded with the damage and no one else.  This would minimize the current ram mode utilized frequently in the MA.


Which would lead to thousands of complaints from people who did not see a collision on there FE getting damaged/destroyed.

Think about how you would feel if you were suddenly wingless with no visible collision (nor any other explanation).

Lag on an internet game is unavoidable, and while the "you see it, you get it" method has its' issues it is ultimately the best method.

Offline Docc

  • Copper Member
  • **
  • Posts: 150
FE & collisions etc.
« Reply #3 on: May 02, 2006, 02:25:40 AM »
Thats exactly what I am saying.   I am getting the damage without seeing it and my computer says "so and so collided with you".  He flies away undamaged.

Offline Tarmac

  • Gold Member
  • *****
  • Posts: 3988
FE & collisions etc.
« Reply #4 on: May 02, 2006, 02:26:44 AM »
Thanks for doing a search beforehand.  It's much appreciated; I hope other posters who don't understand the current model also do the same.  

It comes down to what you see is what you get.  You see a collision, you collided.  The other guy doesn't see a collision, he didn't collide.  That's how you die  and he doesn't.  

The primary thing to understand is that AH uses a smoothing code... your FE is actually predicting where the other plane is going to be based on its last known trajectory/speed.  Keep that in mind.

So now we've got 2 planes on a collision course.  Three computers are involved: yours, mine, and the server.  Let's say it takes 1 second for my computer to contact the server, and then another second for the server to contact you (and vice versa)

Say our planes stay on the collision course until the last second.  1 second before I see the collision on my FE, I jerk up on the stick.  My FE, since it doesn't have up to the second info on where you are (remember, my FE is displaying 1 second old data), uses its smoothing code to predict that you continued flying straight at the same speed.  Since I changed direction, my FE instantly displays that (no lag).  However, the smoothing code assumes you went straight, and so on my FE you zoom under me.  Collision avoided... or so it appears on my FE.  

Now on your FE, you also see my plane 1 second from colliding with you.  Say you take no evasive action and fly straight.  In real life, I'm pulling up on my stick and avoiding the collision.  However, that data will not reach your computer for another 2 seconds (1 to the server, 1 from the server to you).  So your computer's smoothing code predicts that my plane flew straight.  Your computer, based on this prediction, calculates a collision (as far as it knows I flew straight) and assigns damage... you take damage.  

Now, your computer sends a "Brenjen hit Tarmac and died" message to the server.  I didn't see a collision on my FE, so my computer simply sends a "Tarmac is climbing" message to the server... which relays that to you, and you see my plane climb away unharmed.  The server sends me the "Brenjen hit you" message, along with the data that your plane has lost a wing and is in a death spiral.  That data takes a second to reach me, so I see your plane fly unharmed for a second (since my smoothing code is still thinking you're flying straight and level), but a second later it loses its wing and begins to go down.  Since I didn't see the collision on my FE, I take no damage.

Of course, the times are measured in tenths of a second, not full seconds, and these messages are sent multiple times per second.  I used round numbers, but I hope you understand what's really going on.

Offline Tarmac

  • Gold Member
  • *****
  • Posts: 3988
FE & collisions etc.
« Reply #5 on: May 02, 2006, 02:35:48 AM »
Quote
Originally posted by Docc
Thats exactly what I am saying.   I am getting the damage without seeing it and my computer says "so and so collided with you".  He flies away undamaged.


Unless there's a bug, this is impossible.  

-- if your computer says "Tarmac collided with you", that means tarmac's computer said "You have collided."  If my computer said I collided, then I've taken damage.  Maybe not lethal damage, but damage nonetheless.  

-- If you are taking damage, it is because your FE saw a collision.  Your FE is the one that assigns damage, not the server.  You may have been looking in the wrong direction, but your computer saw it happen (even if your pilot didn't) and modelled our planes colliding based on where it predicted my plane would be.

Offline Docc

  • Copper Member
  • **
  • Posts: 150
FE & collisions etc.
« Reply #6 on: May 02, 2006, 02:45:49 AM »
I don't care whether you say its impossible or not.......it is happening.  

I don't see a collision on my computer, I get a message that xxx has collided with me, and I get damaged while he doesn't.

I think the programming is too sensitive or has a bug that assigns damage to the wrong person.

I am used to playing with lag....I live in Malaysia and my normal ping time is 597 ms but it is rock steady.

Offline eagl

  • Platinum Member
  • ******
  • Posts: 6769
FE & collisions etc.
« Reply #7 on: May 02, 2006, 07:31:41 AM »
The server has nothing to do with collision detection.

Your computer keeps track of where YOU are, and the server sends you position, speed, attitude information on every aircraft near you.  If your position (plus the size of your plane) intersects with the position of another plane, your computer detects this coincidence as a "collision" and 2 things happen.  You take damage, and the collision/damage information is sent back to the server.

This has NOTHING to do with what is happening on the other guy's computer, and that is what bothers people when they try to figure out the collision detection model.  On the other guy's computer, the exact same calculations are being done.  His computer is keeping track of his own position, and the server is sending him the positions of other planes.  If any one computer determines a position conflict, even if it isn't seen on other computers due to network lag and the fact that it takes a certain amount of time for any maneuver to be sent from each computer to the server and then propagated to every client within a certain distance, then that collision is still valid because it occurred on that one computer and it will result in damage, and that collision/damage message will be sent to the arena host for propagation where appropriate.

It's really not all that tough to understand once you realize that what YOU see on your computer is 2 things - your own position as tracked by your own computer, and the position info for other planes sent to you by the host.  This means that the position of other planes/vehicles you see on your screen is actually the position those players computers sent up to a full second ago.  That lag results in the game "reality" not being tracked by the host, but by what every player individually sees on their own computers.  So if a guy turns left but for whatever reason that left turn data is delayed in getting to your computer (a warp), and you see him flying straight and you shoot him, he's STILL DEAD even though he really turned instead of flying straight, because on your own computer you shot him fair and square.

This model relies on the fact that even with random errors, the internet is fairly consistent in behavior.  Ping times, lost packets, and general latencies tend to even out for everyone, so everyone sees the lag effects nearly equally.  People with very fast computers and very fast and reliable connections to HTC's servers may see some benefits, but on average everyone is playing with the same lag effects so nobody gets a clear advantage.

There are exceptions and in some cases a network setup that has less transmission lag than receive lag (or vice-versa) may see some artificial benefits, but it takes a real AH veteran to learn how to take advantage of that.  And deliberately inducing a large difference between inbound and outbound network traffic would probably constitute cheating so I doubt anyone is seriously taking advantage of it.  There was a guy with a really high ping time but with a very "clean" network connection, and he benefitted in a huge way from that network characteristic.  He knew that there was a huge lag between what he was doing and what you saw him doing, and he used that to his advantage.  But it's not cheating, because everyone has to deal with network lag.  The difference is that while every single fight he had was under a large network lag condition, most other players only had to deal with that kind of lag when they were fighting HIM.  So it worked to his advantage since to most players, he flew differently than almost everyone else.
Everyone I know, goes away, in the end.

Offline Ghosth

  • AH Training Corps (retired)
  • Plutonium Member
  • *******
  • Posts: 8497
      • http://332nd.org
FE & collisions etc.
« Reply #8 on: May 02, 2006, 07:32:42 AM »
First off just because you suddenly have damage does NOT mean it came from the collision. He could have shot you, you could have run into pieces. You might have jerked the stick hard enough to rip wings off. There are a whole realm of possible causes.

The solution is to not fly so close, AVOID those collisions.
See it coming, react sooner, don't fly it so tight to the edge.

The only way to really be sure of whats happening in the situation your describing would be to film it.

Then step through the film frame by frame to see what happened.

This was not written for AH, so the icon's are not right. But I think most of you are smart enough to figure it out. I read this back in the spring of 97, and a light bulb went on, AHAH!

Take the time to really read & understand what he's saying.

http://www.rdrop.com/users/hoofj/netlag.htm

Offline eagl

  • Platinum Member
  • ******
  • Posts: 6769
FE & collisions etc.
« Reply #9 on: May 02, 2006, 07:48:29 AM »
A lot of people are under the misconception that the arena is somehow "inside" the host.  That the current state of your aircraft's position, speed, etc. is actually calculated and held within the host.  That is completely incorrect!  The main purpose of the host is to receive position updates from everyone's computer and intelligently transmit those position updates out to only those other computers who might need to know that information.

This is why someone with a really crappy computer can still host 8 player H2H with pretty good results...

The real arena is a distributed "dream", held in the virtual minds of each individual player.  The strict control of the client behavior is what makes this a consistent shared dream world, and it's why AH is theoretically susceptable to hacked clients - The host, within closely guarded limits, will 'believe' whatever positional data a client sends it, because the host trusts each client to behave consistently.  So the war, the arena, whatever, doesn't really exist in some host somewhere.  The arena is in your own computer!  Each computer has a full arena, populated by your own aircraft's behavior calculated by your cpu, plus the positions of other vehicles sent to you by the host.  But the host doesn't calculate ANY of those other positions.

Even the AI is done entirely on your own computer.  Everyone's personal arena (their slice of the shared dream called the arena) starts off the same.  The state of non-player objects within the arena is kept by the host, because everyone's arena starts off with the same list of objects.  So the host only has to tell your computer which objects are destroyed right when you log on, and then to pass updates whenever an object's status changes.  Player X blows up object 269, and the status message "object 269 destroyed" is passed to everyone.  But when you shoot or collide with someone, that shot or collision does not occur on the host - it occurs on your own computer, and because the host implicitly trusts whatever it's told, when your computer passes the message "I shot player Y with 2 type 4 gun rounds in the left wingtip", the host believes you and passes that shot data to player Y's computer, which registers the shot data and resulting damage.  The damage that occurs, say it's a wingtip that gets shot off, then gets passed back to the host and broadcast to everyone within visual range of player Y.  So everyone sees player x shoot off player Y's wingtip, after the 4-way transmission lag of course.

Collisions are no different.
Everyone I know, goes away, in the end.

Offline eagl

  • Platinum Member
  • ******
  • Posts: 6769
FE & collisions etc.
« Reply #10 on: May 02, 2006, 07:58:02 AM »
I must say that the host code is pretty clever...  If the host merely blindly passed along whatever it got whenever it got it, we'd see some very strange results.  Planes would fly backwards, spin in place, warp all the time, etc.  So the host code isn't simple by any means.  But as intelligent as the host code is, it still doesn't track collisions or shots.  All that happens on each individual client's computer and only the results are sent to the host for processing and distribution.

I suspect that this will have to change with the new combat tour because the AI will have to be consistent across clients, but it's still going to have to be done with virtual clients interfacing with a "simple" message passing host.  The basic model can't change without compromising the consistency and integrity of the arena environment.  You're not flying a plane inside an arena, you're flying a plane on your own computer and the results are sent to everyone else's computer through the host.  Unless HT has figured out a unique way to synchronize AI vehicles across clients, the AI vehicles will have to be virtualized and sent through the normal host interface as if they're really just another player.
Everyone I know, goes away, in the end.

Offline Brenjen

  • Silver Member
  • ****
  • Posts: 1514
FE & collisions etc.
« Reply #11 on: May 02, 2006, 08:50:06 AM »
Quote
Docc said; I think your question really is: Why is it when someone collides with me I sustain the damage and he doesn't.......and when I collide with someone I sustain the damage and he doesn't? (No guns have been fired by either party)


 No Docc, not really. In a way that's what instigated my research into this; but that's not a problem I am having. As I stated in my opening post, I rarely collide & when I do I don't always go down ( just 80% of the time ) At least two out of the last ten collisions I have flown away from, & the last one a few days ago, I & the fellow AH'r I collided with both flew away. He did eventually crash trying to land though, so he must have took damage ( I don't know if I did or not - I never checked )




Tarmac; right on man! The smoothing code is what was throwing me. I think I understand it now, There is a collision because one PC ( FE ) or the other of the two pilots PC's (FE's) has assumed due to the smoothing code....which is necessary due to lag for fluid motion....that one of the planes or the other continued to fly straight....or better stated; continued to fly into the path of the other plane.

 So; if I pull up & the other guy pushes forward at the same time...my PC (FE) will not see a collision & neither will the other guy on his end. In that situation there is a WARP because the smoothing code is still actively assuming we are both flying in a predictable pattern when neither of us are in real time.


Quote
eagl said: The server has nothing to do with collision detection.


 In a way that's true, but not entirely accurate becasue as I understand it, the smoothing code is there because of lag & lag is caused by the time it takes for our PC's (FE's) to communicate to the server & back to us again. So it's part of the "smoothing code loop" therefore it's part of the decision making; but it doesn't make the decision.


Quote
Ghosth said: First off just because you suddenly have damage does NOT mean it came from the collision. He could have shot you, you could have run into pieces.


 According to HT in one of the threads I searched through he stated "you do not take damage from hitting pieces"

 I can't read through all these posts because I can't tell if some of you are replying to me & my questions or Docc. He has a specific problem & mine are general questions. I think Tarmac covered the part that was confusing me anyway....Thanks Tarmac :aok  
« Last Edit: May 02, 2006, 08:54:38 AM by Brenjen »

Offline Docc

  • Copper Member
  • **
  • Posts: 150
FE & collisions etc.
« Reply #12 on: May 02, 2006, 09:24:47 AM »
If you know so much about the code and the net then change the code so it works with the net as you describe it.

It is NOT even close to being right when I don't see a collision on my front end, I get a message that says 'xxxx has collided with you', and I die and he doesn't.

If I got the message that said 'you have collided with xxx' I would expect to take damage, but HE hit me on HIS front end (and was not damaged)according to your explanation...I did not hit him on mine.

No bullets were fired.

I didn;t hit debris......and anyway HT says debris collisions do not cause damage, only noise.......and I didn't hear any noise.

Bottom line:

 If you get the message that says "YOU have collided with XXX"  then you should get the damage or more damage than the person YOU hit.

 If you get the message "XXX has collided with you" then HE should get the damage or a lot more than you get.

Too many people in the MA are using the current collision model to purposely ram people when they are out of ammo (where the guy you hit dies and maybe you live).  Yes I know it really happened in real life......but this is a GAME....let's be fair to everyone


Sorry guys but this is one topic that gets me on my soapbox.

Offline Saxman

  • Plutonium Member
  • *******
  • Posts: 9155
FE & collisions etc.
« Reply #13 on: May 02, 2006, 09:30:23 AM »
*Head explodes*
Ron White says you can't fix stupid. I beg to differ. Stupid will usually sort itself out, it's just a matter of making sure you're not close enough to become collateral damage.

Offline Tilt

  • Platinum Member
  • ******
  • Posts: 7357
      • FullTilt
FE & collisions etc.
« Reply #14 on: May 02, 2006, 12:36:15 PM »
Quote
Originally posted by Docc

Too many people in the MA are using the current collision model to purposely ram people when they are out of ammo (where the guy you hit dies and maybe you live).  Yes I know it really happened in real life......but this is a GAME....let's be fair to everyone

 


If you try this you will find it only (really) possible when in HO.

But your lag (whilst not contributing to rams directly) is so high that enemy manouvres to avoid ramming will appear to be carried out far too late.........

Also your enemy may seem to be getting hits on you when quite often the angle seems all wrong..............

Quote
If you get the message that says "YOU have collided with XXX" then you should get the damage or more damage than the person YOU hit.

If you get the message "XXX has collided with you" then HE should get the damage


This is how it works...................


Smoothing....................

There is a lot of discussion and assumption about smoothing code...........

I have never seen any AC sim publish how its smoothing code works or what it is written to achieve...............infact these folk seem to keep such cans of worms sealed and not open for inspection.

I have never seen it admitted that it predicts (how can it?) flight paths or locational data of the many dots that can be in the air around us at any one time.

As aircraft come closer to us the "update" rate for that icon increases...smoothing may fill in the gaps but once we are in close contact the update rate is so frequent that joining the dots will always present a fairly smooth curve made up of short straight lines. However in rapid changes or direction even an instant shift of 5 degrees can look wierd..this transition of attitude must be smoothed to generate a smooth flight path.

It makes sense to me that the rendering of the "attitude" of other aircraft flying through the air may require smoothing to ensure they point in the proper direction and bank at the proper angle etc etc and that transition from one location to another is accompanied by smooth transition of attitude.

This can be done on our FE's which is where the bulk of all code is most efficiently carried out. They are rendered with respect to the position we "see" them and as such their attitude is rendered and smoothed with respect to ours.

Untill I see other wise I will tend to believe that the bulk of "smoothing code" is predominently to do with attitude.
Ludere Vincere