Search Unity

AGK: Action Game Kit (v1.5)

Discussion in 'Assets and Asset Store' started by jonkuze, Sep 27, 2013.

  1. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Sure .. it's a really simple solution. Just a few lines of code.

    In script SCR_character.cs, I added the following variables:

    In the RollStart() function within SCR_character, I added the following lines:

    The above lines reload the gun every time the player rolls.

    On the Awake() function of SCR_characterRanged, I added the following (which isn't necessary if you just manually set the remInClip value in the inspector instead):

    Then I replaced every instance of CreateProjectile() in this script with:

    There are only 2 such instances.

    Bear in mind that I also set a empty clicking sound to play when the gun is empty but that's not essential. If you want to just copy / paste the code, remove the line SCR_main.PlayRandomSound(emptySound);

    I think I'll also add some code to add the number of bullets remaining to the GUI and also a Reload! message when the gun is empty and the player tries to fire. However, I'll deal with that when I get to the GUI updates. Also, I may look into limiting the total number of reloads allowed and then have that value replenished with a collectable pickup. At the moment, the player has infinite ammo reloads available.
     
  2. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I'm having some difficulty here and would appreciate some guidance. I set up a new level select screen easily enough and made this stage 1 as the system currently always loads stage 1 after the player select screen. From here I have some buttons that will load each of the other levels. This seems to work fine and I'm able to use Application.LoadLevel() to load any of the other levels.

    However, on completion of a level, I cannot get the system to load to stage 1 / level select screen. Instead, it always seems to load to the next level. I have gone to where I think the code should be to change this, which is the following section from the script SCR_Main and made the following changes:

    As you can see, I've tried various things such as just calling an Application.LoadLevel() to the level select screen but nothing seems to work. I have put in a Debug.Log line so I know that this condition is being met when the player clicks on the Continue button in the GUI at the end of a stage. Can you help? I've gone through the code and just can't figure out why this isn't working.
     
  3. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Actually I figured it out ... I realized now that the level number is actually the Unity scene number in the build settings. I switched it to 10 in my case and it now loads back to the level select screen.

    I also tried incorporating NGUI but I think it seems to conflict with the camera that is created during runtime. How difficult would it be to use a standard camera attached to the player rather than one that is instantiated at runtime?
     
  4. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I'm currently trying improve performance on the iPhone 4, Rajmahal you may have issues also when you come to this device.
    Currently my issues maybe this:

    a) physx, you probably have too many colliding objects (or maybe you are moving static colliders each frame)
    b) rendering, you probably render lots of transparent layers / objects or using post effects, or something else, which abuse quite weak iPhone 4 GPU. Quick fix is to reduce resolution while rendering on this device (see Screen.SetResolution)

    I think this is true, but I'm not experienced enough to figure out the issue, in terms of drawcalls I get 170 and less, I don't think this is a issue.
    My game uses one small map and number of zombies attack the player.

    Any ideas how to go about this..
     
  5. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    170 draw calls still seems a lot. Is that with shadows or without?

    You might want to look at Mesh Baker as a good way to reduce draw calls. I think it would work well for this game as you could basically bake all of the background objects into a single mesh. Otherwise, I do think that we'll need to move away from Unity GUI to make this work on mobile. Not sure how big a job that would be ... the existing GUI is very simple but it seems to be baked into a lot of the code so I'm not sure what will happen when we disable the existing GUI.

    Are the models (zombies, etc.) that you're using designed for the mobile platform? Are they a low number of polygons / triangles and do they have everything on a single material? I don't have mobile friendly assets for my game but I'm using Cruncher to try and make them more mobile friendly. I'll probably try and use mesh baker as well to bake them all into a single mesh and material.

    Beyond those steps, I can't say ... I'm not that experienced with building for mobile myself.
     
  6. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I see, huum thanks for the nice response. I will look into this/ currently have number of shadows - will see if there quick option to disable them.
    The assets are not specific for mobile, I have used cruncher before and will give it another go, see if it helps.
    Then move onto mesh backer, seems more complex for me.

    Tricky thing is game works good for iphone 5 etc. Its like one must make two versions of the game really, as I target game for iphone 4, I will not have good quality for the iPhone 5 users who should have nice quality. Not been in this position before, so learning alot.

    Anyways good luck with your game and let me know how you get along.
     
  7. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
  8. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Can you use a different camera sure, but your definitely going to break alot of things i'm pretty sure. It's hard for me to say how easy or hard it will be to do this, really all depends on your coding experience, and your ability to break the current camera system and code up another that works the way you need it to work. Sorry if it's not really a helpful answer, you're just going to have to give it a try, but unfortunately I can't really provide support for custom coding work for individual projects. Best I can do is keep track of all your's and other users issues in order to decide upon the next update that will help solve a range a problems for everyone.
     
  9. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Thanks for the advice. I agree ... I have no expectation for you to code the game for me or make changes to every request. If you can give me some tips based on your experience with the code base (as you've been doing), that's all I ask.

    I retried incorporating NGUI on top of the existing GUI and it actually seems to work now. Not sure what I did wrong the first time. I may then just build a new GUI using NGUI and then disable the old GUI somehow. I'm not familiar with GUIText so I don't know if there's a way to disable them so they have no performance impact but still leave them there so they don't cause any null reference exceptions when the code updates them. It shouldn't be too hard. If I manage to get it done ... I'll share how it was done with anyone that would like to do something similar.

    I got the level select screen working by the way so if anyone wants details on how to do that, let me know.
     
  10. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    sounds like your cooking up something good over there! = ) would love to see the end result, or even a demo when your ready to showcase it. = )

    I'm pretty sure alot of the GUIText can be commented out without causing big problems, you'll just need to find where in the scripts we call the different GUIText, but hiding them should be just find for testing purposes.
     
  11. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Not sure If I can answer this;

    Are we using GUI.* stuff from the scripts, which covers large part of the screen?
    It also accounts for transparent stuff and "eats" GPU fillrate?

    The physics of my game seem to be trying hard to catch-up with GPU lag, which results into multiple physics simulation rounds per frame. You could try increasing fixed time step in Time project settings inspector (Any recommended settings)
     
  12. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Absolutely ... will share it when done. I'm aiming to have it submitted to the Windows store this month.

    I just incorporated Control Freak for the mobile controls and they're amazing. However, as I'm targeting the Windows 8 platform, I want to give the player the option of either using touch controls via Control Freak or the normal keyboard / mouse controls. Is that something that could be set in the options menu?

    I'm thinking I will have some code that enabled or disabled the "Force Mobile Controller" flag in the SCR_Main script based on input made in the options screen. Do you think that's the right approach?
     
  13. wmgcata

    wmgcata

    Joined:
    Jul 20, 2012
    Posts:
    169
    Hi,

    You should give us the option to choose what type of enemies to spawn for certain spawnpoints, this would also include the amount of times the enemy can spawn there. Currently you can only set a random spawn chance for every spawn point in your scene and a maximum amount of spawns. Basically something like the boss function but for enemies.

    If anyone has accomplished this yet, please share it? ;-)

    Thanks in advance
    Tim
     
  14. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    No there is no Switch that Provides Users with Option to Choose between Mobile or Keyboard. Regarding the Force Mobile Controller, according to Dan who helped integrate Control Freak into UnityAGK stated that the Force Mobile Controller flag is ignored when you build, only applies in the Editor.
     
  15. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    I will keep that in mind for a future update for sure...
     
  16. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    So does that mean that I would have to build a version with mobile controls and one with keyboard controls? That seems problematic for Windows 8 store apps that really could use either keyboard / mouse or touch controls.
     
  17. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Well yes for now... Unless you do some custom code work to create a switch that will enable, disable controls at runtime. You have a special case here with the Windows 8 Store, as Windows 8 is the only OS that I know of that can use both Touch Screen or Keyboard depending if an end user purchased a Laptop that supports it. But honestly you should do some research on this Market if you haven't already to determine if it's even worth your time and effort to Publish on Windows 8 Store in Comparison to iOS/Andriod, or other Platforms.
     
  18. Calehan

    Calehan

    Joined:
    Mar 20, 2014
    Posts:
    2
    Hi, i'm pretty new to this, but it seems i don't get AGK to work. I followed the tutorial step by step, reinstall Unity version 4.3.3, did it again number of times... When i launch the start up scene, nothing happens except a black screen. Maybe i did something wrong but i cant find out what.
     
  19. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    did you make sure to review the Readme File? there is one important step, decompress the Project Settings Zip File into the Root of your UnityAGK, make sure you are doing this with Unity Closed, after extracting the Project Settings to the Root of your Project then Reopen Unity. It should work just fine out the box.
     
  20. Calehan

    Calehan

    Joined:
    Mar 20, 2014
    Posts:
    2
    Thank you very much ! I'm sorry i didnt read the Readme file... It's working well right now, amazing work by the way, keep it up !
     
  21. wmgcata

    wmgcata

    Joined:
    Jul 20, 2012
    Posts:
    169
    Any plans on making this mecanim compatible?
     
  22. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Rendering seems to be my only bottleneck in the game now for mobile.
    I assume its something in the scripts, probably the GUI part of the game, but my understanding is not great.
    Did u manage to convert to NGUI or Daikon Forge?
    And if so, did this help to improve your performance, I'm very interested in your results.
     
  23. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    currently no not at the moment... I recall someone who sent me an email who informed me they managed to edit the code and add mecanim, and also shared the code but I didn't get a chance to review the code to ensure it was good enough for an official update.

    possibly it will come in a future update... so much to do... things have been alittle slow unfortunately due to life matters I am dealing with, but will always try my best to be present on the forums to keep you all updated of the latest.
     
  24. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Just a small suggestion for you, have you tried limiting the number of spawned enemies on the level at one time?

    there should be a value where you can define how many total enemies you will have spawned that you must kill before completing the level, but maybe there are too many enemies spawning at once which could cause performance issue depending on the device you are building for. So try limiting the number of Spawned Enemies at one time and see if that makes a difference...

    For example, I have this issue currently with my game project http://coinrpg.com, where I am trying to push for 56 Enemy Characters in a Single World, all with Roaming, Aggressive, Attacking, AI Behavior... I get a max 30 FPS right now, but if Cut the Number of Enemies down to say 24 or something, my performance way better! I see 40-50FPS, that's only because the AI Scripts are Updating, Running every Second in Real-Time which can be a huge CPU Killer, so I may need to Upgrade to Unity PRO at some point probably for it's Culling Systems that should hopefully improve my Performance which I can't currently do using Unity Free Version I don't think... i'm still looking into further optimization stuff myself for my game, it's not for Mobile though right now, but still any optimization tips I find I will share, and should still apply to Mobile.
     
    Last edited: Mar 27, 2014
  25. rickcollette

    rickcollette

    Joined:
    Mar 17, 2013
    Posts:
    304
    just wondering - should we be posting here, or on the agk website forum?
     
  26. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    doesn't matter... i check both... ;)
     
  27. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Think here is better for visibility by all members.
    As one checks the Unity forums daily - find it easier, but its up to the users I guess.
    Cheers
     
  28. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I been using a tool called "Cruncher" to reduce polygons on my models.
    But I'm having trouble linking the new character LOD Mesh to stages.
    So when I click Stage one I can see OBJ_Environments and change the Mesh etc
    But cannot figure out how to change the main player and enemies, is this controlled by script or another scene?
    Apologies if discussed before already.
     
  29. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I'll be giving that a try this week as well. Have you tried creating an LOD group object and assigning the relevant LOD meshes from Cruncher?
     
  30. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Yes Cruncher is really good but not updated for some time, I wrote in the thread to update it.
    Yes this is all done the models have the new LOD. Just dont know how to edit the actual scene to include the new LOD Model and not the old mesh model. Sorry if I'm explaining this badly.
     
  31. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I'm trying to add some new mission types to the game and one I have in mind is a "Protect unit" where the enemy units would attack (as well as the main player) and the player would lose if that unit was killed. Can you think of any way to create a unit that doesn't attack but would be attacked by the enemy?
     
  32. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I think the way to do it would be to add an LOD group on the unit prefab that has the other SCR_character, SCR_Ranged, etc. scripts and then attach the LOD's to that LOD Group. I haven't tried it though.
     
  33. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Has anyone come up with some interesting mission / objective variations that aren't too hard to code? So far, I've come up with:

    - Survive against endless horde of enemies until timer reaches zero.
    - Find the exit portal (I changed it to begin at a random position on the map).

    Obviously, I still have the default "Kill X enemy" and "Kill X enemy before the timer runs to zero".

    Any other ideas?
     
  34. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I'm trying to implement LOD Groups in this game but I'm running into difficulty. Has anyone got this working?

    What I've tried is to create an empty object with an LOD Group and then add the various LOD units into the LOD Group as normal. However, I'm not sure where to keep the various scripts for health, melee, etc. Should those be on the LOD group object or should they remain in the original unit object that is now attached to the LOD group?
     
  35. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Hey Rajmahal,

    Sorry you're not getting any replies, I wish I could offer some additional help myself but unfortunately I'm just way to busy. It sounds like your making some good use of UnityAGK and I look forward to checking out your game when it's ready! = )
     
  36. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Not to worry ... I figured it out. If anyone is curious, let me know.

    The game is going well. I'm at the testing / fine-tuning and optimizing point now. Trying to get it working at a reasonable frame rate on the original Surface but it's proving to be challenging. Still, I've only just begun so we'll see how it goes.
     
  37. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Quick update ... I'm about 90% through converting the game's GUI to an NGUI setup. Looks a lot nicer and only 1 draw call. There are still a few things I'm not sure how to convert over such as the mouse cursor / aiming cursor and the individual life bars on creatures. I may just leave the mouse cursor thing but I think I'll try to replace the life bars. All in all, quite time consuming but getting good results so far.
     
  38. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Nice to hear, sounds good progress to me, let me know how it works when done on mobile.
    Maybe you have some before and after statistics saved.

    Is the mouse cursor / aiming cursor part of Dans Mobile pack. I assume its from the original pack, maybe author can provide more information.

    Anyway good luck with the progress Rajmahal..
     
  39. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Actually, now that you mention it, there's probably no point in replacing the mouse cursor target reticle since that'll only appear on desktop build ... where it's performance hit is negligible. I think the only thing left to do is the life bars and I should be able to do those using the NGUI add-on called HUDText. I'll let you know if it works.
     
  40. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Hi all, I just wanted to share that I apologize for the inactivity in regard to more updates for this game kit, but at this time I must allocate all of my resources to working on my game projects. I will of coarse continue to monitor the thread, forum, and emails for support requests, but in the mean time I will be working hard on a new game. I'm sure you can all understand that.

    I hope to see what some of you have come up with or created with UnityAGK in sometime in the near future! even if it's prototype work, it's always fun to see what you have accomplished with UnityAGK. If you don't want to share because you need to white label your development tools, that's fine to lol, totally understandable. Thanks again all for your support. Lets Keep Making Games!! Best of Luck to all... :D
     
  41. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    You manage to sort the issues, hows the progress?
     
  42. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Is your buddy free to do some custom work for myself on the kit?
     
  43. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I wasn't able to convert over the lifebars or the point score text. I should be able to use NGUI HUDText for these to reduce draw calls but it seems to crash when I tried to put the UICamera script on the camera prefab used in this game. Not sure why ... I'm going to release my game on Win8 first and then revisit this when I try to build to Windows Phone. I'm going to try and replace the camera prefab with a fixed camera that isn't generated during runtime ... I feel like that's the conflict with HUDText.
     
  44. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Yes, I'm pretty sure he is. ;) Feel free to give send him an email or Skype ping.
     
  45. TechnOrganic

    TechnOrganic

    Joined:
    May 9, 2014
    Posts:
    6
    Will you be adding a Split screen or multiplayer update?
     
  46. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    No i'm sorry I can't say this is something I ever plan to add...
     
  47. TechnOrganic

    TechnOrganic

    Joined:
    May 9, 2014
    Posts:
    6
    $Photo Sep 18, 8 10 54 AM.jpeg

    This was a Dodgeball game I was working on and I wanted to add local play to it.

    OR Using the UAGK as a two player split or local game.
     
  48. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Whoa!! Really Cool!!! :D Thanks for Sharing...
     
  49. sumy0ng

    sumy0ng

    Joined:
    Nov 12, 2013
    Posts:
    4
    Here's my Android game that I made with UnityAGK, it's called Starfleet Troopers: Outpost

    the goal of this game is to survive the attack for 3 minutes until the dropship arrives.

    https://play.google.com/store/apps/details?id=com.sumyong.starfleettroopers

    $vlcsnap-2014-04-26-20h47m15s14.png
     
  50. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709