Search Unity

Feature Request Quick option to start up in regular DOTS vs Netcode [PlayMode Tools] & SubWorlds

Discussion in 'NetCode for ECS' started by Krooq, Jan 5, 2022.

  1. Krooq

    Krooq

    Joined:
    Jan 30, 2013
    Posts:
    196
    I have an ICustomBootstrap set up to start my game without the client and server worlds however it needs to use the ExplicitDefaultWorldSystems list so that rendering isn't included in the default world of my game when "offline" e.g. in the main menu.

    Often I want to do some prototyping in a scene without any Netcode before actually creating ghosts and whatnot.
    It would be nice to have an option to easily do this, e.g. maybe in the play mode tools.

    Currently I'm just changing the ExplicitDefaultWorldSystems to DefaultWorldSystems in my custom bootstrap which seems to work but it seems like a bit of a crappy hack.

    I imagine 99% of games are going to have this configuration, where there are 3 distinct modes
    - Default (e.g. Main Menu, regular ol game/application stuff)
    - Client (e.g. Connected to a server, would want a separate World that is tied only to that connection)
    - Server (e.g. Hosting a game or even just running a game instance "offline")

    I've mentioned this previously but it would be really nice to have "sub-worlds", where you can dispose of a world that is just a subset of a much larger world. In this example, Client and Server would just be SubWorlds of the Default world and there would be no need to fiddle around with moving state across world boundaries.
    It would also prevent the duplication of systems which would probably eliminate this problem in first place.

    In any case, hoping that some time can be spent improving the World workflow of Netcode before 0.5, I don't think it would require much effort to code up something as simple as a default custom abstract bootstrap for this pretty common use case.
     
  2. NikiWalker

    NikiWalker

    Unity Technologies

    Joined:
    May 18, 2021
    Posts:
    316
    Hey krooq, appreciate the feedback. We have both short and long term plans to improve everything discussed.

    0.5 contains improvements to NetCode bootstrap workflows to allow things like main menus. We have a sample for that now too, although not yet sure if that's shipping with 0.5 or after. Will find out shortly.

    However, explicit singleplayer support (i.e. write one bit of gameplay logic that works in both singleplayer and multiplayer) will come later. It's planned, and selecting it via the playmode tools window will almost certainly be the workflow.

    The explicit idea of "sub-worlds" isn't planned, but we have various ideas to solve singleplayer in a "performance by default" way. LMK if this addresses your concerns.
     
    Occuros and Krooq like this.
  3. Krooq

    Krooq

    Joined:
    Jan 30, 2013
    Posts:
    196
    Sounds great! Thanks for reaching out Niki :D