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. freedom667

    freedom667

    Joined:
    Sep 6, 2015
    Posts:
    425
    can we integrate to Web Backend? because I want manage the categories, questions and answers, points, difficulty etc. from web site. Also I want to make Online Quiz. there will be login system, 1vs1 match as random,
     
    Last edited: Nov 3, 2017
  2. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    The package doesn't have a web backend ( login, quiz database, etc), it only supports loading quizzes from XML files.
     
  3. Artomiano

    Artomiano

    Joined:
    Dec 1, 2014
    Posts:
    200
    Hi puppy,
    apparently I'm not the only one who needs an external database application. ;)
     
  4. freedom667

    freedom667

    Joined:
    Sep 6, 2015
    Posts:
    425
    In my opinion, it would be perfect to support web backend.
     
  5. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    You should start making an official statement on when you are ending Unity 4.x support. Considering Unity does not support 4.x it should be easy to stop supporting 4.x. It seems to me that you should say your next update will only support Unity 5.x and newer versions.
     
    mindfulmx, puppeteer and Artomiano like this.
  6. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    For sure Trivia Quiz 2.0 will start from a higher version and abandon 4 entirely, maybe for 5.4 or 5.5. But for now I want to push a couple more things that are able to run on 4 just in case anyone is still using that one.
     
  7. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Submitting new update to the store, with a couple of video guides to go along.

    Update 1.97 (11.11.2017)

    - You can set a followup image and sound in addition to the followup text which appears after answering a question.
    - Right-To-Left text (Arabic, Farsi, etc) support using a free store plugin, with integration video guide.
    - ( Unity 5.5+ only ) Example of rewarded ad giving you an extra life at game over, giving you another chance to continue the game, with video guide.
    - You can customize the score/highscore texts that appear at the end of the game. This is helpful when you want to use a different language for these texts.
    - Bug fix: Make sure buttons are highlighted for selection only when we are using keyboard or gamepad.

    Note that one of these updates ( the rewarded ad ) is only for Unity 5.5+, so it won't be in the Unity 4 version of the update.

    I expect next update to be mostly for unity 5, and 2.0 will definitely be Unity 5.5+ only when it comes out. If anyone is reluctant in moving to a higher version of Unity, don't be afraid to upgrade. I constantly upgrade my projects from 4 to 5 after making code changes and they work fine.
     
  8. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Last edited: Nov 12, 2017
  9. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    This video shows a quick process of using UnityAds to give an extra life in exchange for watching an ad. The example is intended for Trivia Quiz Template as it has the Extra Life code in it.



    Puppeteer Assets package: https://drive.google.com/file/d/16NBhz2hVlThHXjkZ0k1z6BXPAhHfItZM/view

    Here's what we did in the process:
    1. Open Build Settings and switch the platform to one of the supported ones (iOS, Android).
    2. Sign in to your Unity account in order to allow Unity Services such as UnityAds to be activated, then activate UnityAds.
    3. Download Puppeteer's Assets package from: https://drive.google.com/file/d/16NBhz2hVlThHXjkZ0k1z6BXPAhHfItZM/view
    4. Drag the downloaded package into your Unity project, and import it.
    5. Open the GameOver object and turn on the ExtraLife object inside it, then drag the UnityAdsRewarded script to it.
    6. Link script to the button and the ExtraLife function from the GameController object.
    7. Test the game and see how we can watch an ad and get an extra life once per match.
     
    Last edited: Nov 13, 2017
    UnitySora likes this.
  10. UnitySora

    UnitySora

    Joined:
    Mar 31, 2016
    Posts:
    32
    The rewarded video is a good update. Hope this feature is available on other templates such as scrambled word and matching game too, which extends times instead of giving extra life.
     
    puppeteer and SanchoP like this.
  11. joelrossier

    joelrossier

    Joined:
    Nov 17, 2017
    Posts:
    3
    Hi Puppeteer, did you fix the issue when a player made a bad answer the left upper button is highlighted? Thanks
     
    Last edited: Nov 17, 2017
    puppeteer likes this.
  12. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    It *should* be solved in the latest updates, though it has happened twice before that it creeps back up on newer unity versions.

    Yes, it can potentially work with any of the templates, but you need to know which function to call. Maybe I'll add "extra time" function to all the other puzzles and then show a short video of how to target them.
     
    Last edited: Nov 17, 2017
  13. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Update 1.97 is live on the store, check it out!

    Update 1.97 (11.11.2017)

    - You can set a followup image and sound in addition to the followup text which appears after answering a question.
    - Right-To-Left text (Arabic, Farsi, etc) support using a free store plugin, with integration video guide.
    - You can customize the score/highscore texts that appear at the end of the game. This is helpful when you want to use a different language for these texts.
    - Bug fix: Make sure buttons are highlighted for selection only when we are using keyboard or gamepad.
    - (Unity 5.4+ only) Example of rewarded ad giving you an extra life at game over, along with video guide.
     
  14. joelrossier

    joelrossier

    Joined:
    Nov 17, 2017
    Posts:
    3
    Do you mean in the 1.97? Still the same issue in 1.97
     
  15. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Check your messages, let's solve this once and for all.
     
    joelrossier likes this.
  16. joelrossier

    joelrossier

    Joined:
    Nov 17, 2017
    Posts:
    3
    Cool feature!!! I like the idea....
     
    puppeteer likes this.
  17. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I'm submitting a tiny quick update following great feedback from @joelrossier , plus a couple of fixes:

    - Removed leftover Arabic text from menu and RTL script from grid game mode.
    - Fixed auto answer highlight when using mobile device. The way it works now is if we are using the mouse or a mobile device, answers will not be auto highlighted. They will only be auto-highlighted if we use a keyboard/gamepad.
     
  18. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I've been researching an ways to implement a leaderboard into the package, and I've found a free plugin named dreamlo (https://www.assetstore.unity3d.com/en/#!/content/3862) which could potentially get the job done with minimal effort. It seems to work in Unity 4 and 5, and I hope it will pass a mobile test too.

    Here is my first test with a score submit and leaderboard in one of the levels:

     
  19. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Just tested the leaderboards feature in mobile, and it seems to work!

    IMG_0305.JPG

    It also works in Unity 4, so it'll be part of the update for that version as well. So what we have here now is a simple, free, and multiplatform leaderboard you can use to keep track of scores in different game modes. Yay!
     
    mindfulmx likes this.
  20. paultonydev

    paultonydev

    Joined:
    Sep 26, 2012
    Posts:
    2
    Hi puppeteer, earlier in the thread you mentioned adding a head to head mode (local) Has this been implemented or still in the works?

    Thanks.
     
    puppeteer likes this.
  21. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Initially when trying out different things I wanted to make a 2 player head to head mode, which had buttons on each side for each player, and they would be able to answer simultaneously. But it didn't work out well with all gameplay inputs (keyboard/gamepad, touch, mouse) and was had other problems as a local game mode.

    So instead of that I made the HotSeat mode which had unlimited players, but shows each one a question in turn.
     
  22. paultonydev

    paultonydev

    Joined:
    Sep 26, 2012
    Posts:
    2
    Sounds good, just bought your asset a few hours ago. Thanks mate!
     
    puppeteer likes this.
  23. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Here is the guide for adding a DreamLo leaderboard to your quiz game:


    This will be available for version 1.98 of the package, which hasn't been submitted yet.
     
  24. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Testing a more detailed report email which students can send to the instructor after completing the quiz. The new report will include player name, score, name of level we played, number of correct and wrong answers we got, and the time we played the quiz.



    I'm also testing options for making this work on android, looking specifically at this thread:
    https://forum.unity.com/threads/sending-email-on-android-device.198795/
     
  25. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Update 1.98 has been submitted to the store, should be online within a few days.

    Update 1.98 (15.12.2017)
    - Share your score to a simple leaderboard system using the free DreamLo plugin, which works both on PC and mobile.
    - Improved mail sharing, allowing sharing play time, number of mistakes, and the level we played.
    - Bug fix: Category grid doesn't show the last row if the number of categories is not a multiple of the number of columns.
     
  26. send2icq

    send2icq

    Joined:
    Dec 14, 2017
    Posts:
    4
    demo not work.
    There should be 'TQG197 (1)_Data'
    folder next to the executable
     
    puppeteer likes this.
  27. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    send2icq likes this.
  28. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Update 1.98 for Trivia Quiz is live on the store, and it's all about sharing. Go check it out!

    Update 1.98 (15.12.2017)
    - Share your score to a simple leaderboard system using the free DreamLo plugin, which works both on PC and mobile.



    - Improved mail sharing, allowing sharing play time, number of mistakes, and the level we played.



    - Bug fix: Category grid doesn't show the last row if the number of categories is not a multiple of the number of columns.
     
    Artomiano and mindfulmx like this.
  29. murdoxstyle

    murdoxstyle

    Joined:
    Sep 2, 2015
    Posts:
    7
    Hi Puppeteer, i'm newbie on unity and i find this template will help me with my project. Just one problem, my project need head to head quiz, you said on later thread you still working on it because not supported for some input. If i just need to created this trivia quiz head to head on the android just with tap the answer, can you help me?
     
    puppeteer likes this.
  30. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Now that version 1.98 is live, I want to take a look at a few more user requests, including the Head2Head mode. I don't think it will be an online mode, but a local one intended for use on mobile devices is a more feasible option.
     
  31. wh0eii

    wh0eii

    Joined:
    Dec 15, 2017
    Posts:
    2
    Just purchased your Trivia Template and looking forward to use it!

    I was wondering if it possible to randomize the content of wrong answers by using a list of fodder answers. Ofcourse when the answer is the same as the correct answer, it should skip it. This might save time typing the wrong answers and will give a more random display of the answers.

    Also is there a function for the app users, to fill in their own trivia questions directly from the app? I think I read a similar question in this forum before, so my apologies if you already mentioned it.

    Adding the questions by excel is also great! Do you think you can do it as well with google sheets? The google sheets doesn't have an export to xml button, so I'm kind of stuck there.
     
    Last edited: Dec 20, 2017
    puppeteer likes this.
  32. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I made a few tests to see how this could work. The only way I see this working would be if we had a a single list with all possible answers, and then a generic question format that switches one element ( like an image with the label "what is this?" ), and then the correct question is set automatically.

    I have something similar in the Hidden Shape puzzle:
    https://www.assetstore.unity3d.com/#!/content/101558

    But as you can see it's only one question (guess the shape). In Trivia Quiz you have to enter each question and the answers accordingly.

    What type of game format did you have in mind for this? Can you give an example for me to try out?

    I tried this earlier with one of the customers, but without server side code to load and save quizzes it's not possible. The only externally controlled quiz you can make now is through a Dynamic XML file which can be updated without rebuilding the game files.

    I see there is an option to download your Google sheet as an XLSX file which can be opened in Excel. This could be the solution you're looking for. I'll try to record the process from google sheet > excel > xml > unity and post a video about it here.
     
    wh0eii likes this.
  33. wh0eii

    wh0eii

    Joined:
    Dec 15, 2017
    Posts:
    2
    Thank you for making the tests, your hidden shape puzzle seems to be similar if I understand correctly. So I am thinking of a list of questions with only one correct corresponding answer and another list of all possible question answers. When a question is loaded, the correct answer will be put at a random position and 3 (or more) other wrong answers (that are taken from the other list) will be displayed randomly as well. However, this is of course kind of doable in excel as well with randomising the cells. If programming it makes it unnecessary complicated, I can live without it.

    Is it possible to provide a quick template of incorporating such a dynamic XML file with for example a category level? When saving it in playerprefs, will the user inputted list still be accessible when for example updating the game?

    Also the reason why I wanted to download from google sheets is because I don't have access to excel. However, I have fixed this by using the power tools add-on to get a xml output of the selected cells on google sheets. Copy the xml output to notepad++ and use a macro to format the xml to the required xml standard for this game. Ofcourse I am using a different template than provided by you, but this works for me (didn't try sound/pictures/videos though).

    On another point, I wanted to have a combination of this game and a virtual pet game where I can earn an in game currency for example rubies that you will earn after having every 5 correct answers (preferably with popping up sprite animation of a ruby). When either getting a victory or game over, you will see the accumulated rubies on the screen and it will be saved in playerprefs and the total number displayed on the menu screen to be used on a later date. These rubies can be used to unlock levels of the trivia game, but also for the virtual pet game where you can give food or other activities. Rubies can of course be bought as well from in app purchases. Can you help me with incorporating such an in game currency that I can use for unlocks and other minigames?
     
  34. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Contact me directly, maybe I can merge the code from the other puzzle game to make it into a "single question with one list of answers". I think it depends more on the design approach you're taking with your quiz.

    In-game tokens are planned for the 2.0 version of the trivia game, starting with locally saved tokens you can earn by playing and spend on unlockable categories. I also intend to integrate Unity's IAP feature for some real-currecy unlocks ( directly or through the tokens ). But version 2.0 is still far off.
     
  35. Minoterrae

    Minoterrae

    Joined:
    Jan 4, 2018
    Posts:
    6
    Puppeteer, I would like to send you a video snippet of a feature I saw in another game. Could you tell me if it is possible to do in your Trivia template without too much difficulty.

    Would that be okay?
     
    puppeteer likes this.
  36. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Sure, post that video. It could be useful for other users of the package too.
     
  37. Minoterrae

    Minoterrae

    Joined:
    Jan 4, 2018
    Posts:
    6
    In this example the selections are shuffled/randomized on-screen so that the player can see it happening. In other games I've seen the selections are generally in their shuffled position at the start.

    Anyway, I'd like to achieve an effect like this.

     
  38. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Can you explain a little about this? Do you want to see the answer buttons mixing animation before we can choose one?
     
  39. Minoterrae

    Minoterrae

    Joined:
    Jan 4, 2018
    Posts:
    6
    Yes. I want the buttons to all swap positions for 2-3 seconds before finally stopping at their final shuffled/randomized position.

    Then the player should be able to click them, but not while they are shuffling.

    Regards,
     
  40. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Guys, I'm collecting a fix/feature list for update 1.99.
    So far I got valuable feedback about Dynamic XML, and also info about high scores in categories.
    If anyone has other feedback that can be beneficial to all users, I'd love to hear it.
     
  41. WeFancy

    WeFancy

    Joined:
    Jan 14, 2018
    Posts:
    4
    Music
    A way to set the music in each scene where the TQGGlobalmusic.cs would know which song was being played and only change it it the next level/scene had a different song attached. Maybe via tagging the Music? Music1, Music2, etc?

    If there's a scene change and they both have the tag Music1 then it doesn't change or restart.

    If there's a scene change from Music1 to Music2, then Music1 would stop/fade off and Music2 would start.
     
    puppeteer and mindfulmx like this.
  42. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I think it's possible to do this without tagging each music object, just by comparing the actual clips. If it's a different clip, crossfade the two, if it's the same clip, keep the old one.

    Here's my test:
     
    WeFancy likes this.
  43. Bargaintoaster

    Bargaintoaster

    Joined:
    Aug 1, 2013
    Posts:
    4
    Hi!
    Is loading an image from online source implemented yet?
     
    puppeteer likes this.
  44. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    No, unfortunately this feature will not be available anytime soon.
     
  45. WeFancy

    WeFancy

    Joined:
    Jan 14, 2018
    Posts:
    4
    Awesome thank you!

    I'm trying to build in passworded levels based on your LockLevel script atm
     
    puppeteer likes this.
  46. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Great, it will be in the next update.

    The LockLevel script is based on the high score in a certain level. Are you modifying the code to make it a password-based unlock?
     
  47. WeFancy

    WeFancy

    Joined:
    Jan 14, 2018
    Posts:
    4
    Made a duplicate of the .cs and trying to work something in like that yes, but I am a beginner so taking some time!
    If you could put that in the next update too that would be useful for others maybe.


    Also trying to figure out how to make playerPrefs have a 'Completed' value for each scene/level, just like how Categories has. Currently it only sends a CS_*gamename*HighScore to playerPrefs, but we require a Completed value as well - is this easy?
     
    Last edited: Jan 23, 2018
  48. WeFancy

    WeFancy

    Joined:
    Jan 14, 2018
    Posts:
    4
    Got that to work by putting

    Code (csharp):
    1.                  PlayerPrefs.SetInt(SceneManager.GetActiveScene().name + "Completed", 1);
    on Line 1540 of GameController
     
    Last edited: Jan 23, 2018
    puppeteer likes this.
  49. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Had a bit of back and forth with a couple of users who had a problem displaying text in other languages on WebGL.

    Inside the editor the text would appear correctly, and also when building to PC or Mobile, but when we build to WebGL the text disappear.

    This is because WebGL doesn't automatically revert to default fonts when it doesn't find a certain font.

    To solve this you must add your special fonts to your project, and assign their names as fallbacks for the default font, like this:

    ezgif.com-crop(1).gif
     
  50. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Had another question from users regarding the dreamIO leaderboard integration. On some of the versions the button that sends the score to the leaderboard is not assigned properly, so you need to make sure it is assigned in the scene to make it work right, like this screenshot:

    TQGLeaderboardButton.png
     
    mindfulmx likes this.