DinnerBuffet / TTSCarcassonne

Script and data for the Tabletop Simulator mod
MIT License
45 stars 23 forks source link

Multiple issues caused by placing a tile on the table border #10

Closed BafDyce closed 2 years ago

BafDyce commented 3 years ago

In a long game (all expansions) I just placed a tile on the bottom border of the table (where the white player is sitting). As a result the game shifted the placed tiles ("Play area is being shifted to make room for more tiles."). Doing this, a few bad things happened:

DinnerBuffet commented 3 years ago

Hi, sorry to hear you had trouble. I'm no longer working on this mod. Will update the readme to make that clear. Leaving this issue open in the off-chance that someone else makes their own branch of the code and try to pick up where I left off.

Glad to see that people are still playing! Hope you don't run into anymore issues!

BafDyce commented 3 years ago

Oh, sad to hear!

If I find the time I would be willing to debug and fix the issue myself. Nevertheless, thanks for all the effort and the amazing work!

BafDyce commented 3 years ago

Another question: Can you share some tips how I could test my save (or rather, the last manual save) with the most recent version of this mod from github? As far as I know, the script is directly embedded in the savefile, so I'm not sure if I can simply replace it (without breaking anything else). Any tips are welcome :)

DinnerBuffet commented 3 years ago

There's some instructions in the README, though I haven't tried from scratch in a long time. Good luck!

mmann78 commented 2 years ago

Trying to revive this awesome work. I've made my own fork (only local commits so far) and have started to pick up the torch, fixing a few issues and adding a few enhancements. I certainly have several of my own ideas to work on before I start taking others' suggestions (I've run into the border issues originally mentioned in the post, but I want to start with simpler things to get acquainted with the code) The main question I have is how would I put the code back in the workshop (with the nice graphics already provided). I can certainly still work with my own save files as I continue to improve the mod. Would it make sense to source control the save file or would that be considered a "binary" that git/GitHub discourage from adding to a repository?

DinnerBuffet commented 2 years ago

Trying to revive this awesome work. I've made my own fork (only local commits so far) and have started to pick up the torch, fixing a few issues and adding a few enhancements. I certainly have several of my own ideas to work on before I start taking others' suggestions (I've run into the border issues originally mentioned in the post, but I want to start with simpler things to get acquainted with the code)

Good luck!

The main question I have is how would I put the code back in the workshop (with the nice graphics already provided). I can certainly still work with my own save files as I continue to improve the mod. Would it make sense to source control the save file or would that be considered a "binary" that git/GitHub discourage from adding to a repository?

Not sure I understand the question completely. Are you wondering how the workshop works in general? You can think of a workshop item as essentially uploading one of your save files to be available publicly. Like the save file, the graphics will continue to be downloaded from their referenced location, which should all be at my google drive account. I recommend using something like the TTS mod backup tool to make sure you have all of these assets saved somewhere in case for whatever reason my account becomes unavailable.

As for uploading save files to github, I actually tried this for a short while since they aren't strictly binary. However, it seems that TTS completely re-arranges the JSON when you save, so the diffs between revisions become enormous. Unless they've changed that, I would recommend just saving/backing up manually. I just threw backups onto my google drive.

mmann78 commented 2 years ago

The main question I have is how would I put the code back in the workshop (with the nice graphics already provided). I can certainly still work with my own save files as I continue to improve the mod. Would it make sense to source control the save file or would that be considered a "binary" that git/GitHub discourage from adding to a repository?

Not sure I understand the question completely. Are you wondering how the workshop works in general? You can think of a workshop item as essentially uploading one of your save files to be available publicly. Like the save file, the graphics will continue to be downloaded from their referenced location, which should all be at my google drive account. I recommend using something like the TTS mod backup tool to make sure you have all of these assets saved somewhere in case for whatever reason my account becomes unavailable.

So I stumbled across how to upload a workshop item from the TTS website, but it looks like there is a "unique ID" associated with the workshop item. I thought I saw somewhere in your documentation that you took your original workshop item down (not sure when because I've been using it through all of the pandemic). My question was more can I use the existing "unique ID" to upload improvements to the existing workshop item (once I'm happy with my own testing). I think I see a unique ID in the "Info" of the workshop item I have, but it certainly gives the impression that it was taken down (error messages about not being able to find stuff)

Right now I'm concentrating on the scripts because asset/GUI development is not exactly my area of expertise. One of the things that I really like about this mod is that most (all?) of the expansions already have existing assets, so I can focus more on the scripting. I'm new to TTS and Lua but I figure my 20+ years of programming experience and 15+years of playing Carcassonne should help me through a lot of it.

DinnerBuffet commented 2 years ago

So I stumbled across how to upload a workshop item from the TTS website, but it looks like there is a "unique ID" associated with the workshop item. I thought I saw somewhere in your documentation that you took your original workshop item down (not sure when because I've been using it through all of the pandemic). My question was more can I use the existing "unique ID" to upload improvements to the existing workshop item (once I'm happy with my own testing). I think I see a unique ID in the "Info" of the workshop item I have, but it certainly gives the impression that it was taken down (error messages about not being able to find stuff)

My workshop item still technically exists with the same ID as before, but it can not be reactivated without challenging the copyright claim. In other words, you'll need to upload it as a new item. Also be aware there's a fairly good chance that yours might get taken down as well.

Right now I'm concentrating on the scripts because asset/GUI development is not exactly my area of expertise. One of the things that I really like about this mod is that most (all?) of the expansions already have existing assets, so I can focus more on the scripting. I'm new to TTS and Lua but I figure my 20+ years of programming experience and 15+years of playing Carcassonne should help me through a lot of it.

That's exactly my same boat when I worked on it (minus your experience). The original was made by several people and I just appropriated it into my own scripting project. For the same reason, a lot of the newer content (ie. Carcassonne v2 tiles + expansions) never got imported.

As far as adding expansions, be aware that I already did most of the low-hanging fruit. The remaining expansions that have not been done were either too complicated, didn't fit within the design of my code, didn't seem interesting enough, or some combination of the three. I started a branch of the code for implementing bridges, castles, and bazaars, but I think most (if not all) of the work so far is just on the bridges portion.

If you have any questions I'm happy to answer. I think the code is in pretty decent shape now after a bunch of refactoring I did, but my hobby coding isn't exactly high quality. Besides, you'll likely need to rewrite most of it in order to account for some expansions. The only regrettable thing I didn't get to was a re-write of the AI code. I think it works pretty good 90% of the time but there are some game-breaking bugs and the code is a mess. If you can understand any of that, kudos.

BafDyce commented 2 years ago

Huge shoutouts to you @DinnerBuffet ! Even though you stated that you didnt want to develop the mod further, you're still giving advice/tips to others willing to continue your work instead of just ignoring them. Huge props to that!

mmann78 commented 2 years ago

I finally pushed something to the master branch of my forked repo. There are a few minor improvments/bugfixes, but the 2 main differences are:

  1. Refactoring code so that expansions are in their own modules. I've started with the expansions I'm more familiar with (making checking for bugs easier), but I will continue as I learn to play some of the expansions already coded (some I own, just never bothered to learn/play with). Some of the existing Lua modules are just too big to work with. I probably broke the AI portion (by moving variables and functions around), but I will revisit that after my current efforts (probably starting with a different refactor as it's already been mentioned it's needed)
  2. I added a bunch of statistics that get displayed at the end of the game. This was another reason to break up the code by expansion because some of the stats desired are expansion set specific (like number of extra tiles gained by using the builder). The statistics will be my primary focus in the near term.

I included my current save file in the repo. I'm considering adding other save files as "test cases" to test some of the script logic, but haven't decided yet. I haven't put a "version" yet to the code because I like to rebase to "fix" bugs introduced in previous commits. However once a version has been set, I wouldn't rebase previous commits. Comments on the code are certainly welcome, but should probably be done on my forked repo to reduce confusion here.

DinnerBuffet commented 2 years ago

Had a quick look at your commits. Looking good! I like the new expansion modules.

I agree that this issue is way off-topic and will probably just create confusion. I will close this issue, but feel free to ping me if you have any questions.

I've added a link to your branch to my README. Will look forward to seeing your new version on the workshop!