henpemaz/Rain-Meadow

Arena: Load Players into Level 2

Closed this issue · 2 comments

Branch: arena-worldLoading

  • Player 1 gets to next level
  • Player 2 gets to next level
  • Player 1 maintains full ownership while acting as Lobby owner
  • If Player 1 leaves the lobby ownership, someone else takes over

My most recent commit technically had it working, but it was mostly by the luck of the packet race.

I will use this issue to track the process more in-depth.

Online Resource: Transactions

The crux of the problem. I need to make the netcode act more authoritative.

I don't have a single "kill all subscriptions and ownerships to resources" method / function at the moment, so I'm exploring what needs to be done to write something up.

Currently, we have exceptions thrown in Request and Release for when resources are pending or have an availability status. Arena requires more hand-holding when it comes to managing those resources so I've added additional actions to occur when those exceptions would normally be thrown.

Testing

Player 1

Player 1 alone starts the game. Typically, on the third level, there will throw a Generic error requesting the Arena world. This is the second time the modified world is used by the new logic of the Online Transactions (Lobby -> Level 1 == original world, Level 1 -> Level 2 == original to modified logic world, third is Level 2 -> Level 3 == new world to new world).

I've found that checking if the Requested resource is Available AND isActive with a call to Deactivate alleviates this issue so that the lobby owner can claim the world again.

Player 2

Player 2 is where things get fun. I stopped testing today midway through a theory but currently I believe that I need to get P2 to release the world / rooms more aggressively (whether that's on Arena's NextLevel hook or Online Resource: Request() I'm still testing). The reason being that when P2 tries to go to Level 2, they keep throwing errors of being unable to find the previous level's resource room ID, making me believe that they need help forgetting about it.

I have logic setup on NextLevel to account for this, but I believe that the next tick must be re-acquiring the data so that by the time a request is made to the next level, my previous logic didn't matter. So managing that forgetfulness should be done in Request is my working theory.

Future Work

After getting players around in levels is completely stabilized, then I can introduce the logic for if the lobby owner leaves. Considering that Arena is a very short-lived game mode with low loss of progress, it's not a huge priority yet but it'll improve the experience.

Pleasant Progress

Originally, the load logic I had would work on some levels but not others. I've since changed it so that Request() first marks the resource as Unavailable() along with its sub-resources which has enabled me to get pass the issues of loading players into levels. I tested it on two series of level playlists so here's to hoping.

Things still to do:

  • - Remove my commented code that's random musings
  • - Re-add and build out host-leaving logic / claiming resource ownership
  • - Merge to arena branch

Closed by #153