I’m currently working on a Battlegrounds-style game, and I want to get the combat architecture right from the start.
I know that standard server-side replication is a big no-no because it causes insane network overhead and input lag. I want my combat to feel smooth, snappy, and optimized for 100+ skills without dipping the server FPS or blowing up players’ ping.
Here is what I need help with:
VFX & Animation Replication: What’s the industry standard for this in Battlegrounds games? I’m planning to use UnreliableRemoteEvents to fire data to all clients, but how do you guys handle caching (object pooling) and custom animation replication so players don’t see delayed or glitchy hits?
Skill Architecture: Since the game will have tons of skills, I want to avoid a massive if/elseif mess in a single script. What’s the cleanest way to structure this? Should I use a modular factory pattern with ModuleScripts for both server logic and client visuals?
If anyone has experience with frameworks like BridgeNet2 or ReplicaService for this specific genre, or just a solid boilerplate folder structure, please share your thoughts. Any code snippets or architectural tips would be highly appreciated!
Hey! I have been working on my combat game Combat Legends for a while now so I have some solid experience and a few tips on what you can do to make your combat feel super smooth.
The Client → Server → All Client System
The idea here is the player uses input on the client which then sends that input information to the server. The server verifies if this attack is allowed (State checks/cooldown checks etc) and then if passed fires to every player for each of them to see the skill. Once every user in the game is playing said skill, you have each player replicate an animation onto the attacker and listen to the animation events on said animation to display visuals and sfx.
The animation idea makes combat feel smooth even if the attacker is laggy because the player visualizing the attack is running the skill basically on their client themself. A lot of people don’t do the Client-Server-All Client system because of input lag, but if you have bad ping your going to be lagging anyways, Another thing I personally do is client sided hitboxes. Yes I am aware that these are very exploitable and that’s why you build checks on the server to stop exploitable client hitboxes. Client hitboxes are extremely smooth and I am willing to sacrifice that possibility of cheats so the majority of players get to actually have good combat. But that’s how I do it, client server all client with each client loading the animation locally and playing listening to animation events to display visuals themself.
Im not too sure why you would use unreliable remote events to send visual data unless its extremely frequent and they are not needed for most skills. And never write the whole script logic in a single script. Me personally if I have a skill, I break it up into two separate scripts. A service and a controller. So lets say I have a fireball skill, I would have FireballService which would handle all the server sided aspects of the skill fireball and a FireballController which would handle all the client aspects of the fireball skill. That way it is extremely easy to pin point what goes wrong with a skill, where you can add on and change things. Kinda yapped here but I have found this system to be amazing. Happy Coding!