scottschiller / ArmorAlley

A browser-based interpretation of Armor Alley, a combat strategy game originally released in 1990 for the Macintosh and MS-DOS PCs.
https://armor-alley.net/
Other
91 stars 25 forks source link

Notes on Network play #6

Closed whoisterencelee closed 11 months ago

whoisterencelee commented 1 year ago

Noticed network game play is available, AMAZING, so start testing using grey (right side) helicopter, seems most issues can be seen there :^)

Really almost playable, AMAZINGGG

scottschiller commented 1 year ago

Hello, and thank you for the feedback and report; excellent finds. 🙇‍♂️ 👍

I definitely tested the network play largely as the green / left side player most of the time. 😅 Additionally, the default "human" player stuff has been battle-tested over the years - so it makes sense that the right / grey side could have some bugs, as e.g., I never added "dropping paratroopers" to the CPU / AI.

(Total side note, I've been meaning to do that when you as the human player fire a smart missile at the enemy chopper - so they might act as decoys or blockers. The original game did this, at some level of difficulty.)

There might be a de-sync issue around balloons etc., I will look into that. Ideally, all objects should be in sync regardless of what side you're on. If you're hitting invisible things, that's not good and something has definitely gone sideways.

I'll review the bunker situation. Depending on the level, that may be correct. I think most of the network games have a decent balance of sides, but I'm not sure that is always the case. If you play the original levels in a network game, keep in mind that those were designed initially for single-player; so earlier on e.g., Cake Walk, the left / green side will have a significant bunker ownership advantage and so forth. I can review the original game and if they allow you to play those levels and they are balanced, then I will do the same.

I suspect I forgot to handle the grey helicopter dropping paratroopers, and/or infantry from the ground. Whoops! Without being positioned to the left, they'll be picked up again by the helicopter. 😅 This should be an easy fix.

Thanks again for the report, this is great detail. And, I hope you enjoyed playing this remake!

scottschiller commented 12 months ago

@whoisterencelee I pushed some updates earlier, and this is now live on https://play.armor-alley.net - details follow, for the curious.

Balloon + object de-sync

Basically, the level preview feature was throwing off object ID counting and tracking for the actual network game. When the host selects a level and then starts a network game, its balloon ID offset would be different than the remote client because of the previews - and so then when balloon ID 1 gets popped on one side, it might cause a totally different balloon e.g., ID 11 on the other side to pop. Whoops! 😅 In some cases, this might contribute to the "invisible object" your helicopter sometimes hits. Very annoying.

In the local game, there's a "random wind" effect where balloons can slow down or speed up. The randomness is where the de-sync can sneak in between clients. I've disabled that for now in network games - so balloons get one random wind x/y velocity at game start, stay on a constant course and only change direction when they hit boundaries. This should keep them in sync, so the positions are consistent.

Thanks again for the detailed report, these are good bugs and the network play should be much more enjoyable now, if there aren't any other wild de-sync issues lurking about. 😅

scottschiller commented 12 months ago

One thing I forgot: I re-ordered the game level drop-down in the network modal, so that network levels are first. They are designed to be more balanced in terms of who owns bunkers etc., assuming PvP.

I thought it would be fun for people to be able to play the original game levels as network games too, but then "cake walk" has the majority of bunkers being owned by the left (green) side to start. I might add some logic or an option to balance sides as applicable, so each side owns half of the battlefield when a network game starts. That is, unless someone likes a good challenge! ;)

scottschiller commented 11 months ago

@whoisterencelee: I'm going to close this one as fixed, but please re-open or create a new issue if you feel I missed something from your report. In testing, I believe the balloons are staying in sync during network games and that should now make the game much more reliable. 😅 🎉