TUXDB - LINUX GAMING AGGREGATE
by NuSuey
NEWSFEED
▪️ GAMES
▪️ STEAM DECK ▪️ DEALS ▪️ CROWDFUNDING ▪️ COMMUNITY
tuxdb.com logo
Support tuxDB on Patreon
Currently supported by 8 awesome people!

🌟 Special thanks to our amazing supporters:


✨ $10 Tier: [Geeks Love Detail]
🌈 $5 Tier: [Arch Toasty][Benedikt][David Martínez Martí]


Bug Hunt: Fixing Combat AI

The latest Airships update fixes a bug in the combat AI for ships. It was a rather weird and stupid bug, and so I'd like to tell you about it. I hope to entertain you and also give you a view into the game development process. There were a lot of reports of the combat AI being very incompetent when trying to attack buildings, especially from close range. Ships would just float around unmoving instead of closing in and bringing their weapons to bear. So I set about reproducing this problem, which turned out to be rather easy. I set up a combat of an AI grenade bomber versus a building, and the bomber completely failed to position itself.
I will explain the cause of this in a moment, but I first have to get into the detail of how combat AI works. Its main function is to evaluate possible positions for the ship to move to. For each position, it looks at how much damage it can deal from there and how much enemy fire it's exposed to. Some positions it can't get to, because something's in the way, or because they're above its service ceiling.
The other mildly confusing thing I need to mention is how the y-axis in the game's coordinate system works. It points downwards, so ships with a higher y-coordinate value are further down. And the zero point is at about 70 metres above ground. Not the most sensible way of doing things, but it just evolved that way.
I have a convenient debug view in the game that lets me see the combat AI's evaluation of all the positions it considers. In the case of the combat of the bomber versus the building, I could instantly see that it marked all the positions near the ground as unreachable. All the positions with y-coordinate greater than zero. At this point I had a pretty good idea of what was going on. The culprit was an obscure module type value called aiMaxY. This value is used to tell the monster AI to not move too far down, because it looks weird. For example, it prevents the Aerial Jelly, which is meant to hover above your ships and attack like that, from moving all the way to the ground.
aiMaxY is set to 10000 by default, going all the way into the ground. But by looking at the debugger, I could see that the bomber's aiMaxY was actually set to 0. So the AI considered all positions where y was greater than 0 as invalid. Now I just needed to figure out why the value was at 0 instead of 10000. The culprit there turned out to be flipped modules. The information for flipped versions of modules is derived automatically from their un-flipped counterpart. The game does this by copying all the information and adjusting it where needed, making firing arcs point the other way, mirroring the graphical appearance, and so on.
But I had forgotten one line in this code. It didn't copy over the aiMaxY value, and instead left it at 0. So all flipped modules would tell the combat AI to not take the ship beyond y = 0. Any airship with a flipped module had broken AI. Which was many but not all of them, making the bug appear inconsistently. The fix was painfully easy: add that line to copy over the aiMaxY value for the flipped module. And with that one change, the AI started behaving much better!


[ 2018-09-12 14:55:30 CET ] [ Original post ]



Airships: Conquer the Skies
David Stark
  • Developer

  • David Stark
  • Publisher

  • 2018-08-16
  • Release

  • Action Indie Strategy Singleplayer Multiplayer
  • Tags

  • Game News Posts 306  
    🎹🖱️Keyboard + Mouse
  • Controls

  • Overwhelmingly Positive

    (5250 reviews)


  • Review Score

  • http://www.zarkonnen.com/airships/
  • Website

  • https://store.steampowered.com/app/342560 
  • Steam Store

  • The Game includes VR Support



    Airships Linux 53 [139.2 M]Airships Linux 64 [545.79 M]

  • Public Linux depots

  • Airships: Conquer the Skies - Soundtrack
    Airships: Heroes and Villains
  • Available DLCs

  • Design steampunk pixel airships out of functional modules and conquer the skies!

    In the game, ships are viewed side-on, and their modules are operated by individual crew members. During combat, players give high-level commands to a small fleet, positioning their ships, ramming and boarding others. Ships and terrain are fully destructible: they can catch fire, explode, break apart, and fall. Players can also compete against one another in Internet and LAN matches.

    The ships are highly detailed, teeming with sailors moving around at their individual tasks, like an ant farm or a cut-away drawing. The player's choices in ship layout are crucial, and an important part of the game is exploring the design space of different airships and their matching tactics.
    MINIMAL SETUP
    • OS: Ubuntu/Debian/Mint
    • Processor: 1.8 Ghz+Memory: 256 MB RAM
    • Memory: 256 MB RAM
    • Graphics: 1 GB VRAM+
    • Storage: 1 GB available spaceAdditional Notes: Not currently compatible with Intel HD graphics controllers. May run on other Linux distros. but no guarantees.
    RECOMMENDED SETUP
    • OS: Ubuntu/Debian/Mint
    • Processor: 2.2Ghz+ Dual-coreMemory: 2 GB RAM
    • Memory: 2 GB RAM
    • Graphics: 2 GB VRAM+Network: Broadband Internet connection
    • Storage: 1 GB available spaceAdditional Notes: Not currently compatible with Intel HD graphics controllers. May run on other Linux distros. but no guarantees.
    GAMEBILLET

    [ 5166 ]

    13.19$ (12%)
    12.27$ (18%)
    1.60$ (90%)
    16.57$ (17%)
    26.39$ (12%)
    16.89$ (16%)
    8.25$ (17%)
    33.19$ (17%)
    9.89$ (34%)
    0.50$ (90%)
    11.43$ (12%)
    2.00$ (90%)
    26.39$ (12%)
    16.52$ (17%)
    17.39$ (13%)
    4.12$ (17%)
    3.29$ (18%)
    1.50$ (75%)
    15.90$ (20%)
    3.75$ (75%)
    16.97$ (15%)
    4.12$ (17%)
    33.59$ (16%)
    25.79$ (14%)
    6.25$ (75%)
    16.79$ (16%)
    4.97$ (17%)
    15.99$ (20%)
    2.00$ (80%)
    12.00$ (45%)
    GAMERSGATE

    [ 1903 ]

    2.63$ (62%)
    1.5$ (85%)
    6.75$ (66%)
    8.8$ (65%)
    1.19$ (83%)
    1.31$ (81%)
    5.63$ (77%)
    0.56$ (81%)
    1.88$ (81%)
    1.31$ (81%)
    4.5$ (77%)
    3.67$ (47%)
    7.49$ (63%)
    5.06$ (66%)
    0.3$ (92%)
    6.74$ (55%)
    1.31$ (81%)
    0.56$ (89%)
    0.68$ (83%)
    7.5$ (81%)
    1.84$ (74%)
    0.51$ (83%)
    0.66$ (87%)
    11.24$ (63%)
    1.13$ (92%)
    0.38$ (92%)
    0.53$ (92%)
    1.58$ (77%)
    1.91$ (89%)
    6.8$ (66%)

    FANATICAL BUNDLES

    Time left:

    3 days, 14 hours, 13 minutes


    Time left:

    26 days, 14 hours, 13 minutes


    Time left:

    8 days, 14 hours, 13 minutes


    Time left:

    39 days, 14 hours, 13 minutes


    Time left:

    45 days, 14 hours, 13 minutes


    HUMBLE BUNDLES

    Time left:

    6 days, 8 hours, 13 minutes


    Time left:

    6 days, 8 hours, 13 minutes


    Time left:

    15 days, 8 hours, 13 minutes

    by buying games/dlcs from affiliate links you are supporting tuxDB
    🔴 LIVE