Search Unity

Uni Bullet Hell - 2D bullet hell's shot pattern system

Discussion in 'Assets and Asset Store' started by WestHill, Jun 28, 2014.

  1. Yawarshah

    Yawarshah

    Joined:
    Nov 2, 2015
    Posts:
    13
    @WestHell
    Thank you for such a quick response :) ..

    I did manage to integrate the asset but I am getting error in UbhCoroutine class: "Instance" does not exist in the context

    Please advise. Thanks
     
  2. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @Yawarshah
    Does that error also happen in example scenes?
     
  3. Yawarshah

    Yawarshah

    Joined:
    Nov 2, 2015
    Posts:
    13
    @WellHill
    yes
     
  4. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @Yawarshah
    I think that it is an import failure or another script problem.
    Could you send me your unity project?
    here > nishioka-h@westhillapps.com
     
  5. Yawarshah

    Yawarshah

    Joined:
    Nov 2, 2015
    Posts:
    13
    Hi WestHill,

    you were right it was an import issue. It didnt import all the files at first go. After re-importing it did the trick.

    It may sound stupid, but I wanted to ask something. I was using one of the previous version of this asset in my project. I feel the previous version was easy to use with CoreGameKit whereas the current version is a little difficult. So can you provide me the previous version? or should I copy it from my previous project. If you want I can share screenshot of your new version which I purchase few days back.

    Once again my apologies if it sounded a little too stupid to begin with.

    Regards,
     
  6. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @Yawarshah
    kk

    The way to use UBH with CoreGameKit has not changed from the prev version.
    It only enables "#define USING_CORE_GAME_KIT" in "UbhObjectPool.cs".
     
  7. jingray

    jingray

    Joined:
    Feb 6, 2015
    Posts:
    53
    On Unity 2018. Profiler many spike CoroutineDelayedCalls > UbhShotCtrl.WaiforSeconds()
    Link image profiler : https://prnt.sc/k2qx6c
     
  8. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
  9. KarlN

    KarlN

    Joined:
    Nov 27, 2014
    Posts:
    14
    Is there a way to kill all bullets easily? umm I don't necessarily want to get rid of them from the pool, I just want them to no longer be visible. Rather than re-loading the scene I would prefer to just reset all game objects.
    Also real tired, so I probably am missing something very basic sorry if I am :)
     
  10. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @vudong
    I am going to delete coroutines in the next version.
    It is going to be improved.

    @KarlN
    I will add a method to release all bullets from the object pool.
    It comes in the next version.
     
    jingray and KarlN like this.
  11. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    Uni Bullet Hell ver1.4.0 has been released.

    Added method to release all bullets from object pool.
    -> UbhObjectPool.instance.ReleaseAllBullet()

    Improved performance by not using coroutines.
    -> It uses example code only.
     
    Last edited: Jul 31, 2018
    KarlN and jingray like this.
  12. jingray

    jingray

    Joined:
    Feb 6, 2015
    Posts:
    53
    Hi!
    I'm calling many UbhShotCtrl. Sometime, It's working fail, many delay.
    Example: I want shot 3 UbhShotCtrl on Awake(). UbhShotCtrl 1 run and delay UbhShotCtrl 2, UbhShotCtrl 3.
    May be error Time.delta Unity with UbhDeltaTime in UbhTimer.
    Image issue: https://prnt.sc/kgji55
    Image result exspect: http://prntscr.com/kgk50f
    Please check, thanks !
     
    Last edited: Aug 9, 2018
  13. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @vudong
    Is the version you are using 1.4?
     
  14. jingray

    jingray

    Joined:
    Feb 6, 2015
    Posts:
    53
    Right. But I restart Unity, everything working fine again. Sometime wrong.
     
  15. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @vudong
    I'd like to see your settings, can you send me a small project?
     
    jingray likes this.
  16. jingray

    jingray

    Joined:
    Feb 6, 2015
    Posts:
    53
    I sended email, please check!
     
  17. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    ok i’ll check it.
     
    jingray likes this.
  18. jingray

    jingray

    Joined:
    Feb 6, 2015
    Posts:
    53
    Problem solved ?? I'll re-import UniBulletHell less version 1.4.0 for my project. I'm waiting new version. :)
     
  19. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    UBH ver1.4.1 is waiting review.
     
    jingray likes this.
  20. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @vudong
    Uni Bullet Hell ver1.4.1 has been released.
    Please check it.
     
    jingray likes this.
  21. lemmons

    lemmons

    Joined:
    Jun 20, 2016
    Posts:
    68
    Hey, I can't make the bullets collide with any object. I've tried applying scripts to PlayerBulletRoot and EnemyBulletRoot to no avail. I've added tags and layers to each one and try to detect collisions through scripts and nothing.

    Am I missing something here?
     
  22. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
  23. lemmons

    lemmons

    Joined:
    Jun 20, 2016
    Posts:
    68
    @WestHill Hey sorry it's because I was looking for collisions in the wrong place and didn't realize they were triggers. Got it now. But I would love to hear more about how to use the pooling functionality included with the asset. Like, I'm a complete beginner with this type of game and have no idea where to put the UbhObjectPool.prefab or what it really does.

    I also noticed in your sample project you've got colliders set up around the camera, I'm assuming those are used to destroy rogue bullets on contact? Or is that part of what pooling does?
     
  24. lemmons

    lemmons

    Joined:
    Jun 20, 2016
    Posts:
    68
    Ok last question... now that I'm using Core GameKit what object do I attach UbhObjectPool to after I un-comment all the parts about Core GameKit?
     
  25. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @lemmons
    Sorry for late reply.

    UbhObjectPool works to reuse bullets.
    Please place it somewhere in the scene.
    If it is not placed in the scene it will be generated automatically.

    The sample project reuses bullets outside the camera.

    To use Core GameKit 's pool boss, please enable "USING_CORE_GAME_KIT" definition in "UbhObjectPool.cs". (the definition is commented out in line 4.)
     
  26. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Hi @WestHill

    i've been using parentShot.name from UbhBullet.cs to get the name of the bullet owner so i can manipulate it (for example, rotate the bullet around owner). Unfortunately, if i have multiple objects in the scene that bear the same name as parent i get problems. Is it possible to implement parentShot.gameobject property too?
     
  27. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @Kruko
    parentShot inherits from UbhMonoBehaviour. It has the gameObject property.
     
    Oshigawa likes this.
  28. KarlN

    KarlN

    Joined:
    Nov 27, 2014
    Posts:
    14
    Hi @WestHill
    Just wondering if there is a way to tell what bullet has just been fired? I want to assign a player number to each bullet that has been fired, I have other work arounds at worst just this appears to be the optimal way of doing what I want (right now)

    Edit: the post above tells me what I need to know it seems, lol sorry for wastin ya time.
     
    Last edited: Oct 27, 2018
  29. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Hm, ok, i'll try to find it. One more thing, all of a sudden i get errors when enabling define in ubhobjectpool.

    Assets\UniBulletHell\Script\Singleton\UbhObjectPool.cs(8,7): error CS0246: The type or namespace name 'DarkTonic' could not be found (are you missing a using directive or an assembly reference?)

    Assets\UniBulletHell\Script\Singleton\UbhObjectPool.cs(30,13): error CS0246: The type or namespace name 'PoolBoss' could not be found (are you missing a using directive or an assembly reference?)

    Nothing changed in CGK itself, any ideas?

     
  30. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @Kruko
    I uploaded a new version to the store.
    It will be published in a few days.
    If you want to fix the error immediately, please delete the following file.

    Assets/UniBulletHell/Example/AdfUbhExample.asmdef
    Assets/UniBulletHell/Script/AdfUbhScript.asmdef
    Assets/UniBulletHell/Script/Editor/AdfUbhEditor.asmdef
     
    Oshigawa likes this.
  31. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Great, thanks!
     
  32. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    hey @WestHill

    just wanted to let you know that it's no good like that, unity stops responding and memory starts leaking until it crashes the system.
     
  33. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @Kruko
    After deleting the asmdef file, please restart Unity.
     
  34. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Hello @WestHill

    What is the new method for?
     
  35. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @Kruko
    "StopShotRoutineAndPlayingShot()" stops the shot routine and the shot being played.
    I added this because I received a request by e-mail.
     
  36. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Ah, i understand, it stops before waiting for the routine to finish! Great, i must admit it's quite useful, had a few situations myself where i could use it.
     
  37. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
  38. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Hello @WestHill

    i'm having trouble with using pool boss again. Once the pool is depleted and bullets start being reused, they start acting in a weird way. Check out the gif.

    https://i.imgur.com/0qUG506.gif

    Bullets have nothing but rigidbody and collider on them. They are despawning via pool boss once they exit the screen.

    Tried installing the latest version of UBH, but the problem stays.
     
  39. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @Kruko
    I'd like to check the usage problem, please send me your minimum project.
     
  40. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Oh man this is a production project, it's too large. I'll try stripping it. I'll send it to e-mail.
     
  41. hedgeh0g

    hedgeh0g

    Joined:
    Jul 18, 2014
    Posts:
    102
    Hello @WestHill

    Interesting question/suggestion: is it possible to replace coroutines with threads? Possibly on demand by flagging a boolean on UbhShotController.
    See, I'm trying to build a bullet hell so I want to have a lot (really a lot) of bullets on my scene. But my fps count drops to 20-30 when it happens. I did everything I could do with the UbhObjectPool and game optimization in general with no success. That's why I'm suggesting a parallelistic approach.

    Also, I did a lot of prefabs with several Ubh Controllers and Shots, I'd like to update UniBulletHell but if I do I would lose my prefabs. Is there a workaround for this?
     
    Last edited: Dec 15, 2018
  42. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @hedgeh0g
    I am constantly thinking about performance, but the problem is that it can only be operated with Unity's main thread.
    Transform, Collider, Rigidbody, etc ...

    Of these, you do not necessarily need to use Collider and Rigidbody.
    If the bullet is a circle, you can take a hit judgment on the distance.

    Since UBH does not support hit processing as an asset, it can be changed freely.
    I hope your game will be better.
     
  43. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    In the future, if C # JobSystem is improved, UBH will adopt it.
     
  44. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Hello @WestHill

    i've sent you the project to e-mail.
     
  45. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @Kruko
    ok, I will check it.
     
  46. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    WestHill likes this.
  47. iromai

    iromai

    Joined:
    Jan 2, 2019
    Posts:
    2
    I want to move the scene after the battle is over, but the following two kinds of errors are issued.

    MissingReferenceException: The object of type 'Rigidbody2D' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UbhBulletSimpleSprite2d.SetActive (System.Boolean isActive) (at Assets/UniBulletHell/Script/Bullet/UbhBulletSimpleSprite2d.cs:30)
    UbhObjectPool.ReleaseBullet (UbhBullet bullet, System.Boolean destroy) (at Assets/UniBulletHell/Script/Singleton/UbhObjectPool.cs:248)
    UbhBullet.OnDisable () (at Assets/UniBulletHell/Script/Bullet/UbhBullet.cs:62)


    Some objects were not cleaned up when closing the scene. (Did you spawn new GameObjects from OnDestroy?)
    The following scene GameObjects were found:
    UbhBulletManager



    The timing of the error is immediately after the scene of the destination is opened.

    I think that an error occurs because I am trying to reference something in the previous scene even after moving to a new scene, but I do not know how to solve it.

    Please give me a workaround for this problem.
     
  48. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    @iromai
    Please call "UbhObjectPool.instance.ReleaseAllBullet();" before moving the scene.
     
  49. iromai

    iromai

    Joined:
    Jan 2, 2019
    Posts:
    2
    [QUOTE = "WestHill、投稿:4058065、メンバー:145073"]
    solved! Thank you for quick response.
     
    WestHill likes this.
  50. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Hello @WestHill

    just wanted to let you know i sorted out all the trouble with releasing when using Core Game Kit and Playmaker, i made some custom Playmaker Actions. If you want, i can send them to you so you can put them as a third party support when i clean them up a bit.

    Here they are (need some cleaning but work fine):

    https://github.com/Oshigawa/Playmaker/blob/master/UBHStartShotRoutine
    https://github.com/Oshigawa/Playmaker/blob/master/UBHStopShotRoutine
    https://github.com/Oshigawa/Playmaker/blob/master/UBHStopShotRoutineAndPlayingShot
    https://github.com/Oshigawa/Playmaker/blob/master/UBHReleaseBullet

    Anyone else, if you need any other actions for UBH, let me know.

    Cheers.
     
    rrahim likes this.