Re: Anyone else getting "504 Gateway Time-out" errors?
Posted: 23 September 2021, 12:42
That sounds... weird.JonChambers wrote: ↑23 September 2021, 11:14I was expecting this exact response, but you phrased it with more humility than I expected.robinzig wrote: ↑23 September 2021, 10:30I don't want to open a can of worms - but why do you expect this to be so hard? All you should have to do is hide any areas of the screen that show information that is private to one or more players. I don't really see how it will ever be more than a few lines of CSS, and perhaps a tiny bit of JS too in some cases. While I know nothing about your game, I do not see how any game would need to do anything drastic here.JonChambers wrote: ↑23 September 2021, 02:26
- Spectator mode (this will be harder than everything else combined)
Even if you do want to do something complex and custom, I suspect it's wasted effort as I don't think most BGA games attract many spectators!![]()
The entire layout of the game responds to the role you play for that turn. There is a LOT of "so, what's your role?" in the code, and I need to come up with an answer for "spectator" in every single situation.
There's even a script I wrote that displays a message custom to the gamestate and your role in the game. But they're all worded in a way that assumes you are playing.
It's a mad libs of different sentences smashed together, but the most complex of them has 14 different strings individually written. So now I need to write even more messages to the effect of, "Now that was a good move! When you finally get around to playing this game, you should make moves like that!" (It won't be exactly that message, but I'm trying to keep my answer generic to all games rather than specific to mine.)
It's not just spectator mode being hard. It's everything else on the list being easy!
As I said I don't spectate many games on BGA, and I doubt anyone else does it very often - but when I am spectating a game, I expect to just see what the players are doing. I don't expect to be told "that was a great move" or conversely "that was a stupid move" or anything else similar that's more specific to the game. And more to the point, I think players would be annoyed if they knew that some "AI" within the game was decididing if their moves were any good and announcing that to any spectators who might be lurking.
As for "roles" - I may be misunderstanding, but lots of games have roles but this is always something INSIDE the game. It's relevant for spectators to know that Player A has Role X and Player B has Role Y at this moment - but the spectator, being OUTSIDE the game, does not themself have any of these roles. The idea of spectatormode is simply that those not involved in the game can see the full game interface as a player would, but minus any private information that should only be known to a particular subset of players.
(In fact your PHP game logic shouldn't even send private information to the client side that shouldn't be known to that player - and I'm not suggesting you've done anything wrong there. But it means that developing for "spectator mode" is basically a tidying-up exercise - typically there will be say an area for a player's hand, which would appear empty to a spectator because they have no hand of cards, so you just make sure there's nothing there for any spectators viewing the game, so they don't see a weird blank space. Also adding any guards needed to JS code that assumes the user viewing the game is one of the players. As I said, it's just tidying up, you shouldn't need to do anything more. Perhaps this is more a case of you *want* to, rather than need - I personally would advise against, for all the reasons I've mentioned, but of course it's your game so that's ultimately up to you, your players and perhaps the BGA admins. I'm only trying to save you doing what is apparently a big job that is I think at best unnecessary and at worst actively annoying to users.)