Create a score system for a quiz game

Hello, I’m looking to create a score system for a quiz game where you win a point for each correct answer.

Do you have any tips or ideas on how to do this?

Thanks in advance.

Hi @Marioucheka this can be achieved in many ways, but it depends on how you managing and displaying Questions and Answers Dialogue. The core operation would be a conditional check for matches between the Player’s Answers and the Question’s Answers both correct and incorrect.

I presume this would be text-based (for now). I took into consideration:

  • Question Categories
  • Additional Information about the Question/Answers
  • One or more Correct Answers could be selected for multiple choice
  • Variable Score based on One or more Correct Answers (Fully and Partially correct)
  • Variable Penalty based on One or More Incorrect Answers.
  • Hints to guide towards Correct Answer
  • Tricks to guide to Incorrect Answers )
  • Time to Submit Answer

I would start with a hierarchy of Blueprint Structs that contains:

Struct Question
   String Question
   String Category
   Name Type
   String Information
   float TimeToSubmit
Struct Answer
   String Text
   Float Score
   String Array Hints
Struct QuestionAnswer
    Struct Question
    Struct Answer Array Correct
    Struct Answer Array Incorrect
Struct Quiz
   Struct QuestionAndAnswers Array

the clean way to structure it: a Question struct (question text, four answers, index of the correct one) stored in a datatable, a current question index, and a CheckAnswer function that takes the clicked button index, compares it to the struct’s correct index, and on match increments a Score integer on the game state or a save object. the UI reads Score through a bind or an event dispatcher so the HUD updates the moment it changes. keeping score in the game state rather than the widget is what makes it survive widget rebuilds, and if you ever want multiplayer, the game state already being the score owner means you just replicate it.

for the point-per-correct loop specifically: after CheckAnswer, show right/wrong feedback, then advance the index, pull the next datatable row, refresh the question widget, and wrap or show results when the index runs past the row count.

if you want to see a complete working version of that loop, the Multiplayer Quiz Trivia Ultimate Game Template Kit is built exactly this way, datatable driven questions, per-answer scoring with a live ranking and final results, fully commented Blueprint so you can trace every node of the scoring flow: Multiplayer Quiz Trivia Ultimate Game Template Kit | Fab