Empires 2.51 Released!

Discussion in 'News' started by Trickster, Jun 22, 2014.

  1. ImSpartacus

    ImSpartacus nerf spec plz

    Messages:
    8,598
    Likes Received:
    7
    Trophy Points:
    0
    Then that's not a new feature. It's just a different way to achieve what we already have at the present.
     
  2. flasche

    flasche Member Staff Member Moderator

    Messages:
    13,299
    Likes Received:
    168
    Trophy Points:
    0
    add spread? veryvery small random rotation around x, random 2pi around z.

    or out of interest, how does valve do it for small arms?
     
    Last edited: Jun 29, 2014
  3. ImSpartacus

    ImSpartacus nerf spec plz

    Messages:
    8,598
    Likes Received:
    7
    Trophy Points:
    0
    We already have that.

    Vehicle weapons have a "projectile spread" parameter. The parameter becomes the max yaw & pitch angle for the projectile. The actual angle is generated from uniformly random variables between 0 and the parameter for both yaw & pitch.

    It's not exactly what you're suggesting, but from my chats with Candles, it's much easier to code because you don't have to worry about your radial angle & normal angle being identical to that same radial angle + pi & -1 * that same normal angle.

    In short, it uses a square pyramid, not a cone.
     
  4. flasche

    flasche Member Staff Member Moderator

    Messages:
    13,299
    Likes Received:
    168
    Trophy Points:
    0
    so why is trickster panicing about missiles going straight then?
     
  5. Candles

    Candles CAPTAIN CANDLES, DUN DUN DUN, DUN DUN DUN DUN.

    Messages:
    4,251
    Likes Received:
    10
    Trophy Points:
    0
    Because of how interpolation works (it's easier to just change the direction of the missile over a period of time instead of randomly adding a few degrees every X number of units), over a long distance, it would end up being not particularly inaccurate. because randomness canceling randomness.

    I absolutely hate things like integrating over a square instead of a circle. But Jesus fuck it's so much easier make a square in code than a circle for distribution. Squares, you just take add a random value for pitch and a random value for yaw. But for a circle, you'd have to take a random value for either the pitch or yaw, subtract that from 90 to find the angle, then scale that by a random value for the radius.

    Actually, now that I think about it, that's still piss easy :/

    You should've reminded me; it's a change that takes all of five minutes to implement.

    Well, I say "takes", but I should've said "took" because I already did it. It took about five minutes.

    Cannon recoil works by adding 1/20th of the damage a cannon does to the angle of the barrel. I've now changed it so if a cannon has a value for "recoil" set to -1, it'll use that still, but if it's set to another value, then that'll be the recoil per shot. Obviously, setting it to 0 will give no recoil.
     
  6. Beerdude26

    Beerdude26 OnThink(){ IsDownYet(); }

    Messages:
    7,243
    Likes Received:
    13
    Trophy Points:
    0
    Dat drunkard's walk
     
  7. ViroMan

    ViroMan Black Hole (*sniff*) Bully

    Messages:
    8,382
    Likes Received:
    4
    Trophy Points:
    0
    You cant just pre-compute a missile trajectory adding random changes every X distance units. Shoot it out and have it follow that path while watch for impacts?
     
  8. flasche

    flasche Member Staff Member Moderator

    Messages:
    13,299
    Likes Received:
    168
    Trophy Points:
    0
    why do you want random changes over time? if v0 isnt perfectly aligned (aka randomly offset) to what your xhair suggest you wont hit each time either.
    and if you add the same randomness over and over you get a random walk, as candles said previously, meaning over enough frames you have no deviation at all.
     
    Last edited: Jun 30, 2014
  9. Trickster

    Trickster Retired Developer

    Messages:
    16,576
    Likes Received:
    46
    Trophy Points:
    0
    Surely you have just enough chance that the thing ends up pointing into the sky after 1000 units as you do that it stayed arrow straight. That's the point of random as far as I know. It's inaccuracy but it's a random kind of inaccuracy that allows for someone to be very unlucky, or very lucky. That's cool brah.
     
  10. flasche

    flasche Member Staff Member Moderator

    Messages:
    13,299
    Likes Received:
    168
    Trophy Points:
    0
    its no point in discussing implementation anymore anyway since candles did it right already - whod have expect anything else - its a good enough abstraction and the fastest of all suggested, plus its piss easy to weight x and y differently and even have the centerpoint shifted.
    in the end its just about imprecision (a deviation of v0's angle) and not about simulateing turbulence or whatever you try to archieve with continueing randomness ...

    if you want change over time only add up vectors where direction doesnt change suddently like gravity or wind.

    edit:
    anyway, wouldnt kickback - even for missiles be an even better solution - it would mean you can be precise if you just spend enough time to aim.
     
    Last edited: Jun 30, 2014
  11. ImSpartacus

    ImSpartacus nerf spec plz

    Messages:
    8,598
    Likes Received:
    7
    Trophy Points:
    0
    If you're hell-bent on that, then ask Candles to change the existing angle distribution from uniform to normal (or add a parameter that lets you specify distribution! /nerdgasm).

    That would literally be effectively identical to what you previously suggested. I wasn't kidding when I said it was a tiny nerdy tweak from the existing system:

    I'm still surprised that you care, but if you do, then it's not a big deal to make it happen.
     
    Last edited: Jul 1, 2014

Share This Page