Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

[RELEASED] Trivia Quiz Game Template

Discussion in 'Assets and Asset Store' started by puppeteer, Sep 25, 2015.

  1. UnitySora

    UnitySora

    Joined:
    Mar 31, 2016
    Posts:
    32
    It didn't use 2x memory if you duplicate the scene.
     
    puppeteer likes this.
  2. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    EDIT: Sorry for the confusion here, I meant to say @UnitySora was right in that there is no memory loss.

    ...what I suggested was keeping your questions in a category not to save "memory", but to be able to reuse the same question list in multiple games. It's a design convenience.

    About Scramble Word, you can simply import it into Trivia Quiz Game and it should work. Of course in the main menu of Trivia Quiz you would want to put a button that goes to the level ( or the menu ) of Scrambled Word so that the game functions as a whole.
     
    Last edited: Dec 13, 2016
    djoleeeee likes this.
  3. djoleeeee

    djoleeeee

    Joined:
    Nov 12, 2016
    Posts:
    24
    Questions in game are array of strings... If I have 3 single player modes and all of them have same questions it's better to store that questions on one place or I miss something?

    I will try category solution but I'am not sure i understand cleary :D
     
  4. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Sorry about the confusion above, @UnitySora is right about the memory thing. It's not a problem.

    About the questions: You can put the list of questions directly inside the gamecontroller script, or you can attach a category script to the gamecontroller object, which will allow you to add a list of questions in the same way, but then you'll have the advantage of being able to (for example) Copy+Paste the questions from one level to another.

    Take a look at this video:
     
  5. djoleeeee

    djoleeeee

    Joined:
    Nov 12, 2016
    Posts:
    24
    Hello...

    I need help (again)... After updating Unity to 5.5 answer buttons deselection don't work anymore...

    If player select wrong answer 2 times, in next question that 2 answers fields will be highlighted...

    How to fix this?
     
  6. Keitaro3660

    Keitaro3660

    Joined:
    May 20, 2014
    Posts:
    86
    hi, i love the idea of hotseat, but is multiplayer with different devices possible?
    or you plan to make that??
    because it'll be more flexible and more replayability

    i have android native plugin,
    so i want to try to use android native plugin for multyplayer support
    https://unionassets.com/android-native-plugin/real-time-multiplayer-145
    will it altered and adding many code if i do that myself?
     
    puppeteer likes this.
  7. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hi,

    I tested a build of the game from Unity 5.5.0b9 on an Android device, and this is how it looks:



    Is it the same on your side? There could be another reason for the buttons staying highlighted.
     
  8. djoleeeee

    djoleeeee

    Joined:
    Nov 12, 2016
    Posts:
    24
    Last edited: Dec 22, 2016
  9. djoleeeee

    djoleeeee

    Joined:
    Nov 12, 2016
    Posts:
    24
    It's about Unity version...

    In Unity 5.5.0b9 works great...

    I don't know is this Unity bug or game source bug?
     
    puppeteer likes this.
  10. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I've been trying several versions now, the problem happens only in 5.5.0f3 so far, I'm still trying to figure out what could be the cause. Turning off the event system of course prevents the highlighting, but there is no other code piece that should cause two buttons to stay highlighted at the same time.

    Will post a solution today.
     
    djoleeeee likes this.
  11. djoleeeee

    djoleeeee

    Joined:
    Nov 12, 2016
    Posts:
    24
    Last beta version Unity 5.6.0b3 also have problems...
     
    puppeteer likes this.
  12. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282

    Yes, I just finished installing and testing it on that version. Same problem.

    This is what happens: If you click on a button and then it gets disabled ( grayed out ), Unity will "forget" to also turn off the highlighted selection color, so next time the button appears it still has that color until you hover over it again.
     
  13. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Update!

    I think I found the solution, if you want to try it now in your code, do the following:
    - Open the script TQGGameControlle.cs and go to line 770.
    - Under it add this code:

    Code (CSharp):
    1. // Select each button as it becomes enabled. This action solves a bug that appeared in Unity 5.5 where buttons stay highlighted from the previous question.
    2.                         answerObjects[index].GetComponent<Button>().Select();
    -This is how your code should look like:
    TQGHighlightButton.png

    What happens is that we reselect all the buttons once they reappear for the next question, then unity remembers to deselect them properly again.

    Try it out and tell me if it worked for you.
     
    djoleeeee likes this.
  14. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    Any update on not displaying answered questions?
     
    puppeteer likes this.
  15. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Do you mean not asking questions that have already been answered when playing a quiz again? Or not displaying the correct answer after answering?
     
  16. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    Do you mean not asking questions that have already been answered when playing a quiz again?
    => Yes.

    For example, my quiz has 100 questions. A player answer 5 questions correctly. He shouldn't re-start from question #1 but starts at the latest incorrect answer (question #6).
     
  17. Artomiano

    Artomiano

    Joined:
    Dec 1, 2014
    Posts:
    200
    This is an interesting idea. But I would change it a little bit: When the player returns, the game should ask "Do you want to continue your last game? - Yes or No"
     
    puppeteer likes this.
  18. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    After fiddling around with the code, here's the result:



    The way it works is: if a question is asked, it gets recorded in a local PlayerPrefs based on the text of the question itself. On the next play-through we check if a question has a record, and if so, we skip to the next question. If all the questions in a quiz have been asked, the game deletes the records for all these questions from the quiz and starts again from question 1.

    As you can see, this works, but it also presents a design problem. It works well enough if all the questions are of the same bonus level and are not grouped into bonus groups. So I want to leave it up to the user of the package to decide if they want to allow repeating questions or not.


    This is a great idea in itself, but I think it's something different than what @gamingtc asked for. In your case you want to record the index number of the question that was asked before we left the game, as well as the score we had up to that point, and then ask the player if they want to continue from where they left.
     
  19. Artomiano

    Artomiano

    Joined:
    Dec 1, 2014
    Posts:
    200
    Hi puppy,

    what's going on? ;)
     
    puppeteer likes this.
  20. UDN_165a1249-a0c9-4099-8ba0-53daf2789359

    UDN_165a1249-a0c9-4099-8ba0-53daf2789359

    Joined:
    Nov 1, 2016
    Posts:
    12
  21. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    On a late notice, but update 1.8 for Trivia Quiz Template is ready for release:



    Update 1.8 (24.01.2017):


    Improvements:
    - You have the option to prevent a quiz from repeating questions. Once all questions in a quiz have been asked, they will repeat again. The record for each question is based on the text of the question.
    - You can apply quiz-wide changes to some of the values in the quiz, such as Bonus and Time. For example you can set all timers in the quiz to 10 seconds for each question.
    - When playing a sound, you cannot play another sound until the current one is done. When playing a sound and answering, the game will wait until the sound is over before moving to the next question.
    - Animated timer can be used instead of the standard FillAmount timer. An example of an animated timer is in one of the demo scenes.

    Fixes:
    - Fixed some button sounds set to play from “GameController” tag instead of “Sound” tag.
    - Bug fix: In HotSeat mode when the timer runs out, the game skips a player (ex: goes from player 1 to player 3 instead of player 2).
    - Bug fix: In Unity 5.5+ buttons stay highlighted between questions.
     
    Artomiano likes this.
  22. Artomiano

    Artomiano

    Joined:
    Dec 1, 2014
    Posts:
    200
    Sounds great. And now my long awaited highscore system, please. ;)
     
    puppeteer likes this.
  23. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I made a few more changes to the current submitted version (1.8) based on awesome feedback from @Jason-B :
    - Fixed Unity 5.5 specific bugs that made keyboard/gamepad controls unreliable.
    - Found and fixed an exploit in the "Guess The Image" mode which allowed the player to view the image without solving it.
    - Some minor changes.
     
  24. Artomiano

    Artomiano

    Joined:
    Dec 1, 2014
    Posts:
    200
    Is there any tutorial for creating quiz game via Trivia Quiz Game Template? I didn't found one yet.
     
    puppeteer likes this.
  25. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Would you like something like a video showing how to import the TQG package, then duplicate one of the quiz demos you want to use, and then filling it up with information either through the editor or with an XML file, changing some of the rules of the game, etc?
     
    Artomiano likes this.
  26. Artomiano

    Artomiano

    Joined:
    Dec 1, 2014
    Posts:
    200
    Yes. Something like this. ;)
     
    puppeteer likes this.
  27. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Ok, maybe I'll even do it with (terrible) narration :D
     
    Artomiano likes this.
  28. Artomiano

    Artomiano

    Joined:
    Dec 1, 2014
    Posts:
    200
    Okay, I think, in the next two days it would be great. :D
     
  29. UDN_165a1249-a0c9-4099-8ba0-53daf2789359

    UDN_165a1249-a0c9-4099-8ba0-53daf2789359

    Joined:
    Nov 1, 2016
    Posts:
    12
    Hi, looking forward to your video tutorial thank you.
     
  30. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Here is a quick video guide I made to show new users how to import and create their first quiz:



    In this video we'll:
    - Create a new empty project.
    - Import the Trivia Quiz Game Template from the Unity Asset Store
    - Review all the available game types and demos
    - Duplicate one of the game modes and create your quiz
    - Look how we can modify the questions list
    - Add our quiz to the build list and play it
     
    Artomiano likes this.
  31. Artomiano

    Artomiano

    Joined:
    Dec 1, 2014
    Posts:
    200
    Feature request: In case of multiplayer - for every player the player info, e.g. "player 1" is showing on bottom of the screen und scrolls to the left side as the next players plays. In my opinion, it is not very clear, not good visible. Could you make the inactive players lighter and the active player darker or something highlighted?

    And - in addition and memory: What about the old wish to put in players name at game start? ;) It'd be very important. Because of the fact, that - if more than four or five players play the game - it's often unclear who's the 4th, the 5th and so on. This is not good for fun and therefore not good for further sales.
     
    puppeteer likes this.
  32. Artomiano

    Artomiano

    Joined:
    Dec 1, 2014
    Posts:
    200
    Hi Puppy,

    can you make a video with the integration of an IAP asset like "Simple IAP System" or other in combination wih Unity IAP Engine.

    This is what I want to do:
    - Create question sets per category (similar to the example categorygrid)
    - rename the points to "coins"
    - Next category can only be played if previous one was won (1) - or a "paid package purchased"
    (1) or is it possible to unlock new categories with a specific amount of points/coins?

    - My ideas for paid packages:
    .......$1 -> opens one new category
    .......$10 -> opens ten new categories
    or
    .......$1 -> gives you 1000 coins to unlock categories
    .......$10 -> gives you 10000 coins to unlock categories

    Which category/categories should be unlocked, should say the player. But the player can only unlock categories which are next on the line. Means: He can not unlock the 7th category if the 4th, 5th and 6th still unlocked.
    Is this possible? If so, how to do? :)
     
    puppeteer likes this.
  33. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    Can you send me link to Android apk built with the latest version? What about a button to show hint such as remove 1 wrong answer or display a text hint?
     
  34. Artomiano

    Artomiano

    Joined:
    Dec 1, 2014
    Posts:
    200
    Such a feature is a great option for sale. ;)
     
  35. mohdnajeebargdn

    mohdnajeebargdn

    Joined:
    Feb 20, 2017
    Posts:
    3
    I am Mohammed Najeeb from India. I interested to buy trivia quiz assets.But I wish to know that after my student installling this quiz on their android device, can I update the questions? And also wish to know that can i add google ads in this? Pls reply in detail...
     
    puppeteer likes this.
  36. mohdnajeebargdn

    mohdnajeebargdn

    Joined:
    Feb 20, 2017
    Posts:
    3
    Today I bought trivia quiz asset. And I imported the package. But i do not getting how to run this package...I got a message "All compiler errors have to be fixed before you can enter play mode...what to do? can you give me complete tutorial?
     
  37. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hi, thanks for the purchase.

    The package should import and build straight from the store without any (red) errors.

    Which version of Unity do you have?
     
  38. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    This is simple enough to add, I can also link it with UnityAds so that you can watch an advertisement and get one wrong answer removed, or in exchange for a bonus loss.
     
  39. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hello,

    There is an option to load questions from an XML file in an online address. This way you can edit the XML file online and it will be loaded when the player starts the game. I tried it using the Webplayer and WebGL players, and you can also load the XML from online while using the game on a mobile device.

    I can show you a video demonstration of how to put the XML file online and then target it in the Unity Editor and then load it from a mobile device.
     
  40. mohdnajeebargdn

    mohdnajeebargdn

    Joined:
    Feb 20, 2017
    Posts:
    3
    Please send me video tutorial link
     
    puppeteer likes this.
  41. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Here is a video showing the entire process from start to finish, and testing successfully on android device:



    Here's what we did:

    - Upload a compatible XML file with a list of questions for our quiz.
    - Add a Dynamic XML component to our quiz in unity, then put the web address of the XML file we uploaded in it.
    - Test the game in Unity to see that it dynamically loads the questions from the online XML file.
    - Build the game to an Android device, then copy the result APK file to a device to test out. The quiz is loaded successfully on the device!
    - Now we open and edit the XML quiz, then save it online.
    - Then we test again in Unity to see if it works, and it works!
    - Finally we look in our mobile device to see if the questions have been updated there too, and they have.
    - Success! Now you can simply update the XML quiz online and all your users will have new questions for them on the mobile device!

    Take a look and ask me if you have any needed clarification, I will also add subtitles later to explain each step throughout the video.
     
  42. VinodShanbhag

    VinodShanbhag

    Joined:
    Mar 16, 2014
    Posts:
    6
    Hi Pupeteer,
    I bought this package. Very nicely done - good work.
    I am new to unity and need some advice.

    I want to design a trivia game where I mix up all kinds of questions from different modes - i.e I don't want any specific modes.

    Let us say I have 100 questions in total (with all varieties of modes)
    first question -> true or false question
    second question -> math question
    third question - > image question
    fourth question -> sound question
    fifth question -> again true/false question
    sixth question -> sound question
    ....
    .....
    99th question -> math question
    100th question -> image question

    I am trying to understand how I can reuse elements from this package and build a game like this above?
    My specific confusion are around..
    1) How many scenes do I use? 100?
    2) How do I transition/construct/destroy scenes in this pattern?
    3) Where do I store my questions since there is no mode?
    4) Any other issues that I may run into or keep in mind...

    If you can please advise me, that will be great!

    Thanks
    Boybuggy
     
    Last edited: Feb 23, 2017
    puppeteer likes this.
  43. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    From what I understand, you don't want to have several levels with different types of quizzes, but a single quiz with a mix of question types, right?

    You can technically enter sound/image/regular in the same quiz question list and it will mix up nicely, but some of the other examples are more tricky.

    For example the True/False quiz has a different scene setup with different placed UI elements, even though you can just enter a True/False question like the regular ones.

    Another example is the math quiz which has its own component that generates a list of math related questions based on your settings, but again you can simply enter the math question manually into the quiz list like any other question.

    So would it be good enough to be able to put those questions into a single list and mix it up, or are you thinking of having a complete mix of game modes along with their own scenes?
     
  44. VinodShanbhag

    VinodShanbhag

    Joined:
    Mar 16, 2014
    Posts:
    6
    Hi Pupeteer,
    I want complex mix of game modes along with their own scenes.
    How do I go about doing that?

    If I am able to load a scene with customizable question, then I can load/destroy scene for each question. But I am not sure whether it is recommended way of doing it - and if it is recommended way then is there an example I can look at?

    Thanks
    Vinod
     
  45. VinodShanbhag

    VinodShanbhag

    Joined:
    Mar 16, 2014
    Posts:
    6
    Hi Pupeteer,
    I want complex mix of game modes along with their own scenes.
    How do I go about doing that?

    If I am able to load a scene with customizable question, then I can load/destroy scene for each question. But I am not sure whether it is recommended way of doing it - and if it is recommended way then is there an example I can look at?

    Thanks
    Vinod
     
    puppeteer likes this.
  46. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I've been trying to do the load-then-destroy scene method to get it to work this way but it's not working out correctly for me. I want to try something else, maybe with a script that controls several GameControllers each with their own camera in the scene.

    Edit: Okay, this is what we have so far with the new method:



    You can have a list of game modes ( TQGGameController ) assigned. The game will show the current game mode and hide all the others, and when you answer a question the game will switch to another game mode. You'll be able to set whether to move through the modes in sequence or randomly, and you'll be able to choose how many questions to ask before switching to another mode.

    The current problems I'm tackling here is first off having a delay after answering and before switching a question, (possibly) having a special transition between game modes, summing up the score from all the game modes into a final value or displaying it externally while hiding the local scores from each game mode.

    What do you think?
     
    Last edited: Mar 6, 2017
  47. DD_DD_DD

    DD_DD_DD

    Joined:
    Feb 27, 2017
    Posts:
    4
    Hi
    Thanks for the wonderful template.

    In this template i need to add sound questions in the Grid category section.
    There is provision for insertion of sound, but while playing nor the the sound icon nor the sound appears.

    Request you to fix this issue, or in case already fixed, kindly provide the detail of how to do the same.

    Thanks.
     
  48. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Thanks, glad you liked the template!

    The best way to get the result you want is to add a Category Grid to your existing Sound Quiz. I made a video that shows you how to add a category grid to another scene. Follow it and tell me how it worked for you:

     
  49. DD_DD_DD

    DD_DD_DD

    Joined:
    Feb 27, 2017
    Posts:
    4
    Thanks for the response!

    As per the provided video, which is meant for copying & pasting category script from one game section to another, I tried the same for my case.

    I copied the category of sound question and pasted the same in Category 1 Animal (which was in Categories folder) by 3 different ways, listed below.
    1) paste as value: By this mode, question in Category 1 Animal got replaced with that of Game Sound questions, but neither sound, nor its icon appeared in gameplay mode.
    2) paste as new : By this mode, Sound questions got appended to existing Category 1 Animal questions with one more category script. On Game play only Category 1 Animal appeared.
    On removing existing Category 1 Animal script and only letting Game Sound category script being present, during gameplay error was showed.
    3) resetting Category 1 Animal first & then pasting catagory Game Sound as values: it yeilded the same result as 1 above.

    Same thing when tried other way round, i.e pasting catagory 1 Animal script to Game Sound category script as values, removed sound from the sound category.

    Hence, Still i'm not able to get the sound questions within Category Grid section, one of the reasons for which I purchased this game.
    Request you to kindly assist.
     
  50. DD_DD_DD

    DD_DD_DD

    Joined:
    Feb 27, 2017
    Posts:
    4
    Hi Puppeteer,
    I'm still seeking for the solution, as method suggested by you didn't work.
    For you who has developed this nice app, won't be of much difficult. But too me its really arduous as i'm a complete novice to it.
    Hope you'd understand.
    Waiting for your comments!
     
    puppeteer likes this.