Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

[Updated 21st April] BulletFury Demo! Sticky

A topic by WayfarerGames created Apr 10, 2022 Views: 4,143 Replies: 56
Viewing posts 1 to 11
Host (13 edits) (+1)(-2)

You can download the BulletFury Demo HERE

Update 14th April

  • Fixed issue with bullets not being rendered with a burst count of 1
  • Added better handling of lines (numSides = 2)

Update 16th April

  • Fixed an issue where the render data didn't stick around after closing the project. Import the new version, then close and reopen your project, then go to Window -> BulletFury -> Setup and add the render feature back in. Sorry about that!  This issue doesn't seem to be resolved, sorry! If your bullets stop rendering when you close and reopen the project, find your render pipeline asset (edit - project settings - graphics - render pipeline asset), then on the "forward renderer" that is attached to it add a new render feature. BulletFuryRenderFeature should be in the dropdown list.
  • Fixed an issue with the  "preview" button, it should now preview the bullets properly! 
  • Fixed an issue with multiple managers not being able to render bullets correctly.
  • Apparently fixed an issue with the package not importing sometimes? 
  • Removed costly Instantiate/Destroy methods in the demo scene - it was intended as a quick example, but as pointed out in the comments below it is really really bad to Instantiate/Destroy so many times! That's part of the reason this asset exists in the first place

Update 18th April

  • Got a permanent solution to the render feature issue, finally. It's a little more involved than just a button press, though! 
  • Added "Rotate with transform" to the bullet settings

Update 20th April

  • Added an animated bullet shader, you can now use texture sheet animations. Check the demo for how to do this.
  • Added bullet bouncing - enable bouncing on the bullet collider, along with bounciness and lifetime loss. See demo for details.
  • Added BulletManager.NumActiveBullets so you can see how many bullets are currently active.
  • Added another overload to BulletManager.Spawn that takes a transform rather than a position and forward vector. Use this if you want bursts to follow the object.
  • Fixed issue with the circle collider shape not using the transform's scale

Update 21st April

  • Fixed AABB and OBB bullet colliders not bouncing bullets correctly if they aren't a perfect square
  • Fixed bullets not bouncing correctly after the first bounce
  • Aside from any major breaking issues, this will probably be the last update 鈽猴笍

To update, all you have to do is re-download and re-import the package.

If you find any other issues, please do reach out to support@wayfarer-games.com and I'll get them fixed for you ASAP. 

A few things before you get started:

(Please read this I'm begging you)

When you start a new project, make sure you're using Unity 2020 or higher, along with URP. This asset won't work with lower versions of Unity, and requires URP.

Before you import the package, go to Window -> Package Manager, and make sure your project has the following packages:

  • Burst: v1.3.9 or higher 
  • Editor Coroutines 
  • Mathematics - it sounds like they've built this one into the engine now, so if you can't find it in the package manager it's safe to ignore 馃榿
  • Universal RP

Only install the package once this is done. 

From there, you should get a window that will make sure everything else is set up. 

Make sure your bullet materials use the correct shader.

If you don't follow these steps, you'll get a bunch of compile errors and/or your bullets won't be rendered.

Documentation is included in the package file, please read it!

If you need help, I'm usually around on Discord between 7am and 7pm UTC - DM theChief#0001. That's the fastest way you'll get help! 

If you need help outside those hours, ask in the GDB Discord server (linked on the main jam page) and someone might get there before me :)

Enjoy!  

(2 edits) (+1)

Got it working. Need to play with it some more but here are my thoughts from now:

  1. Spawning bullets along a line is problematic.  I set the spawn dir to "directional" and set the "num sides" to 2 to simulate  a line. But radius expands the line/edge length(bigger polygon) and the offset from the center of the bullet manager(since it spawns along edges). This results in appropriate behavior for a polygonal shape but not for a line. So there should be someway to specify a line shape separately.
  2.  Would appreciate a gizmo preview for the shape when the bullet manager is selected. Kind of hard to visualize otherwise.  The above issue with spawning on a line took longer to understand because of that.
  3.   The bullet controller is sufficient for jam needs but most people may want to add their own bullet controllers. 
  4. Rendering the bullets without using gameobjects is a good, performant approach.  I haven't run into performance issues(yet) in my plain ol' pooled bullet setup but this'd surely save a lot of time when I need that many bullets on screen. I would totally buy this if I could integrate just the rendering and collision features with my own bullet movement controller. 
Host (1 edit) (+1)

Hey, thanks for the feedback! 

Completely agree about spawning bullets in a line, I might have a look at that today/tomorrow and update before the jam. For the line, I'll make it so it has a slightly different editor when num sides is set to 2. How would you want it to behave in that case? Like, what parameters and what should change?

When you say a preview for the shape, do you mean wire lines outlining the shape? It should already preview the bullets in the desired shape, right?

I'm not sure what you mean here. What would you want it to do differently? The BulletManager script only handles rendering and collision, movement is done via a multithreaded Job and everything else is handled in BulletSettings.cs (the SetValues function). You're welcome to change the movement there!

The performance issues are mostly targeted at mobile and console builds, with my old object-pooled approach I only managed about 500 bullets on-screen before performance dipped below 30fps on console, which really sucks for a bullet hell game! The same system manage about 5,000 on a PC with modern hardware... I now get about 2,000 on the Xbox One and well over 50,000 on my PC 馃槀

(1 edit) (+1)
For the line, I'll make it so it has a slightly different editor when num sides is set to 2. How would you want it to behave in that case? Like, what parameters and what should change?

I think simply not having the radius act as an offset when num sides = 2 would be enough.  Radius can be used to represent the length of the line. I think the particle system does it that way too.

I'm not sure what you mean here. What would you want it to do differently? The BulletManager script only handles rendering and collision, movement is done via a multithreaded Job and everything else is handled in BulletSettings.cs (the SetValues function). You're welcome to change the movement there!

I don't think you should take one person's advice here. My needs may not match others. Anyways, the setvalues function provides a sufficient interface but the function is not virtual. So any person who modifies this directly may have problems integrating when you update the package. Ideally, you'd have some base abstract class for BulletSettings that the user can inherit from to write their own BulletSettings class that's completely independent. Again, that's just my opinion. 

When you say a preview for the shape, do you mean wire lines outlining the shape? It should already preview the bullets in the desired shape, right?

Yes. If the shape is set to a pentagon with some radius, it should show the pentagon.  IDK if preview does this already but it gave me errors(bullets were spawning correctly in play mode though) when I tried it.

 

I have editor coroutine installed.

with my old object-pooled approach I only managed about 500 bullets on-screen before performance dipped below 30fps on console, which really sucks for a bullet hell game!

I mostly make stuff for pc so yeah that might've  caused a bit if the bias there haha. 

Host (1 edit)
I think simply not having the radius act as an offset when num sides = 2 would be enough.  Radius can be used to represent the length of the line. I think the particle system does it that way too.

Good thinking - I'll get that added before the jam 馃憤

I might make BulletSettings an inherit-able class, sure! Probably not before the jam, though, there's a ton of editor code behind it. I didn't really anticipate people wanting to add much more functionality to that side of it 馃槄 is there anything in particular that it doesn't do that you'd like it to do? I modelled it mostly off the particle system, though there are a few missing things (like animations and trails, etc - incredibly difficult to implement but I'll get around to it eventually...)

If the shape is set to a pentagon with some radius, it should show the pentagon. 

Yep, I can do that. Currently it should always show a render of the bullet size and position, along with the collider size, while the BulletManager gameobject is selected.

If it doesn't do that, there must be a bug 馃 I'll check it out, thanks for the error info!

I might make BulletSettings an inherit-able class, sure! Probably not before the jam, though, there's a ton of editor code behind it. I didn't really anticipate people wanting to add much more functionality to that side of it 馃槄 is there anything in particular that it doesn't do that you'd like it to do? I modelled it mostly off the particle system, though there are a few missing things (like animations and trails, etc - incredibly difficult to implement but I'll get around to it eventually...)

Understandable. Currently there is not that much I can think of outside of the line issue.

Actually there is one thing I'd  like to check. The store page lists webgl support but  I can't verify that since the demo version doesn't allow builds yet, Does it really work in webgl? Because from my experience, webgl and jobs don't go well together.

Host(+1)

Yep, it works on WebGL! Here's a demo: https://app.wayfarer.games/bulletfury-demo/

Host

I've done this and updated it for you! Re-download the asset package from the google drive link and re-import, and it should work a little better.

Nice!

Submitted

What if we don't want to use the asset because I want to use unity 2019 or 2018

Host

you don't have to use it 鈽猴笍 it's entirely optional, just a demo. There will be plenty of people using different engines, too!

Submitted

Ok, Thanks! Just asking.

Submitted

I am not able to spawn bullets even after setting everything as mentioned in documentation and at this webpage ? Also,why max active bullets is always zero, even if max bullets is not zero ? Please help me.

Host

Hey! Can I see the TestingGun.cs script please? And the Spawn Settings on the bullet manager? 

Host

I will likely be quicker to respond on Discord or by email, feel free to send me a DM: theChief#0001 or email me at support@wayfarer-games.com

Host

a few things to check, if you reply while I'm not at my computer:

  • first things first, make sure the demo scene runs properly. If it does, it's likely an issue with your script or spawn settings
  • check the console to make sure there are no errors. The most likely one is that the bullet material isn't using the correct shader, or it doesn't have GPU instancing enabled.
  • make sure the fire rate is some normal value. The value is the number of seconds between spawns, it's generally best to have this somewhere between 0 and 1
  • make sure the number of sides and number per side are 1 or higher. If either are 0, it won't spawn any bullets!
  • make sure you're calling bulletManager.Spawn somewhere, with a position and direction. I usually do this in Update
  • if all of those things are true, zip up your Assets folder and send it to me at support@wayfarer-games.com (https://wetransfer.com is a great way to do that if your project is bigger than a few megabytes) and I'll have a look and see what I can figure out!
Submitted

Okay, I will check that.

Host

Hey! There was an issue with the asset, thanks for picking that up. I've sent you an email, you should just be able to redownload it from the same link on this post!

Submitted

Hi there I followed the instructions and made sure that the bullet material is correct but the bullets

are not showing in the demo scene

not sure what I am doing wrong

image.png

Hey, your image has some trouble embedding for me, but I might have had the same issue. In your assets find a scriptable object called: "Renderer2D". Make sure in the inspector that it has an enabled section called "Bullet Fury Render Feature". If it is not there, you can add it by pressing the "Add Renderer Feature". This fixed it for me.

Submitted

Awesome  thanks I will give it a try

Submitted

Hey 10Drenth,

 Thanks  for your help I think it worked ,

not sure it is 1:45 am and i need to get some sleep now !  lol.

Submitted

Hey

 I finally got it working  I updated my unity version to 2021.3

(1 edit)

Thanks for the BulletFury demo project!  It looks pretty promising and I was able to get it working on Unity 2020.3.33 URP.

One request... Can you update the dll compile directory so the plugin doesn't break if you move the BulletFury folder into a sub-directory?  (error message below)  I like keeping my project folders organized and it's a pet peeve when assets completely break if you simply move them to a sub-directory.

`error CS0006: Metadata file '/Users/B/.../_Game_Jams/BulletHell22/Assets/BulletFury/BulletFury/Plugins/BulletFury.dll' could not be found`

Host

Seems to me like unity has kept the reference alive - have you tried closing and reopening the project? Unity loads DLLs into memory and doesn't unload them, so if you move them it sometimes complains. In theory, there is nothing there that forces it to be in that directory!

Cool, that did the trick.  I had to re-add the BulletFury render feature, so I bet it has something to do with that.  Either way, problem solved, thanks.

(+1)

I can get the package to work, but I can't see the bullets.  I only see explosions.  

Submitted

I had to add the render feature after the fact. This is probably because I installed and removed the unity package some amount of times to try to get it to render. Once you have URP set up in your project settings, find your "URP_Renderer" object in your Project and look in the Inspector window for "Add Renderer Feature". Add the "Bullet Fury Render Feature" and you're good to go!

(+1)

That worked!  Thanks!!

Submitted

Thanks for this great assets, it鈥檚 awesome.

I have a bug to submit (we are 2 developpers with similar problems)

It鈥檚 hard to reproduce because it happens not everytime and not in the same way, but when I have multiple BulletManager, and when I call Spawn() every Update frame, one of emitter is not spawning bullets. (not a problem of views, apparently the bullet doesn鈥檛 spawn at all) They are exactly the same object, and Spawn function called the same way but I have only 3 of my 4 bulletManager working.

Have you got some idea ? (apparently, I have the same problem, when I call the spawn method not from an update unty callback.

Sorry, it鈥檚 difficult to send you a small project to reproduce that, but you can DM me to get more details.

Appreciate your answer, because I鈥檓 kind of stuck in my gamedev with this bug ;) Thanks in advance

Host(+1)

hey! I can't seem to reproduce that. Do you get any warnings or errors in the console? 

If you want me to take a look at the project I'm happy to, just zip up the Assets folder and send it to me either on Discord (theChief#0001) or if it's too big for that you can send it via https://wetransfer.com to support@wayfarer-games.com


Cheers!

Submitted

Thanks for your answer. I think I have found a way to create the problem in a similar way my code do.

  1. Open your Demo_Scene
  2. Press Play, there is 3 bullet manager that are spawning
  3. Disable the component TestWeapon.cs on one of them
  4. Enable it again, the concerned bullet manager does not start spawning again.

Is it a normal behaviour. Apparently in TestWeapon, you just call the Spawn func in Update ( like I do with my code). So It should start spawning again after reactivation, no ?

Thanks in advance for your reply. Maybe I鈥檓 missing something in my comprehension ;)

Host

This is interesting - that doesn't happen for me! What version of Unity are you using

Submitted

Unity 2020.3.18f1

Host (1 edit) (+1)

I've just sent an update, can you try redownloading and reimporting it for me please?

Submitted

Yeah ! thanks !! It fixes the issue descrived ! You鈥檙e the boss :)

Submitted

I speak a bit too quickly :) I have another problem whe numside is 2 ( the manager only spawn one in this case) I see in my git, that you added a special case whith if numside == 2 , so maybe it breaks something else ?

Host

Show me the spawn settings?

Submitted

Starting from your demo scene, just switch NumSides to 2 The Manager only send 1 side bullet

Host

Ah, it looks like that is because numPerSide is 1 - it's going to do exactly numPerSide bullets!

(1 edit)

I noticed that the explosions part of BulletFury (BulletExplodeOnHit.cs) is very heavy on FPS (100 FPS without explosions, only 25 FPS with explosions in the demo).

Looking at the code, I see that new explosion GameObjects are being instantiated on every collision.  Unity instantiation is famously slow, so I'd recommend using object pooling in order to reuse a large amount of the explosion prefabs and avoid the Instantiation slowdowns. Should speed things up by 2x-3x I would guess.

Coroutines are also somewhat slow, so that could be sped up by using a timer on the explosion prefab, or even better using the new Async Await.  But the biggest performance gains will come from object pooling here.

Just wanted to give everyone else a heads up in case they're looking for ways to improve performance.

Host (1 edit) (+1)

totally agree, I changed it to be a bit more performant but these are great tips nonetheless

Submitted

Hi, I'm struggling to get more than one bullet manager working at a time. I want to have one for the player and one for enemies, etc. The spawn and bullet settings are currently both identical for each manager, and bullets work if both the player and enemies use the same manager, but as soon as I switch out the manager on the player, bullets don't spawn.

Host

hey! Can I see the script you've got that spawns the bullet? It will be easier for me to help on Discord (theChied#0001) or via email (support@wayfarer-games.com) 馃槄

Submitted

Sent a friend request

Submitted

It also seems if you try and spawn bullets from the Update() methods of more than one game object, only one set of bullets can spawn at a time.

Submitted

Thanks so much for sharing this! Super helpful in the jam.

I'd like to sync the bullet fire rate to my music. I have custom cues triggering from my music atm, but is there a way to hijack the fire rate in the spawn settings? I have 8 different music cue types and would to set a spawn pattern to each type of cue. While ensuring the bullets fire in time with my cues.
Any recommendations on how to do that?
Thanks!

Host

just set the fire rate to 0 and handle it in your own script 馃榿

Submitted

You make it sound so simple haha. What do I need to know in order to access the fire rate? If I just run the Spawn function from my "weapon" it only tackles the location and direction, but not the speed.
If I try to call SetSpeedSettings, I'm not sure what to pass to it in order to actually send information over to it.
Do those questions make sense?
Thank you for the help!

Host (1 edit)

you don't need to access it, just set it to 0 on the bullet manager. Then in your own script, only call Spawn every beat. Ignore the fire rate in the spawn settings entirely!

Submitted

It's acting super weird,

So I have a callback from Wwise into Unity. It is watching for a marker in my project. Whenever the marker is hit, it returns a string of the name of the marker. So unity is getting 5 ish markers every beat. So the spawn will do a random burst and then just shut off, even though I can see that my if statement is printing to my debug every marker.

My fire rate is set to 0. Burst I'm assuming should be 1? I tried 0 and there were no bullets.

But Spawn, it should produce one bullet per call to the function right? Even if I called it once, it would be

Call Spawn

Spawn fires 1 bullet

Spawn does nothing until called again


I feel like I'm missing something super basic about how this is functioning, any recommendations? Am I approaching it from the wrong angle perhaps?

Host

are you in the discord server? It'll be much easier for me to help there, or via support@wayfarer-games.com 馃槄

Spawn fires as many bullets as the spawn settings describe. So if you've got numSides = 5, numPerSide = 1 it will fire 5 bullets in a circle every time you call Spawn. It would help if I can see you bullet settings, spawn settings and the code you're using that calls Spawn

Submitted

I am as CurtisSmithSound#5426. I did send an email to you as well with more details. Thank you for taking the time to help!