[SOLVED] How to test later parts of my game without replaying it from the beginning?

Started by zeta_san, Mon 10/06/2024 20:07:52

Previous topic - Next topic

zeta_san

Hi everyone

my game, a point and click adventure, is well underway, it has about 60 locations, 30 characters. The test is getting a little complex when I have to work on the sections that come after 30, 40 minutes of play.
Initially I saved so as not to start from the beginning but when I went to change the code it wouldn't allow me to load.
I started changing the state of functions in global variables... but even here it's easy to make mistakes.

You have advice?

heltenjon

Are you using the Debugging features? (Link to manual.) They allow you to use keyboard shortcuts to teleport to any room, get all inventory items and more.

Khris

This questions comes up occasionally and the usual advice is to basically do exactly what restoring the savegame does but manually (because as you know, savegames break).

I.e. divide your game into chapters and write a function that moves the game state to the beginning of a chapter by setting globals, adding inv items, etc.

(Also please edit your first post and use a proper thread title; I put a suggestion as this reply's title)

Snarky

If I understand your question correctly, it's about playtesting your game, and how to skip to particular parts of the game?

As heltenjon says, the Debug functions can be useful. It is also quite common to write some helper functions for testing which, for example, set all the game variables to a particular state, or jump to a given chapter/act (and then some tester/debug GUIs to let you set that while playing). See the suggestions here. If that's what you've been trying to do when you say "it's easy to make mistakes"... well, yeah, but then you just have to fix them.

Writing the game in a structured way (putting all the state variables together, for example) can go some ways towards keeping things organized and easy to get an overview of, and maybe help avoid mistakes, but if you haven't been planning it out in advance it can be a lot of work to fix; it might be more of a learning experience for your next project.

zeta_san

Thanks everyone for the advice and help. I'm using debug mode, I remember I couldn't use it due to a problem and I gave up.
The problem persists.
After SCROLL LOCK, I click on a row but when I press f9 and f11 the window freezes and I have to restart.
However the Ctrl functions are really useful.

Khris

There's no reason to break execution or step through your code though? That's not going to help with skipping over the beginning of your game in any way.
All that's of use to you is the Debug() function, and really only the "give all items" and "teleport" parts.

But again, there's no magical shortcut here. You need to actually write code that moves to the part you want to test.
Some time ago I caught a stream by Grundislav where he used a massive GUI to set game variables, trigger events and jump to various parts of Rosewater. It probably helped that it's not his first full-length game though :)

Crimson Wizard

A while ago I've been helping to script a big game project, and they had a very well made "story teleport" system.
This system would configure whole game depending on a group of "story progress" variables.
The most interesting part was that this system applied changes step-by-step, simulating player's walking through the game.

For example, if user requested a teleport to "chapter 10", this system would apply:
- all changes for chapter 1
- all changes for chapter 2
- all changes for chapter 3
- etc
until chapter 10 is reached.

This made it much easier to update even with very high chapter numbers.

Also, each room had a setup code in "room load" event, where the whole room was reconfigured, depending on these "story progress" variables. This happened during normal gameplay too. So it did not make a difference whether you entered a room by normally walking there, or teleporting using a debugging gui.


Snarky

Quote from: Crimson Wizard on Tue 11/06/2024 21:04:59For example, if user requested a teleport to "chapter 10", this system would apply:
- all changes for chapter 1
- all changes for chapter 2
- all changes for chapter 3
- etc
until chapter 10 is reached.

This made it much easier to update even with very high chapter numbers.

That's very similar to what @Wyz described in the thread I linked. In his case he also called these functions during normal gameplay at the start of the corresponding chapter, to ensure consistency. (Of course, on the other hand it is not difficult to imagine that this could easily be a source of gameplay bugs and inconsistencies, especially if there are changes to the game logic but the chapter functions aren't updated accordingly.)

FortressCaulfield

What I did was make a gui popup on first screen that asks me where I want to start from. Obviously to be removed before final.
"I can hear you! My ears do more than excrete toxic mucus, you know!"

SMF spam blocked by CleanTalk