Context, I guess…
So ever since I started to make the scenarios of my (unreleased) games with clones, I’ve always struggled to make clone creation faster.
The best I could do was to add each block with stuff like width and position to different
When object is cloned
Blocks.
The main part
So as mentioned earlier I struggle with accelerating clone creation and I would like to know a way to make it faster. So if you know any way, PLEASE tell me as it would be very useful.
How it would help me
So I need a reason for people to help me (xD). Well I’ll use it in pretty much any game as I prefer using clones than using separate objects to build scenarios.
to clone faster, do (@/ThinBuffalo showed me this, it’s a good method):
when game starts {
set self(numberOfClones) to ___ // total clones you want
ABILITY clone {
if self(total clones) <= originalObject(numberOfClones) {
create a clone of this object
ABILITY clone
}
}
}
when object is cloned {
ABILITY clone
// clone index code next
}
Both methods shown double the number of clones each frame. So both create clones exponentially (2^n clones in n frames) so the they’re equivalent from that point of view.
The method with a recursive ability has several advantages
allowing synchronized initialization after the clones are created
assuming both options utilize a When Game Starts and a When Cloned to initialize the clones, the objects don’t have to evaluate the When <= after the cloning is done (more efficient)
clones can be destroyed (if/when desired for optimization). Whereas the When <= method would automatically recreate clones if they’re destroyed
Does that make the use of the recursive ability better? Not necessarily. The above points may not matter for many projects. So sometimes simpler is better or even just a personal preference.
If you use AE’s blocks, you can add a block called Clone Object Times, which will clone a certain number of objects all in one frame (not recommended though).