Search Unity

Looking for advice and Ideas for Shoot the Star Carnie game

Discussion in 'General Discussion' started by devotid, Mar 23, 2019.

  1. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    445
    TCG_MAIN_Capsule.png

    My newwest game on steam The Coin Game is out finally and I have been working on the next big update which is a large traveling carnival that has a bunch or rides and fun games to play.

    Shoot the Star Gun copy.jpg

    One of the games is the Shoot the Star game. You shoot a red star out with a BB gun and if you shoot all of the red from the card you win a prize. Here is the prototype video from the game that I made four years ago. (gives you an idea of how long I have been working on this game lol) http://www.devotid.com/shoot-stuff/



    In the first prototype I was using the old Unity Cloth system for the "tearable" logic to simulate the target. The only problem is that when the game was over I had no way of telling if the user won or not. I could not assign colliders or anyway to know if they shot all the red of the star out. Even the real life operators will flatten the card out if there is a small piece of red folded behind you do not win. So that way is out.

    Im trying to think up some other ways of doing it so the user can shoot the target and then I can tell if they shot all of the star out.

    Maybe a single voxel style gameobject for each piece of the target and assign tags to the red parts of the star and if they are all gone the users wins. But this wont work properly because if you shoot all the way around the star there will be no physics for the red star to "fall out" of the target.

    Anyways.... Anyone got any ideas? Im even thinking of raycasting to the neighboring piece and if that is gone the item will just fall...... But that a LOT of raycasters as they have to be about the size of a BB.

    Thanks for any ideas you may have to help me....

    Kevin
     
  2. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    445
    Also I have seen Obi Cloth on the Unity Asset Store... I just dont know a way to tell f there is certain pieces of the mesh missing. Hence I dont know a way to tell if the user has won.
     
  3. ClaudiaTheDev

    ClaudiaTheDev

    Joined:
    Jan 28, 2018
    Posts:
    331
    I don't know if you can "copy" the fabric with the star and the wholes remain in it But here is an idea :

    Create a second instance of the fabric after shooting it. Be sure that is has no motion etc and it has the same wholes from the shots.
    Create a camera with orthographic view and a belonging light with a mask on a layer so that the objects want affect your other objects. Let the camera look straight at the star. Make the camera render to a texture.
    You can use even post process with the camera to make the contrast bigger and prevent shadows etc.
    After having the result in a texture you can either write a logic to count red pixels or train a neural network.
     
  4. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    445
    I thought about this one years ago but gave up because I had no idea how to read pixel colors back then... I thought about taking an ortho screen grab of the target and then "Search for Red" in the pixels. The only problem with that is if there is a bit of red that is hanging behind the visible area it wont see the red and count it as a winner.

    I even thought about somehow "flattening the mesh" like the attendant does in real life. I dont know how I could just flatten the mesh to a certain plane to make sure all the little "hanging" pieces would be included. hhhmmmmmm
     
  5. ClaudiaTheDev

    ClaudiaTheDev

    Joined:
    Jan 28, 2018
    Posts:
    331
    I an not familiar with unity cloth system But perhaps there is a stiffness setting? You could lay the mesh on a table or box so it flattens but that doesn't guarantee that there are hidden folds. Does the cloth system have a not folding or stiffness setting?
     
  6. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    445
    Yes it does and you know that could work. I could even build something using Set hinge position that could return the pieces back to flat. I didnt think of that.

    Im building a little 2d gui style target too. The 2D UI runs so fast that I might be able to get more resolution out of it and make it feel more real. I want it to be just as hard as it is in real life. Ill report back. :)

    Kevin