AI Offloading

    Lone_Puppy

    Me, myself and I.
    Joined
    Mar 12, 2015
    Messages
    1,274
    Reaction score
    529
    • Purchased!
    • Community Content - Bronze 2
    • Legacy Citizen 8
    Hi schema and Schine,

    Just reading the thread "AI Learning Curve" by Dearthx about his idea for AI learning curve.
    AI Learning Curve

    It reminded me of something I've always wanted to do with online games and that's have an AI that plays as a player.
    Then I thought, this could be useful for Starmade, because you wouldn't need to dedicate so many resources to the server.
    All the server would need to worry about is the basic physics and object locations etc which is what it's really good at.

    The idea would be to off load the AI processing to an alternative server or servers that connect via port 4242 or perhaps an alternative port like 4343 or something.
    The same port would simplify things, but an alternate would lower latency for actual players and also allow for better security and management around AI.
    You could also use this separation in game to ID a player vs AI more easily.

    Benefits

    • off loading would lesson the bourden on the server
    • AI would be mostly experiencing the server like a player
    • server owners could spin up/down additional AI servers as required without altering or interferring with the universe.
    • This would also allow Faction birth, growth, death like any player faction at any time in the life of the server.
    • Server install simplified for those who only want to build a player only universe with no AI.
    • AI Server component modular and extensible from a logical and physical perspective
    • Moduler AI servers would allow you different types of AI including specialisation and server admin customisation.
    • Also opens up the prostect of player developed AI uploads similar to blueprint uploads, but naturally admin controlled and secured appropriately.
    • Server build and AI build can be managed and worked on independantly by different teams without too much impact to each other
    • Different update streams would be possible with little impact to each other.
    • AI creatures like Fauna/animals could be dynamically spawned on the fly using a different AI server module dedicated to Fauna. This would be way simply in build design to the NPC type AI.


    Caveats

    • Removing all AI code from the game or migrating it to a server based module could be major work.
    • Player AI requirements would need a means to spawn AI to control traditionally BobbyAI controlled systems.
    • This could change the way we use AI in our ships, e.g. turrets, fleets, etc.
    • The AI could be NPC's players instruct/order to enter the core of the entity, ship, turret, whatever or perhaps only enter the BobbyAI modules.
    • Perhaps when a BobbyAI is spawned in build mode, the actual AI is spawned on the AI server, then connects to the universe and is physically linked to the BobbyAI module with some kind of ID kinda like linking warp gates.
    • And for it's life time, it exists inside the module until the module is removed/destroyed or it is ordered into another BobbyAI such as build changes or updates. At that point the AI would pop out as an NPC that reverts to existing NPC style behaviours perhaps. Like if it was in charge of a turret and was set to take out missiles, the NPC would pull out his pistol and start shooting missiles until it is killed.
    • This means, the AI server would need to have more information provided to it by the universe than what a player would receive.
    • Secure communications methodologies between AI and Universe servers would be required.

    I know this sounds complicated, but I believe this could ultimately simplify the game development where those who only want work on the mechanics of the universe versus AI can do just that without the other being dependant or impacted by anything from the other.
     

    Lone_Puppy

    Me, myself and I.
    Joined
    Mar 12, 2015
    Messages
    1,274
    Reaction score
    529
    • Purchased!
    • Community Content - Bronze 2
    • Legacy Citizen 8
    Bumping this again, with the new universe on the horizon.
    Theoretically, you could strip out all the AI code in Starmade and move it to a separate process that talks back to Starmade via TCP port.
    The data transfer would consist of all the normally chatter within the server, but instead over secure TCP comms.
    That way, you could then develop NPC AI separately with little or no lagg problems due to processing AI.
    If the AI component has a processing issue within itself, you would see the typical scenario you see with a player where their avatar either freezes or disappears without affecting the server and everybody else. NPC's would be essentially bot players.

    If bot players is something to be feared, all it would take is safeguard controls or a management tool or tools in the server. Much the same way we manage unruly players, you could have a system in place to manage unruly NPC's, e.g. Banning, limiting numbers, privileges, etc.

    I dream of the day I can enter a server with my NPC AI buddies in tow. They run on separate PC's and we rock on into the server to wreak havoc on the fellow players and their NPC's not to mention the NPC's provided by the server operator owners. ;-)
     
    • Like
    Reactions: MacThule
    Joined
    Mar 23, 2018
    Messages
    114
    Reaction score
    75
    I thought the "software meta" is to push the most of computing work to the clients and keep server as free of load as possible without allowing too many exploits. Exploits do tend to appear in mass when server does not check what and how does the client compute. But ideally, the game would be a peer-to-peer connection with server just re-sending to whom needs it what others send to the server and computing nothing by itself.

    Now, are you sure an idea of increasing the load of SM servers to the point when they need a second server for the same game is a good idea?
     
    Joined
    Feb 10, 2017
    Messages
    350
    Reaction score
    775
    • Community Content - Bronze 2
    • Legacy Citizen 5
    • Likeable
    I thought the "software meta" is to push the most of computing work to the clients and keep server as free of load as possible without allowing too many exploits. Exploits do tend to appear in mass when server does not check what and how does the client compute. But ideally, the game would be a peer-to-peer connection with server just re-sending to whom needs it what others send to the server and computing nothing by itself.

    Now, are you sure an idea of increasing the load of SM servers to the point when they need a second server for the same game is a good idea?
    Most of the server load is single threaded which doesn't utilize multi core CPU server capacity very well. You have one core sitting at 100% going flat out and all the others doing not much of anything. (You can check this when running your own games, look at cpu utilization on a core by core basis and you'll see most of them doing nothing while one does all the work.) This is why a high GHz quad core is much better then a low GHz 16 core CPU at running your server, (and most other games for that matter.) The idea is to split the AI off so it runs as a 'player' independently from the server process which would mean it could utilize the idle core capacity thereby reducing load on the single server core running the world and make everything rainbows.
     
    • Like
    Reactions: Agame3

    Lone_Puppy

    Me, myself and I.
    Joined
    Mar 12, 2015
    Messages
    1,274
    Reaction score
    529
    • Purchased!
    • Community Content - Bronze 2
    • Legacy Citizen 8
    Now, are you sure an idea of increasing the load of SM servers to the point when they need a second server for the same game is a good idea?
    What I'm proposing would provide a way to remove processing load, either process based on the same server or entirely by introducing an additional server that communicates with the server running the universe. That way, all the universe server has to worry about it the universe along with object tracking etc. It would be almost as if only players are playing in the universe. The difference being, NPC's would have more info/telemetry than players to be able to navigate or interact in the universe more easily. Whether this NPC capability is opened up to outside the servers network or not, would be up to the server owner.
    [doublepost=1528240709,1528240667][/doublepost]
    The idea is to split the AI off so it runs as a 'player' independently from the server process which would mean it could utilize the idle core capacity thereby reducing load on the single server core running the world and make everything rainbows.
    Exactly! :)
     
    • Like
    Reactions: alij331 and Agame3