Search Unity

Core GameKit! Pooling / Spawning / Combat

Discussion in 'Assets and Asset Store' started by jerotas, Jan 27, 2013.

  1. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok, no need then. No one has asked for it yet actually, out of well over 1 thousand customers.
     
  2. Deleted User

    Deleted User

    Guest

    I am "One of KInd" or "Pain in The Ass"....depending who you ask..;-}
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Haha, me too.
     
  4. Keitaro3660

    Keitaro3660

    Joined:
    May 20, 2014
    Posts:
    86
    no problem now :D
     
    Last edited: Oct 4, 2014
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Good to know :)
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Huge sale on Core GameKit for 80% off through 10/6/2014! $10 is a great price :)
     
  7. RoTru

    RoTru

    Joined:
    Jun 5, 2014
    Posts:
    37
    I think people using this are more likely to use Photon, given the requirements for setting up servers etc. Photon is just so much cheaper, easier. I know I have no plans for using Bolt.

    Playmaker has an easy way of sending things, you just click a button to turn it on.
     
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'm not convinced. I usually hear tons of complaints about Photon. Tons and tons. I would need more votes on this before considering it.
     
  9. RoTru

    RoTru

    Joined:
    Jun 5, 2014
    Posts:
    37
    Well Photon basic is free, so there's going to be a lot of feedback from it. Bolt is not a free asset.

    All in all I think Photon is only going to continue to get bigger and expand, especially with networking and cloud space getting cheaper and cheaper. I personally think it's best to go with whatever is best for your business. If most your users need Photon or Bolt.

    This great tool seems more focused on newer users who would use Photon
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I don't think Core GameKit is focused to any particular group. Experienced programmers who don't want to spend a lot of time writing all the things it does definitely benefit just as much as a brand new Unity user. I know Photon is free, and you also have to know how networking works to use it. Not so with Bolt. If we do any networking support, I'll put it to a vote. I certainly will never use Photon, or Tnet on a project I'm working on. Bolt does all the heavy lifting for you and makes it so you don't have to learn about networking (which is a HUGE topic with many many pitfalls).

    I also don't agree that most newer users will use Photon just because it is free. It only has a 4 star average review! Because there's too much to learn before you can use it to make something pretty good.
     
    Last edited: Oct 16, 2014
  11. RoTru

    RoTru

    Joined:
    Jun 5, 2014
    Posts:
    37
    Fair enough! So many options! I'm just happy to have tools that make things easier like Core Gamekit
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    :)
     
  13. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    We're back on sale for 50% off for a limited time, for anyone who missed the sale yesterday!
     
  14. dark_tonic

    dark_tonic

    Joined:
    Mar 23, 2011
    Posts:
    138
    Core GameKit V 3.2.3 will be live in 20 minutes. Changelog:

    • Fixed text on expand / collapse buttons for World Variable Tracker. They were swapped.
    • Fixed bug with the IsInitialized property in WorldVariableTracker. It caused lots of errors in custom WorldVariableTracker scripts.
    • Fixed bug where retrigger limit > 100 seconds wouldn't allow a Triggered Spawner wave to happen at all.
     
  15. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    207
    Hi again :)

    to make my live easier (with a hundred pooled items) i try to make my Objects set them selfs up into the PoolBoos:

    Code (CSharp):
    1. protected virtual void Awake ()
    2. {
    3.         if (InitialPooling) {
    4.             if(!PoolBoss.PrefabIsInPool(BulletPrefab.name))
    5.             {
    6.                 PoolBossItem pbi = new PoolBossItem();
    7.                 pbi.prefabTransform = BulletPrefab.transform;
    8.                 pbi.instancesToPreload = BulletNum;
    9.                 pbi.allowInstantiateMore = true;
    10.                 PoolBoss.Instance.poolItems.Add(pbi);
    11.                 // How to kick off Instanciation ?
    12.             }
    13. }
    This works so far that the item shows up at the PoolBoss, but it doesn't get preloaded. How do i do that?

    Thanks!
     
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Preloading happens in the Awake event of Pool Boss. So there's no way to guarantee that your script will run first (same event). I have a hundred items in our new game too. Just go ahead and set them up in the Inspector, it won't take very long and you only need to do it once.

    Also I want to mention that your script will actually Instantiate objects during Scene play if that object isn't in the Scene when it begins (if it spawns or becomes active for the first time later) - which is likely to cause performance problems because that's not proper pooling.
     
    Last edited: Oct 18, 2014
  17. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Core GameKit V3.2.3.1 will be live in 30 minutes. There's a couple things in here people were asking for. Changelog:

    • Fixed bug where Killable Listener called DamagePrefabFailedToSpawn when it did in fact spawn, and vice versa.
    • Fixed bug with Spawn Tracker logging a Null Exception error sometimes.
    • Note: Please check all your Triggered Spawner waves and change the new Max To Spawn field to equal Min To Spawn, or you will be seeing less things spawn. Added Max To Spawn in Triggered Spawner so it has Min and Max (for random) like Syncro Spawners.
    • Added "Sync H.P. Variable" checkbox to Killable, which appears if you are using a World Variable for Start Hit Points. Defaults to off. If you check the box, the World Variable will be updated with the Current Hit Points of that Killable every time they change. This is good for a player Killable to update a Health variable for instance. It is not a good idea to use this on a prefab that has more than one instance in the Scene, because the World Variable value will not be predictable and may jump around.
    • Made the WorldVariables Inspector refresh automatically when variables change.
    • Made the Immediate Actions in the Killable Inspector invisible when object is despawned.
     
  19. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    We just released our new plugin Pool Boss, which is on a $5 sale for a limited time only. Regular price will be $15. It is included in Core GameKit, so if you already have that, no point getting Pool Boss. If you want a standalone pooling plugin, this is the one to beat!

    Link: https://www.assetstore.unity3d.com/en/#!/content/23931
     
  20. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok, I've got a new video recording program which looks like it's working perfect!

    So please suggest some tutorial videos you'd like me to make. I prefer to make a bunch of short ones instead of a very long one.
     
  21. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Core GameKit is now on sale for $30 (40% off) for a limited time (regular price $50). Our top-selling audio plugin Master Audio is also on sale for 40% off currently.
     
  22. meom

    meom

    Joined:
    Feb 15, 2014
    Posts:
    24
    I'd like to see a tutorial on how to set up a coin collection/reward system. I'm doing a 2D/2.5D platform game and I'm going to have 10 sets of 5 small coins for one point apiece and 5 sets with one large coin for ten points placed throughout the level(s) in specific places. And, after going through all the documentation, I'm still not sure what the most efficient way is to set this up. Also, I'm using NGUI to post the score on the screen throughout game play.
     
  23. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    So you're not even spawning the coins, they are just sitting there in the level? You just need to give them a Killable with zero attack points, 1 hit points, and then assign World Variable modifiers to the coins so they modify the score or whatever variable you want.

    You still want a video?
     
  24. meom

    meom

    Joined:
    Feb 15, 2014
    Posts:
    24
    No, I've only created 1 coin so far and already added the killable script with the attack points and the world variables setup properly. That was the only part I actually got. What I'm unsure of, because I can be really slow sometimes, is do I need to use the pool manager and create prefab pools. Am I also using triggered spawners to spawn the rest. and if so, how do I get them to spawn exactly where I want them to be throughout the level?
     
  25. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    To be clear, "Pool Manager" is a different plugin, not written by us. If you mean Pool Boss (our version), that's not the same as Prefab Pools. Prefab Pools is for spawning random prefabs from a list (pool) of weighted prefabs, instead of spawning a specific prefab. This can be used for things that spawn in Core GameKit, like spawners and Killable death prefabs.

    Pool Boss setup is always needed. That makes it so nothing is Instantiated or Destroyed, just activated and deactivated. Any Core GameKit prefab you have that can be destroyed (Killables or other prefabs from Syncro Spawners if you're using those) needs to be set up in Pool Boss.

    I'm not sure you need to use Spawners at all. You can go ahead an place many instances of the coin prefab into the Scene. Unless you want to spawn them at a different time?

    I can make a video, if there's specific things you want to see. There's no video of Pool Boss for instance. Anything else that should be in the video?
     
  26. meom

    meom

    Joined:
    Feb 15, 2014
    Posts:
    24
    I did mean Pool Boss, not Manager. And yes, a video on using it would be good. I think part of my problem with this asset kit is that there are so many goodies in it that it's a bit overwhelming at first for a beginner like myself. Thanks for your assistance.
     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Cool, I will start with a video on Pool Boss :)
     
  28. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Id like to see tutorials for some fancy spawning systems. In one of your screenshots you mention fireworks and bullet hell systems, would be great to see these in action.
     
  29. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The ones provided in the first 2 Example Scenes are fairly fancy. Motherships spawning 2 different waves of fighters that each span their own bullets. A ring of 16 UFO's. Fireworks would just be a particle prefab.
     
  30. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Yeah, thats true haha. Didnt think about the complexity of the examples, they are pretty good.

    When you mention "bullet hell", are you referring to a bullet spawning system, or more the genre?
     
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The genre. I know some people are using the BulletML plugin on the Asset Store to set up patterns with CGK.
     
  32. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Ah, thats interesting. Ive been looking into that plugin. Thanks for the heads up.
     
  33. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    If I want to increase a world variable manually via code, would this be the correct way to do it?
    Code (CSharp):
    1. WorldVariableModifierscore = newWorldVariableModifier ("Score", WorldVariableTracker.VariableType._integer);
    2. score._modValueIntAmt = newKillerInt (100);
    3. score._modValueIntAmt.curModMode = KillerVariable.ModMode.Add;
    4. WorldVariableTracker.ModifyPlayerStat (score);
    Or I could use this, which is just one line of code. Just wondering if there is a preferred way?
    Code (CSharp):
    1. WorldVariableTracker.GetWorldVariable("Score").CurrentIntValue += 100;
     
    Last edited: Nov 10, 2014
  34. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The second one. Just modify the CurrentIntValue after getting the variable.
     
  35. meom

    meom

    Joined:
    Feb 15, 2014
    Posts:
    24
    I just downloaded the Unity 4.6 RC1 and have been playing around with the new UI systems and it's very easy to work with, much easier than NGUI. Now I'm at the point where I have the 'Score' label to appear via a script but I'm confused as to how to tie into the WorldVariable for Score so that it will update. I'm using the Killable script on my collectibles (coins) and I can kill them with my player, so that part is working. I just need that bridge between the 2. I've read through the entire thread and tried a number of things, but obviously none were successful .

    Any ideas?

    This is the code I'm using on the label (from Unity's 4.6 Survival Shooter tutorial).

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3. using System.Collections;
    4.  
    5. public class ScoreManager : MonoBehaviour {
    6.  
    7.     // The player's score
    8.     public static int score;
    9.  
    10.     // Reference to the Text Component
    11.     Text text;
    12.  
    13.     void Awake ()
    14.     {
    15.         // Setup the reference
    16.         text = GetComponent <Text> ();
    17.  
    18.         // Reset the score
    19.         score = 0;
    20.     }
    21.  
    22.     void Update ()
    23.     {
    24.         // Set the displayed text to be the word "Score:" followed by the score value
    25.         text.text = "Score: " + score;
    26.     }
    27. }
     
  36. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    You can use a listener script to be notified when a world variable is update. If you import the NGUI package that comes with Core GameKit, then you can modify the world variable listener to use UnityEngine.UI.Text instead of an NGUI UILabel.

    Read the World Variables section in the PDF documentation, or search it for the world variables listener section.
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Mimminito is correct. I'll go ahead and build a Unity 4.6 version of the WorldVariableListener for the next release.
     
  38. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Thanks! I converted the NGUI one for uGUI but it would be good to have it available in the package.
     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Would you mind send me that so I can include it in the next release?
     
  40. meom

    meom

    Joined:
    Feb 15, 2014
    Posts:
    24
    Thanks, I got it working.I also had to edit my ScoreManager script to bring in the WorldVariable. If anyone else wants to use it just add:

    Code (CSharp):
    1. // Grab the WorldVariable here
    2.         var scoreVar = WorldVariableTracker.GetWorldVariable("Score");
    to the Update. This could also be used for any of the other WorldVariables, just change as needed.

    Also, Brian, if you still need the updated script I can post it or send to you.
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Let's see that script. Go ahead and post it. It might not be fully optimized for speed, so I'd like to see it.
     
  42. meom

    meom

    Joined:
    Feb 15, 2014
    Posts:
    24
    Here it is:

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3. using System.Collections;
    4.  
    5. [RequireComponent(typeof(Text))]
    6. [AddComponentMenu("Dark Tonic/Killer Waves/Listeners/World Variable Listener")]
    7. public class WorldVariableListener : MonoBehaviour {
    8.     public string variableName = "";
    9.     public WorldVariableTracker.VariableType vType = WorldVariableTracker.VariableType._integer;
    10.     public bool displayVariableName = false;
    11.     public int decimalPlaces = 1;
    12.     public bool useCommaFormatting = true;
    13.    
    14.     private int variableValue = 0;  
    15.     private float variableFloatValue = 0f;
    16.  
    17.     private Text text;
    18.    
    19.     void Awake() {
    20.         text = this.GetComponent<Text>();
    21.     }
    22.    
    23.     public virtual void UpdateValue(int newValue) {
    24.         variableValue = newValue;
    25.        
    26.         var valFormatted = string.Format("{0}{1}",
    27.             displayVariableName ? variableName + ": " : "",
    28.             variableValue.ToString("N0"));
    29.  
    30.         if (!useCommaFormatting) {
    31.             valFormatted = valFormatted.Replace(",", "");
    32.         }
    33.        
    34.         if (text == null || !SpawnUtility.IsActive(text.gameObject)) {
    35.             return;
    36.         }
    37.        
    38.         text.text = valFormatted;
    39.     }
    40.  
    41.     public virtual void UpdateFloatValue(float newValue) {
    42.         variableFloatValue = newValue;
    43.        
    44.         var valFormatted = string.Format("{0}{1}",
    45.             displayVariableName ? variableName + ": " : "",
    46.             variableFloatValue.ToString("N" + decimalPlaces));
    47.  
    48.         if (!useCommaFormatting) {
    49.             valFormatted = valFormatted.Replace(",", "");
    50.         }
    51.        
    52.         text.text = valFormatted;
    53.     }
    54.    
    55. }
    56.  
     
  43. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thank you sir!
     
  44. meom

    meom

    Joined:
    Feb 15, 2014
    Posts:
    24
    Ma'am. And, you're welcome.
     
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Sorry about that. Thank you ma'am!
     
  46. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    New video showing how to set up Pool Boss (and some Core GameKit spawning for good measure)!


    More videos coming soon!
     
    Last edited: Nov 21, 2014
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Another new video showing Prefab Pools (probability-based random spawning!)
     
  48. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Here's another new video showing Triggered Spawners used for a variety of cases, and how they are different from Syncro Spawners:
     
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Core GameKit is now on Insanity Sale of $20 (60% off) until the end of November!
     
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Sale is over but we're back with another great sale of $30 for a limited time.