Hello there! I have been working on a multiplayer game the last 8 months and everything works fine for the first minute or two. You can possess vehicles and characters, partake in their actions/abilities, points tally, widgets and overlaps work. It seems great. A minute or two in all actions start to fail and I cannot figure out the root cause. I’ve used the log to eliminate any visible runtime errors with my actors, and I used the various stat commands to isolate the mentioned problem to a specific actor. If I remove this actor from the level everything works. If I double the number of actors being spawned the problem happens twice as fast. I created a new actor and remade the blueprint from scratch, but my level had the same problem. This makes me believe the issue is in my blueprints, one of the settings for a component, or the setup actor itself.
This actor is an area of fire, measured by a collision box component. It has a root ‘Scene’ component and a ParticleSystem component as the second and third parts of the actor. After a random amount of time between 1.5-3.5 seconds, the fire burns long enough to spread. The server and clients are notified of the spread, and the actor scans a 360-degree area on the server by doing a line trace to check for impeding objects. These line traces from above are done in a square like pattern from the center, and there is a total of 8 traces done on tick the 1 time the fire is spreading.
If there are none present a new fire cell is generated in the green area. That new fire cell will do this same 8-point check 1.5-3.5 seconds later. These line traces check for previously burned areas and do not burn back on themselves. So, if I place 2 of these in the level at begin play, they spawn 8 more fire cells, and then burn out a few seconds later. An invisible actor (Collision box) is placed as a place holder to prevent any fire from burning back in the area for a while. Those 8 cells do a scan detecting each other and the still burning fire/ invisible marker. They then spread to any open area. I do not believe the invisible marker or spawning of that actor causes the problem, because I have bypassed/removed the blueprints for this spawning, and the problem still occurs.
When things start to break like vehicle possession, widget displays, the server taking input keys and such, the fire continues to spread on the clients and appears to perform like it should over the landscape. It spawns more actors visible to the server and client, crawling over the landscape in the proper position, up and down hills. If I fly around in my helicopter (having got in before the break occurs) watching the fire and press stat FPS, I get 30-35 FPS. This is with over 2000 fire cells on the map.
In an effort to isolate the problem within the actor further, I bypassed each function (Other than the build surrounding locations function,) and let the actor run on 90% functionality. Inputs and actions still break a minute into the level no matter what is bypassed. I used the startfile and stopfile to look at the profile, but I do not see any culprits. Using all the stat commands didn’t provide me a direction within the actor on what I should look at. Admittedly I don’t know by default what these times should be. This is the first game I’ve ever made and my first attempt at using unreal engine. But I was wondering if:
- Does anyone see a problem within my branch of building one of the surrounding locations? There are 8 in a sequence node which I have a larger picture of (8 branches are identical (Does running 8 identical lines of code trigger a loop problem?))
- Are there any issues with my server/client/multicast calls in the event graph?
- Other than the ‘-log’ command on the server and stat commands, is there anything else I can use to find a problem within an actor?
I feel if I can figure out what is causing this process to break, I’ll have a game ready for alpha testing. I’m pretty tech savvy and run a team of Sr. Sys Admins so I am knowledgeable around tech, but this is not my usual line of work. Since I was running out of ideas, I thought I would come ask you all! I”ve spent weeks trying to figure out the problem with this 1 actor and don’t seem to be able to do it. When using the stat commands after inputs, animations, and such break, it appears like the server continues on processing commands ok without spikes. The fire spreads like it should and spawning 200 actors, 30 seconds into the game, should not crash it. I just feel stuck! Thanks for the time spent reading!