Extension Idea: Slow Loop Object
This is similar to the Fast Loop Object but you can set a maximum for how many times it can fastloop per a mainloop.
For example: If you were to set the Slow Loop Object to run a Loop 1000 times at a limit of 10loops per mainloop at 100frames per second, it would take exactly one second for it to do it.
The purpose of this is to make gradual effects rather than instant effects, both gradual effects and instant effects are good.
Re: Extension Idea: Slow Loop Object
Err.. this isn't possible :)
EDIT: Misunderstood what was meant!
Re: Extension Idea: Slow Loop Object
And even if it was... what? You want to slow down fastloops?
Re: Extension Idea: Slow Loop Object
Didn't someone make a chunked fastloop object?
(it takes long loops in smaller chunks of a certain size)
Jamie: Of course it is possible, instead of just triggering the event in a for loop, just max it out at 10 and then continue on the next event loop.
Re: Extension Idea: Slow Loop Object
Re: Extension Idea: Slow Loop Object
What would be the point, why not just regular events for it? since the need for speed aint there?
Re: Extension Idea: Slow Loop Object
I've already done this extension which is named "Useful Loops object". It contains the possibility to create "chunked fastloops" and traditional "fastloop" with IDs. ;)
You can download it with FusionUpdater.
Re: Extension Idea: Slow Loop Object
Sphax, would you consider releasing your extensions on the forum instead of silently on Fusion Updater? Not everyone uses it, and you make some pretty awesome stuff :)
Re: Extension Idea: Slow Loop Object
Re: Extension Idea: Slow Loop Object
There was a looper object by Crag for MMF 1.5 that had many features and a lot more control over the loops. However, many people were looking at speed rather than capabilities and preferred the other options.
Maybe someday that one will get ported and become another option in the looping toolbox, again.
Re: Extension Idea: Slow Loop Object
Yeah, it had the Yield feature didn't it. So you could tell it to yield every 10 loops or so. It's actually very useful as it helps spread complex processes over multiple frames to dilute slowdown.
For instance, suppose I want my badguys to see me using a Line of Sight routine. MMF will judder to a halt if I check this every frame for every enemy all the time.
However, I know that my enemies don't NEED to update their vision every frame. So I can set it to Yield (draw the frame as it currently stands) after every 10 objects have been vision tested.
This spreads the processing over multiple frames, causing enemies to have slower reactions, but less slowdown in the game itself. If done properly, you can usually find a balance between avoiding slowdown and making quick reactions.
This can be done with regular fastloops, but is better (simpler) done with an extension.
Re: Extension Idea: Slow Loop Object
Chucked fastloops are also useful for loading screens for things that takes a long time and you want to update the user on the progress every once in a while. The loops doesn't get much slower since you can control how often you want the main event loop run during the loop. If your loop chunks are huge then you probably wouldn't notice any speed difference at all but you would still get a responsive application/game. Almost as if the loop was running in it's own thread :P
I think my friend once called that technique for the "poor mans threads" method lol.
Re: Extension Idea: Slow Loop Object
A thread extension, anyone? :)
Re: Extension Idea: Slow Loop Object
Sphax: Jamie is right, I have not even known that something like this has been alreeady made :) Will take a look asap
Re: Extension Idea: Slow Loop Object
Bornemix:
I think Xinok experimented with threads in MMF but wasn't really successful because of MMF's single threaded nature. I don't think you can process events in other threads. Your only way to use threads is to process stuff but when you need to "communicate" with MMF (like firing events like fastloops) you need to queue them and execute them when it is your objects turn in the runtime. Kinda defeats the purpose of multithreading.
Re: Extension Idea: Slow Loop Object
So it already exists, Useful Fastloops Extension, Chunked FastLoops.
Re: Extension Idea: Slow Loop Object
Yep :) So I guess that answers the query you had.
On the subject of Multithreading, I'm just about to pop another topic up about that actually.