bot optimizations#45
Open
royal0959 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a client sends a command to the server, that command is encoded on the client then decoded on the server. This is also done by bots whenever they generate a command, however, there's no need for this encoding/decoding process for bots because they pass on their command directly to the server which immediately decodes it. I changed it so that bots pass on their raw command and bypass the decoding which greatly improves performance for each bot
Whenever a player joins or leaves the game,
ServerModule.SendWorldStatewill be ran on every chickynoid character, which goes through every chickynoid character to compile the world data to be sent to each player. However, even for bots which don't have a client,ServerModule.SendWorldStatewill still go through its entire process including iterating through every chickynoid character. This makes it so when the server has a big number of bots, every time a player joins / rejoins there will be a brief drop in server performance due to all the world state data compiling going on for every bot. I've made it so this function doesn't try to compile world state data for bots