[REFERENCE] Creating a game through the API [63180]

Discussion in 'Mod Discussions' started by wondible, February 28, 2014.

  1. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    As of 62519, Game now requires toggle_ready from all players, in multiplayer games. The kick command is also back in the lobby.
  2. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    62857, code observations

    New message set_loading {loading: bool}

    Changes to setting starting planet.
  3. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Neither of those changes seems to be completely mandatory to use though.
    thetrophysystem likes this.
  4. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Thanks, I was about to check that when I slammed in the debugger problem.

    Something is breaking Instant Sandbox... but I can't find out what it is.
  5. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    PA Stats Automatches keep working for the most part, apart from a few random hickups. So dunno what could be wrong.
    thetrophysystem likes this.
  6. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    I.S. failing at update_game_config; the following server_state has no system set.
  7. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    That might be related to the current issues I have with PA Stats where basically shortly before the lobby starts the game it randomly throws bogus army data at me. No idea why. But it's a pain.
    thetrophysystem likes this.
  8. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    The system config was an async issue; if I delay the config, I still get the second blank server state, but saying hello afterwards will get a correctly configured one. I think the issue now may be waiting for system_ready before trying to start the game.
  9. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I am not sure you _need_ to actually wait. I did add in code to wait for the server/client load messages because I mostly had it already from earlier, but automatches did work in most cases even with the unfixed version, which doesn't wait. Might have been a race condition though and since I do the negotiation between the players and stuff it might have just randomly worked out most of the times. You on the other hand setup a single player game, so you're much faster about going through the steps.
    thetrophysystem likes this.
  10. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Yep, firing start_game right away failed. I had to implement the control message (I was never sure (before) whether the sub-parts of server_state were actually separate messages, or just the place that subroutines got stuck) start_game will fail unless sim_ready is true. You were already waiting on that condition, so the change didn't affect PAStats.
  11. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    From glancing at the difs, the game desc/config calls have been replaced with modify_system. Everything is piecemeal now.

    I don't expect to do anything more until tomorrow.
  12. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    updateSettings/modify_settings still there, using it's local object definition. I may have missed dropping enable_lan flag in the earlier version.
  13. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Ton of stuff changed for Galactic. GW in particular could take quite some time to document - set_config call, which takes a bunch new top level fields including GW state, system map, and unit spec overrides that are different for each team.

    Current issue: AI is a player setting, not an army setting. So now you can have AI teamates (but not sharing economy, at least in new_game UI), which ripples through multiple settings, in particular the new add_ai message.
  14. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    It appears that start_game will be rejected if the client isn't finished generating planets (api.getWorldView(0).arePlanetsReady().then)
  15. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Automatches deals fine with the changes as far as I can tell, it waits for the loading process already.
    thetrophysystem likes this.

Share This Page