Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Trivia Quiz Game Template

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

  1. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Trivia Quiz Game Template
    [ASSET STORE LINK]
    [DEMO]






    Trivia Quiz Game is a full Unity template that gives you a quick and easy way to create a trivia game, along with a timer, lives, varying bonuses, and some nice audio-visual feedback.

    Features:
    - Game ready for release straight out of the box, just build and play!
    - Works on all platforms, PC, Mac, iOS, Android, etc
    - Supports multiple resolutions and aspect ratios, automatically.
    - Supports Mouse, Keyboard, Gamepad, and Touch controls.
    - Easily customizable with lots of options to control game difficulty.
    - Import your quiz through Excel or XML.
    - If you need help with anything, contact me, I'll do my best :)

    This thread will be for updates, FAQ, and any question or feedback you may have.​
     
    Last edited: Feb 26, 2019
    Gozdek likes this.
  2. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Forgot to mention, the game is coded in C# of course, and here is the main component you will be working with:



    It's pretty straightforward; You can add as many questions as you want, and they are sorted into groups by the bonus value, from low to high. When the game starts the questions are pulled randomly from each group, and when the player answers correctly, the game moves on to the next question group.

    You can set the maximum number of mistakes allowed, how much bonus you lose when getting the answer wrong, and how much time you have for each question. You can also set the number of correct answers needed to move to the next question group.
     
    prabathjayatissa1905 likes this.
  3. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    A new update submitted to the store, should be accepted within a few days hopefully.

    Update 1.06 (29.09.2015) :
    - Support for Keyboard and Gamepad controls, detected automatically.
    - Support for dynamic answer numbers (2 answers, 3 answers, etc in the same trivia level)
     
    prabathjayatissa1905 likes this.
  4. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
  5. hluper

    hluper

    Joined:
    Jun 25, 2013
    Posts:
    16
    I just recently bought this asset and I was wondering, could you use pictures as questions and/or answers? If not, would that be something planned for the future?
     
  6. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    The current version supports text questions only, but picture trivia would be a great idea!

    My next update is going to be a 2 player head to head mode, and after that I can clear up time for more things.



    How would you like the pictures to be presented? An image + text caption, or something else? What do you have in mind?
     
  7. hluper

    hluper

    Joined:
    Jun 25, 2013
    Posts:
    16
    I am really excited to see your response, I look forward to multiplayer. Are you thinking about using wi-fi or bluetooth or is this going to be over the internet for head to head? As far as the images it would be ultimate if we could have an option to select if we want to add an image to the question or an image + text. We are coming up with something that needs a diagram for the question. Any estimates when the head to head version will be released?
     
  8. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    No, for this update it's just going to be local head to head. I'm trying to get it to work right with all platforms and input types without the user having to meddle with anything. So it has to work right with keyboard/gamepad, mouse, or touch. That's why I'm also making it real time; the questions are presented for both players at the same time and the one who answers faster will gain points or reduce a life from the other player ( not sure about that part yet ). It's all WIP.

    About the image + text, I think it can be done. I'll have a field for the image and the question field will be used for the caption if it is filled. I think I'll also give an option to tap on the image to zoom in on it for a better look, because the current design leaves little place for large images. We'll see when we get to that bridge.
     
  9. duvaj

    duvaj

    Joined:
    Oct 16, 2015
    Posts:
    2
    Hi Puppeteer, first of all congratulations for your excellent asset!
    I was wondering whether it would be possible to have the questions/answers loaded from an external (txt) file. I am thinking to different trivia games, and it would be great if one could be able to fine-tune the GUI/gameplay/scoresystem once for all, and then just load the different sets of Q/A and build different games without having to deal with the TQGGame Controller script!
    I look forward for your comments... Thanks!
    Duvaj
     

    Attached Files:

    • TQG.PNG
      TQG.PNG
      File size:
      53 KB
      Views:
      1,298
  10. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hello Duvaj, thanks for the nice words!

    From the start of development was looking into ways of simplifying the process of entering questions/answers into the game. One of the easiest ways should be using an XML template that can be filled with input and just loaded at the start of the level.

    I still have several updates on the way including a Head to Head mode, UnityAds, Image/Caption question, and of course XML ( or similar text format ) loading is in the list too.

    Keep track of this thread to see where I'm at in terms of upcoming updates and to give your feedback, it's extremely important for the success of the package as a whole.
     
  11. duvaj

    duvaj

    Joined:
    Oct 16, 2015
    Posts:
    2
    Thank You Puppeteer! I'll keep track of this thread as you say and I look forward to seeing nice updates and new things of yours! Keep up the good work! All the best, Duvaj
     
  12. javipamp

    javipamp

    Joined:
    Oct 17, 2015
    Posts:
    3
    Hello:
    Your work is great. I would like to buy it but I am learning javascript for unity. Could you translate your "quiz" to javascript? It would be very helpful for all the people who don't understand C.
    Thank you very much. Looking forward to hearing from you.
     
  13. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hi, I'm glad you like the template!

    Originally I was a JS coder. Nearly all of my portfolio is made in JS, and was ported to C# mostly by the awesome Jordan Swapp. At some point I got a chance to port one of my templates to C# on my own (Road Crossing Game), and later on I made a poll to see which code type is used more (The Poll). The overwhelming response in favor of C# made me decide to only work with C# in the latest packages, and Trivia Quiz is one of those.

    Buuuuuuuut, I still have some fond memories from the JS days, so a port by request is quite possible. Of course I have a set of feature updates to go through first but when the JS port comes it will be added to the package as an update so that all buyers can benefit from all versions.

    TL;DR: JS is possible after I finish the main feature additions ( H2H, XML, Images), and it will be part of the package, so you'll have both versions c# and JS in the same package.
     
    javipamp likes this.
  14. hluper

    hluper

    Joined:
    Jun 25, 2013
    Posts:
    16
    Hi, I was working with the asset but I wanted to change the background animation, but is there a specific program to open it in?
    Thanks.
     
  15. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hi, the background animation is just a simple PNG image tiled and looped to animate. You can open it in any graphics program. To quickly open the texture folder on the computer, right click on one of the textures and select Open In Explorer.



    There is also a source vector graphics image for each of the textures in the game, these are FLA files that can be opened with Flash CS3 and above. The advantage of editing an FLA vector image is that you can scale it to any size you want without losing the quality ( no pixelation ).



    Tell me if you need anything else.
     
  16. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    The second update for Trivia Quiz is complete and ready to ship!

    I decided to skip the Head To Head mode for a bit ( It's almost done, but still needs some work ) and give way to what seems like a much easier task to accomplish: Images as questions.

    You can now assign an image to any question. So questions can have images, text, or both!



    Took me while to figure a way to show as much of the image as possible while still keeping all the other parts of the UI intact. The solution was to use the question tab as a mask, and place the image inside it. It turned out pretty nicely in my opinion, what do you all think?



    I also wanted a way to show the entire image if necessary, so I added a button on the question tab that shows an enlarged version of the image.



    The enlarged image is just a canvas that activates/deactivates as needed, so you can design it any way you like. I wanted to add an enlarge/shrink animation to it but haven't been able to do it so far. I'll try to add an animation later.

    You can also play the updated webplayer here to try the image questions for yourselves:
    http://puppeteerinteractive.com/Webplayers/TQG/

    Hope you all like it, and any feedback is welcome!
     
    Last edited: Oct 22, 2015
  17. hluper

    hluper

    Joined:
    Jun 25, 2013
    Posts:
    16
    Thanks, that worked perfectly. Great update on the asset. I looked at the web-player and I saw that there was a 'More games' button, will that work to bring users to the app store?
     
  18. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    @hluper: Yes, the 'MORE GAMES' button can send you to any URL you specify. Here's what the URL field looks like in the editor:



    What do you think about the image questions?
     
  19. hluper

    hluper

    Joined:
    Jun 25, 2013
    Posts:
    16
    I think it's great, thank you for getting on it so quickly. It hasn't updated in the asset store yet and I'd like to publish with it sometime today, is it possible for you to email the update to me?
     
  20. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    It usually takes a few days before it gets accepted into the store. In the meantime you can send me your invoice number to the mail, and I'll send you back a link with the updated version. Also tell me in the mail which version of unity you are using.
     
  21. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Trivia Quiz Game update 1.09 is now live on the store, click here to see it in action.

    Update 1.09 (19.10.2015)
    - Support for image based questions. You can now assign an image as a question, with or without a text caption. The image can also be enlarged to take a better look at it.
     
  22. hluper

    hluper

    Joined:
    Jun 25, 2013
    Posts:
    16
  23. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Wow, I'm glad you managed to get your game live! It's always awesome to see what people can make out of my templates. If you don't mind I'd like to tweet about your game sometime.
     
  24. hluper

    hluper

    Joined:
    Jun 25, 2013
    Posts:
    16
    Sure, I wouldn't mind at all. It's a great template, keep up the good work.
     
  25. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I've had several inquiries regarding multiplayer ( local ), and I noticed people are preferring if it was possible to have more than just 2 players in the match. When I first started working on the Head2Head update, what I had in mind was a realtime duel between two players where each of them can click the answer to reduce a life from the other player. Adding more than 2 players to this type of game would clutter an already over-cluttered UI and wouldn't fit the gameplay style of duel anyway.

    So, with that in mind, I've set to make another local gamemode called hot-seat. This will allow any number of players (2,3,4,5,etc) to participate in the match without cluttering the UI. Each player will get a turn to answer the question, answering wrong will reduce the bonus and pass on to the next player. Whoever answers correctly gets the points. There will either be a question limit or a points limit that will decide the victor.

    Would love to read people's thoughts about this, pros/cons/suggestions are welcome.
     
  26. javipamp

    javipamp

    Joined:
    Oct 17, 2015
    Posts:
    3
    Thank you so much. I look forward to hearing that javascript update!!!
     
  27. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I've been working hard on the new update and the hotseat mode is looking really good so far! I reorganized the gamecontroller component so that you can now set up more than one player, and this allowed me to create the new hotseat mode where you get to play along with 2-4 ( You can have more than 4 if you can fit them nicely in the UI :D ) in turns.



    You can try the webplayer for the upcoming update right here:
    http://puppeteerinteractive.com/Webplayers/TQGUpcoming/
     
  28. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I made a video showcasing the updated gameplay for 1.14, you can take a look at it here:



    The main addition in this version is the ability to play a local multiplayer mode with several players. You can also choose the number of players before starting. In hotseat mode each player gets a turn to answer a question. If you get the answer wrong, the bonus is reduced. Answering correctly or wrong will move the turn to the next player. The player with the most points after all questions are answered wins. It's possible to reach a draw between several players.

    In later updates I will also allow the players to change their names in-game, and to limit the target score so that the player who reaches X points wins.





     
  29. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I've been working on the question format in my trivia game, and I decide to reorganize the way questions and answers are listed. Right now you can have one correct answer per question, and the rest are all wrong answers. What if we wanted to have a question with potentially more than one correct answer?

    The solution is to merge both values of Correct Answer and Wrong Answer into one class named simply Answer. Each answer may be set to be correct or not, and as an added bonus I can also set an Image for each answer, just like how the questions can have images.

    Here's a side by side look at the old and new formats for the questions:



    It's still a work in progress slated for release in the next week or so, but I'd love to get some feedback from users about this change, whether you like it or not, and what potential issues you may find in it.

    From my perspective I can see a problem occurring with owners of previous versions, as they will have to reenter the answers into their games, so I've also kept the old GameController.cs script in the package in order to allow people to keep the old format if they wanted.
     
    DuaneMc likes this.
  30. rkruk

    rkruk

    Joined:
    Dec 19, 2012
    Posts:
    6
    Hey great game template. Was wondering if there will be a category or different levels option in the future updates. Like for example players could choose a different category containing random questions, or once a category was passed they move on to a new category level. Note: notmixed like now or trivia pursuit type. But more less if i wanted to make seperate category quizzes for the challenger or quiz taker to try? Thanks.
     
  31. puppeteer

    puppeteer

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

    You can have different levels with different sets of questions, so it's not limited to just that group you see in the example gamecontroller. The way I would go about it is create a scene for animals category, and another for cars for example, and then load one or the other from a level menu. You can of course have buttons on the victory screen that take you to the next category also.

    Do you have something specific in mind, maybe something else different than how I would do it? Maybe a set of keywords for each question so that we can filter the list by category/theme? Any ideas you have are welcome!

    Also, if you want I can make an example with multiple levels, with different categories and progression.
     
  32. rkruk

    rkruk

    Joined:
    Dec 19, 2012
    Posts:
    6
    Sure making an example with the multiple levels and with different categories would be great. So I can learn from your example. Thanks.
     
  33. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Okay, in the update after the next ( current one is going to be XML focused ) I will make several levels connected to each other, each with a category with 5 questions. Maybe I can even connect the score between the levels for a final total or something similar.
     
    Last edited: Nov 12, 2015
  34. rtideas

    rtideas

    Joined:
    Jul 30, 2012
    Posts:
    1
    Great template. Cant wait for the XML questions import. I'm hoping to use this to make mobile versions of some older Flash work that had similar game play. Would love to be able to import existing quiz questions. Would save a bit of time.

    Thanks.
     
  35. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    @rtideas: You won't have to wait much longer, I'm happy to say that after long days of trial and error ( first time doing XML for unity ) I've finally gotten it to work!

    Here's a video of the import in action:



    In the editor menu you can choose Tools > Trivia Quiz Game > Import Questions From XML and then choose the file you want to import.

    Here is the format of the XML:



    In order to avoid errors, I made sure to ask the user to have a Game Controller object selected before trying to import any XML. You'll also notice that the format has changed a bit as part of the update. In this new format you don't have a Correct Answer and then a list of Wrong Answers. Instead you simply have a list of answers, which you can set to be true or false. This allows you to have more than one correct answer for a question. In a later update you'll also be able to add an image to each answer just like in the question tab.

    I hope the change in the format doesn't "ruin" it for many people, as it will require to enter the questions again. But now with the new XML import the whole process should be easier for future games. I also kept the old format of the game controller for this version just to give a chance for users to pass on the info from the old one to the new one. Next version I will remove the old format altogether.

    I would love some feedback from users, is the format good for you? Is there a way you prefer to have it? Is loading the XML into a game controller from the menu acceptable for you?
     
  36. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Update 1.2 (14.11.2015) is live on the store!

    - Added the ability to load a list of questions and answers from an external XML file using the Tools menu in the Unity editor. XML example provided with documentation.
    - Reorganized the format of the answers, allowing you to set more than one correct answer. The new format is not compatible with older formats, so you will lose the answers on import. Make sure you copy the answers to an external file before importing.
    - Minor changes and fixes.

    Make sure to backup your project before importing this version. The answers have been reformatted and need to be entered again. Of course having XML will make this much easier for your future builds.
     
  37. Mariol

    Mariol

    Joined:
    Dec 22, 2009
    Posts:
    42
    Great asset. I'm really excited to extend what you've done so far. I bought your latest build yesterday and I've found that my game timer animation isn't playing in the 1 player mode when I created an iOS version (built with xcode 6.3 and the iOS version 8.2). Also the lives counter seems to be incorrect. You have to incorrectly answer two questions before you lose one life instead of one for one.

    Are you aware of these issues? How long would they take to resolve?

    Thanks
     
  38. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I'll take a look at the timer issue on iOS.

    But the life loss is not an error. You get a number of chances ( default 2 ) to answer a question, and if you don't succeed you lose a life and go to the next question. You can set the number of mistakes allowed in the gamecontroller here:



    BTW, you can read the comment on each part of the component by hovering over the variable.
     
    Last edited: Nov 23, 2015
  39. Mariol

    Mariol

    Joined:
    Dec 22, 2009
    Posts:
    42
    Ah, I see what you mean. I guess it just seemed like a bug because I knew I was getting something wrong but the UI wasn't updating. I may change that functionality if you're not offended.

    Btw, I fixed the timer issue. Turns out the Timer Canvas on the GameController wasn't set to the right object. It was set to the Timer Icon instead of the Timer Circle. Wasted loads of time trying to debug this. I was stepping through code and everything lol. Gave me a chance to learn how to debug using MonoDevelop though so that's a good thing I guess.
    Now that that's all sorted I can't wait to repurpose this project. Keep up the good work!

     
  40. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Just set it to 1 and you're good to go. The whole point is to give buyers as many customization options for their game as possible, so changing it to your liking is the way to go :D

    I was scrambling in the last couple of days to see why it might not work specifically on iOS. I should have tried a simple assignment check first, would have saved me some time too haha. Glad you found the issue. I'll make sure it doesn't happen in the next update.

    When you have your project finished, send over a link. I'd love to tweet about it!
     
  41. Mariol

    Mariol

    Joined:
    Dec 22, 2009
    Posts:
    42
    Thanks for the quick fix tip. I got around it but I think your fix is much better.

    Will definitely let you know when I've finished.
     
  42. shahmmx

    shahmmx

    Joined:
    May 10, 2015
    Posts:
    3
    hi, i just bought this awesome asset. My Question is i want include video in every question. Can u help me?
     
  43. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hello, thanks for the purchase!

    I'm going to take a look and see how something like this can be done. I think it should work without problems in the same ab as the image, or maybe by using RawImage instead.

    Stay tuned.
     
  44. shahmmx

    shahmmx

    Joined:
    May 10, 2015
    Posts:
    3
    Thanks for the tips! It's worked!
     
  45. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    That's great!
    I'm adding it to the next update so you can have either an image or a video attached to the question. Here's an example of the result:



    I'll also add a level example with 5-10 video questions.
     
  46. shahmmx

    shahmmx

    Joined:
    May 10, 2015
    Posts:
    3
    Awesome! Can't wait for the next update!;)
     
  47. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I've had a couple of mail from customers regarding the single player scene not having a working timer progress circle. The timer counts correctly but it doesn't show the progress. This is because the wrong part of the timer was assigned in the game controller. The correct timer should be assigned like this:



    I've submitted an update along with the video questions, it should be in the store within a few days.
     
  48. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Update 1.24 (12.12.2015):
    - Added support for video based questions. You can now assign a video as a question, with or without a text caption. The video can also be enlarged to take a better look at it. Video questions are supported by Unity 4 pro, Unity 5 free and Unity 5 pro. Unity 4 free does not support video.
    - Added support for Unity 5.3 SceneManager.
    - Minor changes and fixes.
     
  49. Adswars

    Adswars

    Joined:
    Jun 28, 2015
    Posts:
    13
    I try v1.24 with Unity 5.3.0 then try to build to Android.
    It got an Error said namespace 'MovieTexture' could not be found.

    how to solve this?
     
  50. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    It looks like Unity itself does not support videos on mobile devices (iOS, Android, etc), not only for version 5.3 but for earlier ones as well. This means that there is no way to add videos to the quiz, and having videos in your project will make it impossible to build on mobile.

    I just discovered this fact, don't know how I could've missed it before.
    http://answers.unity3d.com/questions/181330/movie-texture-in-mobile-devices.html

    I'm contacting you now with a private message to give you a cleaned up version of the package without references to video so that you can continue work on your project. I'm also going to see how I can make an update that can accommodate videos without making the project unusable on mobile.

    Thanks for bringing this to my attention. I'll fix it ASAP.