[Multiplayer ARPG] Yet Another Scripting Performance Update

Published by May 19, 2017 11:21 pm Leave your thoughts Category:

Nothing new to post. Premature optimization is the bane of many programmers, and I happen to fall victim of it. I understand the circumstances though, so maybe it’s not too big of a problem and perhaps even beneficial. If my game isn’t running smooth with thousands of monsters chasing hundreds of players around, I’m not happy.

Anyways, I’m moving away from Lua in favor of a CSScript, a C# scripting system. From initial tests, CSScript will be much faster and way more efficient than any Lua/Python/interpreted scripting system. With MoonSharp or NLua the numbers of monsters executing AI would have been limited to perhaps 500-1000 per server, and it would have been eating up a lot of frame-time and allocating lots of garbage, resulting in the GC to run often. This would be fine if I intended for each server to host just a handful of players (100 or less), as I can optimize in other ways such as processing only monsters who are within line of sight, but I just don’t like the idea of being restrained in such a way. What if someday I want each server to handle 500 players and 5,000 monsters, essentially allowing each player to fight 1,000 monsters at a time? That would be insane. These are just random numbers I’m tossing out here, I’m not sure what the capacity of each server might actually be.

Leave a Reply

Your email address will not be published. Required fields are marked *