GithubHelp home page GithubHelp logo

Game crashed about beaverbuddies HOT 19 CLOSED

Thysos avatar Thysos commented on August 16, 2024
Game crashed

from beaverbuddies.

Comments (19)

Thysos avatar Thysos commented on August 16, 2024

Server.log

Another Crash 10 minutes later

from beaverbuddies.

thomaswp avatar thomaswp commented on August 16, 2024

Thanks for the report. The logs are very helpful. I'll definitely look into it. Seems like you ran into the same thing as #15. I don't understand how it's happening, so I'll need some time to try to reproduce it.

This may be the product of changes I made in the latest patch, so you could try an older version if it keeps happening in the meantime.

from beaverbuddies.

thomaswp avatar thomaswp commented on August 16, 2024

A few questions for both @Thysos and @joseprl89:

  • Is there a save file you have that reproduces this behavior reliably?
  • Did anything notable happen before the crash?
  • Did both client and server crash, or just one?
  • Was anyone trying to rejoin at the time (guessing not from the logs)?

This is very odd. The problem is that two identical unique IDs (guids) are being generated. The mod changes the way guids are generated to keep them in sync between client/server. But the only way a duplicate could be generated is if:

  • The initial state of the random number generator were reset to a value it previously had, so the same guid gets generated twice. However, I've put logging statements before the seed is reset, and I don't see that happening in your logs.
  • The Unity random number generator repeats itself. This is known to happen with random number generators, and it's my primary hypothesis, but I can't reproduce it. I've tried generating 10000000 guids, and none of them repeat...
  • Some weird stuff with parallel threads, but I'm quite confident that the only threading in Timberborn doesn't mess with Random at all.
  • Timberborn is registering the same Entity twice - I can't think of any reason it would do that, or that the mod would make that happen, but it would be pretty hard to track down if it was.

from beaverbuddies.

thomaswp avatar thomaswp commented on August 16, 2024

I could probably solve it if the problem is the second bullet point above, but I can't reproduce it right now, so I can't test the fix.

from beaverbuddies.

joseprl89 avatar joseprl89 commented on August 16, 2024

@thomaswp I dont think there was anything v significant, we had a couple of districts going on, and we were doing the early game (planting trees, farms,...). I think as the colony grew it was more common (I assume as we were planting more often?).

I'm not sure how a mod is built, but am wondering if you can replace the dictionary with a thread safe one, or if there's a "if it doesn't exist insert if not don't do anything"

from beaverbuddies.

thomaswp avatar thomaswp commented on August 16, 2024

@joseprl89 there are definitely a number of fixes I could apply to solve the "symptom" so to speak, but I worried that just skipping invalid guids will cause desyncs and other major issues. I'd rather be able to reproduce and then fix it in a way I can confirm works, rather than just a workaround. That's why I was asking if any of your saves reliably produce the error.

But if nothing else I can try that in the next release.

from beaverbuddies.

thomaswp avatar thomaswp commented on August 16, 2024

Further checking of the logs shows that it can't be the same random guid being generated twice, since I also log that. I'm quite stumped on this one...

from beaverbuddies.

Thysos avatar Thysos commented on August 16, 2024

A few questions for both @Thysos and @joseprl89:

  • Is there a save file you have that reproduces this behavior reliably?
  • No the crashes seem to be totally random every 10-15 minutes.
  • Did anything notable happen before the crash?
  • Nothing.
  • Did both client and server crash, or just one?
  • First the server crashes while the client freezes then after a few seconds the client crashes too (this happens everytime when it crashes)
  • Was anyone trying to rejoin at the time (guessing not from the logs)?
  • No

from beaverbuddies.

thomaswp avatar thomaswp commented on August 16, 2024

Ok, I figured it out. Since guids are also saved in the save file, it's occurring because the same guid is being generated again when you load that file. I've got a fix and just need to test and release it. Thanks for your help.

from beaverbuddies.

thomaswp avatar thomaswp commented on August 16, 2024

Ok, the fix is live. Let me know if you're still getting the crash.

from beaverbuddies.

joseprl89 avatar joseprl89 commented on August 16, 2024

Hi @thomaswp we were able to play for a bit, at some point the game desynced, and now when we try to join the match, the client crashes and the server freezes. I don't have a crash report on the server, but sharing the client one.

Attaching also the save file in case it helps.

error-report-2024-04-06-18h16m26s.zip

37BB18A9.zip

from beaverbuddies.

thomaswp avatar thomaswp commented on August 16, 2024

Ugh. Ok, well this is interesting. Apparently upon loading the game, Timberborn immediately checks whether any beavers should be procreating... and so a child is born before the server can send the correct random seed. Not sure why they do that, but look like I'll have to change my strategy a bit. I know how to fix it, but it'll involve fiddling with the networking because I'll have to send the random seed along with the map, so it'll need some testing. Thanks for your continued help testing!

from beaverbuddies.

joseprl89 avatar joseprl89 commented on August 16, 2024

No worries, happy to do tests when new versions are ready too!

from beaverbuddies.

Thysos avatar Thysos commented on August 16, 2024

We played a few hours yesterday with your new version. The Game didn't crash once (but desynced).The desyncs seemed very random, sometimes after 30 minutes (and more), sometimes every 2 minutes and then after a few desyncs again nothing for a longer period.
It's way better than before because resyncing the Game means only a short loading screen without the need of restarting the whole Game! Thanks for your great work!

from beaverbuddies.

Lillemats90 avatar Lillemats90 commented on August 16, 2024

ive written a comment in #13 about this issue, we are desyncing immediately now when joining the save.

from beaverbuddies.

thomaswp avatar thomaswp commented on August 16, 2024

Ok, thanks everyone for your input and your log data and saves. I think I've fixed it for real this time, since I was able to reproduce the issue locally and confirm the fix. But as always, I'll need your help testing. Try v1.1.7-beta and let me know if it fixes it.

from beaverbuddies.

joseprl89 avatar joseprl89 commented on August 16, 2024

@thomaswp thanks a lot! We managed to play for a while with no crashes, only desyncs. We noticed the desyncs would happen about the same time when we had a weird tide effect that would flood some builds at semi-regular intervals, wondering if that flooding event would trigger too many syncs across the network and bottleneck or something? In any case, thanks a lot for your help!

from beaverbuddies.

Lillemats90 avatar Lillemats90 commented on August 16, 2024

Try [v1.1.7-beta]

We will test it the next few days :)

from beaverbuddies.

thomaswp avatar thomaswp commented on August 16, 2024

I'm going to close since I haven't seen this pop up in comments or issues since the release, but let me know if it happens again.

from beaverbuddies.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.