Skip to main content
Background Animation

Technical realisation of an interactive turn-based online learning game

Knowledge database Human Training & digital expertise D.1: Intelligent management of networked hospitals - a digital simulation game

Interaction is the key to a successful learning game. It promotes active learning, in which learners not only passively absorb information, but actively participate in the learning process. This leads to a better understanding and retention of what has been learnt.

Problem description, research question and relevance

In modern hospitals, the efficient management of resources such as staff and beds is crucial for the quality of patient care. A turn-based learning game can help to understand and optimise these complex processes.

 

To this end, a digital, interactive, turn-based learning game was developed that simulates the challenges of resource sharing in a hospital's wards. Players take on the role of ward managers and have to make strategic decisions in each round in order to optimise the use of available resources and ensure patient care.

  1. Understanding resource management: Players should learn how to allocate limited resources efficiently in order to keep a hospital running.
  2. Promoting teamwork: The game is designed to encourage co-operation and communication between players to achieve common goals.
  3. Interactive learning environment: Interactive elements and immediate feedback are designed to motivate players and actively involve them in the learning process.
  4. Round-based structure: Each round represents a specific period of time (in this case, a day) in hospital operations.
  5. Resource allocation: Players must make decisions about the allocation of staff, beds and patients.
  6. Configuration: It must be possible to define various parameters such as the number of wards, the number of rounds, the random distribution of new patients per round and the starting values for staff and beds.

The game sequence of a round is divided into several steps. These include viewing the current situation on your own ward and requesting and exchanging resources between the wards.

Methods and procedures in the project

To achieve the above goals, a web app was created with a central server part and a client part. The app is programmed in JavaScript. SQLite was used to persist the configurations and the course of the game.

It makes sense to use a state machine for a turn-based simulation with several steps. A state machine is a mathematical model that describes the behaviour of a system. It consists of a finite number of states and transitions between these states and actions. The actions are executed at certain states or transitions. The state machine can be in exactly one state at any time. It changes from one state to another when certain inputs or conditions are met. These changes are referred to as transitions.

Overall, a state machine offers a structured and flexible way of managing the complex processes and rules of a turn-based simulation game.

Figure 1: Diagram of the state machine

WebSockets were used to ensure optimal interaction between the players (stations). WebSockets are a network protocol that enables a bidirectional, persistent connection between a client (e.g. a web browser) and a server. This means that both sides can exchange data at any time without the client having to constantly make new requests.

Figure 2: Diagram of WebSackets

Results and findings

In conclusion, it can be said that the use of a state machine (SM for short) and WebSockets was a good choice.

 

The SM has proven itself for the following reasons:

  1. Clear state definition: In turn-based games, there are often clearly defined states such as "player turn", "calculation of results" and "end of turn". An SM can precisely model these states and the transitions between them.
  2. Extensibility: If new game mechanics need to be added, this can be done relatively easily by adding new states and transitions in the SM without having to rewrite the entire system.
  3. Error prevention: The clear structure of an SM reduces the risk of errors. It is easier to ensure that only valid transitions take place.
  4. Readability and maintainability: The code becomes more readable and maintainable through the use of an SM.
  5. Event-driven actions: In turn-based games, events (such as the end of a turn or reaching a certain number of turns) can trigger state transitions. An SM can handle these events efficiently and carry out the state changes.

The WebSockets (abbreviated WS) could ensure several goals:

  1. Real-time communication: WS enable bidirectional, continuous communication between client and server. This is particularly important in turn-based games to ensure immediate feedback and updates.
  2. Low latency: Unlike Hypertext Transfer Protocol (HTTP), which is based on request-response cycles, WS offer a more persistent connection. This leads to a smoother gaming experience.
  3. Event-driven architecture: WS support an event-driven architecture where the server can send instant notifications to all connected clients. This is ideal for turn-based games where all players need to be informed about the progress and actions of other players.

Recommendations for practice

  • Expandability and maintainability - Educational games are constantly changing and often need to be adapted during development. It is therefore important to programme them to be expandable and maintainable in order to be able to react flexibly to new requirements and improvements.
  • Interaction- In an educational game, technology that enables immediate updates is of great importance as it significantly increases interactivity and learner engagement. Real-time updates ensure that players receive immediate feedback on their actions, making the learning process more dynamic and effective.
  • Test environment - Providing a test environment early in the development of a learning game is crucial to ensure the quality and effectiveness of the game. Early testing allows potential problems to be identified and fixed early on. Iterative development with continuous testing thus promotes the creation of a successful and engaging educational game.

Literature and other sources

Citation of the contribution