As of late 2021, we are in the process of updating Stencylpedia and fixing up outdated & broken content. Thanks for your patience!

27,583

Views

Beginner

Level

12

Comments

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!

12 Comments

JKTKops
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 9 years, 9 months ago
XerosXIII
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 9 years, 9 months ago
Fpedruski
How i create pallete ActorEvente_0 from page 25/42 like you ,with the cordinate x and y Pls Help!!
0 10 years, 10 months ago
Kajitii
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 12 years, 3 months ago
Abigayl
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 12 years, 3 months ago
Kajitii
There's a serious problem with this method: cannot scroll across a scene without taking the "actors" with you.
0 12 years, 3 months ago
Xietao
The "index" attribute is the number of actors?
I've open the console a prints a lot of 800 numbers

0 12 years, 3 months ago
Abigayl
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 12 years, 4 months ago
zayed
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 12 years, 4 months ago
Abigayl
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 12 years, 4 months ago

Sign In to Comment