INVESTIGATING THE SEA OF LAG! need help / opinions
Hello everyone!
I have been having some lag issues with my project recently and i was wondering if some of yall can help me figure out what is making the most lag in GS
Here is some of my main concerns/Questions!!! :
-Is Spawning an actor a heavy processing task? (ive been trying to spawn grids of actors and it doesnt work well at all)
-Are constrains constantly looping or are they smart and require less processing when the value doesnt need to change?
-What is laggiest process according to you?
-If you have some cool workarounds and lag reducing techniques please share
-what do you think of timers vs time attribute?
-Does two loops searching for a value trough a table do it faster than a single loop? ex: loop up from Row 1 and loop down from EndRow?
My project is a Hero based tower defence similar to the classic WC3 Enfo's TS
heres the link: http://arcade.gamesalad.com/games/131986
CONTROLS
-WASD to move
-Q and E to switch weapons
-1 for potions
-pick dear lola for player
please feel free to comment on anything about my project!! ideas, critics and suggestions are always helpful
THANK YOU
Comments
This question could mean anything, you could be referring to spawning a 12 x 12 grid of static 50x50px actors on the latest mac desktop, or you could be spawning a 320 x 320 grid of 1024 x 1024 actors, each with a 60fps animation and 30 complex rules and 3 layers of sound on an iPhone5 . . . . (the desktop won't even notice anything is running, the iPhone5 will melt) . . . basically 'spawning a grid of actors' doesn't really mean anything without context.
Also . . . . "doesn't work well at all" also doesn't really mean anything, it's much more helpful if you say that on your Samsung G57 it takes X seconds to complete the spawn, or the process crashes the app on a Mac Mini or only spawns X actors, or you get an error message (etc etc).
They are constantly firing, on each cycle of your code (60 times a second if your project is running correctly).
Divorce.
You'd probably have to ask a specific question, as the context is usually a factor.
@Socks I almost choked on my dinner!
I agree, if you can provide more specific information, you'll get better answers.
Some of these questions can be answered by doing a simple test, such as this one:
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks for the awesome answer socks!
Sorry if my questions aren't very specific. since my first project is badly done (too many useless constrains i think thanks to your tips) i'm currently brainstorming for a second project so everything is an option.
my project would be a turn based D&D style game
For spawning a grid of actors:
-I want to spawn a grid that creates the map out of a table
-is the actual action of spawning an actor can cause lag or its mainly its behaviors
-what is the maximal rate of actor spawning
-I have been have trouble spawning the grid at a decent pace
-if i start adding behaviors to the tiles the lag comes shortly
-im testing on arcade the game platform is not chosen
As for timers would it be better to :
Example 1
Use a Timer: after X seconds do something
or
save Self.time on an attribute and use IF Self.time > arrtibute+X seconds DO something
Example 2
Use a Timer: every X seconds do something
or
Use an attribute and IF Self.Time > attribute DO something and Change attribute to attribute+Xseconds