Its not a world generator, its a… world simulator???
im not sure how to word it but its calculation the world population, mood, date, score, age, danger, economy, wants, and some other small things. All of this goes into calculating eachother so if they are unhappy there more likley to want happiness…
At the end of each “shift” based on how good you did the world will advance the next day, and i need to simulate all of this advancement very fast so that when you return its already done
i already did that, see when your at your shift the simulations go by every second, but when yourt home i need them to go by INSTANTLY so that when your back its as if your whole world has been advancing for hours even if its only been a few seconds
i dont have any because im trying to figure out how to simulate all of this instantly, i already have had the simulation code done for days but now i need a way to simulate it instantly
You can indeed run a while .. do loop without a yield, but there is a limit;
local limit = 100
local count = 0
while true do
count += 1
print(count)
if count >= limit then
task.wait()
print("Count reset to 0.")
count = 0
end
end
Statistics
Count from 0 to 100 takes 4 milliseconds.
From 0 to 0 takes 45 milliseconds.
This loop runs instantly (or as fast as the tick speed allows) 100 times in a row, then yielding for a millisecond to avoid a timeout.
However, there is a reason it requires a yield, because it’s just too straining to do without. A safer option would be to use a coroutine or task.spawn to use multiple threads which could all run the same loop independently.
if you want to skip some amount of time in a simulation and each step needs to be processed then you need to use a loop that only waits one out a few hundred times
yes. i have that code. that code needs to just run very VERY fast. if you really want something heres the stepper code:
CWD.Event:Connect(function(PR)
if PR == "Started" then
while WrldData.Cont == true do
--Does simulation here
task.wait(WrldData.GameTick)
print(WrldData.Cont)
end
elseif PR == "SleeperrMode" then
-- here i need instant simulation
end
end)
Okay, finally you’ve given us some code to look at, but we need to see how your progressing the simulation regularly so we can see how to do it “INSTANTLY”