Abigayl's Interactive Tutorials (Part 6)

by Joe (Updated on 2012-04-06)

Tutorial 6 - Virtually Lagless Actors


Liked this one? See them all!

Part 1: The Basics

Part 2: Attributes, Saving/Loading, Kongregate API

Part 3: Advanced Controls, Spawning

Part 4: Mouse-based Shooting, Collisions and HP

Part 5: Music, Screen Boundaries, Backgrounds, Power-ups and More

Part 6: Virtually Lagless Actors

Disclaimer: Use comments to provide feedback and point out issues with the article (typo, wrong info, etc.). If you're seeking help for your game, please ask a question on the forums. Thanks!


I'm making a bullet hell game for a school project, so this is exactly what I needed. However, I could be wrong but with this method you are using the "incremented movement" method, which is like telling your normal actor (an actor without this method applied to it) every frame to, say, set x-position to the old x-position nbr, say, 10. This would cause problems, since my ship's hitbox is only 3 square pixels, about the standard for the genre. Am I wrong about how this works, or is it irrelevant enough that I shouldn't have to worry about it? Even so, this looks like a great tool since I almost constantly have 500 or more actors on the screen. Thanks so much!
1 6 years, 3 weeks ago
this is amazing, thank you for the guide!
it manage to handle about 700~800 "Actors" along with "hitbox" (more without hitbox)
however after adding "opacity" and "die-over-time" into the mix, the count decrease about 500 for a stable 60fps
will try out with angles later :)

0 6 years, 1 month ago
How i create pallete ActorEvente_0 from page 25/42 like you ,with the cordinate x and y Pls Help!!
0 7 years, 2 months ago
Yeah, my bad. At the time, I was shocked at the inconsistencies of the tools Stencyl provided, and I guess I needed some place to "rage" xD

Nevertheless, I'm taking this stuff to an extreme. It's a bit overwhelming what I'm doing with my lagless actors.

0 8 years, 6 months ago
Xietao: Yes, it goes through the number of actors.

Kajtii: It's only a serious problem if you don't subtract the x and y of the camera ;).

2 8 years, 6 months ago
There's a serious problem with this method: cannot scroll across a scene without taking the "actors" with you.
0 8 years, 6 months ago
The "index" attribute is the number of actors?
I've open the console a prints a lot of 800 numbers

0 8 years, 6 months ago
If you add just actors, it will be very slow. That's the point of the tutorial: to show a different way of doing it that won't be slow ;)
1 8 years, 7 months ago
Abigayl , my screen became very very slow when adding more actors , i added the actors not throw the behaviors i added them direct from the scene how to solve this one
0 8 years, 8 months ago
Umm... the motive IS stated... virtually lagless actors. If you tried getting that number of actors on the screen at once leaving it up to the engine, you'll be running very slowly.
1 8 years, 8 months ago

Sign In to Comment