Gameoptions with dynamic description

Game development with Board Game Arena Studio
Post Reply
User avatar
quietmint
Posts: 299
Joined: 31 July 2017, 00:28

Gameoptions with dynamic description

Post by quietmint »

Hanabi offers a "preset deck of the day", and we were thinking about a preset match of the day/week for a new game, but we need a way to inform players before starting. I want something like this:
Screen Shot 2020-07-12 at 21.00.57.png
Screen Shot 2020-07-12 at 21.00.57.png (33.94 KiB) Viewed 2305 times
It seems a game option/variant with changing description text isn't possible now? From what I can tell, the list of options is loaded by main site call to /tableinfos.html (none of my game code is invoked), and the description string is handled by BGA translation system with a special key like "gameoptions_1985_English description here" (the translations are pre-computed and don't invoke my game code, either, of course). Any thought about BGA providing way to do this in the future? Or can anyone suggest another idea?
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Gameoptions with dynamic description

Post by Een »

There is no such possibility in the framework at the moment. Options are strictly static.
We have seen some requests about extra possibilities for options (some games tend to offer a huge number of options), but at the moment we have not set a priority for a framework evolution about this.
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: Gameoptions with dynamic description

Post by Tisaac »

Ok and what about the gameoption.php file, could we put some php file inside that would be runned when we click on the "reload game option" button ?
That way we wouldn't have to push new code but just click the button (or maybe even fetching an URL ?).
User avatar
quietmint
Posts: 299
Joined: 31 July 2017, 00:28

Re: Gameoptions with dynamic description

Post by quietmint »

Yes we can put PHP there to generate the array, but now it only runs one time (when you click "reload gameoptions"). We cannot (yet) put lambda function() inside the array as the value of "description", for instance. I think there's also no way to deploy only gameoptions to production (must deploy the full game again)?
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Gameoptions with dynamic description

Post by Een »

I get that you are enthusiastic with this matchup of the week idea, but I have to disappoint: this is strictly non dynamic (for security reasons, we make sure on the way that it's deployed as a static array as it's not just used in a "game" context). So for now, it's a no go.
I don't really know what has been done on Hanabi for predefined sets, so I'll let sourisdudesert complete the answer or suggest something when he is available again, if he sees a possibility for this.
User avatar
quietmint
Posts: 299
Joined: 31 July 2017, 00:28

Re: Gameoptions with dynamic description

Post by quietmint »

Yes, we'd need a new syntax. (Hanabi doesn't show any description). If "description" could be a static array, like this?

Code: Select all

'description' => [
  'conditiom' => 'date'
  'dateFormat' => 'z', // day of the year
  'values' => [
    66 => clienttranslate('option on day 66'),
    67 => clienttranslate('option on day 67'),
    68 => clienttranslate('option on day 68'),
  ]
]
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Gameoptions with dynamic description

Post by Een »

Yes, something like that could probably work. I took a note to discuss this with sourisdudesert when he is back.
Post Reply

Return to “Developers”