Make AMS pre-calculated

    Discussion in 'Suggestions' started by Nosajimiki, May 15, 2018.

    ?

    Good idea?

    1. Yes

      9 vote(s)
      60.0%
    2. No

      6 vote(s)
      40.0%
    1. Nosajimiki

      Joined:
      Sep 14, 2017
      Messages:
      667
      So, Weapons 3.0 brought use some serious projectile speed optimizations, which are pretty cool, but in the process, AMS seems to be broken. My first assumption was that this was just an issue with AI not working, but based on various observations, I believe it is a side effect of how fast things are. Turrets often do not seem to be able to track fast enough to follow a missile, and even if they could, there is the secondary issue of lag displacement being massively amplified at higher speeds.

      What this means is that in the past, if X amount of lag would cause a cannon's trajectory to have +/- 2m margin of error, with things moving 10x as fast, that same amount of lag creates a +/- 20m margin of error making everything miss wildly.

      The idea here is to make AMS a pre-calculated hit/miss probability rather than follow true intercept physics. Instead of cannon-cannon turrets being AMS, make a new weapon primitive called AMS that will fire at missiles (and maybe mines?). It would look like a cannon-cannon or possibly a beam, but instead function very differently. Basically, if a missile is within its gimbal area, you just calculate a chance to hit based on how far away it is... you either hit, or you don't. With bullets and missiles both flying around at mach-26, no one is going to actually be able to tell if those bullet graphics are actually hitting the missiles or not anyway.

      Appart from fixing the accuracy issues, this should also see a massive improvement in game performance since you only need to calculate to hit once between one output and one missile instead of having to run continuous hit tests for as long as each bullet is in the air.

      [EDIT] After further consideration, I feel a specialized weapon block is likely unnecessary. This behavior could instead be initialized by the AI as an alternate behavior when firing at blockless entities: missiles, bombs, mines, etc.
       
      #1 Nosajimiki, May 15, 2018
      Last edited: May 16, 2018
      • Like Like x 5
    2. petlahk

      Joined:
      Jul 30, 2013
      Messages:
      191
      First off. Schema himself has said that it wasn't a tracking issue but an issue with the missiles having glitched-high health. Meaning the missile HP was so high the AMS couldn't kill them. This has been fixed.

      Secondly. No. Just no. This is a terrible idea I'm sorry. I respect you Nosa, I love lots of your ideas, but not this.

      AMS turrets do fine. They track fine. And As far as I can tell in my tests they were hitting just fine under the new weapons update.

      Doing some sort of silly calculation with a new block is gonna take up and ID with a really silly block when that was being handled just fine by AMS turrets, and I don't think this would actually lead to any significant optimazations at all. In fact, I think it would just make it worse.

      For Schema to do this he would also have to write an entirely new bit of code to do just this. which is really silly when the AMS turret system works just fine.

      Also. If you do this then there is absolutely zero point to designing different types of AMS turrets and could very easily lead to a scenario where these things are just AoE AMS despite your gimbal bit.

      Also, a probability system, seriously? That's just a hidden dice-rolling game beneath the surface. That isn't fun. That doesn't have any design choices like where to put the turrets associated with it. That doesn't have any choices related to what turret to use associated with it. What if I wanna use a fast tracking beam turret as my AMS and have it double as an anti-fighter weapon?

      Just no. So much no.
       
      • Like Like x 4
    3. CockADoodleDoo

      Joined:
      May 14, 2018
      Messages:
      22
      I categorically disagree. AMS has always been unreliable after the first few seconds of the engagement. Just because the system "works" doesn't mean it works well. A CTH based system would be an excellent improvement over the current system, which works about as long as it takes dumbfire distractors to enter the AI's engagement range.
       
      • Like Like x 2
    4. MacThule

      Joined:
      Jan 31, 2015
      Messages:
      1,575
      I haven't tested AMS in 3.0 yet, but it's an interesting proposal.

      I like the idea on the basis that it would improve performance. I dislike it in that I see PD as applying to all entities incoming towards a point target, be they missile, rocket, mine, bomb, bomber or fighter and that a block just for AMS seems overspecialized. Kind of a wash for me.
       
      • Like Like x 1
    5. Dire Venom

      Joined:
      Feb 27, 2014
      Messages:
      1,062
      Some interesting ideas.
      Perhaps when missiles have had their makeover point defense can get an update as well.
      I recall Missiles getting proper HP values and other changes to make them more durable.
       
      • Like Like x 2
    6. Nosajimiki

      Joined:
      Sep 14, 2017
      Messages:
      667
      So, the more I think of it, you are right that it does not need a new block, but everything else about your response comes from a lack of experience building physics engines or any direct experience with the StarMade engine when put under stress. In theory, one could use a "fire-at-missiles" flag on a normal cannon turret to create an exception that initiates pre-calculated shots based on the chosen target so that you could maintain some level of multi-role functionality.

      That said, AMS do not, nor have they ever tracked fine when the game is under a heavy load. Tests so far where 1 missile fired between a couple of small ships just sitting there do not reflect what the game looks like when you have 5-20 million blocks worth of ships on the board with hundreds of missiles and thousands of direct fire weapons popping off at once. As the sim rate falls, margins of error increase, and they will just plain stop hitting missiles at all as was often the case in power 1.0 battles. This ability to overwhelm the game engine was a big part of why missile spam was so popular and cancerous.

      As for calculations, the optimization that happens with pre-calculated shoots is a compounding advantage over time on a way simpler formula. It is the difference between checking every bullet and missile for collisions every single sim cycle which beings to slow the game down at just a few thousand bullets per second vs a one time calculation that a would take hundreds of millions of shots a second to create any noticeable lag.

      Also, precalculated shots are resistant to other sources of lag because margins of error do not apply. A 15% chance to hit will always be a 15% chance to hit, no matter how much the battle turns into a slideshow war.

      As for dice rolling, that is already what the game is doing, but it's using a LOT of math to produce a very simple result. The problem is that the dice become weighted based on factors unrelated to your ship's design. As long as the factors of accuracy are set right, this mechanic would be indistinguishable from a hit-test mechanic, but without breaking under lag.

      As for AoE, you can still do a raytrace to confirm Line-of-Sight, and the gimbal would not be any different than a cannons already existent ability to do this. Just like the dice rolling issue, this mechanic would be indistinguishable from current mechanics.
       
      • Like Like x 4
    7. Nosajimiki

      Joined:
      Sep 14, 2017
      Messages:
      667
      Technically, current AMS is not this versatile; bombers and fighters are not targeted by Fire-at-Missile turrets and almost never get hit by stray shots since they have such inherently small profiles. Missiles, Rockets, Mines, and Bombs should all be considered for this mechanic, since they are not voxel entities. The only factor that matters is if you hit them, and not how you hit them.
       
      • Like Like x 3
    8. Nebulon-B_Frigate_FTW

      Joined:
      Jul 4, 2013
      Messages:
      415
      I think that there should just be a system so AI firing at fast targets with cannons/beams gets pre-calculated impacts with the game faking the projectiles flying there.
      You should still be able to manually shoot missiles down and it shouldn't be a separate weapon type as then we'd lose the style of awesome PD lasers (like the blue ones on Zahn Consortium corvettes from Empire at War's expansion) or Battlestar Galactica anti-missile flak.
       
      • Like Like x 1
    9. EricBlank

      Joined:
      Jul 1, 2013
      Messages:
      428
      I like the idea of saving performance through a calculation like this, and in canon on my vessels ams is handled by laser emitter domes on the surface not cannon based turrets so i wouldnt complain much if something like that was an option, but i do see pd turrets as being important to the game and should continue to function.

      I do have to question how you claim lag affects ams accuracy, as both the missile and ai turret are tracked and controlled server-side, right? Latency is a huge problem for players, but i dont see how the server can mess up so badly it forgets where it put that other part of itself (the missile) in a function (tracking and firing at that missile) that calls on that parts location and such
      And schema did confirm its a hp issue anyway as i recall, not one of accuracy
       
    10. Fays

      Joined:
      Jan 17, 2017
      Messages:
      40
      Question 1: are you using default Ai accuracy settings? if no, what is it set to?
      Question 2: I build 3x3x2 AMT's that have dealt plenty well v.s swarming heats, so I'm curious about your configuration; are you using a single or double barrel AMT?

      In not having any issue with AMT-Ai after 'sciencing' different configurations, I can't see a need for AMT change.
       
    11. Valiant70

      Valiant70 That crazy cyborg

      Joined:
      Oct 27, 2013
      Messages:
      2,176
      At the heart of it, this is just another optimization. It reduces glitchy behavior and improves performance. If Schema took the time to do this and do it WELL, then it could be a good addition.
       
    12. dwwojcik

      Joined:
      Jun 22, 2013
      Messages:
      196
      I'm not in love with this idea, but one major benefit that occurs to me is that we could have the option of using beams for anti-missile systems as well as regular cannons. If cannons are given a set chance to miss in the abstracted simulation, beams could be as well. This is important because an array of missile-killing beams would look cool as shit, assuming the abstracted ams doesn't lose the visual animation fully simulated ams has.

      I don't think that's the only option to make beam ams fair, but it would be an easy way to do it as long as you were at it.
       
      • Like Like x 1
    Loading...