Most Efficient way to deal with bullets (when there's dozens on screen)

ozz

  • *
  • Posts: 534
It does seem to be there and public, but I uploaded it again.  Now there are two, Both Called "Bullet Hell" oddly.

Tuo

  • *
  • Posts: 2469
I found it, and I think I see the confusion.

The bullet actor itself should be made when the scene itself it made, not in the individual actors, so start with that. Also, while I don't think it was in the tutorial, you might want to add "make self always active" into the "when created" for your bullet behavior. Then, in the individual actors is where you use the green custom code block, like this:
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

ozz

  • *
  • Posts: 534
That's brilliant, thank you!

ozz

  • *
  • Posts: 534
Oh, I think I did it wrong, pluging that in an making the bullet always active didn't make it work, but the game did slow down immensely.

Tuo

  • *
  • Posts: 2469
Re-upload and I'll take a look.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

ozz

  • *
  • Posts: 534
Thank you, I remove the older "Bullet Hell" and put up the current one.

MeToo

  • Posts: 338
Hi, can I ask you a little bit about this lagless actor stuff? :)

A. In 3.0 is there a different/better/easier way to do it? I thought I should check before I learn this one.

B. What about IOS? The tutorial says that you may not be able to reach the same amazing lagless swarms....even 100 would be fantastic.

C. I'd like to also set mine turning at a given speed, would this be ok?

D. I suppose tweening is out of the question?

Tuo

  • *
  • Posts: 2469
Ozz: The issue doesn't seem to be with just the lagless bullet (or at least not only with it). You have 1009 errors popping up everywhere. Your next step will be to go through all of your behaviors to see which one has an attribute that you are not initializing correctly, probably an actor attribute. One thing I do is to have a check to see "if < attribute has value >" in my codes to make sure that it has been initialized. Try adding that into the codes to see if you can find which behavior(s) are causing issues.

Metoo:
A. Not to my knowledge, although my playing around with 3.0 has been rather minimal.
B. I'm not sure on this one; it might work decently enough.
C. That can be done, but it will add some lag as you will need another list to handle the direction (and then in the "always" updater, also update the direction it is facing and set it to face the new direction).
D. Yes.

My suggestion to you would be to whip up the demo in 3.0 and try it out on your iOS device (I don't have one so I can't check it) to see how the lag is. It shouldn't take too long to make (just follow the tutorial), and then you will have more precise answers to A and B.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

ozz

  • *
  • Posts: 534
That's odd especially since I haven't changed anything beyond switching out since you last checked if for errors.  In fact the only thing I've done is compressed and reload the .png graphics files for space saving and the obviously add the lagless bullet code, could the lagless actor simply not be capable of being firedfrom a second actor? 

Tuo

  • *
  • Posts: 2469
I disabled the lagless behavior carefully and re-ran the game. You are getting multiple null reference errors, mostly from 20, 40, and 41 behaviors (dunno which those are).

Then I looked those up manually:
20: Actually your 02 code: You told the coding to wait to make the launcher, but started using in "always" immediately, causing the null error.
42 (didn't have an error that I saw): Actually your 03 code: Same issue as with 02
40: Actually 04 code: Same issue
41: Actually 05 code: Same issue
43 (didn't have an error that I saw): Actually your 06 code: Same issue as with 02

There is also a null reference error when your first actor gets hit by a bullet.

Once the fighters started coming up, I noticed those null errors too... still debugging.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

Tuo

  • *
  • Posts: 2469
Okay, the first actor was 101 sensor, which I added in "if Linked has Value, if Linked is alive, kill Linked" (putting the kill code inside the two new if's) to take care of that issue.

As for the lagless bullet, the issue is that you were making the bullet before the player. In the scene code to create the bullet, put it inside a "do after 0.05 seconds" delay and it works.

That takes care of your null errors... but for some reason the collision coding still isn't working. It's 1 AM though, so I'm calling it a night... your coding is indeed the same as the tutorial, so that's weird that is isn't working.

EDIT: I just tried using a different idea, and I can confirm that something is definitely going weird with your bullet collisions. I also noticed that they don't show up right below the enemies, which could be a part of the same issue. Good luck.

« Last Edit: February 12, 2013, 10:03:48 pm by Tuo »
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

ozz

  • *
  • Posts: 534
That's great, I had no idea those null errors were a problem.  I'll see if I can find a way to make it work, could you upload the fixed Bullet Hell on the forge?

Tuo

  • *
  • Posts: 2469
Sent via email instead.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)