Best testing practises for Ren'Py

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
NumberA
Newbie
Posts: 3
Joined: Thu Jan 05, 2017 8:56 pm
Github: NumberA
Contact:

Best testing practises for Ren'Py

#1 Post by NumberA »

Hey! I'm new to visual novel development and am wondering what the community wisdom is with regard to testing games. I've seen discussion of the Lint script checker in the quickstart (https://wwmmw.renpy.org/doc/html/quicks ... -your-game) and the beta testing thread viewforum.php?f=45). Are those two phases together enough to produce good-quality code or are there other tools out there I should know about?

Thanks for your help!

User avatar
Suika
Regular
Posts: 99
Joined: Thu Oct 03, 2013 12:23 am
Contact:

Re: Best testing practises for Ren'Py

#2 Post by Suika »

I'm sure others will have more to offer than this, but if your game has any complex logic or custom mechanics, I find code reviews to be pretty valuable. Sometimes just getting a second opinion helps you find better solutions or bugs that haven't quite been caught in beta testing.

NumberA
Newbie
Posts: 3
Joined: Thu Jan 05, 2017 8:56 pm
Github: NumberA
Contact:

Re: Best testing practises for Ren'Py

#3 Post by NumberA »

Hey! Thanks for getting back to me :) We'll be working on GitHub and will be doing CRs for all pull requests for master. I'm also working on getting continuous integration tests set up via Travis CI. Someone posted about how to do it on Tumblr a while ago (http://fuckyeahrenpy.tumblr.com/post/11 ... ing-travis), but I've not got it working yet :( I'll update this thread with a guide if/when I do in case anyone else is interested.

NumberA
Newbie
Posts: 3
Joined: Thu Jan 05, 2017 8:56 pm
Github: NumberA
Contact:

Re: Best testing practises for Ren'Py

#4 Post by NumberA »

In case anyone is interested, here's instructions for how to get Travis CI integrated with Ren'Py (https://mibscanlations.tumblr.com/). Note my updated .travis.yml file at the end.

User avatar
justcolorado
Regular
Posts: 47
Joined: Sun Feb 07, 2016 9:32 pm
Completed: Experiment Gone Rogue, Caravan Of Saints, HeartBaked, Hipster Axe
Projects: Iragon
Organization: Repulse.com
Github: coloradostark
Location: Plovdiv
Contact:

Re: Best testing practises for Ren'Py

#5 Post by justcolorado »

I have been trying to find effective ways to include tests in the code. I did find that it becomes really hard to test changes in the programming logic for the stat system on a 100,000 word novel. Even when I skip or hold control, it is time consuming.

In my current project we are putting in a test mode which turns the story off, so we can focus on testing the choices, stats, meters, etc without having to skip through the story over and over again. Looks something like this:

Code: Select all

label start:

    $ testmode = False
    
    if testmode == True:
        
        call ch_01_choice
        call ch_01_cleanup
        
    if testmode == False:
        call ch_01
        call ch_01_choice
        call ch_01_conclusion
        call ch_01_cleanup
And also, I also maintain a test suite for all of the features that I can just turn on and turn off with comments that looks like this:

Code: Select all

     #call blood_effect_test
     #call rain_effect_test
     #call battle_system_test
     #call character_test
If anybody has any input on how they write tests into their code please share it.

User avatar
ISAWHIM
Veteran
Posts: 318
Joined: Sun Nov 06, 2016 5:34 pm
Contact:

Re: Best testing practises for Ren'Py

#6 Post by ISAWHIM »

The bigger question is how to remove testing stuff from code... So it isn't just overhead bulk that ends-up leading to bugs itself, or slowing the game down, or making crazy update patch-sizes.

You shouldn't have to test things that are already tested. Play, save, reload from that point, and do it as others playing it will be doing it. Otherwise, you are not actually debugging the game, just doing overly-hard debugging of specific situations that should be texted prior to being added into a game, in an isolated test-file. Once it works, it should always work. In or out of the story.

load game0
Set_GameTestValues (max-money, max-health, unlocked locations, etc... Whatever isn't in the saved-file itself.)
Goto TestSpot

... Test, then move the jumper and change the test values for the next part. No need to put test-code all over and checks, and confusing code that is inseparable, or needs constant bypassing and removal, all over the place. Just one easy to search-for phrase "TestSpot:"

That is how I do it, which isn't that often. Just a simple save-game is fine, and using "SHIFT + R" to force it to auto-reload whenever any files change, while playing. (I do use disposable windows to track specific values of variables... Another easy line to remove, and easy to show and hide with the press of a key on the keyboard.)

User avatar
wyverngem
Miko-Class Veteran
Posts: 615
Joined: Mon Oct 03, 2011 7:27 pm
Completed: Simple as Snow, Lady Luck's Due,
Projects: Aether Skies, Of the Waterfall
Tumblr: casting-dreams
itch: castingdreams
Location: USA
Contact:

Re: Best testing practises for Ren'Py

#7 Post by wyverngem »

Yeah, I've created a flag before as well to test specific areas. I usually create a label that loops itself saying test zone and using the Developer shift-o to jump to specific labels.

If you write the code yourself you're going to find the game crashing bugs because Ren'py will tell you exactly what line the error occurred when you test the game. There's the documentation (https://www.renpy.org/doc/html/) that is a wonderful reference for troubleshooting. The documentation is a quick button when you load Ren'py and it's searchable! It'll save you time by just having it around.

In my experience the bugs that you're not going to find are little things that aren't coding errors, but things you didn't intend for the player to be able to do. Usually these are you forgetting to check a condition before an event or trying to figure out why it's adding extra values to an int. I made a shop once that if you opened the main menu of the game it would close the shop and make purchases for you. I didn't notice, but my friend did when she was negative -1000 money. To catch these I always have a good friend blind test the game, meaning I don't tell them about the possible errors, and they catch grammar and tell me to break up my paragraphs, but I notice that they skipped a bit of writing that they shouldn't have or that something I thought was easy to pass is actually very frustrating.

It's nice to see the game being played and to be present at possible errors because those playing will assume that a bug is a part of the game.

Post Reply

Who is online

Users browsing this forum: Amazon [Bot]