Applying Typical Coding Practices

Game development with Board Game Arena Studio
Post Reply
User avatar
edward_green
Posts: 8
Joined: 19 September 2022, 16:30

Applying Typical Coding Practices

Post by edward_green »

I am wondering if there are any typical practices of coding that translate to the development of BGA games? For context I am about a month into development of my first real game. I appreciate the excellent teaching materials, documentation pages, and encouraging community. I see the clear instructions on using version control (and I totally agree. Good version control is a must). I was wondering if anyone has found any other practices to be helpful that aren't talked about as often. I'll list a few that come to my mind, but if you have any other helpful practices to recommend that's great too.

Project documentation: Is there any precedent for making thorough project documentation? I'm thinking of when you use a documentation generation software that requires you make comments with specific formatting describing your classes/instance members/class methods. And then it generates static pages documenting the project structure. I'm a huge documentation nerd and I could definitely see that being helpful for communication/testing/bug fixes/adding expansions later. (For example, I have used Sphinx for a totally different project in the past. https://www.sphinx-doc.org/en/master/index.html)

Unit testing: Should/could I use unit testing style tests for a BGA project? Or if not is there a usual or recommended method for the developer to conduct official testing? I am far enough into development that I have testing/debugging days. I have managed well enough following the methods described in the documentation (print statements, var_dumps, method calls from the chat, accessing/modifying the database directly). It works well enough but I wondered if there was something more rigorous that others have found helpful.

Optimizing: What does the process look like for optimizing a project? Is there any way to monitor resources being used like memory usage and runtimes? Or is that something I should only worry about if there are obvious issues?

Sorry if that's too much, feel free to comment on any of that or anything related.
User avatar
thoun
Posts: 1620
Joined: 10 December 2020, 22:25

Re: Applying Typical Coding Practices

Post by thoun »

Project documentation: it's mandatory for project with big team of devs. For games, mostly one dev per game, I don't think it was done, except comments in the code. Of course you can, but it will be mostly for you :)

Unit testing: there is an example of setup in the wiki for unit testing, but there's no "official" way.

Optimizing: usually, the games don't require that much resources and don't need special optimization, but we won't forbid you to do some ;)

Generally, your questions makes me think you come from bigger projects that what BGA games usually are. You can look at the Reversi tutorial, the code is pretty basic!
User avatar
edward_green
Posts: 8
Joined: 19 September 2022, 16:30

Re: Applying Typical Coding Practices

Post by edward_green »

Thank you for the clarification. I appreciate your advice and I'll keep that in mind!
Post Reply

Return to “Developers”