[SOLVED] Option only usable when Elo is off

Game development with Board Game Arena Studio
Tchebychev
Posts: 103
Joined: 08 March 2014, 00:53

[SOLVED] Option only usable when Elo is off

Postby Tchebychev » 12 April 2018, 18:19

Hi everybody :)

I am developping a classic card game, which length is not determined by the rules (unlike Belote, where there is a target score).
So I will certainly add several possibilities in the options. Something like that:
Game length
  • 4 hands
  • 8 hands
  • 12 hands
  • ...

I would like to add a kind of "friendly mode", where players can play as long as they wish: each time a hand ends, there is a vote to continue the game or not. The game ends when any player votes "No". If all players vote "Yes", the game continues with a new hand (things like that can be seen on some other game platforms, like https://www.whistenligne.com).

For that mode, Elo does not make sense because the winner can change depending on the game end, and I think I will manually neutralize scores at the end.
Is there any way to prevent players to play that option with Elo off, in gameoptions.inc.php? Or (more unlikely) to ovveride the Elo computation system to put +0 to everyone?
Even if I neutralize player score and strongly advise not to play this with Elo on, there is still room for Elo maniacs that could use that option to boost their stats quite fast...

Thanks for your help!

Tcheby
Last edited by Tchebychev on 21 May 2018, 20:03, edited 1 time in total.

User avatar
Een
Posts: 1868
Joined: 16 June 2010, 19:52

Re: Option only usable when Elo is off

Postby Een » 20 April 2018, 09:43

Hi Tchebychev,

You can use this displaycondition inside the definition of your "friendly mode" option. Then it will appear only if ELO mode is OFF.

Code: Select all

'displaycondition' => array(    // Note: do not display this option unless these conditions are met
                                    array( 'type' => 'otheroption', 'id' => 201, 'value' => 1 )
                                 )

Tchebychev
Posts: 103
Joined: 08 March 2014, 00:53

Re: Option only usable when Elo is off

Postby Tchebychev » 20 April 2018, 12:22

Hi Een,

Thanks for your reply. I think I'd rather display the option all the time (I think few players play with ELO off by default so most player would not be aware that option exists).
So, if it is possible with the framework, since thanks to you I know the option for ELO has id 201, I think I will replace the display condition with a start condition, showing up a message if somebody tries to start the table with Elo on. (I assume here that the value for ELO on is 0):

Code: Select all

         'startcondition' => array(
             1 => array(), //
             2 => array(), // "Normal" game length options (4 turns, 8 turns...) can be played with no restriction
             ...
             6 => array(
                 array(
                   'type' => 'otheroption',
                   'id' => 201, // Option for ELO
                   'value' => 0, // Value for ELO on ?
                   'message' => totranslate('This option can only be played with ELO off.')
                 )
             ),
         ),


Will that work, do you think?
Last edited by Tchebychev on 20 April 2018, 18:22, edited 1 time in total.

User avatar
Een
Posts: 1868
Joined: 16 June 2010, 19:52

Re: Option only usable when Elo is off

Postby Een » 20 April 2018, 15:44

Well, startcondition currently implements only minplayers and maxplayers values, so... no :P
But as this could be useful for other games, I suppose we can add it to the framework when releasing your game. Please remind us when we'll be going for beta on this :D

Tchebychev
Posts: 103
Joined: 08 March 2014, 00:53

Re: Option only usable when Elo is off

Postby Tchebychev » 20 April 2018, 18:27

Alright. In the meantime I'll go for your solution.
I have almost finished to code the game (French Tarot), but I now have to test it a lot and debug it. I let you know when it's ready for beta testing (during May, probably).

Thanks a lot for your help Een :)
See you soon.

Tcheby

Cococool69
Posts: 10
Joined: 30 May 2016, 19:35

Re: Option only usable when Elo is off

Postby Cococool69 » 30 April 2018, 15:08

Hi,
I'm very impatient to play Tarot and i ok to be on the beta player list.

Thanks Tchebychev

User avatar
Een
Posts: 1868
Joined: 16 June 2010, 19:52

Re: Option only usable when Elo is off

Postby Een » 16 May 2018, 16:35

Tchebychev wrote:I think I'd rather display the option all the time (I think few players play with ELO off by default so most player would not be aware that option exists).


This was also requested by Victoria_La.
With the next release, you will be able to add a 'notdisplayedmessage' to your option, that will cause the option to show as disabled (instead of just removing it when displaycondition is set and not valid).

NB: this is already available on the studio so you can test it.

User avatar
Victoria_La
Posts: 275
Joined: 28 December 2015, 20:55

Re: Option only usable when Elo is off

Postby Victoria_La » 17 May 2018, 00:53

Do you mean like?

Code: Select all

  'notdisplayedmessage' => totranslate('This option can only be played with ELO off.')

Een wrote:This was also requested by Victoria_La.
With the next release, you will be able to add a 'notdisplayedmessage' to your option, that will cause the option to show as disabled (instead of just removing it when displaycondition is set and not valid).

NB: this is already available on the studio so you can test it.

User avatar
Een
Posts: 1868
Joined: 16 June 2010, 19:52

Re: Option only usable when Elo is off

Postby Een » 17 May 2018, 08:43

Victoria_La wrote:Do you mean like?

Code: Select all

  'notdisplayedmessage' => totranslate('This option can only be played with ELO off.')



Yes, exactly.

User avatar
Victoria_La
Posts: 275
Joined: 28 December 2015, 20:55

Re: Option only usable when Elo is off

Postby Victoria_La » 17 May 2018, 13:24

Did not work like that. Anything else is missing?

Code: Select all

        100 => array(
                'name' => totranslate('Learning Game (No Research)'),
                'values' => array(
                       
                        1 => array( 'name' => totranslate('Off'), 'tmdisplay' => totranslate('') ),
                        2 => array( 'name' => totranslate('On'), 'tmdisplay' => totranslate('Learning Game') ),
                       
                ),
                'displaycondition' => array(
                        // Note: user cannot use this option unless these conditions are met
                        array( 'type' => 'otheroption',
                                'id' => 201, // ELO OFF hardcoded framework option
                                'value' => 1, // 1 if OFF
                                'notdisplayedmessage' => totranslate('Learning variant available only with ELO off')
                        )
                ),
                ),


Return to “Developers”

Who is online

Users browsing this forum: No registered users and 3 guests