I am currently making a game with bullets (~100 at any time) with small multiplayer (4 players max) and would like to hear some of your opinions since I’m still fairly new to UE4 and have no experience in networking outside a trivial scale. I have googled a bit and this thread came out which I found some issues the OP encountered in implementing numerous instances of homing missiles.
Some info on my planned projectiles / bullets:
-most will be quite stupid and moves in a straight line;
-most will only stay in the screen of any one player for at most a few seconds, and generally less than 10 in terms of life span;
-the spawn frequency of individual bullets will be somewhat clustered; a close example is the heavy machine gun in Metal Slug (for those who don’t know what it is, a rough estimate is around 50 of them in a 3-4 seconds span).
Since it looks like my projectiles are a lot cheaper than the OP’s who encountered latency problems with 30-40 projectiles, I am wondering if I really need to bear optimization in mind on implementing it or I can get away even if I am doing things in an not ideal way
The most straight-forward way I think of now is to make each shoot request from players a Server RPC who then :
- check for validness (ammo, rate of fire, etc.);
- spawns the replicated projectile with UE4’s built in movement replication;
- call a NetMulticast RPC to inform clients to update the shooter’s visual (animations, effects, sound etc).
Some form of optimization I can imagine and don’t know if it will be enough:
- use a “bullet manager” to batch shoot requests over a non-noticeable small interval then use a single multicast RPC to signal multiple shoot requests;
- for simple bullets, as long as the starting position, direction and velocity are correct on clients I should be able to use a low rate of syncing.
Would love to hear from you guys’ experiences and rough estimates (C++ only workarounds are welcomed too), in any case, I will update my progress in this thread just in case anyone is interested.