Page 1 of 2
Code Sharing
Posted: 28 January 2017, 02:55
by Victoria_La
I think there are lots of active developers here, can't blame you - its fun!
Unlike other open source communities though its not open source so its very hard to find any relevant stuff,
reuse what other people did or anything like that. The admins don't share framework code, and we cannot extend it.
So I propose to have some other other ways of code sharing, for things like
- common APIs which is not in framework
- commonly used tools and scripts
- re-usable game templates
- commonly used graphics
etc.
We can put such project on github but it seems disconnected, or create a project here and add anybody who wants to contribute (but would be hard if multiple people start modifying it).
So, suggestions?
Re: Code Sharing
Posted: 28 January 2017, 10:35
by Andy_K
I'm all in favour of this. I'm currently storing all my source code in GitHub anyway, so I'd be quite happy to use a repository there for shared BGA code, but I'm open to other suggestions. I'm sure there's a few things I've written which could be handy for others - hex based grid system and pathfinding on eruption, for example. It's a shame we can't (that I'm aware of) reference other include files, as it would be handy to just directly include a community utility library.
Re: Code Sharing
Posted: 28 January 2017, 19:22
by Victoria_La
We can include files but they have to be copied in the project (which is better anyway, you don't want you games to stop working because
common library was updated)
Re: Code Sharing
Posted: 30 January 2017, 14:32
by Andy_K
I suggest we make a start, and then with any luck more devs will contribute once we have some sort of a system up and running. We can set up a github project for now, I think the source control on BGA projects is not sufficient for code control from multiple developers.
So, things to share:
Common art - tokens, counters, meeples, dice, arrows, icons, etc. Presumably we're allowed to harvest many of these from existing games on BGA?
Utility code - common time saver functions for e.g database work, manipulating objects, and so forth. Whatever else is deemed useful.
Templates - what sort of thing are we looking for here? Simple games using common mechanisms may be useful - much like reversi and the other existing examples (which are absent on my FTP area). May well be we can make some improvements to the code for those examples too, as I doubt they're getting much maintenance.
I think anything which promotes community involvement in the development process here is a good thing... there are a huge number of developers in the projects listing, but only a handful who've managed to get something finished and published in the last 12 months (or for that matter, contributed on the dev forums either), which leads me to suspect that many are just losing interest or hitting too many brick walls when trying to make progress.
Re: Code Sharing
Posted: 08 February 2017, 13:22
by Morgalad
Following this I´ve created a project in github for my learning / practice project:
https://github.com/AntonioSoler/bga-incangold
Re: Code Sharing
Posted: 11 February 2017, 01:04
by Victoria_La
I created a wiki page for starters,
http://en.doc.boardgamearena.com/BGA_Code_Sharing
please add you project links there
Re: Code Sharing
Posted: 25 February 2017, 21:22
by Victoria_La
Ok I create a project on bga code "sharedcode" and mirror git repo
https://github.com/elaskavaia/bga-sharedcode
It has nothing now (empty bga project). If you want to submit your samples, js functions, etc, create a pull request on github for now.
Let me know who wants access to bga project (I don't think I can make it public now)
Re: Code Sharing
Posted: 13 April 2017, 17:25
by Andy_K
Victoria_La wrote:We can include files but they have to be copied in the project (which is better anyway, you don't want you games to stop working because
common library was updated)
I wanted to clarify what we can or can't do with this, so question for Victoria or any admins who know the answer:
Currently in my studio project I've added a new file (let's call it 'akpathfinding.inc.php'), which has some custom php classes in it. It's linked via a 'require' in my game.php file. This works fine in the studio, but when it comes to production is this sort of code structure allowed or is it unsafe due to potential for namespace clashes or something like that?
Re: Code Sharing
Posted: 14 April 2017, 09:12
by Een
Andy_K wrote:
Currently in my studio project I've added a new file (let's call it 'akpathfinding.inc.php'), which has some custom php classes in it. It's linked via a 'require' in my game.php file. This works fine in the studio, but when it comes to production is this sort of code structure allowed or is it unsafe due to potential for namespace clashes or something like that?
In order to have a common structure for all games, only the default files are taken into account.
If you add an extra php file, it won't get commited to the source control and won't get packaged for deployment, so it won't work out of the studio.
Re: Code Sharing
Posted: 14 April 2017, 09:13
by Andy_K
Alright, so if I put the new classes inside the existing files that would be okay?