Page 1 of 1

Name/space issues with Bounty Hunting when you don't own the project

Posted: 09 February 2021, 11:06
by codehearted
I tried using the recommended method mentioned on the Bounty Hunting page: create a new project then from this project's "manage game" page you can overwrite it with a copy of the official project you want to work on.

I also clicked the link to get read-only access to the files through the link on the Bounty Hunting page, in part because I didn't see those instructions at first. I hope this wasn't a huge mistake - if so those links perhaps shouldn't be there. I'll explain why I'm worried it might be.

In any case I have one project named exactly the same as the real game - sqroomtwentyfive, with read-only access.
I also have another one with a different name - chroomtwofive because it seems to need to be unique. They both have the same files copied in, I believe.

I don't know if or how they might be modified. I wanted a second one because I needed one I could modify and test with, to try to fix the bug and confirm it is fixed. This system seems like it's designed to allow people who don't have write access to the main source to try to develop and test fixes. At least, the Bounty Hunting page gives that impression.

However, the code copied into the second project doesn't run as is. I get a Fatal error propagating from GS 1 (method: createGame): saying "Class Chroomtwofive not found". And then "Wrong table status (open): should be 'setup'". The game engine is looking for a class named the same as my project with my username prefix, but the code has a class and set of filenames named after the other prefix.

My short term goal here is just to get it to work and be able to fix bugs and learn. My slightly longer term goal, since it takes an unbounded amount of testing and re-fixing, is to submit these fixes.

  • One possible solution here is, I could change the code, the filenames etc. to all refer to my new username and prefix. There are 39 instances of the name with prefix, but I suspect it might be more complex than a search and replace, and then renaming of files.
    If I were to do this though, it would break the code. It could no longer function in the old prefix username for the same reason. I'd either be taking over the prefix, which would be pretty rude in my opinion, when I hadn't lifted a finger in the actual development; or I'd be submitting a bunch of code that didn't work anymore. So that doesn't seem very useful for submitting.
  • I could maybe try to write a reusable forwarding main game class of my own (the one it's crashing and looking for) to try to forward function calls to the other code, while leaving it intact other than bug fixes. One issue is I don't think it's possible to do redirects in every necessary way - SQL files and folders for images, for example.

    And when it's time to submit, again there is a mess to clean up - but at least it would be mostly an external mess that could be achieved almost entirely by deleting files, that could hopefully be slightly modified and re-used another time to do the same thing. It's a nice thought at least. I don't know if it's possible. There would have to be a shell script to delete the mess.
  • Should I create a project with the exact same name as the original game - sqroomtwentyfive? If so, that's where I am worried getting the read-only access might have been a problem, because even if I delete the project with that name, so I can try to create an empty project with that name, I think it would re-create the read-only one. if I make another project with the same name - assuming I can create a project with that name at all. I might not be able to because a published game is named that, or perhaps because another developer has a project named that - I'm not sure if it's a user namespace or global namespace in order to be in a shared play now area. I'm still learning the rules here. I admit I could experiment further here, but It seems like I was discouraged from doing so by the BH page link. (Correction - I had mixed up where the Get Read Only Access link was, it was on the studio projects page, but I am still thinking getting read only access shouldn't prevent testing.)
So, what's the standard procedure for bug hunting and how should I move forward to be able to play a game on code I can change? I would think this would follow a standard software development model where there is some correct way to clone a repo and work on and test it independently, right? I just can't figure out what the correct way is.

Thanks in advance :)

Re: Name/space issues with Bounty Hunting when you don't own the project

Posted: 09 February 2021, 14:29
by Een
This is a little verbose, but I see nothing wrong with what you did overall.
Points where things might have gone wrong:
- the proper project name is "roomtwentyfive". Not sure why you are speaking about "sqroomtwentyfive".
- you may not have used camelcase when overwriting. As cloning a project relies on renaming and substitution, if you didn't use the same case as the original developer (which is usually camelcase, you can check in the readonly project), then indeed renaming or substitution probably didn't work as expected.
And for some projects, they might for some reason not be clonable, or result in difficult to read code, when the project name is not distinctive enough (for this project, it should not be the case though, "roomtwentyfive" is probably not used in variable names and such).

Re: Name/space issues with Bounty Hunting when you don't own the project

Posted: 10 February 2021, 07:56
by Tisaac
The easiest is to use a script that does renaming on the fly before synch with studio. You can find example on the cookbook on the studio.doc.
That way you will have the impression to work on original game while pushing in your custom repo for tests.

Re: Name/space issues with Bounty Hunting when you don't own the project

Posted: 10 February 2021, 08:22
by codehearted
Een wrote: 09 February 2021, 14:29 This is a little verbose, but I see nothing wrong with what you did overall.
Points where things might have gone wrong:
- the proper project name is "roomtwentyfive". Not sure why you are speaking about "sqroomtwentyfive".
- you may not have used camelcase when overwriting. As cloning a project relies on renaming and substitution, if you didn't use the same case as the original developer (which is usually camelcase, you can check in the readonly project), then indeed renaming or substitution probably didn't work as expected.
Well, the code I have includes a main file "sqroomtwentyfive.game.php" containing a line "class SqRoomTwentyFive extends Table". This is the first game I've taken a close look at, so I'm learning from it. My impression had been that it's typical to prefix code, in this case the Sq refers to the developer Sqweelygig.

As for the camelcase, I'm all for perfect matching if that's the proper way, I just needed to know we didn't need to be globally unique among all developers. I've noticed that whatever case a project name is written in though, in my limited experience the system converts it to lowercase for project and file naming.

Also I noticed I am seeing my own separate "chroomtwentyfive" copy of Room 25 showing up on studio projects all of a sudden, even though the light is red in Manage Projects so it shouldn't be visible to others. Is that just showing there for me?
Een wrote: 09 February 2021, 14:29 And for some projects, they might for some reason not be clonable, or result in difficult to read code, when the project name is not distinctive enough (for this project, it should not be the case though, "roomtwentyfive" is probably not used in variable names and such).
No, I could convert it easily enough, I just don't want to break it, I figured there might be a better way.
Which of these options I originally mentioned would you choose, if you don't mind me asking? Is it possible for me to make an sqroomtwentyfive project even though a public repo exists named that etc?

Re: Name/space issues with Bounty Hunting when you don't own the project

Posted: 10 February 2021, 08:24
by codehearted
Tisaac wrote: 10 February 2021, 07:56 The easiest is to use a script that does renaming on the fly before synch with studio. You can find example on the cookbook on the studio.doc.
That way you will have the impression to work on original game while pushing in your custom repo for tests.
Thank you for the lead - I found it on the manage page now, I was just using the wrong script to sync with. I finally have a working game to test with. Your help is appreciated.

Re: Name/space issues with Bounty Hunting when you don't own the project

Posted: 10 February 2021, 08:54
by Een
codehearted wrote: 10 February 2021, 08:22 Well, the code I have includes a main file "sqroomtwentyfive.game.php" containing a line "class SqRoomTwentyFive extends Table". This is the first game I've taken a close look at, so I'm learning from it. My impression had been that it's typical to prefix code, in this case the Sq refers to the developer Sqweelygig.
Some developers prefix their project name, but the production project is the one with the correct name without prefix. In that case, you cloned a project that has already been cloned from the prod repo by another developer (and possibly modified). It would be better to start over from the reference project in any case.
codehearted wrote: 10 February 2021, 08:22 Also I noticed I am seeing my own separate "chroomtwentyfive" copy of Room 25 showing up on studio projects all of a sudden, even though the light is red in Manage Projects so it shouldn't be visible to others. Is that just showing there for me?
All projects appear on the list, except those with the default bgg_id or a bgg_id matching the tutorials, in order not to clutter the list. There is also some garbage collecting for projects after some months of inactivity.
Een wrote: 09 February 2021, 14:29 No, I could convert it easily enough, I just don't want to break it, I figured there might be a better way.
Which of these options I originally mentioned would you choose, if you don't mind me asking? Is it possible for me to make an sqroomtwentyfive project even though a public repo exists named that etc?
Every project name must be unique. chroomtwentyfive is perfectly fine. You should just overwrite it with the proper source project roomtwentyfive instead of sqroomtwentyfive.

Re: Name/space issues with Bounty Hunting when you don't own the project

Posted: 10 February 2021, 09:28
by codehearted
Een wrote: 10 February 2021, 08:54
codehearted wrote: 10 February 2021, 08:22 Well, the code I have includes a main file "sqroomtwentyfive.game.php" containing a line "class SqRoomTwentyFive extends Table". This is the first game I've taken a close look at, so I'm learning from it. My impression had been that it's typical to prefix code, in this case the Sq refers to the developer Sqweelygig.
Some developers prefix their project name, but the production project is the one with the correct name without prefix. In that case, you cloned a project that has already been cloned from the prod repo by another developer (and possibly modified). It would be better to start over from the reference project in any case.

...

Every project name must be unique. chroomtwentyfive is perfectly fine. You should just overwrite it with the proper source project roomtwentyfive instead of sqroomtwentyfive.
Thank you! These two clues along with the other help along the way were what finally got me to a playable copy of the game. I'm glad I did it with just the built-in tools, so I know I'm not doing it wrong. I didn't realize that the sqRoomTwentyFive was likely to not be the official one, and that I was better off copying the official "RoomTwentyFive" repo (or that there was a separate official RoomTwentyFive repo) into the "chroomtwofive" (I misspoke when I called it chroomtwentyfive before, I had tried to use that name previously and ran into some issues that lead to me switching to this new name.)

Anyway. Problem solved, I think. I've already reproduced the bug I'm hunting. Thanks again.