View Full Version : Which actions will consume most of resource?
wongwanchap
01-09-2010, 11:09 PM
I believe every Alice game creator have encounter problems about lack of resource, for instant, the game is running extremely slow.
I don't really know how Alice work, I want to ask someone professional in programming, which action consume more resource?
1. lots of object
2. lots of object but all of them are set to be invisible
3. lots of event with <while> event handler
4. moving lots of object in the same time
5. a long and complex calculation
And also which action we should avoid.
Welcome for any discussion here.
x2495iiii
01-09-2010, 11:55 PM
Lots of objects and infinite calculations slow down Alice considerably. To avoid lag, use "hen a Variable Changes" instead of infinity loop whenever possible, and limit/reuse the objects in your world.
If you use sound, use an MP3 file, not a WAV file. WAVs are bulky, MP3s aren't.
If you import a picture, use a jpg if possible (usually lower filesize, can be much lower if you have a quality controlling program like GIMP). Sometimes, pngs are necessary, like when creating special effects. If that's the case, don't be afraid to use it, but for textures and square billboards and the like, use jpgs.
wongwanchap
01-10-2010, 01:21 AM
I understand lots of object can cause huge consumption.
But if I set all object to be invisible, will it improve consumption a lot?
x2495iiii
01-10-2010, 02:21 AM
If you set their isShowing property to false, it can improve game speed (opacity doesn't work the same way, as you can still interact with objects that are 0% opaque).
wongwanchap
01-10-2010, 05:06 AM
I see, thanks for your help.:)
jediaction
01-11-2010, 08:57 AM
I said on another post to make the object showing false, but 0% opacity i did not think that would work, oh wait, its the same as showing = false...hahaha
x2495iiii
01-11-2010, 09:06 AM
Not quite. Objects with 0% opacity can still be clicked on and registered by the mouse and have visible outlines when going through other objects. IsShowing = false doesn't have either of those side effects, and can still be used to sense other objects positions (as with a collision detector).
jediaction
01-11-2010, 09:13 AM
I see. would that take up space
x2495iiii
01-11-2010, 09:23 AM
I'll admit I haven't tested it, but opacity-changing methods are processor intensive in other design programs (like Flash), and opacity wasn't even available in the earliest version of Alice 2.2, so I assumed that it must be a difficult operation.
Also, chris101b said that when his objects were set to notShowing, his world speed increased. So, it looks like setting isShowing to false is better if you're trying to save space.
jediaction
01-11-2010, 09:59 AM
I know, thats what ive been saying x2495iiii