ML fire's way left (2.7.0)

Discussion in 'Feedback' started by JustGoFly, Mar 9, 2016.

  1. flasche

    flasche Member Staff Member Moderator

    Messages:
    13,299
    Likes Received:
    168
    Trophy Points:
    0
    only wanted to add - if you do what i said, which you probably wont anyway (i only deduce from that all our previous devs have been frightend about raycasting), you will need an offset totalling to one missile-diameter if you have more than one rocket pod or the rockets will collide a short distance before they hit target.

    you btw could do something similar for BE-dual cannons only that you calculate trajectory instead of a raycast (while assuming the impact being at the same height as the tanks origin). the trap here is that you can fire at lower positions, so you need a slightly bigger offset to compensate.

    or you could have it precise, but calculating the whole path considering collisions would be costly - but you could discretize the curve to a bearable level, you dont need traveltime*fps positions, the angle change over 10 frames should be small enough to have only traveltime*6 positions (assuming a 60fps server resolution) or even less. but for long shots it could still be a few hundred raycasts.
     
    Last edited: Mar 11, 2016
  2. Thexa4

    Thexa4 Developer Staff Member Moderator

    Messages:
    304
    Likes Received:
    98
    Trophy Points:
    0
    The code actually did contain a raycast to compensate for it and it will probably be added again. Unfortunately the previous implementation had problems with the situation you're describing.

    Offsetting cannons to compensate for gravity is an interesting idea. It can probably be done with a single trace. Not sure if it will feel right.
     
  3. Smithy

    Smithy Developer Staff Member Administrator

    Messages:
    333
    Likes Received:
    68
    Trophy Points:
    0
    I did find that you can add entities by their collision type to a trace filter. So we could implement a similar system to what used to be implemented and filter out entities using the projectile collision type. This way the traces pass through the projectiles, eliminating the dual cannon issue.
     
  4. flasche

    flasche Member Staff Member Moderator

    Messages:
    13,299
    Likes Received:
    168
    Trophy Points:
    0
    what you mean by single trace?
     
  5. Thexa4

    Thexa4 Developer Staff Member Moderator

    Messages:
    304
    Likes Received:
    98
    Trophy Points:
    0
    You could use the previous trace, estimate the travel time and adjust the angle so it'll drop the right amount to hit the crosshair. Then you don't need to actually trace every step of the estimated path.
     
  6. flasche

    flasche Member Staff Member Moderator

    Messages:
    13,299
    Likes Received:
    168
    Trophy Points:
    0
    i still dont get it ^^

    are we still talking about re-aligning the barrels based on the range at a given upwards aim angle?
     
    Last edited: Mar 18, 2016
  7. Neoony

    Neoony Member

    Messages:
    1,370
    Likes Received:
    106
    Trophy Points:
    0
    wait, wait...were things adjusting direction to the crosshair and its range before?
    So that missile would have different direction based on the range you are aiming at, so that it would always hit the middle of your crosshair wherever you aimed at.
    I thought I remember something like that, just wasnt sure if I dont confuse it from other games or something.
    Or Iam just misunderstanding?

    Still, the crosshair does change its placement, so it seems like something like that was a thing. (or I guess thats only somewhat correct for close cannon shots)
    Just those tests I did few days ago seemed like thats not true, so now Iam not sure if it was a thing in empires or not.

    anyway, if I get it right...for missiles sure, but for cannons? please no

    whats the problem with dual cannon anyway?
     
    Last edited: Mar 11, 2016
  8. Smithy

    Smithy Developer Staff Member Administrator

    Messages:
    333
    Likes Received:
    68
    Trophy Points:
    0
    It used to work like this:
    When you fire your weapon it runs a trace to get the end position (This is where your cursor is.) , then it fires the projectile toward that position from the weapon attachment point on the tank.
    The problem with this is that the implementation used to use the cannon1 attachment point for all weapons. (It still does on tanks with only 1 cannon slot.)
    Because of this it caused issues with weapon traces hitting the first projectile fired, and it would calculate the angles wrong for the second projectile to fire.

    One of the changes that was pushed out with 2.7.0 was to make weapons fire straight forward, but this is obviously quite game changing. I've reverted the change and also fixed traces hitting projectiles, but these changes need to be approved and pushed out with a hotfix.
     
    Neoony likes this.
  9. Neoony

    Neoony Member

    Messages:
    1,370
    Likes Received:
    106
    Trophy Points:
    0
    Oh right, so I wasnt wrong when I said the directions were changing to the crosshair, allright.
    Thanks for explanation.

    So thats why when you fired both cannons at the same time, one would fly off somewhere completely else, right?
    I got used to shooting independently anyway, it also has better "time in area" coverage anyway, especially with HE and its splash. It doesnt happen then.
    I always thought it has something to do with the recoil of one of the shots messing with the other or so.
    Unless thats not what you meant by wrong angle for second projectile.
     

Share This Page