I whipped up a regular algorithm that creates obby stages, in an attempt to see the full extent of the roblox engine. I have created an algorithm that does so, I do not know the full extent tho,
except a problem I have ran into was that it started glitching the auto generation because there was no waits implemented, so I added a simple wait() , but that isn’t even fast enough. If anyone knows the fastest way to add a delay in a script it would be greatly appreciated.
firstly:
you can use task.wait() instead of wait(). wait()
has a minimum wait time of 1/30th of a second, while task.wait()
has a minimum of 1/60th of a second.
secondly:
within each iteration, have a for loop that repeats it all multiple times prior to having the wait.
e.g.
while true do
for i = 1, 10 do
-- much code. such wow!
end
task.wait()
end
Yes, I had already implemented everything except task.wait
can you please show more of the code? What’s i in that case, just to see if you were doing it how I suggested
It keeps track of the current iteration in the loop.
it is always counting as I have to implement math which requires the variable.
So it’s not implemented in the way that I suggested? If you are having a loop already cause you are trying to keep count, you can achieve something similar to what I suggested by adding replacing wait()
in your code with this:
if i % 10 == 0 then
task.wait()
end
This makes it wait every 10th iteration, rather than each iteration
Mind me asking, why would it need to wait for the 10th iteration?
The loop increments regardless, the wait is there to slow it down so the player doesnt crash. it has over 1 million stages, I just wanted it to be more efficent
Doesn’t have to be the 10th. it could be the 20th or 100th. It’s just so that you have the wait to prevent the player from crashing, while not having to wait 0.0167 seconds per stage, instead waiting 0.00167 seconds per (i.e. 10x faster), or faster if you mess around with the value
it conflicts with my code. I’ll take to your suggestions but i will have to find time to implement them
How does it conflict your code? There’s no reason that it should be conflicting with anything