[Workaround found] AI does nothing (stuck in idle) ...

Discussion in 'Mac and Linux' started by gav42, January 12, 2017.

  1. gav42

    gav42 New Member

    Messages:
    5
    Likes Received:
    1
    When playing against an AI (single player galactic war or skirmish), they do nothing. they build nothing, they do not move (unless attacked, where they will actually return fire but that's it). Changing the difficulty to absurd does not change their idle behaviour!

    Linux Mint 17.3 64bit (essentially Ubuntu 14.04)

    Appears to be the same issue this user had way back in April 2015:
    https://forums.uberent.com/threads/no-ai-on-linux-while-using-local-server.68651/

    Sure enough, disabling the local server allows the AI to work. At a significant increase in time between pressing "Fight" and first seeing the star system (17 seconds becomes 95 seconds).

    I have included two logs, one with the local server set to "AUTO" (were the AI does not function), and another with the local server set to "OFF" (where the AI works).

    For reference, this issue was originally reported on steam (where I was advised to make a report here):
    (Change hxxp to http)
    hxxp://steamcommunity.com/app/386070/discussions/1/142261352644416087/

    Workaround (as diagnosed in this thread):
    Do not install PA Titans to an alternate directory, ensure steam installs PA Titans only to the default directory (~/.local/share/Steam)

    Attached Files:

    Last edited: January 15, 2017
  2. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,327
    Likes Received:
    2,125
    Does this only occur with Galactic War or does it also happen when playing an AI skirmish?
    Oh, and just to be safe, can you also try verifying the game cache in Steam? https://support.steampowered.com/kb_article.php?ref=2037-QEUH-3335
  3. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    [10:20:49.004] ERROR Error opening 12UnitListSpec spec "/pa/units/unit_list.json.player", file failed to load
    [10:20:49.004] ERROR Failed to load unit list

    As DeathByDenim said, verify the cache. If that doesn't work then launch the server.exe from the bin_x64 folder (assuming Linux uses the same structure) with the --ai-log option appended. This will generate a separate server log (prefixed server-). Join the game, go blow up the AI, then collect the log. It will tell us what the AI thinks is happening.
    Last edited: January 13, 2017
  4. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
  5. gav42

    gav42 New Member

    Messages:
    5
    Likes Received:
    1
    The AI fails to function in both Galactic War and when playing an AI skirmish.

    I verified the game cache; "All files successfully validated".

    As requested, I set up a local server (with the --ai-log option), connected to it (multiplayer), added an AI player (on Absurd), and proceeded to blow up the idle commander. See attached log.

    Attached Files:

  6. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    Was that after verifying the game files?

    eg it looks like following unit specs is not loading from your PA installation directory:
    Is there anything preventing the server executable from opening those files?
  7. gav42

    gav42 New Member

    Messages:
    5
    Likes Received:
    1
    Yes, the log was taken after verifying the game files.

    I checked for the files you mentioned, and there are no permission issues when opening them as the same user running the game.

    Your question got me thinking though ... I am using an alternate directory to install steam games (this is an option when installing a game through steam, and I currently have 24 other steam games installed this way).

    I uninstalled PATitans (and manually blew away any remaining related files), then re-installed to the default Steam directory (~/.local/share/Steam), and this has resolved the problem (I tried a skirmish with an AI, and the commander was off building as it should be).

    So it would appear there is a bug in PATitans on Linux where Steam has installed it to an alternate directory that is not ~/.local/share/Steam.
    cdrkf likes this.
  8. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    Based on the error it's a problem with the AI unit map. The AI files use shorthand which they refer to the AI unit map file to interpret into a unit JSON. The error displayed means they can't find the relevant reference in the AI unit map. I can recreate the problem by deleting my copy.

    /media/pa/ai/unit_maps/ai_unit_map.json

    This file is either missing, corrupt, or inaccessible.
  9. gav42

    gav42 New Member

    Messages:
    5
    Likes Received:
    1
    Sorry, but none of those options appear to be correct.

    I've just run an strace (a Linux utility to trace system calls so I can see file open calls) on the server executable while installed in the default ~/.local/share/Steam directory and again while installed in the alternate directory that I prefer. It never even tries to open "ai_unit_map.json" when installed in the alternate directory.

    I have attached the relevant portions of these traces.

    The trace for the default directory: stats the "unit_maps" directory, opens "ai_unit_map.json" and several other json files before stating the "platoon_templates" directory.

    The trace for the alternate directory: stats the "unit_maps" directory, then immediately moves on to stat the "platoon_templates" directory without even attempting to open any of the json files. Any attempt to open a file that was missing or inaccessible would have been seen here with an "ENOENT (No such file or directory)" error.

    Attached Files:

  10. Quitch

    Quitch Post Master General

    Messages:
    5,853
    Likes Received:
    6,045
    Whatever is causing it to not open ai_unit_map,json is the issue. The errors seen in your log only occur when it can't get to that file, or find the entry it's looking for in it. The root cause could be deeper, some other file it calls first to open ai_unit_map.json which it can't reach, but its inability to get to that file for whatever reason is the issue.

    I'm afraid I don't know enough about Linux to be much more help, but something is clearly borked with either your system or your install.
  11. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    Will add alternate install location on steam linux to my list and wiki.
  12. gav42

    gav42 New Member

    Messages:
    5
    Likes Received:
    1
    Thanks for your help mikeyh.

    I have updated the title and original message to indicate the workaround for others who may stumble across this one.

Share This Page