Skill Trees ~ Avoiding soft locks in skill tree integration - uchicago-cs/chiventure GitHub Wiki
What is a softlock?
A softlock is an inescapable situation in a video game where it is impossible to progress any further, but also return to a previous state in a game. This has the unfortunate effect of rendering the game as broken for the player, requiring him to either revert to a previous save file in the hopes of acquiring the needed item or skill, or restarting the game altogether.
What are the types of soft locks that the player can run into?
- Requires a certain skill or item to further progress in the game that the player failed to acquire earlier in the game and cannot go back and acquire.
- The player saves the game during a situation (e.x. a battle) where they are low on health and therefore are unable to defeat the enemy and progress further in the game; this causes the player to be stuck in a loop in which they keep on dying, which results in the game having to be restarted and all progress being lost.
- Players getting stuck in terrain, or objects. Chiventure is currently a text-based game engine, this is not an issue we would have to worry about yet.
How to prevent a player from getting softlocked?
The most obvious solution would be to issue some kind of compiler warning if a game developer programs a scenario in which a player might not have the necessary skills or items to proceed further. The problem this poses is that the engine would have to somehow have some knowledge of the fact that progress cannot be made. This would entail checking all possible paths the player could take and realizing that the player cannot move closer to a game ending condition.
A rudimentary way in which this could be done is by checking if there are any options provided to the player that do not result in a "fail" condition, i.e. making sure it is always possible for the player to make at least one choice, even if they possess no items or skills.
Another way to escape a soft lock is to prevent the saving of the game (either manually by the player or through autosaving) during a situation where there is a very high chance of dying (for example, in a crucial battle). This can be achieved by adding an in-battle flag (possibly a bool) that prevents the saving of the game if it has the value of "true".