SimEthereal problems

Hello Everyone,

I got my sim-eth-es based game up and running. I’ve been testing it regularly with just two players and have had no issues. Yesterday I got the opportunity to test with 4 players connected. During that test session, about 5-10 minutes into playing the game I get this stacktrace on the server.

00:15:54,777 ERROR [StateCollector] Collection error
java.lang.RuntimeException: Very bad things have happened in the receivedAcks set.
	at com.simsilica.ethereal.net.StateWriter.startMessage(StateWriter.java:227) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
	at com.simsilica.ethereal.net.StateWriter.startFrame(StateWriter.java:194) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
	at com.simsilica.ethereal.NetworkStateListener.endFrame(NetworkStateListener.java:284) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
	at com.simsilica.ethereal.zone.StateCollector.publishFrame(StateCollector.java:226) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
	at com.simsilica.ethereal.zone.StateCollector.collect(StateCollector.java:258) [sim-ethereal-1.2.1-SNAPSHOT.jar:?]
	at com.simsilica.ethereal.zone.StateCollector$Runner.run(StateCollector.java:313) [sim-ethereal-1.2.1-SNAPSHOT.jar:?]
00:15:54,812 ERROR [StateCollector] Collection error
java.lang.RuntimeException: Very bad things have happened in the receivedAcks set.
	at com.simsilica.ethereal.net.StateWriter.startMessage(StateWriter.java:227) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
	at com.simsilica.ethereal.net.StateWriter.startFrame(StateWriter.java:194) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
	at com.simsilica.ethereal.NetworkStateListener.endFrame(NetworkStateListener.java:284) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
	at com.simsilica.ethereal.zone.StateCollector.publishFrame(StateCollector.java:226) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
	at com.simsilica.ethereal.zone.StateCollector.collect(StateCollector.java:258) [sim-ethereal-1.2.1-SNAPSHOT.jar:?]
	at com.simsilica.ethereal.zone.StateCollector$Runner.run(StateCollector.java:313) [sim-ethereal-1.2.1-SNAPSHOT.jar:?]
00:15:54,863 ERROR [StateCollector] Collection error ```

On the client I got this message.

21:15:55,797 WARN  [StateReceiver] ********* Network ID lookup returned null.
21:15:55,797 WARN  [StateReceiver] ********* Network ID lookup returned null.
21:15:55,797 WARN  [StateReceiver] ********* Network ID lookup returned null.
21:15:55,797 WARN  [StateReceiver] ********* Network ID lookup returned null.
21:15:56,149 WARN  [StateReceiver] ********* Network ID lookup returned null.
21:15:56,149 WARN  [StateReceiver] ********* Network ID lookup returned null.
21:15:56,149 WARN  [StateReceiver] ********* Network ID lookup returned null.
21:15:56,149 WARN  [StateReceiver] ********* Network ID lookup returned null.

Based on looking at the code, it seems that I am overflowing the 128 buffer for received acknowledgements. I am unsure of how that could be happening.

Any assistance would be appreciated. I need my game to support at least 16 players.

Thanks, Mithrin

How “based”? How much have you changed? What have you changed? etc.

The default constants were setup with certain assumptions in mind… if you change those assumptions then the constants may also have to change.

Your assessment as to why the exception is thrown is correct but it’s just a watchdog and not any kind of max buffer size. The fact that the received acks list is growing so large is a sign of trouble. I’d have to think a lot deeper than I can right now about what that trouble could be… but things like lots of dropped packets in one direction might do it. It’s also possible that there is a bug triggered by these sorts of cases.

I will say that I’ve had a heavy user that has managed to have hundreds (or more? I can’t remember) of users on without issue.

Well, I added a bunch of systems, entity components, visual stuff… tried not to change much on the networking side of things. Wired up physics bodies to dyn4j, added some rpc methods for shooting and mining… lots has changed but very little has in the network code itself. I didn’t do anything with body position publisher for example.

Any thoughts on which constants to adjust or how to troubleshoot this further would be appreciated.

Thanks

I got this error when I was simulating very poor connections over a large amount of users. It’s a fringe case at best. I am currently supporting over 2000 entities in the scene with over 1500 users with no problems.

It would probably take some digging.

How often are you publishing updates? How many object updates are you publishing?

You could try turning up the logging levels to see if that shows anything interesting.

Everything is set to the stock numbers, the clients are set to publish 20 times a second, and simethereal is using its default statecollectioninterval of 20 times per second.

I have 32 game objects, plus 4 players when this crash happens, plus bullets, explosions, damage entities. I would estimate 400 maximum entities could have been being updated typically much less. I will throw in some code to dump the number of physicsbodies I’ve got so next time I test I can get better numbers.

I will also turn up the logging to see if anything interesting pops out.

Does each player have their own statewriter? I may need to dig more deeply into ethereals code so I can understand whats going on a bit better.

Mithrin

Alright, just did some testing … the entity count would have been something like 100 entities total. With entities being added and removed quite often … bullets and explosions being added and removed. No way would we have been able to get more than 100 entities going at the same time, bullets move too fast and get removed too quickly.

Mithrin