jleonard2099 / LHG_ProBB

Lance Haffner Basketball Pro Game
GNU Affero General Public License v3.0
2 stars 0 forks source link

Simming several games can result in game "freezing" #17

Closed jleonard2099 closed 8 months ago

jleonard2099 commented 1 year ago

When simming a large number of games, it has been determined that the game can eventually freeze. Closing out and starting again will proceed fine.

From early tests this appears to happen more frequently with recent decades of team files than with older ones. It is not known why.

Error log from game is attached showing the lines in PROHOOP where the issue shows.

Similar behavior was exhbited in Baseball when variable naming was redundant across several areas, leading to - array index being referenced in a looping structure that was unable to exit as a result.

errlog.txt

jleonard2099 commented 10 months ago

This should be checked to confirm if it's still an issue given the most recent updates / adjustments to the code since this was logged.

As of the most recent simulations I performed of pro seasons, I experienced no errors or freezing.

jleonard2099 commented 10 months ago

Latest test of a Pro Season shows over 640 games completing before an issue was reached.

There are a number of errors logged along the way, about every 100 games or so.

BOth issues will be investigated before this post is revisited.

jleonard2099 commented 10 months ago

Opening a new issue for the errors being logged but I don't believe they're in the way of the "freezing".

Another season run this time shows almost 700 games completed before an issue was reached.

We are definitely providing a pattern, but will have to work hard to log PBP for all areas of game to narrow down where things are happening.

jleonard2099 commented 10 months ago

This has finally been narrowed down as something that occurs during the "CreditAssists" routine. The logic is such that it's crediting assists based on whether the current player's name in the loop is equal to the target player.

On the rare occurences this happens, this gets to be an infinite loop. It appears so far that is because it finds the names identical, but for some reason the logic doesn't assign a different player to evaluate against.

That, or, as I suspect, something happens during susbtitutions that the same player makes it in the roster more than once by accident.

Doing more sims and details to get to the bottom of this, worst case scenario is I limit how much the loop runs once I better understand the logic (it shouldn't need to run but x # of times)

jleonard2099 commented 10 months ago

At this time I've run several games to determine that, as I would anticipate, the loop should resolve itself within 4 iterations (because there are 5 active ball carriers to evaluate).

So the loop is currently being terminated automatically after 5 iterations to prevent the infinite condition and make the game runnable / reliable.

Root cause analysis is still in progress but essentially, the variable that increases the ball carrier to check appears to never get increased (initalizes to 0, remains at 0) and this is why the ball carrier is always compared to himself.

jleonard2099 commented 8 months ago

Several more seasons of replays have been done and no more freezing / locking.