DinnerBuffet / TTSCarcassonne

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

[Bug] Builder + Magic Portal + Cloister #7

Closed lilasquared closed 4 years ago

lilasquared commented 4 years ago

We were playing a game just now when a player added a tile to a feature containing the builder, and placed a meeple on that tile. Then they got a second tile which contained the magic portal. When trying to place a meeple from the magic portal there was an uncompleted cloister that did not show as a valid placement, and when placing it there anyway the message was "Only one meeple may use the magic portal per turn". We wondered if it was due to the placement of the meeple in the first "turn" from the builder. We went ahead and let the piece stay on the cloister and were able to continue on but it might be a bug in the game logic.

(the uncompleted cloister was due to a tower piece capturing the meeple that was there)

DinnerBuffet commented 4 years ago

I've reproduced this and it does appear to be a bug. I will try to get a fix out soon. Thanks so much for reporting!

DinnerBuffet commented 4 years ago

Quick note if you're curious, this bug was caused by code added to The Phantom micro expansion. With that expansion, you are allowed to place the secondary phantom meeple with one tile. In this circumstance, it is illegal for both of them to use the magic portal. Since the Phantom was added almost a year and a half ago, the bug has probably existed since then.

lilasquared commented 4 years ago

Wow thats a long time, I would guess its a pretty rare occurrence. Is the same bug the reason the cloister didn't show as a valid space or is that something else?

DinnerBuffet commented 4 years ago

"Wow thats a long time, I would guess its a pretty rare occurrence." You'd be surprised. Yes it might be an usual combination but I've had very common scenarios be completely broken for years without being reported. Truthfully, I don't have time to test every expansion every time I make a change and not enough people report bugs. Reporting them really helps.

"Is the same bug the reason the cloister didn't show as a valid space or is that something else?" Yes.

Although unrelated, I also noticed another bug while I was testing this morning. The rules state that, if you place a tile containing a magic portal, you shouldn't be able to place the meeple on features completed by this tile. Well I just tried and I could place it on a nearby cloister completed by the tile. Too many bugs!

I should have time this weekend to fix all of these.

lilasquared commented 4 years ago

Luckily we can still just override whatever the game says and move forward, which is a nice feature to be honest! Thanks again for the great work on this. I haven't had time to get the dev environment set up for this but would like to some day

DinnerBuffet commented 4 years ago

The mod was designed such that figures are always calculated real-time. Yes, the mod will still validate how you placed the figure and prevent you from going to the next stage of your turn, but skipping the turn does the same thing.

Tiles, on the other hand, have a lot of metadata stored, so they must be validated in order to store this data. You can still remove tiles once they have been placed (code will immediately run to remove the metadata), but they can only be replaced during a normal turn.

Let me know if you have any questions should you take a look at the code. It's pretty messy but the README should give some guidance.

DinnerBuffet commented 4 years ago

I have a fix ready that will be included in v1.22.6, but I need to spend some time fixing other bugs and testing for regressions before I can release.

Thanks again and keep the bug reports coming!