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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[RELEASED] Trivia Quiz Game Template

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

  1. Realidade

    Realidade

    Joined:
    Mar 9, 2016
    Posts:
    24
    In this button issue save the color, I decided to create another same button and erasing button issue.
     
    puppeteer likes this.
  2. Realidade

    Realidade

    Joined:
    Mar 9, 2016
    Posts:
    24
    In perfect working order.
     
  3. Realidade

    Realidade

    Joined:
    Mar 9, 2016
    Posts:
    24
    My app has already been published!

    There will be an update to play multiplayer?
     
  4. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    @Relidade:
    So it's related to a specific button, I'll take a look at it.

    That's great! Can you share a link with us?

    About online multiplayer, I have that in my list for future updates, but there are other features I would like to add first, and I also want to learn more about Unity's multiplayer features before adding them to my template.
     
  5. Realidade

    Realidade

    Joined:
    Mar 9, 2016
    Posts:
    24
    puppeteer likes this.
  6. karmik

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    @Realidade awsom. Congrats
    Would you like to share how you reached out to your customers. Advertising/social media what worked better for you
     
  7. Realidade

    Realidade

    Joined:
    Mar 9, 2016
    Posts:
    24
    Hello!

    I used Advertising on Facebook and Whatsapp.

    The App is intended for a public contest for the Military Police. This contest has averaged over 100.000 subscribers.

    Yesterday reached over 10.000 downloads.
     
  8. karmik

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    Thanks for the info
    Will look to advertise on FB too once my app is up and running. I am waiting for images to be included in answers
     
  9. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    That is awesome! Going to tweet about it if you don't mind :D

    The images update shouldn't be long now. Next update will be submitted this weekend if no problems appear. The answer images will use the same object as the question image, but I also need to make sure it goes well with XML. A more pressing issue for me now is making input systems like Rewired work well with the package.
     
  10. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,549
    With Rewired you should also consider making a pre-configured Rewired Input Manager available as a prefab. You do not include the Rewired Input Manager prefab in your asset but on your website so developers can just drop it into their scene. That way we (as Trivia quiz Game template) users can start using it right away without any setup. It is extremely helpful and then we see how you are using it as a starting point.

    See how @guavaman (the Rewired developer) discussed this approach in this thread as an example.

    http://forum.unity3d.com/threads/motion-controller.229900/page-26 (see msgs 1264 - 1266 )
     
  11. karmik

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    @puppeteer
    Just a question, how do i make the screen not turn from vertical to horixantal axis. Some of my images are bigger in questions and it would be better if they are displayed on vertical screen.

    Is it easy enough to change how the screen is setup. I mean if i adjust score and other objects.
     
    Last edited: Apr 4, 2016
  12. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    You can lock the orientation for mobile devices in Project Settings > Player Settings ( On mobile ), like this:



    After that it comes down to UI design and organization. Some of the newer game modes ( Hotseat, True/False ) are organized in a way that allows the game to be played both in horizontal and vertical orientation, but the older default modes were originally designed for landscape mode, so putting them in vertical will mess up some the UI.

    You can move the objects around to make them fit vertical better, for example set the grid of answer to 1 column instead of 2 columns, and put the options buttons to the top. I'll have to think more about it to see how the default mode can be in vertical with the round clock, hearts, score, and bonus text.
     
    karmik and Realidade like this.
  13. Rengga

    Rengga

    Joined:
    Nov 11, 2015
    Posts:
    1
    can i edit quiz without opening unity ?
     
  14. karmik

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    You can place xml files with questions on server and use those files to load quiz in your game. That way you can keep updating the questions in quiz by modifying the xml file on server
     
    puppeteer likes this.
  15. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Like @karmik said you can target an online XML file and load the questions dynamically from there. But you'll still need to use Unity to make the initial edit for your quiz, to point to that online location you'd like to use.

    There's a plan to make the dynamic XML load work locally too, but currently it only works with an online web address.
     
  16. AvGaz

    AvGaz

    Joined:
    Dec 21, 2012
    Posts:
    82
    When I build on iOS the answer choice from the previous question answer remains highlighted... is there a way to stop this so each next new question has no answer choices already highlighted.

    Other than that seems like a fantastic asset so far.
     
  17. Realidade

    Realidade

    Joined:
    Mar 9, 2016
    Posts:
    24
    Hello!

    How do I add a button to continue the quiz multiple choice, so that issues do not pass automatically?
     
    Last edited: Apr 17, 2016
  18. karmik

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    Hi i am planing to display images based on count of high score user receives
    And also take a screen shot at the end of the quiz with this image to share with friends to play the game as well.
    If this Can this be added i would be great to create buzz about my game on Facebook.
     
  19. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Do you mean a button that asks you to continue after the question has been answered? There is an example for that in the "Guess the Picture" game example in the package. It can show a text after answering and then waits for pressing the continue button.

    If you want a custom example contact me through my profile and I'll send you a package with the example.
     
  20. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I remember using screenshots in one of my past games. I'll take a look to see how it was done, but in general I try to avoid all the social elements around my templates as there are already much better solutions that provide things like facebook/twitter/etc.
     
  21. karmik

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    @puppeteer
    Thanks for that. I will check out social assets.

    Also just want to check how can i edit the number points scored on each question.
     
  22. Realidade

    Realidade

    Joined:
    Mar 9, 2016
    Posts:
    24
    Yes!

    Send email.
     
  23. Realidade

    Realidade

    Joined:
    Mar 9, 2016
    Posts:
    24
    Hello!

    Any news about the buttons?
     
  24. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I sent you a package with a modified scene that uses the Continue button from the CloseUp Mode inside the regular mode. I made it so that it checks if we have a continue button and then stops until we press it to move on to the next question. There is no need to change anything special, you only put a continue button and target the gamecontroller with a SkipQuestion() function.

    Did you get that mail and try out the package?
     
  25. Realidade

    Realidade

    Joined:
    Mar 9, 2016
    Posts:
    24
    Hello!

    I'm testing.

    Thank you.
     
  26. Realidade

    Realidade

    Joined:
    Mar 9, 2016
    Posts:
    24
    Working perfectly!!!
     
    puppeteer likes this.
  27. HeiseGames

    HeiseGames

    Joined:
    May 2, 2016
    Posts:
    6
    I am very excited about using this template, but I can't seem to be able to un pause and continue the game after the follow-up text is displayed. Also there does not appear to be a quite button.
     
  28. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Thanks, I'm glad you like it!

    Does the continue button appear and work as it should be in the CS_GameCloseup scene? Like here:



    Or are you trying to make it work in another scene/game mode?
     
  29. HeiseGames

    HeiseGames

    Joined:
    May 2, 2016
    Posts:
    6

    Dear Puppeteer,
    I was hoping to use the follow-up text with the normal mode of the quiz.
     
  30. HeiseGames

    HeiseGames

    Joined:
    May 2, 2016
    Posts:
    6
    Also I was referring to a quit button to close the application.
     
  31. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    You can do that too. The different scenes are basically different layouts using the same code, so you can switch around parts of the game and put them inside other game modes, but you'll need to assign the functions to the buttons. In your case after taking the Continue Button and putting it inside the question object you need to assign the relevant function to it from the scene, like this:



    But notice that in this scene layout I made the question object into a mask, so viewable area is limited to the question box. If you don't need the image part you can just delete it and remove the mask component, or you can place the continue button within the question area.

    In this case you'll have to place a button somewhere in the scene and make it call a function Application.Quit(); which will take you out of the app completely.

    If you need help just send me a mail and I can send you the project with the quit button and the continue button added to the regular game scene.
     
  32. HeiseGames

    HeiseGames

    Joined:
    May 2, 2016
    Posts:
    6
    Thanks for the offer, but I will give it a try and let you know how I go.
     
  33. HeiseGames

    HeiseGames

    Joined:
    May 2, 2016
    Posts:
    6
    I am trying to add scroll bar's and Scrollrects to the questions in order to allow for larger questions. I am having trouble with having the scroll bar work and the location of the question resetting between questions. While I know this is not a feature of your current design, any advice would be greatly appreciated.
     
  34. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    By default the text in the question box is set to Best Fit which means it will try to fit all the content of the text to the area fo the text box, like this:



    In your case, the way I would make the question box scrollable is by doing the following:

    1. Add a ScrollView object inside the question object, and remove all the extra parts ( unless you want to keep the vertical scrollbar part ). I removed The Content object, as well as the Horizontal/Vertical Scrollbars.

    2. Set the RectTransform of ScrollView to full stretch ( the blue cross arrow shape ), and assign the question text object into the Content field in the ScrollRect component.



    3. One last thing to do is to set the height of the Text Box itself. This is one of the disadvantages of the method, since it doesn't dynamically detect the size of the text and expand/shrink the text box accordingly.



    Now it should look like this, and you'll be able to scroll the question text box:



    Hope that clears things up for you. Like always, if you want to get the ready example just contact me, unless you want to experiment on your own. Just be sure to share the results when you're done :D
     
    karmik likes this.
  35. HeiseGames

    HeiseGames

    Joined:
    May 2, 2016
    Posts:
    6
    Resetting the scroll bar..PNG
    Thank you for all of your help. We are working on app to help people prepare for the Architectural Practice Exam in Australia. (We are Architects and I want to eventually use unity to create VR games of our project.)

    The next step in the app would be to reset the value of the scroll bar to 1 after the question has changed. I will have to start learning some C# but would appreciate some help.
     
  36. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    You'll definitely need to do some coding to make that work. I'm going to take a look at how that can be done, and while we're at it I should be able to make the box resize dynamically based on the text content.
     
  37. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    @HeiseGames : Okay, we have results!

    I added these two lines of code in the AskQuestion() function inside the gamecontroller script, right after displaying the text of the new question.

    Code (CSharp):
    1.  
    2. // Set the height of the text box based on the current content inside it ( more text lines = more height )
    3. questionObject.Find("Text").GetComponent<RectTransform>().sizeDelta = Vector2.up * questionObject.Find("Text").GetComponent<Text>().preferredHeight;
    4.  
    5. // Reset the scrollbar of the question text box
    6. questionObject.Find("Scroll View/Scrollbar Vertical").GetComponent<Scrollbar>().value = 1;
    7.  
    These should be place in the code like this:


    Now when you start the game, it will check the size of the question and make the text box size accordingly. It will also reset the scrollbar to top when presenting a new question.

    Try it out and show us the result!
     
    karmik likes this.
  38. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    An update regarding the latest update:

    Trivia Quiz has had a couple of hiccups in the latest update, which was rejected twice so far by the review team due to some buggy implementation of third party features. I'm going to change up the update priority in order to be able to get more stable updates through the review process.

    On the brighter side, I've been getting many support emails throughout this period, some of which resulted in additional features being tested successfully with user of the quiz template. This means I already have some new features to add to the next update, so stay tuned!
     
  39. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,549
    Looking forward to your next release.
     
    puppeteer likes this.
  40. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    One of the customer requests I received recently was about a way to send mail to a predetermined address. This way the instructor would be able to give the students a quiz link, and get their scores straight to mail. It turned out to be simple, not requiring any third party code. I was able to send the quiz score to my mail along with some followup text.

    My initial implementation was to have 3 fields in the gamecontroller component:
    - user mail ( The mail of the student doing the quiz )
    - user password ( The password of the user mail )
    - target mail ( The mail of the instructor )

    Using this method could potentially be problematic, deterring students from giving their password to a third party. But this was the only way to make sure the student was actually doing the test. I also didn't like cluttering the gamecontroller with even more fields to fill up.

    So I decided to take out the script and use it as a standalone component which you could attach to an object or a button. In the case of the button it would be for example a "share your score" button that triggers the function to send the mail to the predetermined address. It could also send completion time ( if there is a timer ), and allow the student to write a message to the instructor.

    What do you guys think? Should I keep the requirement for the student pass/mail as an option?
     
  41. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Update 1.51 has been submitted for review:

    1.51 (04.06.2016)
    Game Modes:
    - Added another version of the standard game mode, with the UI elements aligned to fit a portrait mode (vertical).

    Improvements:
    - Option to toggle whether we show the correct answer or not at the end of a question. (When you choose an answer, the correct one is highlighted).
    - Added Dynamic Grid script which lets you set grid sizes for both horizontal and vertical aspect ratios. - Switch the sound source to an independent prefab similar to how the music source is set up.
    - Lives Object can also display text. If you display text you can’t use the lives bar.
    - Improved support for Unity version 5.4 and above.
    - Improved UnityAds support with new integration video.

    Fixes:
    - In HotSeat mode, the game skips the next player after making 2 mistakes.
    - If the game starts while the category wheel is enabled, sometimes it shows a one-time null reference.
    - When using a gamepad, if you press the button on an image to enlarge it, you press the button again and the enlarged image doesn't close.
    - In Unity 5 the last selected button stays highlighted after displaying the next question.
    - Some of the UI animations are missing.

    The next update after this one will be submitted on 14.04.2016, you can take a look at the WIP Trello here:
    https://trello.com/b/ml2DoSW7/trivia-quiz-game
     
  42. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,549
    Thanks for this update.
     
  43. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,549
    @puppeteer

    I was thinking about the ability to import trivia questions from Excel. I think the easiest method to is to make Excel the master and then always export from Excel and import into Trivia Quiz Game Template. It seems like it is easiest to use Excel VBA and to control all of the exporting from Excel via that method.

    I noticed a short example of exporting to XML in the book Excel 2010 Power Programming with VBA (ISBN:978-0-470-47535-5) and used that a basis for my simple testing. I used Excel 2013 for Windows for my general test case since I believe VBA is basically Windows only.

    This basically a proof of concept stage. But basically it just uses a macro where the Excel range is hard coded currently but it does work. The current limit of answers is 4 but it can easily be expanded.

    I have included the MS Excel 2013 spreadsheet (Windows) with the included VBA script as an example. You currently have to add the developer tab to MS Excel 2013 if you do not already have it. Then run the VBA macro from Excel.

    The attached zip file: Unity3D_trivia.zip has three files included. The MS Excel 2013 spreadsheet, the generated XML file and I also extracted the VBA code to it can be viewed without having to launch Excel.

    The current Trivia Quiz Game Template documentation on Page 13 looks to be missing a few fields from the XML import picture. Mainly time and bonus fields are not listed. I just looked at Assets\TQGAssets\Resources\XML\Game01XML.xml as my test case and included both of those additional fields in my example.

    In the VBA code you only have to change Excel Range (on line 12) to handle larger number of questions.

    Set Rng = Range("A1:K6")

    In the VBA code you only have to keep adding columns to allow for more answers. You need to change the loop to handle the number of answer fields per question.

    For col = 8 To 11 Trivia_Spreadsheet.JPG
     

    Attached Files:

    puppeteer likes this.
  44. Realidade

    Realidade

    Joined:
    Mar 9, 2016
    Posts:
    24
    Hello!
    Insert questions with videos. How to make the sound of the video work?
     
  45. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    @longroadhwy : Awesome implementation, and it works as long as users keep to the rules. But I think it still is more complicated for the end-user than simply filling out a category component or a list of questions inside the editor. For example if you don't follow the "F|Answer" string rule you'll get an empty field. The way I would have liked it to be is being able to toggle each answer without having to write it in a specific way. The newer XML will also have image/video options on each answer so it will complicate things even further.

    I'm thinking of making a custom inspector for creating the quiz lists, letting the user choose some general settings like the option to have image/video questions or not, and the same for image/video answers, and filling up the quiz with content. It could be exported to XML after that maybe.
     
  46. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hi, can you tell me more about the video you are trying to play? Does the video work without sound, or does it not work at all?
     
  47. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,549
    The least amount of effort to get some results is the method I was using. :)

    My use case is a bit different in that I wanted anyone to be able to create questions with standard MS Office tools. Excel is the easiest to move around (since it also retains the macros and the ability to export questions). Not everyone wants to use Unity to create a question and answer list.

    The reasons for (TF)|<answer> was to keep each answer in a single cell. Otherwise I would have to have two columns for each answer. The reason answers do not show up if you do not follow the format is I have some simple validation into what type of data goes into the XML file. I do not know how much your Trivia asset validates the XML data during the import process. I want to make sure only good data gets into the XML file. I want to avoid any subtle problems later on due to bad data in a XML file that I created (that gets imported into the Trivia asset).

    I really would need to perform better validation on all questions and answers before they get into the XML file. Removing all non-printable characters (or automatically replace them with a single space character) is one I was thinking of adding.

    Of course this will require more work whenever you change the XML file format.

    My original thought was creating a sqlite database (http://www.sqlite.org) to store all questions and use reports to create the Trivia XML file. That seems like a longer term better method to store questions and answers.
     
    puppeteer likes this.
  48. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    @longroadhwy: At some point I'll also add the ability to have a video/image in each answer, so that will strain the sheet even more. At that point you can't just rely on splitting strings from a single cell, or it might become too complicated for the end user.

    Next update ( 14/6/2016 ) will add mail sharing and some other small things ( including image/video answers ). After that I want to make a larger XML update ( 24/6/2016 ) which includes the ability to append questions to a quiz from XML and export question to XML. Then I'll face the bridge of XLS to XML, and see where it stands.
     
  49. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Update 1.51 (04.06.2016) is now online in the store:
    https://www.assetstore.unity3d.com/en/#!/content/45521

    1.51 (04.06.2016)
    Game Modes:
    - Added another version of the standard game mode, with the UI elements aligned to fit a portrait mode (vertical).

    Improvements:
    - Option to toggle whether we show the correct answer or not at the end of a question. (When you choose an answer, the correct one is highlighted).
    - Added Dynamic Grid script which lets you set grid sizes for both horizontal and vertical aspect ratios. - Switch the sound source to an independent prefab similar to how the music source is set up.
    - Lives Object can also display text. If you display text you can’t use the lives bar.
    - Improved support for Unity version 5.4 and above.
    - Improved UnityAds support with new integration video.

    Fixes:
    - In HotSeat mode, the game skips the next player after making 2 mistakes.
    - If the game starts while the category wheel is enabled, sometimes it shows a one-time null reference.
    - When using a gamepad, if you press the button on an image to enlarge it, you press the button again and the enlarged image doesn't close.
    - In Unity 5 the last selected button stays highlighted after displaying the next question.
    - Some of the UI animations are missing.
     
  50. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,549
    My end users might not be a typical use case since they are mostly engineers so I am not worried about complexity of the spreadsheet.

    Per Microsoft you can put 32,000 characters in a single cell so I don't think I will get close to those limits anytime soon.

    https://support.office.com/en-us/ar...d-limits-16c69c74-3d6a-4aaf-ba35-e6eb276e8eaa

    Export to XML will be very useful. It will be useful for round trip testing.

    The XLS to XML is good topic. Do you have a minimum version of Microsoft Excel that you will be supporting?
     
    puppeteer likes this.