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

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Coming right up! :p
     
  2. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    Hi,
    I played the your regular full build web browser version and it was very smooth. GJ!
    Anyway, I was wondering on 2 things. As you said "Planet shader lets you create your own unique looking planets with a few clicks of a mouse" so I suppose the kit come with a group of planet shader? Are the one you have in the demo is a kind of a 'standard' planet looks?
    The other is the skydome/box, How many of them is included in the kit?
    Thanks in advance.
     
  3. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    The kit comes with one planet shader that uses RGBA channels of a texture for masks. Here's what it looks like:



    You can tweak the colors to make a completely different looking planet, or create your own mask texture (this one kind of sucks, but I'm no artist).

    As for the skyboxes, there is only one. You can use free software to generate your own better looking skyboxes.
     
  4. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    Skybox is one of the thing that irritates me, what software is good in making them?Thanks for the info.
     
  5. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    The link is in my previous post. "free software". :)
     
  6. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    Thanks for the link.
    After playing more on your regular full build and the beta version. I feel much more comfortable on the ship control you put in. Is there a way to do a rotate cam so a player can actually view his/her ship in 360 where the ship is in center? As of now, 3rd person view is fine but if the player got a ship upgrade, he/she will like to check out how the ship looks like (use the middle mouse and drag should be good to rotate the cam).
    Other than the above, I presume your demo assets like asteroid models will come with the kit? Thanks.
     
  7. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Everything you see in the web player is there in the kit. No surprises.

    There is currently no way to orbit the camera around the ship -- it's always set to be behind it. It would make more sense to have a different camera when customizing the ship (different scene altogether, ideally) -- something similar to the main menu, but with the ability to rotate the ship.
     
  8. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    So do you plan to add a base config scene?
    I never tried Multiplayer with the Unity, assuming I got 3 players, each with a different ship, when joining the same game session , will I (the programmer) have to do special things to make those different ship model to appear? Sorry if this question is noobish.
    I think I am about to go the the Asset store to get your kit :) very impressed.
     
  9. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    The starter kit only has one ship. You the programmer would need to figure out which prefab to spawn for the player if there are different ships, but it's a fairly easy thing to do. I am not sure what you mean about a base config scene?

    Edit: If you mean a ship config scene... I will consider it but first I'd have to find something to customize. :)
     
    Last edited: Dec 1, 2011
  10. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    "..You the programmer would need to figure out which prefab to spawn for the player if there are different ships, but it's a fairly easy thing to do"
    Assuming player A chose to fly ship A (ship model A), player B chose to fly ship model B and player C is flying ship model C before joining the game. Say if player A and B then joined player C, do I/programmer have to do special logic to have all 3 different models show properly in the joined multiplayer game? or the network play will show the all the proper model image when joined? I hope I am not making this more confusing :) thanks.
     
  11. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    You the programmer can choose what prefab to instantiate for the player. Essentially instead of doing Network.Instantiate (or in the kit's case -- using the NetworkManager), you'd send an RPC call from the newly connected player identifying what type of ship it is. Send this call to everyone, including yourself, and inside that function instantiate the proper ship.
     
  12. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    I will go ahead and get the kit from the Store.
    BTW, I presume new version updates will be available to the old customers?
    Thanks.
     
  13. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Yeah, all updates are available for free, Asset Store is like that with everything.
     
  14. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    Ok, I got the kit but there are few things that I incurred after I install the kit. I am not using Pro BTW:

    1. Material doesn't have a color property '_Color'
    UnityEngine.Material:get_color()
    DamageShield:Update() (at Assets/SGST/Scripts/Game/DamageShield.cs:41)
    If the shield shows that would rock :)

    2. The image effect Distant Camera (AntialiasingAsPostEffect)is not supported on this platform!
    UnityEngine.Debug:LogError(Object)
    PostEffectsBase:NotSupported() (at Assets/SGST/Scripts/Effects/PostEffectsBase.js:85)
    PostEffectsBase:CheckSupport(Boolean) (at Assets/SGST/Scripts/Effects/PostEffectsBase.js:60)
    AntialiasingAsPostEffect:Start() (at Assets/SGST/Scripts/Effects/Antialiasing/AntialiasingAsPostEffect.js:51)
    UnityEditor.DockArea:OnGUI() -> this might be Pro related, I am not sure.

    3. "Essentially instead of doing Network.Instantiate (or in the kit's case -- using the NetworkManager), you'd send an RPC call from the newly connected player identifying what type of ship it is. Send this call to everyone.." Ok, is there an example I can check out on how to send an RPC and how to do an callback or such when a process receives an RPC?

    Thanks for you help :)
     
  15. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    #2 is probably pro-related, but #1? That's odd. Seems like some reference is missing for you. Did you add the kit to an existing project, or created a new one? I am also assuming you followed the unzipping part correctly? Double-check the Shield game object under the Spaceship prefab. This is what it should look like:



    As for #3, you can read up on them here: http://unity3d.com/support/documentation/Components/net-RPCDetails.html

    Check the NetworkManager, line 190:
    Code (csharp):
    1. // Notify everyone that this player has connected
    2. mView.RPC("ClientAddPlayer", RPCMode.Others, ent.id, ent.name, player);
    You can add another parameter here, an integer identifying what type of ship to use.
     
  16. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    I loaded the kit as a new project.
    It looks like the Distortion shader is having issue, this is also happening on the middle of the space station.
    The attached screen show the game running when I press the space bar.

    I think it might be a good gesture for you to replace those Pro only features for customers who is not using the Pro version.
    Again, thanks for the reply.
     

    Attached Files:

  17. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    I will do that. Thanks for letting me know. :)
     
  18. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Last edited: Dec 4, 2011
  19. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    I unzip the files into Misc/Distortion folder (replaced the old ones). The problem persisted. I got the same thing from my previous screenshot...2 error messages still popping up when I start the game scene:

    Material doesn't have a color property '_Color'
    UnityEngine.Material:get_color()
    DamageShield:Update() (at Assets/SGST/Scripts/Game/DamageShield.cs:41)

    The problem still persisted after I re-import all assets.
     
  20. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    That's highly unusual. What shader is it that material using? You should get a notification about a problem with the shader at least.
     
  21. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    It appears the statement "Color c = mMat.color;" is where error message pops. There were 2 related statements initializing in the Start():
    mRen = GetComponent<Renderer>();
    mMat = mRen.material;

    I made another screenshot as follow, where you can see the shaders were updated this morning but the materials are still with the old time tag. On the right side, you can see the color of that mat is the same as what I am getting on the game scene when start the game and press the space key (activating the shield I suppose) and looks the same in the space station when in the edit mode. I think the same mat is also covering the enemy ship in the edit mode.

    After messing around a bit more by removing the Distortion directory, save and exit and then add back the folder. I found out the 2 shaders (DistortionOne.shader and DistortionTwo.shader) both got a message in the editor saying "shader has errors or is not supported by your graphic card". This might be why the strange color shows up since in the mat inspector, those shaders were broken.
     

    Attached Files:

    Last edited: Dec 4, 2011
  22. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Odd. I will see about installing Unity Basic on one of the comptuers later tonight. I assume using a transparent shader works fine? I'm surprised you are the first one to mention something -- I doubt you are the first one to pick up the kit without a pro license.
     
  23. crgimenes

    crgimenes

    Joined:
    Jul 20, 2011
    Posts:
    4
    Hello!

    I bought the kit in the asset store and I am testing it.

    I created a new project and then import the kit then I added some inputs that were missing and could open the "Game" scene.
    It seems almost everything works but for some reason I am not able to control the ship with the mouse. I suspect it is a simple problem but I am new to Unity and have not figured out what might be wrong. Maybe I need to configure anything else to use the mouse, any suggestions?
     
  24. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Hi,

    The readme file describes how to fix the issues with input: simply extract the contents of the LibraryAssets.zip folder into the Library folder. Editor configuration files don't get included in the unity package, so this is the only way to get them to carry over in full.
     
    Last edited: Dec 10, 2011
  25. crgimenes

    crgimenes

    Joined:
    Jul 20, 2011
    Posts:
    4
    never mind it.
    I found the file "read me" now everything is ok. :)
     
  26. crgimenes

    crgimenes

    Joined:
    Jul 20, 2011
    Posts:
    4
    thanks for the quick reply!
     
  27. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Of course -- I'm glad it works. :)
     
  28. evillemez

    evillemez

    Joined:
    Sep 21, 2011
    Posts:
    24
    Just saw your NGUI release, congrats on getting it out the door. I'll probably pick that up in the next two weeks as 3D GUI stuff is the next big hurdle for my demo.

    Would the radar you had planned, or a 3d radar in general, be something you would recommend using NGUI for, or is that already too complex of a use case?
     
  29. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    I'm going to keep expanding NGUI with more examples, and I have the radar system planned as being one of them (as everything is much more straightforward with the new UI system). After I do it for NGUI I might just plug the code into the space kit using its UI system, but we'll see. Either way I'll be adding new stuff to all 3 of my kits (well, 4 if you count Battle Treads).
     
  30. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    @tumitoto: Almost forgot to mention -- the updated version (1.12) contains a distortion shader that works equally well on Unity Free and mobile platforms.
     
  31. Deleted User

    Deleted User

    Guest

    ArenMook in your kit when you press A or D ship is rolling over but not around his own vector but around the vector of middle of camera point. You don't see it when you are in completely stop but you can see it when you are moving fast towards an object for example a planet.
    Just pointing this out i don't know if it how you wanted it or you didn't sow that like me at the start. ( if its possible can you adjust it ? )
     
  32. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    I can look into it, sure.
     
  33. Deleted User

    Deleted User

    Guest

    Thank you very much, when its around ship it self vector than its more realistic and easier to navigate by the 360 or just by joystick. ( more like real ship )
     
  34. evillemez

    evillemez

    Joined:
    Sep 21, 2011
    Posts:
    24
    Do you know offhand if there will be conflicts with importing NGUI into a project which already contains SGST? After looking through the NGUI documentation, I'm really antsy to just get it and start playing. :) I haven't touched any of the UI stuff from SGST at all yet, so ... I could just remove the UI code folders in case of conflicts?
     
  35. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    SGST's UI is basically NGUI version 0.1. There will be conflicts, so my suggestion is delete the SGST's UI first prior to adding NGUI.
     
  36. evillemez

    evillemez

    Joined:
    Sep 21, 2011
    Posts:
    24
    So, after playing/building some more, I think the biggest feature I would like to see in SGST is a solution for dealing with large environments and floating point imprecision. I can think of a couple, and I've found several discussions on the matter, but when it comes to implementing a particular solution and dealing with multiplayer, I'm not sure whether or not they're realistic solutions. The main general solutions I've come across are:

    1. Move the world around the player, keeping the player at position 0,0,0

    2. Break the world up into several sections, tiles basically (so cubes in our case), moving the cube the user is currently in to 0,0,0 and letting the player move within that. If the player moves to another sector/cube, move that cube to 0,0,0

    3. Divide the world into cubes like in the previous examples, but have buffer zones between the cubes, like transition areas, which have a different scale. So, you could have two cubes fairly close to each other, but flying in between them would put you on a different scale, so it would seem to take a long time to fly between the two areas.

    It may be a problem that's beyond the scope of the kit, but it seems to me that if anyone is going to seriously make a 3d space game, dealing with large environments and floating point imprecision is likely to be an issue. Even if you don't provide an example implementation, I'm curious to what your thoughts are, and where you would start if you were going to tackle the issue for a real game.

    Same goes for anyone else out there who may have strong opinions or proven solutions!

    Happy Holidays, man, keep up the good work. :) NGUI is rocking.
     
  37. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Option 4: Think of space divided into cubes and move them around the player. As a cube moves out of range, place it in front of the player loading content that should be there instead. Ultimately there are plenty of methods of achieving this, and in SGST I used a simple method of having two cameras as you saw I'm sure. One camera is for regular objects, another for distant ones, and the distant camera moves much slower than the regular one. This works fine for a space game because space is mostly empty, but of course nothing is preventing two players from flying really far out and getting float imprecision issues. :)

    Ideally I'd suggest making a game that takes this limitation into account as creating these work-arounds is difficult to achieve with physics remaining intact. For example, the player hyperjumps into an area, arriving at the center -- think of it as a bubble. The planet can be off to the side of this bubble. If the player gets too close to the planet, the ship gets destroyed. If the player gets too close to the edges of the bubble, warn the player that he's leaving the area and then activate hyperjump.
     
  38. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    And thanks btw :D Happy holidays to you as well.
     
  39. crgimenes

    crgimenes

    Joined:
    Jul 20, 2011
    Posts:
    4
    I'm also thinking about solutions for large environments.
    I would like to see implemented the idea of the cubes. Please post here any news about it.

    I'm also looking for how to implement an effect of jump, hyper-speed, warp speed, or however you want to call it: D
    The initial idea was to simply load another scene at the end of the jump. Unless I find a good solution for large environments.

    Happy new year!
     
  40. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Your large world issue is easily fixed as evan.villemez ArenMook have mentioned. My method i guess is closest to the so called "Cubes" approach. Keep in mind they are not actual cubes, it's more of a way to symbolize a defined volume of space via distance. Here is how i solve for it.

    Code (csharp):
    1. private var ThisTransform : Transform; //Your player transform
    2. var ResetDistance : float; //How far from world 0,0,0 you need to be to reset. FirstPerson 100, ThirdPerson <= 1000;
    3.  
    4. function Start(){
    5. ThisTransform = transform;
    6. ThisTransform.tag = "Player"; // Set your player tag to be "Player" This needs to be done.
    7. ResetDistance = ResetDistance * ResetDistance; //Square your ResetDistance
    8. }
    9.  
    10. function Update(){
    11. if(ThisTransform.position.sqrMagnitude > ResetDistance){ //Check if ThisTransform's distance(sqr) is > ResetDistance(sqr)
    12. FloatingOrigin_FR(); // If yes then reset
    13. }
    14. }
    15.  
    16. function FloatingOrigin_FR(){  // Floating Origin Fixed Reset      
    17. //Find All Parent Objects Then Reset Them Back To World Origin Relative To The Player's Position
    18. var Objects : Transform[] = FindObjectsOfType(Transform); //Get a list of all active transforms in the game
    19.     for(var o : Transform  in Objects){
    20.         if (o.parent == null  o.tag != "Player"){ //Only move the parent objects. Ignore the player for now.
    21.             o.position -= ThisTransform.position; //Reset the parent objcts position relative to the players position.
    22.         }
    23.     }
    24.     ThisTransform.position = Vector3.zero; //Reset the player back to world 0,0,0
    25. }
    26.  
    What happens is: You define a "ResetDistance", this is the distance from world 0,0,0 the player must be in order to reset the player back to 0,0,0 and shift the world assets relative to the player.

    function function FloatingOrigin_FR() is where it all happens. Once the function is called it will look for any object that is a parent (the root objects) and will adjust there position by the players current distance from world 0,0,0. Then it will reset the player back to world 0,0,0.

    Wash rinse repeat.

    The one thing i know you don't want to do is place all your objects inside a master object and then move the master object relative to the direction the player is facing. This seams simple as it keeps the player fixed at 0,0,0 as you just move the world around the player. The problem is that the floating point problems just shift from world space to local space. While the object inside the master objects world location may be something small 100,20,20, it's local space could be something crazy large, and thus error prone.
     
    Last edited: Jan 2, 2012
  41. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    The only tricky thing is getting that to work with multiplayer. ;)
     
  42. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    :) I'll leave that up to you guys.
     
  43. hive

    hive

    Joined:
    Jan 12, 2012
    Posts:
    2
    First of all, wow! Great work! And sorry for my bad english, i'm german. ;)

    I'm working on space game and this would help me speed up a lot, will buy it. ;)

    I also solved a lot of things by my self and of course also came to the spatial jitter problem, which I was solving with the floating origin script from there:

    http://www.unifycommunity.com/wiki/index.php?title=Floating_Origin

    But that's not a real solution, especialy for multiplayer, as you pointed it out.

    So I was also thinking about cube system and came up with the idea to give every object in the game a range for their positions, like it is used to sign IPs to a computer.

    This is wad I had in mind:

    Universe(X,Y,Z) : Galaxy(X,Y,Z) : Quadrant(X,Y,Z) : Cluster (X,Y,Z) : Sector (X,Y,Z) : LocalCoordinates.Vector3(X,Y,Z)

    Universe till Sector will be a Vector3 with integer values, LocalCoordinates are Unity transform positions and so for floats.

    A sector consists of 1000 units X,Y,Z in local space (floating positions).
    A Cluster consists of 1000 sector units, and so on... (integer positions)

    So it's easy to determine if a ship is in the same sector or not, or in neighbor sector.

    If your ship is leaving the sector to the next one, its local position is set back 1000 units ingame, while its sector will be updated to the next one in which it is flying. The same if its leaving the cluster, quadrant, etc...

    With this system, it should be relativly easy to calculate positions ingame.
    To manage the positions of sourrounding objects in the game, a script should first check if the object is in the same universe.
    If yes, it would check if it's in the same galaxy and so on.

    You could tell the script, that objects are only getting rendered if they near of 2 or 3 sectors.
    If not, they aren't needed in the game, only the server should know about their positions.

    To get the relativ position of a rendered object you just have to multiply their local positions with the difference of the sectors.
    To render planets correctly they should be rendered while beeing in a distance of 100 sectors maybe...

    This should solve the major floating point imprecision problem and offers a huge space for multiplayer.
    To conquer the universe range it should need a lifetime by warp 9. ;)

    I didn't implement any networking in my project for now and this needs a fast database to handle, so this are just my thoughts for the moment.
    But maybe it could work. ;)

    Looking forward to read more about this here. :)
     
  44. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    That's a good idea, but again physics will be the issue since the physics system won't work like that. :)
     
  45. hive

    hive

    Joined:
    Jan 12, 2012
    Posts:
    2
    Sure? As I tested this script, it works pretty well with a physix driven spacecraft.

    Well, there maybe a short lag while reseting to the origin, but otherwise it works quite nice in my project.
    The ship ist moving thight with correct physix.

    Or did I misunderstand something?

    Btw.... since the link is down for repairs, ill post the script here:



    Another thing is to slightly change skyboxes when flying through different systems.
    Maybe it's a bit offtopic, but...
    Any idea for that?

    And another one... to the warping problem it self.
    With the range system in my last post, it should not be a problem to quickly change positions over a large distance. But physix behavior while warping is not on the wishlist.
    So it should be disabled in the meantime.
    Deleting the rigidbody through the flight and adding it afterwards via script, possible or not?
    I don't know, didn't tested it yet.
     
    Last edited: Jan 13, 2012
  46. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Hello,

    I'm very interested in this for a space scene in my upcoming iOS / Android game. How are the controls on mobile devices, the last update I read is completely touch based. Did you, or are you planing on adding accelerometer support? I'd like to give the player the option of both.

    Thanks,

    JL
     
  47. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    I added touch-based controls a while back via simple touches at certain parts of the screen doing something, but there are no visible indicators of what those areas are (room for improvement!), nor are they that intuitive. The fact that the kit runs on mobile devices was one of those "oh hey, look, it runs!" things that led to an assortment of changes to make it run better, but no real "game" logic behind them.

    So to summarize -- there are controls for mobile touch-based devices, but you will want to change them for your game. :)

    As for the accelerometer -- unfortunately I no longer have access to a mobile device or a way of building for it, and all my time has been going into NGUI recently. I'd like to add it, but I'm afraid it will have to wait a bit.
     
  48. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    @hive: How did I miss your reply a week ago? Hmm. The reason physics will still be an issue is because of syncronization over the network. Positions will be sent in absolute values -- or you will need to modify them into relative-to-cube values yourself before sending them out. It's doable, certainly... just more work.
     
  49. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Ok, I just bought it, what do I have to do to activate the iOS Controls?

    Thanks,
     
  50. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    As I recall you can turn the ship by touching on the sides of the screen, accelerate / decelerate by pressing the corners on the left side, and fire via corners on the right side. Turn the ship by dragging from the center.