Author Topic: configure the layout of the tile deck  (Read 11696 times)

Offline danisthirty

  • (not thirSty!)
  • Owner
  • Chatelain Grand-Croix
  • *
  • *
  • Posts: 6941
  • Merit: 293
  • "First to 4 points wins?"
    • View Profile
Re: configure the layout of the tile deck
« Reply #15 on: December 19, 2014, 02:00:40 AM »
I can't pretend to understand all of what you're talking about but it's really good to see others taking an interest in what can be done with JCloisterZone as I'm sure farin will be very grateful of your ideas and support!

I believe farin's focus at the moment is making the expansions more granular so that you can select only certain elements of specific expansions. Obviously this ties-in with how tiles are selected so this may help your "pie in the sky dream" to become a reality. Or I may just have dreamt all of that.

Offline Decar

  • Owner
  • Chatelain Grand Officier
  • *
  • *
  • Posts: 6719
  • Merit: 317
  • Shut up and take my money!
    • View Profile
    • tehill.net
Re: configure the layout of the tile deck
« Reply #16 on: December 19, 2014, 09:51:34 AM »
I've had a productive day!  I figured out why I couldn't run JCloisterZone in eclipse, then I could get started:

I've created a new file called prepared.yaml which specifies a draw list (just like the debug mode).

When a new game is started, it checks for this file.  If it exists, the DrawPhase is replaced with a PreparedDrawPhase that pulls tiles from the list specified in the file.

The tiles are played in the order the were specified, when the list end it continues to play randomly, unless there is a . (just like debug) .

Here's the good bit.

When you save the game, it knows it's a prepared game and contains the list of tiles left to play. 

So you can load the save file without the prepared.yaml and continue!

Just need to review all my changes and figure out how to commit it.

There's also a little worry that potentially players could cheat if they load a game with the prepared.yaml ready to use without the other players knowing.

Gerry

  • Guest
Re: configure the layout of the tile deck
« Reply #17 on: December 19, 2014, 11:04:32 AM »
Impressive !! 


There is a chat interface built in - maybe you could use that to commuicate that a prepared YAML is in use for this game

Offline Decar

  • Owner
  • Chatelain Grand Officier
  • *
  • *
  • Posts: 6719
  • Merit: 317
  • Shut up and take my money!
    • View Profile
    • tehill.net
Re: configure the layout of the tile deck
« Reply #18 on: December 19, 2014, 01:55:07 PM »
I did one better,  I added a prepared counter to the Control Panel on the right hand side.  It tells you how many prepared tiles are left in the deck.

I've submitted my changes for scrutiny : https://github.com/farin/JCloisterZone/pull/74

If you can't wait (and you fancy giving it a go) - you can download a locally built jar file and example prepared.yaml here:

www.tehill.net/carcassonne/jcloisterzone

I've also added a screenshot feature under the Window Menu, thought it was easier than print screening :)

Gerry

  • Guest
Re: configure the layout of the tile deck
« Reply #19 on: December 19, 2014, 07:59:52 PM »
Hi 

I tried the new jar and it worked well, the counter is really handy. 

Can both  yaml files be used at the same time and if both contained draw commands, which would take precedence?

Gerry

  • Guest
Re: configure the layout of the tile deck
« Reply #20 on: December 19, 2014, 11:33:11 PM »
So as I understand what is happening.

You specify which tile sets (expansions) you want JCloister to be able to select from using the initial game screen.
You can override the random tile selection by using the Draw command, I assume if a tile is forced by the draw command it will not be also selected later as part of the random draw.
Once the draw command file is emptied and you do not force a game stop then Jcloister goes back to selecting randomly from the full tile set (minus any tiles that have already been drawn).

Now having all the tiles come from the draw file has the advantage that all games would be identical but it has the corresponding disadvantage that players could play the game through on their own and then would know exactly what the tile draw would be.

The game supports a discarded tiles function where cards that cannot be placed on the layout are recorded.  Would it be possible to have the draw sequence be
1 select from Draw command file,
2 discard any tiles from a discard command file then
3 select the remaining tiles at random from those left in the initial tile set.

Offline farin

  • Duke
  • *
  • Posts: 241
  • Merit: 44
  • JCloisterZone maintainer
    • View Profile
Re: configure the layout of the tile deck
« Reply #21 on: December 20, 2014, 01:15:16 AM »
Hi guys

First, you don't need to unpack jar to get tile ids, it can be easilly found here https://github.com/farin/JCloisterZone/tree/master/src/main/resources/plugins/classic/tiles
(or you can just clone git repo)

I see you already makes draw option working.  You right that the Draw list is loaded when JCZ starts and is independent of games played.

(and independent on autostart options - for that preset must be defined in config root eg
presets:
  a:
    expansions: [GERMAN_MONASTERIES,
     TOWER, ABBEY_AND_MAYOR, RIVER,
     PHANTOM]
    rules: []

)

Now there is no option to force tile order just for saved game (purpose of this option was just to be able easily repeat incorrect behaviour and test fixed)

Offline farin

  • Duke
  • *
  • Posts: 241
  • Merit: 44
  • JCloisterZone maintainer
    • View Profile
Re: configure the layout of the tile deck
« Reply #22 on: December 20, 2014, 01:21:57 AM »
Quote
You can override the random tile selection by using the Draw command, I assume if a tile is forced by the draw command it will not be also selected later as part of the random draw.
Once the draw command file is emptied and you do not force a game stop then Jcloister goes back to selecting randomly from the full tile set (minus any tiles that have already been drawn).

that is exactly right

Btw there is maybe another option how to implement your goal.
Server part is quite easy, see https://github.com/farin/JCloisterZone/blob/master/src/main/java/com/jcloisterzone/wsio/server/SimpleServer.java

And it select what tile is drawn, it gather or expansion information etc. So it is possible to run server as independent application and connect.
Then server can force draw order (and client don't know it in advance), server can force rules etc.

Gerry

  • Guest
Re: configure the layout of the tile deck
« Reply #23 on: December 20, 2014, 06:51:11 AM »
Farin

thanks for the replies.  I will leave the technical details to Decar  as it is beyond me.

I just know enough to be dangerous.

 I did find the tile codes linked to the graphics useful and I am in the process of adding your tile identifier codes to the tile images I work with.

Thanks again

Offline Decar

  • Owner
  • Chatelain Grand Officier
  • *
  • *
  • Posts: 6719
  • Merit: 317
  • Shut up and take my money!
    • View Profile
    • tehill.net
Re: configure the layout of the tile deck
« Reply #24 on: December 20, 2014, 09:46:23 AM »
Hi Gerry,

I think it makes sense to have a discard: list included in the prepared.yaml which discards selected tiles at the start of the game.  I think that would cover what you described earlier.

Farin's been a great help today over on github.  He's even put up with my terrible code submission. Hopefully over the next few days he'll show me how to do it properly ;)

You can follow our exploits over on https://github.com/farin/JCloisterZone/issues/77

Offline farin

  • Duke
  • *
  • Posts: 241
  • Merit: 44
  • JCloisterZone maintainer
    • View Profile
Re: configure the layout of the tile deck
« Reply #25 on: December 20, 2014, 10:02:28 AM »
If you want we can talk about it via IM/irc whatever. This is quite complex task and there are more ways how to implement it with different pros & cons.

SimpleServer - draw order can be hidden, easy to implement, small complication with tile tracking on server side
or we can still try to modify client - set up some basic framework for full-feature plugin - this means provide way how to hook rule engine and eg. replace draw phase
- this is much hard to impement (and even more hard to implement in flexible but not too complicated way) - but it can be more useful for future posibilities




Offline Decar

  • Owner
  • Chatelain Grand Officier
  • *
  • *
  • Posts: 6719
  • Merit: 317
  • Shut up and take my money!
    • View Profile
    • tehill.net
Re: configure the layout of the tile deck
« Reply #26 on: December 20, 2014, 10:32:22 AM »
Thanks Farin,

I'm away this evening, so maybe we can hook up on IRC if/when you've got time tomorrow?

When I started yesterday, I attempted to swap out the DrawPhase.  I wasn't happy with the conditional check in the CreateGamePhase.  It seems that a client plugin-framework would be the sensible/long term approach.  I imagine they could also help with the fine-grained rules selection you've got planned for the future too.

Short term, I'm new to the code base so I'm keen to make tiny changes.

Having said that, I'm happy to have a go at which approach is best for JCZ long term.  So if you've had thoughts in this area it seems like they way to go.


Share via delicious Share via digg Share via facebook Share via furl Share via linkedin Share via myspace Share via reddit Share via stumble Share via technorati Share via twitter

  Subject / Started by Replies / Views Last post
xx
rules Besiegers in original layout

Started by thodekey

3 Replies
2883 Views
Last post November 16, 2016, 04:48:18 AM
by Paul
exclamation
--- Customized Deck = FUN!!! and Randomized Pixel Art ---

Started by DOCTORawfulMD

30 Replies
19810 Views
Last post February 15, 2014, 11:38:18 PM
by DOCTORawfulMD
xx
A Carcassone deck of cards

Started by Howdypoopy

6 Replies
4387 Views
Last post March 12, 2017, 12:31:28 AM
by stalcupojoy
xx
WTT/WTB Russian Carcassonne (Single-Count-Tile, Gingerbreadman-Tile...)

Started by LaPorxada (aka BigBoss)

15 Replies
9269 Views
Last post June 30, 2017, 02:28:32 AM
by Yashin-n
xx
Trade my Spiel 14 tile for your Spiel 15 tile

Started by pinback

0 Replies
2575 Views
Last post October 17, 2015, 10:16:55 AM
by pinback