Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New user confusion on multiplayer and sharing #1409

Closed
jbash opened this issue Aug 6, 2020 · 7 comments
Closed

New user confusion on multiplayer and sharing #1409

jbash opened this issue Aug 6, 2020 · 7 comments
Labels
discussion Needs more information or major design decisions

Comments

@jbash
Copy link
Contributor

jbash commented Aug 6, 2020

I hesitate to open an issue about this, especially because I just appeared out of nowhere yesterday and started whining... but I think it's legitimate new user confusion that the target audience may share, and I really am offering it in a helpful spirit. If the documentation covers these things, it doesn't seem to be very prominent.

Background: I'm looking at CodeWorld to see if it's something I can recommend to my daughter's high school coding club. Most of them are coming from Scratch, and quick games are the "hook" that keeps them around. They're not required to be in the club.

One of the biggest things that grabbed me about CodeWorld, and especially that made me think I could sell it to the kids and to the club sponsor, was that it might let them write multi-player, multi-seat games (and chat programs and whatever). So my immediate goal is to write a two player Spacewar, and see how it performs. Of course I wanted to start out with something even simpler.

The API is obvious (in Haskell; I don't know about the non-Haskell language), so I wrote a program that draws a circle and lets players grow and shrink it using keypresses. It worked fine with one player.

I couldn't figure out how to run it as a two-player game. I still don't know as I write this. It's not that I don't know how to code it; it's that I don't know how to run and share it.

I can start an instance of the game. I figured out fairly quickly what "new" and "join" meant. "Main Menu" doesn't seem to do anything, so I think it's probably meant to be a title. Anyhow, once I start an instance, I'm told I have to share a four-letter code with the other player(s). I'm not told how, or what the other player has to do with it. Where does the other player go to enter the code?

The only way I can find to get to the "join" screen is to run the program, so I thought that maybe I just needed to share the program and have the other user run the identical code, and everything would work automagically.

So I created another user on my test instance and tried to share the program. It took me a bit, but eventually I figured out that, to share it, I had to put it in a folder and share the folder. I have no idea what "share as gallery" would do, but I figured it probably wasn't what I want, so I just "gave" the link to the "other" user.

But I don't seem to have shared the folder so much as given the new user a copy. The new user was prompted to give it a new name. Edits by either user had no effect on the other user's copy.

As far as I can tell, running either copy creates an instance of what CodeWorld sees as a different game entirely. Entering a four-letter code generated by the other copy fails without explanation. So I'm stuck, which is frustrating.

@cdsmith cdsmith added the discussion Needs more information or major design decisions label Aug 7, 2020
@cdsmith
Copy link
Collaborator

cdsmith commented Aug 7, 2020

Thanks for bringing this up. I can start by explaining how it's supposed to work, and hope that opens a conversation on how the UI could have worked so as to avoid your confusion.

To participate in a multiplayer game, all participants must, first and foremost, be running the same program. That's accomplished by using the Share button when the program is running and sending them the URL. It shouldn't matter whether you share with or without access to the code. Once all players are running the same program, one player needs to click New, and tell the other players the four-letter code they are given. The other players click Join, and enter that code.

One change that wouldn't be too difficult is to have New generate a link that gets other players to BOTH the right program, and the right session. I suspect that would help?

@cdsmith
Copy link
Collaborator

cdsmith commented Aug 7, 2020

You definitely don't need to put something in a folder to share it, so I'd also like to understand where that confusion happened. Sharing a program is just a matter of running it, then clicking Share, and copying the URL there. (Or, actually, you can just copy the URL from the address bar while the program is running.)

@jbash
Copy link
Contributor Author

jbash commented Aug 7, 2020

That's accomplished by using the Share button when the program is running and sending them the URL.

Ah. I probably would have figured that out if I'd been doing most of this on the main instance at code.world, but I was only using the main instance occasionally as a sanity check, and apparently I didn't check the right part of the sanity.

There is no "Share" button at the lower right when I run a program on my local instance. I only get "Start Recording", "Stop", and "Run". The only time I ever see a "Share" button on the local instance is when I'm displaying a folder (in which case it's "Share Folder"). There is a "Share" button when I run a program on code.world, so it's not just some weird problem with my millions of browser extensions. Maybe I missed something in the installation instructions. I'll try to figure out what's going on there.

Even though I'm sure I would have figured it out if my instance had been right, I do still find it confusing that I would have to click "Run" to share a program. If I were looking for a way to share a program, it would probably not occur to me to look at the "Run" button. The only reason I'd find out about it would be that I'd clicked "Run" for some other reason and happened to notice that the "Share" button appeared.

Basically, I would expect the action of sharing the code in front of me to be orthogonal to the question of whether that code was running at the moment or had ever been run. That's especially true since it still seems to work even if the program doesn't compile and therefore doesn't actually run.

I would also expect a difference between sharing the code and sharing a running instance of the code. And really I can't be sharing a running instance anyway. I'm not sure exactly what I am in fact sharing when I click "Share". My best guess is that I'm sharing something like membership in a "hive" of game server sessions all tied together by some kind of identifier associated with the program.

... but that identifier doesn't just seem to be the program text or a hash thereof. Unless I made a mistake somewhere, if I share the code using "Share Folder", a running instance of the new copy does not seem to connect to the same "hive", even though the program text is unchanged. So one way of sharing is different from another way of sharing the "same thing". It looks like sharing the program shares some kind of reference, but sharing a folder shares a copy.

By the way, is there any way to share some kind of updatable reference, so that two users can collaboratively modify the same program and see one another's changes without explicitly sharing back and forth? Or does that happen already if you share an individual program? I now know how to share programs but haven't actually played with it.

I may be more troubled by some of this than your main audience would be, because I've been doing this computer nonsense for like 45 years and must have some preconceptions. On the other hand, I'm not sure it's good to build intuitions in your audience that don't comport with what you'd expect from working with other systems, or that are too artificially distant from what's actually going on in the computer.

One change that wouldn't be too difficult is to have New generate a link that gets other players to BOTH the right program, and the right session. I suspect that would help?

That sounds like a really good idea, but it seems the main source of this confusion is that something is weird with my local instance.

Thanks for indulging this barrage of stuff, by the way.

@cdsmith
Copy link
Collaborator

cdsmith commented Aug 7, 2020

I like your comment about sharing not being connected to running. I filed a new issue for that. Also filed a new issue for invite links to multi-user program sessions.

I'm really not sure why you don't see the Share button. Without being able to reproduce it, I'm not sure how to look into that. If you file a separate bug for it with all the information you have, I can try to look this weekend. Maybe it's connected to local auth or something like that? (It shouldn't be, but mistakes happen.)

About collaborating on the same code, that's an excellent question, with a long history. Today, no this is not possible. It is one of the oldest open issues (#17), and a student worked on an implementation (#551) for Summer of Haskell a few years back. Unfortunately, the summer project ended in a drive-by mega pull request that needed too much work and could not be merged. I'd love to see someone take this up and I think it's a huge opportunity, but I'm unlikely to have time for it myself in the foreseeable future.

@jbash
Copy link
Contributor Author

jbash commented Aug 7, 2020

The missing Share buttons apparently only happen on my instance and on my browser

It looks like I can recover the Share button on my instance if I disable uBlock Origin in my heavily hacked and abused Firefox profile. I also see the Share button in Chromium or if I use a fresh Firefox profile.

... but even my regular Firefox profile, with uBlock enabled, shows me the button on code.world.

In all cases, the button is present in the DOM, and I can't see any obvious difference between how the Share button is styled and how the Run button is styled.

So there's apparently some difference between versions of CodeWorld, but since it involves uBlock, I doubt that it's anything you'd want to consider as a bug in CodeWorld or that you'd want to investigate any further.

Sorry about that.

If you do for some reason want to see what's being sent back, my instance is front-ended by Apache at https://codeworld.jbash.com and also directly accessible for the moment at http://vps2.kdjf.net:8080 . The Apache front end doesn't seem to affect the Share button thing.

As for this issue, feel free to close it whenever you think you've sucked all the useful juice out of it...

@cdsmith
Copy link
Collaborator

cdsmith commented Aug 7, 2020

Okay, I see. So the idea is that uBlock is detecting the button as a popup or something, and blocking the script from showing it? I hate to walk away from a problem, but I think it's unlikely I can debug this issue on my side. So unless it comes up for other users, I think I will punt on it. There are two more specific issues for the sharing and multiuser UI issues, so I'll close this in favor of those two.

Thanks so much for talking this through and helping to make the platform easier to use.

@cdsmith cdsmith closed this as completed Aug 7, 2020
@jbash
Copy link
Contributor Author

jbash commented Aug 7, 2020

So the idea is that uBlock is detecting the button as a popup or something, and blocking the script from showing it?

Presumably something like that. And I have no idea what's triggering it, or how it manages to hide the button without unlinking it from the DOM. uBlock does much black magic that I don't want to understand. Personally I plan to just disable uBlock for that site and ignore it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Needs more information or major design decisions
Projects
None yet
Development

No branches or pull requests

2 participants