Hi! I'm trying to optimize my code in MMF 1.5. Can anyone shine som light on how much, if any, influence these things have on the application speed:
1. "To the power of" calculations (vs. X * X)
2. Squareroot claculations
3. Global values (accessing them)
4. Fast Loops
5. Semi-Transparency
6. Other ink effects
7. The amount of actions in a frame
Thanks
---
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
15th October, 2006 at 12:03:35 -
MMF has to go through the entire event list 50 times in a second.
I don't see why global values would be different than counters or some other variable as far as accessing it goes.
Large objects or large amounts of objects with ink effects will slow down the game.
Depends on what you are fastlooping, I guess. Fastloops haven't slowed down anything of mine yet.
Huh, I'm not sure on the math (or any of this speed issues things), but I know from experience that calculating the shortest distance from 1 object to 250 others can be slow. *shrugs*
To test FPS, have a counter.
ALWAYS> Add 1 to counter
Every 1 second> Set counter to 0.
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
Some operators in C++ are slower that's why I thought that might be the case here too.
I read somwhere that some operations with global values was slow in MMF 2, I don't remember what sort of operations though that's why I'm asking.
As for Fast loops - is looping something X times the same as having X actions? That sort of thing.
I know how to test FPS, that's why I wanna optimize thing up.
---
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
15th October, 2006 at 12:45:37 -
For fastloops: I'm fairly sure it's the same, it only repeats an event quicky anyways. Before fastloops were around, people just copied and pasted code to repeat things fast.
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
It depends how many actions or events you have on the fastloops.
n/a
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
15th October, 2006 at 16:46:48 -
Fastloop DO speed up stuff a whole lot, depending on what you do with it. Just look at the TGF/MMF1.5 example that comes with the fastloop extension! Huge speed!
Yes but if you have it do like lotsandlotsandlots of stuff at the same time, it will slow down, or crash.
n/a
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
15th October, 2006 at 17:07:04 -
I don't really want to download an extension for something that's built in. I think your talking about something else though. Fastloops only repeat an event X times, so having that event X times instead would be exactly the same... no? Everything still happens before the screen updates, it's just messier... no?
Example:
Always>start loop "x" 5 times
on look "x">add 1 to counter
---
is the same as
---
Always> Add 1 to counter
Always> Add 1 to counter
Always> Add 1 to counter
Always> Add 1 to counter
Always> Add 1 to counter
Edited by the Author.
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
15th October, 2006 at 17:34:48 -
Yeah, but are they the same speed is the question.
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
Fastloops do not affect the speed of the application greatly, however it would be the things IN the fastloops affecting the performance if repeated a lot.
Semi-transparancy and ink effects do affect speed a lot, using large objects will greatly affect it.
Well, the event editor is rather fast actually. I can't see the events actually making as much of a difference as the objects you're moving around on screen.
I guess more complex mathematics will slow down the game as will more events.
Not closing groups down when they're not needed would slow the game down needlessly.