beyond-all-reason / Beyond-All-Reason

Main game repository for Beyond All Reason.
https://www.beyondallreason.info/
Other
1.79k stars 299 forks source link

The AF Lobby Plan #41

Closed tomjn closed 2 years ago

tomjn commented 4 years ago

The broad stroaks:

I've identified these projects will be needed:

tomjn commented 4 years ago

Brief mockup of the basic lobby UI frame:

AFL2 [ ] tomjn
Singleplayer Current screen gets displayed here
+ New Game
DSD FFA
Red Comet 2v2


Settings
tomjn commented 4 years ago

The unitsync problem has been a major thorn in my side, it was a huge time sink with AFLobby, and it's gotten worse since then.

For now to get things moving it'll be necessary to hardcode the game/map list.

However, I'd really like to:

If interfacing directly with unitsync in Node isn't possible, then I have some alternatives:

As for native Node, N-API may provide the solution https://nodejs.org/api/n-api.html but I know little of how it works

tomjn commented 4 years ago

For login, OAuth2 is the paradigm of choice, this means we can login users via other services such as Discord, or provide multiple options.

E.g.

By using OAuth2, we also eliminate the need to implement authentication from scratch at the client end, they can just use a generic library for their programming language. As a result, existing bots such as hubot or slackbots would be able to authenticate with minimal changes if any. Automation would be significantly easier

tomjn commented 4 years ago

Basic UI frame up and running:

Screenshot 2020-05-06 at 18 06 07

Using the codename necrontyr, colours need adjusting, not a fan of the teals. Next step will be to integrate react router

tomjn commented 4 years ago
Screenshot 2020-05-06 at 18 41 52 Screenshot 2020-05-06 at 18 41 59
tomjn commented 4 years ago

Finally excised the blue header, added disabled menu items for campaign and replays

Screenshot 2020-05-06 at 20 40 57
icexuick commented 4 years ago

I like this!

tomjn commented 4 years ago

A fortuitous consequence of using a custom post type in WP to represent battles, is that they can have comments if so desired. This might actually provide a crude means of battle chat complete with a historical record/backhistory

MasterBel2 commented 4 years ago

I fear you're adding extra baggage that turns this into SpringLobby 2.0 in many ways – just cut off the hands and the feet. I'd be really interested to see the rest of your plan to understand it so I can discuss with you more fully about things, but for now I'd pitch what I envision.

Let's start with a bit of background first, though.

What does a user currently have to do to play a game?

-1. Discover BAR Website

The SpringLobby Way: (worst case scenario. Most players won't spam the start button for example)

  1. Redirect to SpringLobby's website
  2. Download lobby
  3. Open lobby
  4. Register an account + email verification
  5. Find a populated battle, join
  6. Wait for everything to download
  7. Learn that you have to press "ready" to start
  8. Deal with people constantly changing to maps you haven't downloaded yet
  9. Spam the "start" button until you get kicked by flood protection
  10. Get back into the battleroom, press ready, wait for everyone who's AFK, and finally start the game

The Chobby Way: (not quite worst case scenario)

  1. ???
  2. Download lobby
  3. Open lobby
  4. Register an account + email verification
  5. Decide singleplayer v.s. Multiplayer
  6. Find a battle & join
  7. Wait for everything to download
  8. (I don't know past this point)

What should it take to get a new player ingame?

  1. Navigate to page showing current game queues (FFA/ Team / Scavs/ 1v1)
  2. Click a link saying you want to play
  3. Download lobby (Can this be automated if we detect it's not installed)
  4. Open lobby, and have everything already done, just have to wait and the game will start.
  5. (Maybe have a "ready" button)

Click a link on an application deep link on the website which launches the lobby, puts them in the queue they selected, and as soon as practical the game starts. If a user wants to leave the queue they press a "Leave Queue" command.

If the user hasn't downloaded the lobby yet, it automatically downloads the lobby instead of just launching it. Or less ideally, on clicking the link a "Download lobby" button appears beside the link also, just in case they haven't downloaded it yet. On launching the lobby, if it's launched within 5 minutes (or so) of downloading it automatically adds them to the queue they selected (according to a config included in the app bundle when downloaded.) Else it presents them with a similar list to what they see on the website.

Lobby should download with the latest game + engine version, plus all maps in the standard queue, so a user never sees downloading, except when they first get the game, or when an update is pushed. Ideally.

Although. If they're downloading from the main page, should just download the map in the queue that the player selected to speed up download times? Then the lobby will download the missing content in the background.

Login details are saved in keychain, or similar programs, for users who have already logged in. An option to log out/switch account would be important. For new players, logging in should be as simple as typing in their wanted username, and it's assigned to them as soon as they claim it. If it's already taken, ask them to choose a new one (or show a password field so they can log in?) Passwords could be automatically generated and stored securely in a password manager. An option to retrieve the password so they can log in on another machine is important.

If a player isn't being redirected from the website, they should have access to a

Features players will probably want

  1. Choosing maps in a queue. Only give players 3 maps to choose from, resetting every hour. Players permanently vote for "Don't care", one of the three maps, or "New selection".
  2. Chat. Could provide chat for the queue they're currently in. (As the number of players online increases this will become infeasible and it will make more sense to let groups of players familiar with each other organise their own chat.) 3.1. Organising a game with a specific group: private hosting should be a thing, as should be inviting players to your battle. For the host, this should probably give full control. To prevent the issue of hole punching/whatever, a relayhost-type system should be used where the game itself is hosted on a remote server that all players connect to. The "Host" simply has full control of game options, deciding who is in the game, etc. 3.2. But what about LAN Parties, when all this falls apart? Is it safe to assume that since this is an open source community, people will indefinitely be able to rely on our servers? I don't think we should assume this. 3.3 What about spectating private games? Uhhh… this is where it seems like we're just rebuilding the current system?

My Concerns With My Own Proposal

  1. Email verification? This slows down troublemakers, sure, but is it realy
  2. Recovery emails? How should this be prompted such that people don't lose their accounts, but in a non-intrusive way?

This post will be revised to add things as I remember what I wanted to put here, or as suggestions & criticisms are made.

tomjn commented 4 years ago

I don't intend to add a lot of what you've mentioned:

Channels and DMs

There isn't any.

There won't be channels in this lobby, at least not in v1, I question if they're needed at all. If they're ever added, they'll be de-emphasised. They certainly aren't going to be built first like most lobbys. Tbh if I were to organise a game with friends, I'd probably fire up a zoom room so we can talk and ignore the lobby channels completely.

The only chat I see happening in the next few months is battle chat, but that doesn't mean someone couldn't build a chat component and add it to the sidebar. Eitherway chat is not the primary purpose of a game lobby, gaming is, and most games don't have it.

Logins

Login details are saved in keychain, or similar programs, for users who have already logged in. An option to log out/switch account would be important.

Screenshot 2020-05-07 at 11 12 08

User switching isn't in minimum viable lobby, perhaps several months down the line. But with no clans, and no rankings, I see minimal utility in the feature. In the future it would have more relevance.

As for email, the lobby itself doesn't need email verification, or emails at all. That's up to whatever OAuth2 provider gets used. It would seem that most of the OAuth2 part is already built on the server side by other people already. I don't consider this a part of the lobby project, but instead its own parallel thing. A login/register button takes you to the browser.

However:

Downloads UI

Lobby should download with the latest game + engine version, plus all maps in the standard queue, so a user never sees downloading, except when they first get the game, or when an update is pushed. Ideally.

The most I expect is an indicator next to a player to say they're downloading things, and a progress bar in the top to show your progress. It should be contextual, I don't like the idea of having a dedicated download page, and if I did add one it would be for acquiring new content, more like a map store.

But I don't consider this within the scope of minimum viable lobby

Downloading The Lobby

If the user hasn't downloaded the lobby yet, it automatically downloads the lobby instead of just launching it.

I really don't like downloading a downloader. The initial download should be able to get you ingame with singleplayer. I also don't intend to have this UI shown inside the browser on the website. If it's running in a browser, it's because you have the browser and react dev tools and webpack watch running to debug something. This is a desktop app.

Private Battles and LAN

But what about LAN Parties, when all this falls apart? Is it safe to assume that since this is an open source community, people will indefinitely be able to rely on our servers? I don't think we should assume this.

Technically a server is just any WP site with a specific plugin installed. A multisite would thus be able to host hundreds of servers from a single installation. You can install WP with a 1 click installer on most cheap hosts. As for the plugin itself, it just needs to define some data types, which is stupidly easy. I went to WP Generator and filled out some questions and it populated an array of options I copy pasted into a local dev environment.

Given this would use Node, and the REST API is rather simple, a future experiment might be to use one of the Node CMS' and spin up a mini web server in the background that just uses these API points then advertises it locally or gives instructions to other people.

As for authenticating private battles, and private LANs, I'd like to rip off Pokemon Go. Don't show the battles at all, just add an option to enter a private battle, and give it a code, e.g. pidgey squirtle alakazam. It could be customized instead to BAR units or memes like nyan cat. This way private battles are truly private, and don't clog up the battle list.

But while I have these in mind, these are not minimum viable lobby, so are not currently in scope.

What should it take to get a new player ingame?

Singleplayer:

  1. User downloads BAR
  2. User opens BAR and is presented with lobby UI
  3. User clicks single player and selects some options and clicks start

Multiplayer:

  1. User downloads BAR
  2. User opens BAR and is presented with lobby UI
  3. User selects a battle in the sidebar
  4. User gets a banner across the top saying they're spectating, and a big button to Join if they're logged in, or a prompt to register/login
  5. Once logged in they can click Join
  6. Usual battle banter occurs of picking a map, team, colour
  7. When enough players are ready they can press start, countdown from 5, game starts

If a user already has BAR and an identity then:

  1. User opens BAR and is presented with lobby UI
  2. User selects a battle in the sidebar and clicks JOIN in the banner that appears
  3. Usual battle banter occurs of picking a map, team, colour
  4. When enough players are ready they can press start, countdown from 5, game starts

Right now I've several competing thoughts about the exact layout of the battle screen, but I've plenty to do before I reach that point. However, I don't want a great big panel of options and settings. I'd like to eliminate as many as possible or move them to a new host screen.

Part of me wanted to make it so that battle rooms have a map, and you'd need to open a new room with a new map, but that just sounds really annoying so I killed that.

tomjn commented 4 years ago

Some brief progress updates

Screenshot 2020-05-07 at 13 43 03 Screenshot 2020-05-07 at 13 49 33
tomjn commented 4 years ago

Repo: https://github.com/tomjn/aflobby2

tomjn commented 4 years ago

Neutralino on MacOS doesn't work, it may work fine for Windows/Linux but this oversight is not a good sign for the project. On first glance, someone popped up and added MacOS support then left. I don't believe the maintainer has the ability to test Mac support, or even understands how apps on MacOS work ( they suggested doubleclicking to launch a raw compiled binary that wasn't in a .app bundle )

tomjn commented 4 years ago

Just for personal reference, some battle room research I had in tabs

ota-battleroom

Screenshot 2020-05-07 at 21 53 21

I quite like the PA layout, though I would reorder and redesign a lot of that sidebar. I thought I'd taken screenshots of Stellaris and some others but misplaced them, Stellaris has a 3 column layout, players/chat/options with a start button at the bottom

icexuick commented 4 years ago

image Notalobby SP

MasterBel2 commented 4 years ago
  • I'd prefer it if the lobby came with an engine and the game, and at least 2 or 3 maps. Alternative engines is more for testing and replays. Unless these differ from the current status quo I see no need to mention them in the UI. There is the current BAR and then there are other versions of BAR

I fear that by relying on Uberserver, you greatly increase the difficultly of maintaining this paradigm, and not being sucked back into the current lobby paradigm of Chobby, or worse, even SpringLobby.

But to each their own; I shall cease to bother you now.

MasterBel2 commented 4 years ago

Although I'll take a moment to clarify something:

My idea was to not download a downloader: The website isn't a lobby on the player's computer; instead, a new player finds the website "oh that's cool", sees a button to play and presses it, and he instantly receives a download of everything he needs. (Afaik a purely in-website lobby is not possible, but if possible that would likely be ideal.) All he has to do then is open the lobby and he's put in a queue, ready to play.

In the background, invisible to the user, the lobby then collects all assets that weren't needed for that first game, as soon as possible (?). Everything needed to join the queue and get ingame in the first place was already downloaded within the lobby package itself, again invisible to the user.

tomjn commented 4 years ago

I fear that by relying on Uberserver, you greatly increase the difficultly of maintaining this paradigm, and not being sucked back into the current lobby paradigm of Chobby, or worse, even SpringLobby.

I have no intention of supporting uberserver in any way shape or form. Uberserver and the TASServer protocol will burn with the fire of a thousand suns. For my official stance at length on the subject, please refer to this helpful video

My idea was to not download a downloader: The website isn't a lobby on the player's computer; instead, a new player finds the website "oh that's cool", sees a button to play and presses it, and he instantly receives a download of everything he needs. (Afaik a purely in-website lobby is not possible, but if possible that would likely be ideal.) All he has to do then is open the lobby and he's put in a queue, ready to play.

Women play RTS games too, but what you're describing just sounds like a download link.

In the background, invisible to the user, the lobby then collects all assets that weren't needed for that first game, as soon as possible (?). Everything needed to join the queue and get ingame in the first place was already downloaded within the lobby package itself, again invisible to the user.

My preference is an installer that installs the game, old school style. None of this collecting assets and downloading assets nonsense. If you want extra maps or updates that's a different thing. Installing the base game should install the base game, that the lobby is built with JS and HTML should have no effect on the website at all, it's just an implementation detail, like which type of screws and nails were used in building your house

icexuick commented 4 years ago

I'm all for oldschool / basic style. Lean and mean.

When joining a server, things should auto-download however. That is a huge benefit. Preferably also as fast as possible AND ideally showing progress to other players how much % is downloaded/installed.

For hosting your own game or play single/offline, there should be an easy way to get new maps, or widgets or other 'mods'. This need to be some sort of a 'subscribed' list (could be a bit like steam workshop). Ideally, this would be linked to your account, so if you re-install and re-login the lobby knows what maps/stuff to download.

icexuick commented 4 years ago

Most important thing is that the lobby is fast, intuitive and also very(!) easy to setup games. Choose a game-type-mode, choose starting locations, setup the teams, do balancing stuff, add scavengers or random-drops or whatever modoption. This is currently costing way too much time and also fun.

tomjn commented 4 years ago

quick update on battleroom scaffolding:

Screenshot 2020-05-18 at 17 42 56

Also some Starcraft screenshots:

KuJCs lobby x1EKX

tomjn commented 4 years ago

Just putting this here:

Screenshot 2020-05-18 at 20 39 05

Also, I like that Starcraft 2 has a separate singleplayer UI that streamlines things, I got a friend to send newer screenshots:

98000609_176139167053705_8687679535031779328_n 98002369_3803579129683709_4996690301339828224_n 98043400_558459744859953_3660375312396451840_n