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

Space Game Starter Kit [Released]

Discussion in 'Assets and Asset Store' started by ArenMook, Oct 11, 2011.

  1. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Hi ArenMook,

    currently I'm playing with the kit, I can see from your well organized code that you have an interesting experiance.
    also the graphics and asset level is very good.

    I'm digging inside the code right now, even it's well organized but it's not easy to understand all the techniques that you are using right away.

    I'm thniking of using the GUI used in the kit with my own game, however I have a couple of questions:
    1- I can see you are using animation files to animate the GUI's can you please let me know how did you create these animations? did you use an exteral application? please explain?
    2- with a quick look for the script folder I can see there is GUI folder under Scripts and also there is a GUI folder under Script/Common/GUI, so what is the differenace between both of these folders? and why did you split the GUI to be in 2 seperate folders?
    3- My custom game that I have is using java script and I want to integrate your GUI code, so in this case I believe I need to move some of your GUI C# code to my StanderedAsset Floder, can you please let me know if this is correct? and what GUI files I need to move to my StanderedAsset folder to make the integration work?

    Thanks in advance.
     
    Last edited: Mar 7, 2012
  2. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    My suggestion -- don't use the GUI in the space game kit. Use NGUI instead. The UI in the space game is basically NGUI version 0.1.

    The animations were created within Unity using the Record Animation feature.

    To use javascript with C#, you need to move C# code into Standard Assets or Plugins folder.
     
  3. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Thanks Aren for your reply.

    Actually I belive I need to test my game with your NGUI code first.

    So can you please let me know how to access your free version of NGUI for testing purpose?
     
  4. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    I'll PM you the link.
     
  5. vished

    vished

    Joined:
    Oct 24, 2010
    Posts:
    26
    How disappointing, I was looking forward to buying this.
    They make changes that break existing projects. They 'update' official demo files rather the fix backward-compatibility issues. Don't they test builds on asset store content?
    To get a compile with each new version you have to spend valuable time updating your source to be compatible with new 'features'.
    Once you figure out the correct project and editor match, there's no way to easily swap between editor builds like a normal software developing environment - you have to de-install and re-install all the time.
    answers.unity3d.com Download link for previous versions of unity3d
     
    Last edited: Mar 15, 2012
  6. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    It is indeed disappointing that Unity doesn't offer a way to download an older version, especially considering that their 3.X.0 updates always break something important (at least in my experience). That said, I can confirm that the issues have been fixed in the latest (not-yet-released) version -- so what Unity broke in 3.5.0 is once again functional in 3.5.1. There is some new cryptic error message showing up when navigating away from the Game scene, but it seems to be harmless.
     
  7. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    (bookmarked)
     
  8. deadswine

    deadswine

    Joined:
    Mar 27, 2012
    Posts:
    19
    Where to start with adapting this kit to 2d movement and top down camera??
     
  9. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    I'm not even sure how to answer that. This is a 3D kit, and 90% of what it does is in how the spaceship is controlled and moved in 3D. If you want it to be 2D, you will need to scrap the entire controller.
     
  10. deadswine

    deadswine

    Joined:
    Mar 27, 2012
    Posts:
    19
    I want it to be totally in 3d but with 2d movement (left,right,forward,backward not up and down) and camera from top where wold be best płace to start?
     
    Last edited: Mar 28, 2012
  11. sagron6015

    sagron6015

    Joined:
    Apr 19, 2010
    Posts:
    32
    The gui seems to be what is entirely responsible for crashes (when swapping scenes). If you disable the 3d hud stuff it no longer crashes and seems to run fine.

    Edit: Apparently the welcome scene is the only one causing problems - if you change the material from uiskin to default-diffuse on all the pieces of the UI containing it there's no more crashes.
     
    Last edited: Mar 29, 2012
  12. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Yup, but whatever the issue, Unity still shouldn't crash because of it. Only 3.5.0 crashes. 3.4.2 and 3.5.1 run fine.
     
  13. guyal

    guyal

    Joined:
    Feb 25, 2011
    Posts:
    17
    After confirming 3.5 doesn't work for the usual reasons...have the following in Game scene on 3.4.2, on Snow Leopard:

    UnityException: Input Axis Right is not setup.
    To change the input settings use: Edit -> Project Settings -> Input
    SpaceshipController.Update () (at Assets/SGSK/Scripts/Game/SpaceshipController.cs:160)

    Since the script references "Right" and its a Project Setting, I assume this is a Kit issue, rather than user error, but...?

    I don't see anything in PS -> Input that clearly matches to "Axis Right", so before I start hacking it up...any known issues, comments, tips?

    Thanks
     
  14. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    "Read Me - Important.txt" <-- the "important" part is there for a reason :)

    Long story short, you need to extract the contents of the zip file into your library folder.
     
  15. mldesanctis

    mldesanctis

    Joined:
    Sep 30, 2010
    Posts:
    40
    Can you help me try and apply a minimum speed? I added this to Spaceship.cs and I'm getting nothing back.

     
  16. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    That should work fine. Select the spaceship in the inspector and make sure the 'minimumSpeed' is indeed 50.
     
  17. mldesanctis

    mldesanctis

    Joined:
    Sep 30, 2010
    Posts:
    40
    That's what I thought, however I am getting
    The ship then completely looses power. I can still tilt and rotate, but it will not apply thrust until I comment out what I just showed you.
     
  18. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    You need to check for zero. If the 'speed' is zero, then you are going to run into problems as you'll divide by zero.
     
  19. mldesanctis

    mldesanctis

    Joined:
    Sep 30, 2010
    Posts:
    40
    Oh, I see, I needed to use my fourth grade math skills. If anyone is interested, here is how I modified Spaceship.cs so that it utilizes a minimum speed and max speed, and then decelerates to the minimum speed if you are not thrusting. Note that I had to move mAppliedThrust up a few lines earlier.

    I also have some feedback on Arcade mode. Unless I am missing something, I find the firing to be unusable. Games like this usually revolve around the reticule moving around the screen so that the player can fire at anything in view. The way it is currently, you can only fire at the center of the screen. This could be very useful for a zero-gravity racing game based on maneuvering the player around obstacles on a specific path, but for an arcade shooter (I feel) the player needs more control over what exactly they can shoot at.
     
  20. Newbquest

    Newbquest

    Joined:
    Apr 2, 2012
    Posts:
    24
    Visually impressive! Can't try the web player since I'm at work but screens and feature list look cool. This is something I love about Unity, the existence of stuff like this for newbs like me to learn from. Thanks for publishing this!
     
  21. JimTarver

    JimTarver

    Joined:
    Dec 14, 2011
    Posts:
    2
    I did that and I'm still getting the error that guyal is getting.

    I'm using 3.5.1 on a Mac. Do I need to go back a version?

    UnityException: Input Axis Right is not setup.
    To change the input settings use: Edit -> Project Settings -> Input
    SpaceshipController.Update () (at Assets/SGSK/Scripts/Game/SpaceshipController.cs:160)
     
  22. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    You need to extract the contents of the ZIP file into the Project Settings folder, as per the ReadMe file's explanation.
     
  23. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
  24. chriscana

    chriscana

    Joined:
    May 2, 2012
    Posts:
    3
    For you scripting experts (I would think this is easy):

    Is there a way to map the ship controls to the virtual joysticks included in the penelope demo (see the dual joysticks prefab and joystick scripts) - and sill retain the physics and feel of the rails and game demo, but with virtual joystick support?

    Thought maybe between the preexisting prefab and script for joysticks and the already-working mobile controls, this would be an easy one for some to post a script or code example to get this one working pretty quickly.
     
  25. WhiteRabbit

    WhiteRabbit

    Joined:
    Jun 16, 2011
    Posts:
    13
    Aren -

    I bought this game several months ago and I need to update to the current version - how do I do this? Previously, I thought there was an update link, but it doesn't appear to recognize me anymore. Also - is there any way you can provide a brief description of what tools/methods you used to create the assets in this project? There are various resources I've found regarding scripting/UI etc.. but I have found little on asset creation. The Dirty Headline font and details of the planet creation would be particularly usefull.
     
    Last edited: May 20, 2012
  26. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    You need to be logged in for it to let you download the packages you own on the Asset Store. As I recall this kit uses basic GUI 3D text -- it was created prior to NGUI, so there isn't anything special about it. I found a free font and used it, basically. For the planet, I generated a normal map in another program I wrote a long time ago that somewhat resembled a bumpy planet and used it there, together with a shader I wrote that added some basic atmospheric-like tinting.
     
  27. potinana

    potinana

    Joined:
    May 15, 2011
    Posts:
    1
    This is looking great.
    I want to use this package in a project that is currently using NGUI. When I import the package, unity starts throwing lots of errors. I tried importing SG into a fresh project then copied its assets manually to my project and fixed my project settings.
    I can run the (Game) scene now but all GUI elements are gone!.
     
  28. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    There will be an update to SGSK in the coming weeks that will make it use an updated version of NGUI Free.

    Until then, you can obtain a combo pack of NGUI + SGSK by just emailing me and providing me invoice #s for both of your purchases. I did all the merging already. :)
     
  29. jamesi

    jamesi

    Joined:
    Jun 19, 2012
    Posts:
    1
    I have purchased and been digging into Space game starter kit and ngui recently, really nicely done.

    Q: The networking to host a game, is this fully functional, or more of a limited proof of concept? I tried to export a pc/mac standalone version on two different computers one the same wireless network. Using the "welcome screen" scene and the "game" scene provided in your example.

    a) tried it using internal lan addresses (192.168.0.104 and 107)
    b) also tried using the external web ip address (same for both computers obviously) I have not tried 2 computers with different web ip's yet
    c) the first user can host the game, but the second user cant seem to join that game (after putting in the first user's ip address and clicking join on the welcome screen)

    thanks, looking forward to the upcoming SGSK update.

    UPDATE: removing the host computer firewall (OS firewall and anti-virus firewall) allowed the multiplayer to work perfectly over internal LAN - thx
     
    Last edited: Jun 21, 2012
  30. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Yup, networking works fine with different computers, provided the host doesn't have a firewall blocking access. I tested it back in the day by playing on a Win7 host with a Mac joining in. Both connected via a wireless network and using an internal 192.168.*.* IP
     
  31. joshuacarpeggiani

    joshuacarpeggiani

    Joined:
    Jun 18, 2012
    Posts:
    1
    Hi
    Ive been trying to figure out how to get the Ip address field working on the iphone keyboard. I am a beginner at unity and scripting so I don't know a lot. I'm not sure if anybody has already asked this question.
     
  32. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    I have a version of SGSK that uses NGUI (but it's not yet finished -- in-game HUD is missing). Once it's finished, I'll put up an update to SGSK, so your iPhone will bring up a keyboard when you click on the input field. You won't have to do anything.
     
  33. buenofelipe

    buenofelipe

    Joined:
    Nov 9, 2011
    Posts:
    4
    Could you please make a webplayer of the SWTOR / Star Fox space combat demo? =)

    Thanks in advance!
     
  34. S0ULART

    S0ULART

    Joined:
    Jun 14, 2011
    Posts:
    131
  35. buenofelipe

    buenofelipe

    Joined:
    Nov 9, 2011
    Posts:
    4
    Oh, thanks! =)
     
  36. NoCanDo

    NoCanDo

    Joined:
    Jul 27, 2012
    Posts:
    2
    I really need help with this.There are lots of things I want to change, but it doesn't work. The only thing I can do is add some music and delete the spare enemy spaceship.

    I have tried changing things in the inspector and in the scripts. For example, if I change maximumSpeed to anthing else, the ship can still only do a max of 150. I change the value in the script, save the script, hit play, and still 150 is the result.

    Likewise if I want the 'Host' button to load up a different scene, I change it in the script and nothing happens.

    <public string levelToLoad = "Game";> if I change that to <public string levelToLoad = "Game1";> and 'Game1' is an edited scene that I load up in the build editor, clicking the Host button no longer works.

    So what's up? Changing the values in the script makes no changes to the game! So far seems like the Starter Kit is an End Kit.
     
  37. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Changing the public values in code has no effect once the script has been attached to any game object. That's just how Unity works. You need to select the game object where this script is attached and modify it in the inspector instead.

    You need to add "Game1" to the build settings, otherwise it can't be loaded dynamically. Unity tells you of this. Check the error log.
     
  38. NoCanDo

    NoCanDo

    Joined:
    Jul 27, 2012
    Posts:
    2
    I did try changing values in the inspector, selected the Spaceship under Test Objects, changed the Maximum speed to 1150, but the ship could only do a max of 150. Like I said above, changing script or inspector makes no change.

    Anyway, I did load "Game1" in the build settings, but got an error:

    NullReferenceException: Object reference not set to an instance of an object
    NetworkManager+<LoadLevelAsync>c__Iterator0.MoveNext () (at Assets/SGSK/Game/Scripts/Common/Other/NetworkManager.cs:387)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    NetworkManager:OnDisconnectedFromServer(NetworkDisconnection) (at Assets/SGSK/Game/Scripts/Common/Other/NetworkManager.cs:275)

    So it's turning out to be a lot harder to modify this code than I expected. Another example:

    In Game, when I selected 'test objects' and then 'plasma beam' under the hierarchy, it comes up with various scripts in the inspector. If I change public values of the Fired Object script in the inspector, it makes no changes in the game. I can change the Firing Velocity from 250 to 5000, and there's no change.

    'Test Objects' is grayed out in the hierarchy, but that's the only place I can find the ship, plasma beams etc.

    So what am I doing wrong? I change code, change public values in the inspector, but neither works.
     
  39. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    You need to click "Apply" to apply your "test object" changes to the prefabs, otherwise it's not going to work. Again, a Unity thing. Modifying local instances of prefabs only modifies that instance, not the prefab itself.
     
  40. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Also btw, adding the scene to the build list isn't enough, you need to check it as well, so that it's actually included.
     
  41. Phill123

    Phill123

    Joined:
    Jul 29, 2012
    Posts:
    11
    Hi, Thanks for making this excellent kit!

    It's already saved me countless hours. I am using the arcade controller setup in my game, and i've gotten the rear thrusters working all the time
    by turning off the thruster control script on them. But it would be cool if i could use the directional thrusters aswell and have them turn on automatically when you are moving the ship via touch/mouse. Eg as you move up in your spline based demo the bottom thruster fires etc. Proportionally would be even better, so moving slowly has a small thrust and moving quick gives larger thrust etc. If you have the time to point me in the right direction it'd be much appreciated (i'm very new to scripting) - although i think you've already done a lot of work for your $65!

    Thanks,

    Phill
     
  42. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Easiest way to do that would be to check the position delta every fixed update. Save the current position in the beginning, in update check the difference between current and previous, and set the thrusters based on that.
     
  43. Phill123

    Phill123

    Joined:
    Jul 29, 2012
    Posts:
    11
    Thanks for the answer,

    Another issue i'm having is i can't for the life of me make the explosions instantiate with velocity.
    Ideally I want them to either explode and the velocity match the speed of the object before explosion, or in the project i'm doing i only need the explosion to instantiate with a set velocity on the Z axis so i can match them to the set velocity of the objects.
    Its probably very simple but i'm very new to this!

    Thanks
     
  44. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    You need to add a rigidbody to the explosion, and when you create it, set rigidbody.velocity to something to make it move.
     
  45. Phill123

    Phill123

    Joined:
    Jul 29, 2012
    Posts:
    11
    I'm lost. I've spent 2 hours reading examples and questions trying to figure this out but nothing works.
    I thought this looked like it might be the answer but it comes back with 'UnityEngine.Vector3' is a 'type' but is used like a 'variable'

    // Instantiate an explosion prefab
    if (explosionPrefab != null)
    {

    Instantiate (explosionPrefab, transform.position , Quaternion.identity);
    rigidbody.velocity = Vector3(0,0,-30);


    }

    // Destroy this unit

    Am i even close or is this just completely wrong?
     
  46. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    You're missing "new" in front of "Vector3":

    "new Vector3(0,0,-30)"

    You might want to brush up on C# :p
     
  47. Phill123

    Phill123

    Joined:
    Jul 29, 2012
    Posts:
    11
    Thanks, now it compiles but I still can't get anything to move.
    I dont just need to brush up on c#i need to learn it from scratch :) Will get there slowly though.
    99% of my first game doesn't require any scripting, just this one issue holding me back.
     
  48. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Btw you might want to add velocity to the instantiated object, not whatever you're instantiating it on. Like so:

    Instantiate (explosionPrefab, transform.position , Quaternion.identity).rigidbody.velocity = new Vector3(0,0,-30);
     
  49. Phill123

    Phill123

    Joined:
    Jul 29, 2012
    Posts:
    11
    when using that i get 'UnityEngine.Object' does not contain a definition for 'RigidBody' and no extension method 'Rigidbody' accepting a first argument of type 'UnityEngine.Object' could be found
     
  50. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Code (csharp):
    1. GameObject go = Instantiate (explosionPrefab, transform.position , Quaternion.identity) as GameObject;
    2. go.rigidbody.velocity = new Vector3(0,0,-30);