Page 1 of 1

Open Sourcing Studio components

Posted: 06 September 2020, 15:37
by v_k_k
I've sifted a bit through this forum and found other threads on open sourcing individual games or all of BGA, but not on this topic specifically. I understand that there are no plans to open source *all* of BGA, but I'm curious to know if just the studio components that are mentioned on the wiki could be made available?

Here is the specific case I'm encountering right now. I'm working on a card game and thought I'd use the Deck component. It turns out that though it has some features I'd like, it's a bit too rigid for my use case. So I'd like to make my own deck-like class that does. But I'm not really sure how Deck is doing shuffle, and there are enough warnings elsewhere on the wiki about randomness, that I'm wary of coming up with my own solution. I'd like to be able to use the Deck's source code as a starting point to create my custom component, but it doesn't seem to be available.

However, my Deck problem is just a specific case that shouldn't distract from a more general issue. Most of the documentation for these types seems incomplete. Some of it even sounds like the author had to to reverse engineer many of the features they describe. Other features (e.g., Draggable) have requests for documentation but no clear pathway for how one would contribute to it.

So would it be possible that just these components be made available somewhere for developers to reference? The code wouldn't need to be functional, just readable. It would also give game developers an opportunity to fill in the gaps in the current documentation.

Re: Open Sourcing Studio components

Posted: 06 September 2020, 17:01
by CuriousTerran
The javascript side of things is readily available. Using 'view page source' during game one can find the BGA js code.
https://en.1.studio.boardgamearena.com: ... _studio.js
It is all minified javascript in one long line, but one can search the file for a particular function. Select and Copy the code for the function you are interested in (look for ebg/draggable or ebg/stock) and paste it into https://www.unminify2.com/ to get the code parsed with line breaks and indents to make it more human readable.

On the php side most of the functions (from a game design standpoint) like deck are just wrappers for sql database calls, so you can use bga_rand for randomness to write your own sql database calls to customize ordering of cards.

Re: Open Sourcing Studio components

Posted: 09 September 2020, 01:28
by tsaunat
As was previously stated, deck is just pre-done sql calls you could probably use deck and include some extensions to write/read the database in the specific way you need.

But I agree some of the resources are poorly documented in particular zone has some errors in the documentation, but I don't feel knowledgeable/confident enough to fix them although I do like that documentation is in a wiki. More shared code is better. I do like that a large amount of the projects in studio are readable.

Re: Open Sourcing Studio components

Posted: 23 December 2024, 17:55
by wdspider
I stumbled upon this thread while looking for the php source code for Deck. Much like the OP, the component does about 85% of what I want. Therefore, I was hoping to use it as a guide while creating a new component that includes the additional 15% of what I need.

I understand that it might mostly be a wrapper around db calls; however, referencing the source would make it that much easier to create a custom version rather than writing the whole thing from scratch.

It's been a few years since the original OP. Any chance that the source code can now be released?