Search Unity

Space Game Starter Kit [Released]

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

  1. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    Hello Aren,
    I was trying to add the single joystick (from the standard asset mobile package) to the 'Game' scene in SGSK, somehow, it is not showing in the game view when I ran the scene. I am not sure why. Is that due to your camera settings?

    I wonder if you plan to integrate a joystick(like the one that came with the Unity3D mobile assets) to your ship controller script later on? Since your ship controller is tightly bundled with few other scripts, it might be a big effort to tear them apart. Anyway, do you have any suggestion on how to integrate them together? My primary interest is in Android and iPhone. Thanks in advance.

    btw, I am getting "Scene is being destroyed while there are hidden renderers that are using it. This is likely an editor script creating objects with hideFlags and leaving them enabled" message here and there when I run the scene, is this normal?
     
  2. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    @Kafar: Multiplayer is very optional.

    @tumitoto: Likely due to camera setup, yes. SGSK uses several cameras to draw everything correctly. The scene is being destroyed message is a side effect of Unity version going up and SGSK version remaining the same. Either of the two updates -- SGSK with NGUI, or SGSK with NGUI+TNet fixes that one. Both updates are optional as I don't want to force either of the two packages on developers who are looking for a simple prototype to start with.

    In regards to the visible joystick -- you should be able to tie into it easily enough, I don't see there being a need to tear apart the code. The input is currently handled only in one place, so you can add new stuff there easily.
     
  3. itzik009s

    itzik009s

    Joined:
    Oct 17, 2012
    Posts:
    8
    Hello i have to work to a project for lego starwars...I bought your pack..it is really amazing...targeting works very well....I am using an eyetracking system instead of the mouse...and i am thinking on a solution for the arcade style game...without using the mouse to steer the spaceship...so it just follow the follow points in the rail example...and rotationg according to the position of the points...And is there an AI for enemy ships included in the pack?

    Best regards
     
  4. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Nope, there is no AI aside from the homing missiles. In case of missiles, they are actually spaceships as well (have the spaceship script on them), and the AI logic steers them toward a specific objective. You could use this to create AI for ships as well -- but you will need to figure out the target objectives, and when to fire.
     
  5. itzik009s

    itzik009s

    Joined:
    Oct 17, 2012
    Posts:
    8
    great...Thank you for your support...i will try to use the missile script for the enemy AI...and i have scripts for targeting...and other stuff...
    another question: could you explain me how is the targeting working for the player? Is it based on mouse over?? Or how is the misile working? I see that is not always following the target you have locked in last?
     
  6. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Check the Missile script. It finds the closest HeatSource in front of it.
     
  7. drewi

    drewi

    Joined:
    Jan 4, 2013
    Posts:
    2
    "Even runs on Android and iOS (with appropriately limited functionality) ?"

    What functionality is available on android tablets? detailed list please
    And how is the performance on android tablets?


    Thank you
     
  8. drewi

    drewi

    Joined:
    Jan 4, 2013
    Posts:
    2
    Do you perhaps have a apk for tablets where we could try the limited functionality and how the performance level is?
     
  9. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    As I recall back when I tried it on an android device (1.5 years ago), it ran at 30+ FPS. The planet's atmosphere is turned off on mobiles, and controls need to be designed properly... but the rest worked fine. Nope, no APK.
     
  10. jbman

    jbman

    Joined:
    Jan 24, 2013
    Posts:
    1
    I just purchased this template. This package looks to have what I need to help me get the game I want to make a reality. I'm a 3D modeler, not a coder, so I will try to figure this out :) I'm sure I will have some questions soon.
     
  11. itzik009s

    itzik009s

    Joined:
    Oct 17, 2012
    Posts:
    8
    Is the target locked on , on mouse hoover? I am using an eyetracker.....where can i change...that instead of using the mouse over....coordinates...to use eyetracker x and y coordinates...?

    Also, in which script i have to look,,and change...that the missile will follow the last target hooverd on? instead of usign heatbase system?

    Thank you in advance
     
    Last edited: Jan 28, 2013
  12. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    It's all inside SpaceshipController.cs.
     
  13. itzik009s

    itzik009s

    Joined:
    Oct 17, 2012
    Posts:
    8
    I think i `ve asked you before...but i can`t figure it out....can you explain me how is the targeting workin? I mean: when is the target Locked on? I want that to happen when the mouse is over it...like hover...and that missille will follow the one that you looked at.....If you can have some directions where to change , and where to look...

    Thank you
     
  14. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    HeatSource.Find is what's used to find the optimal heat source in front of the ship (and to update missile's target).

    If you want missiles to stay on target and not redirect themselves, just set "One Target" to 'true' on the Missile.
     
  15. itzik009s

    itzik009s

    Joined:
    Oct 17, 2012
    Posts:
    8
    great thank you... it works :) But what about the Target lock on recticle? I want that to happen when mouse is over the enemy object...mouse hoover on collider...I have looked on SpaceShipController...but couldn`t find anything there...it seems that the mouse is restricted to an area of the screen..I want to be able to select all targets......... Mouse over target: target locks on......shoot missile...missile follows target....this is the game logic......
     
  16. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    You will want to change the SpaceShipController as I mentioned. Its Update() function to be more precise.

    If you have the NGUI version of this package, then your game objects will be receiving OnHover events (assuming the game camera has a UICamera attached). If not -- you will need to code your own logic.
     
  17. itzik009s

    itzik009s

    Joined:
    Oct 17, 2012
    Posts:
    8
    ok I will try that...thank you for the support :)
     
  18. preefen

    preefen

    Joined:
    Feb 16, 2013
    Posts:
    3
    I have a problem trying to run the game scene. When it starts UnityException: Input Axis Right is not setup.
    I have un zipped the Project settings file to Project Settings but still get this. I'm new to unity so bear with me.
     
  19. Distant_Temples

    Distant_Temples

    Joined:
    Apr 14, 2012
    Posts:
    131
    Hi Preefen, Welcome to Unity. Unity creates a Project Settings folder in the top directory/folder of the projects that you create. You need to replace that one with the one you unzipped.
     
  20. preefen

    preefen

    Joined:
    Feb 16, 2013
    Posts:
    3
    Thanks for the quick reply.
    Started new project, opened asset store and imported SGSK. unzipped projectsettings.
    Now have new folder ProjectSettings with the Audiomanager.asset, ProjectSettings.asset etc in.
    Open scenes folder and loaded game.
    Pressed play at top and loads game but have no movement.
    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)
    Not sure what to change ?
    If I load Arcade Controller Example I have movement control.
     
    Last edited: Feb 16, 2013
  21. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    As Distant Temples mentioned, you need to unzip the contents of the zip file into the existing ProjectSettings folder, overwriting files that are already there. It's right beside the Assets folder.
     
  22. preefen

    preefen

    Joined:
    Feb 16, 2013
    Posts:
    3
    Ok I see were I'm going wrong.
    I am unzipping it in unity and it is coming up with a project setting folder but I need to unzip to my documents where the project folder is saved.
    It now works ok
    Thanks for your help.
     
  23. pallinarozza

    pallinarozza

    Joined:
    Jul 24, 2012
    Posts:
    14
    On android with the word optimized, you say that if I compile for android of work without coding nothing?
     
  24. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Will it run? Yes. But it has a pretty terrible control scheme (there are no visible widgets, it's just based on touching sides of the screen).
     
  25. shwa

    shwa

    Joined:
    Apr 9, 2012
    Posts:
    461
    Can one land on the planets and move around with any of the included demos?

    tx,

    shwa
     
  26. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    No, the planet is just for show. You can get close to it, but you can't land on it.
     
  27. mohydineName

    mohydineName

    Joined:
    Aug 30, 2009
    Posts:
    301
    Hi Aren Mook,

    Do I need to buy TDNEt to use the TDNet version?
    I already own NGUI license so how can I get the NGUI version of this game?

    Stephane
     
  28. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Yes you need TNet if you want the version of this kit that uses TNet.

    You can email me your invoice #s for NGUI and SGSK and I will send you a download link that combines them.
     
  29. mohydineName

    mohydineName

    Joined:
    Aug 30, 2009
    Posts:
    301
    Ok thanks. I guess I'll get your email on your website
     
  30. R1D3

    R1D3

    Joined:
    Mar 19, 2013
    Posts:
    1
    Hi ArenMook,

    Bought the kit a few weeks back and very pleased with it so far. I am currently trying to allow users to change the ships weapons. Getting this functionality was simple enough, but I am unsure how to send this data over multiplayer so that all players see the same weapons for each other.

    Would you be able to give some quick advice on this? No need to go to detailed if you don't have the time, just pointing me in the right direction would be great

    Thanks

    R1
     
  31. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    My advise would be to use TNet. It makes sending data really simple. Unity Networking... that's rather fussy, and more of a trial-and-error deal.
     
  32. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
    Code (csharp):
    1. /// <summary>
    2.     /// Add an explosion force at the specified position.
    3.     /// </summary>
    4.  
    5.     public void AddExplosionForce (float force, Vector3 pos, float radius, float upwardsModifier)
    6.     {
    7.         tno.Send(3, Target.All, force, pos, radius, upwardsModifier);
    8.     }
    9.  
    10.     [RFC(12)] void OnAddExplosionForce (float force, Vector3 pos, float radius, float upwardsModifier)
    11.     {
    12.         rigidbody.AddExplosionForce(force, pos, radius, upwardsModifier);
    13.     }
    14.  
    I believe this is a bug... there is no [RFC(3)] so should the above line be:
    Code (csharp):
    1.         tno.Send(12, Target.All, force, pos, radius, upwardsModifier);
    2.  
    ?

    Thanks and I'm still trying to understand the code so if I'm wrong, please don't hesitate to let me know :)

    PS I observed this error in the console:
    Code (csharp):
    1. Unable to execute function with ID of '3'. Make sure there is a script that can receive this call.
    2. UnityEngine.Debug:LogError(Object, Object)
    3. TNObject:FindAndExecute(UInt32, Byte, Object[]) (at Assets/TNet/Client/TNObject.cs:354)
    4. TNManager:OnForwardedPacket(BinaryReader) (at Assets/TNet/Client/TNManager.cs:755)
    5. TNet.GameClient:ProcessPacket(Buffer, IPEndPoint) (at Assets/TNet/Client/TNGameClient.cs:620)
    6. TNet.GameClient:ProcessPackets() (at Assets/TNet/Client/TNGameClient.cs:565)
    7. TNManager:Update() (at Assets/TNet/Client/TNManager.cs:763)
    8.  
    Forgot: I also fixed the SGSpin file, the class was named Spin but filename was SGSpin.cs

    Just updated TNet to v1.6.8 and the project will no longer Host a game :(
    First Error:
    Code (csharp):
    1.  
    2. An exception was thrown by the type initializer for System.Net.Sockets.Socket
    3. UnityEngine.Debug:LogError(Object)
    4. TNet.FileServer:Error(String) (at Assets/TNet/Server/TNFileServer.cs:44)
    5. TNet.GameServer:Start(Int32, Int32) (at Assets/TNet/Server/TNGameServer.cs:161)
    6. TNServerInstance:StartLocal(Int32, Int32, String, Int32) (at Assets/TNet/Client/TNServerInstance.cs:176)
    7. TNServerInstance:Start(Int32) (at Assets/TNet/Client/TNServerInstance.cs:105)
    8. SGButtonHostGame:OnClick() (at Assets/SGSK/Game/Scripts/UI/SGButtonHostGame.cs:14)
    9. UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
    10. UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:644)
    11. UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1147)
    12. UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:906)
    13. UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:761)
    Second Error:
    Code (csharp):
    1. ThreadAbortException: Thread was being aborted
    2. System.Net.Sockets.Socket..cctor ()
    3. Rethrow as TypeInitializationException: An exception was thrown by the type initializer for System.Net.Sockets.Socket
    4. System.Net.Sockets.UdpClient.InitSocket (System.Net.EndPoint localEP)
    5. System.Net.Sockets.UdpClient..ctor (Int32 port)
    6. TNet.UPnP.ThreadDiscover (System.Object obj) (at Assets/TNet/Common/TNUPnP.cs:156)
    7. UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
    8. UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:644)
    9. UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1147)
    10. UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:906)
    11. UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:761)
    12.  
    To confirm I deleted TNet v1.6.8, dropped in my backup of v1.6.6, re-opened the project (it recompiled the scripts) and it now launches (Click Host button) - Let me know if I can help...
    Error Update: I can build and run, host the game and then JOIN in the Editor. So the error only happens when trying to HOST a game from the Editor. Hope that helps.
     
    Last edited: Apr 5, 2013
  33. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    You're right about RFC(3) stuff. I'm surprised no one noticed that before! Thanks. I have fixed it in the latest build. Ping me at support at tasharen.com for an updated package.
     
  34. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
    Thank-you - email sent.... :)

    Update: TNet v1.6.9 fixed the THREAD CRASH I was experiencing in the Editor.
     
    Last edited: Apr 9, 2013
  35. Xsnip3rX

    Xsnip3rX

    Joined:
    Aug 29, 2009
    Posts:
    197
    Apologies, i am thinking about getting this and was wondering what the out-of-box multiplayer user limit is?
     
    Last edited: Apr 10, 2013
  36. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    The package on the Asset Store is using Unity's built-in networking, so it's pretty limited. TNet version is in a better shape -- and the only limit is your hardware and bandwidth.
     
  37. Xsnip3rX

    Xsnip3rX

    Joined:
    Aug 29, 2009
    Posts:
    197
    Does TNet have a sample project? i'm a horrid C# coder and a mediocre JS coder, i'm pretty much looking to drop it in to my 3D Space game with little to no effort.
     
  38. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Space Game Starter Kit has different versions available upon request with your invoice # -- SGSK + NGUI, and SGSK + NGUI + TNet, which is what I was referring to. TNet is a networking library. The combo pack simply integrates the 3 packages together.
     
  39. Xsnip3rX

    Xsnip3rX

    Joined:
    Aug 29, 2009
    Posts:
    197
    I see, do you mind if we talk on Skype(i don't have a mic or cam but i can type :p), i have limited funds but i would like to use TNet and/or SGSK, if you could message me on Skype we could talk about pricing and whatnot? my skype is kennye001
     
  40. lyndontroy

    lyndontroy

    Joined:
    Dec 12, 2012
    Posts:
    31
    Hello,

    To optimize large space scenes, are procedural texture and primitives available with your prefab? I want to create a space scene with some planets that I can either travel to directly using clipping and procedural textures or planets rendered as backgrounds that would require me to load another level to land on the planet. Please advise so I can buy your prefab. Thanks.
     
  41. lyndontroy

    lyndontroy

    Joined:
    Dec 12, 2012
    Posts:
    31
    Any video training on the TNet and Space prefab products?
     
  42. Xsnip3rX

    Xsnip3rX

    Joined:
    Aug 29, 2009
    Posts:
    197
    TNet yes, but not very detailed. and i think there's only like 2 videos
     
  43. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    No, there are no procedural planets.
     
  44. ozoner

    ozoner

    Joined:
    Jun 8, 2009
    Posts:
    85
    The iOS/ Android example, what type of controls are used, is there a joy stick example ? Thank you - Hemry Jr.
     
  45. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    The kit runs on androids, but it's not designed for such, so the controls are there just as an afterthought. You will want to create your own, properly designed ones (likely using on-screen joystick knobs).
     
  46. Brainswitch

    Brainswitch

    Joined:
    Apr 24, 2013
    Posts:
    270
    Not knowing the Space Game Starter Kit, but I'd do it something like this:

    Code (csharp):
    1.  
    2. public void ChangeWeapon(string weaponName)
    3. {
    4.     ChangeWeaponLocal(weaponName);
    5.     networkView.RPC("ChangeWeaponOverNetwork", RPCMode.Others, weaponName);
    6. }
    7. private void LocallyChangeWeapon(string weaponName)
    8. {
    9.     // Actual Changing weapon code
    10. }
    11. [RPC]
    12. private void ChangeWeaponOverNetwork(string weaponName)
    13. {
    14.     LocallyChangeWeapon(weaponName);
    15. }
    16.  
    And I am curious, Aren Mook, wouldn't the TNet code be similar? Or how would it be done in TNet?
     
    Last edited: Apr 25, 2013
  47. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Very similar, yes. Instead of networkView.RPC, you'd use tno.Send, and instead of [RPC] you'd use [RFC]. :)
     
  48. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    What are the prerequisites for this asset? It has networking so do I need TNET and Unity Pro? Also must I have NGUI?
     
  49. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    The version from the Asset Store has no requirements and works in Unity Free. Alternative versions that are available upon request require NGUI or NGUI+TNet.
     
  50. maspi

    maspi

    Joined:
    Feb 8, 2011
    Posts:
    18
    Hi Aren

    Your Starter Kit is great and very useful.
    Half a year ago I built my App for iOS, based on Space Game Starter Kit. The code is really clean and well designed.

    Today I moved the project to Android. Everything worked fine on the first try, except the accelerator based steering has a delay.
    (SGSK 1.14; Unity 4.1.2; Android 4.0.4; tested on a Prestigio dual core 1.5 GHz Tablet)

    Do I need to change something in the code,
    Thanks in advance