gggmork
If you can make any sense of this post, congratulations

Posts: 2379
Registered: 06-07 |
The rabbit hole of complexity continues. The real trick is to find the first turtle because then you know its turtles all the way down:
https://en.wikipedia.org/wiki/Turtles_all_the_way_down
I was wondering if the 500,000 (or whatever) actions per tic cap could be raised, but I guess not as quasar mentioned (if everything is tic based (as opposed to time I guess) it seems like it shouldn't matter and the whole game would simply run slower if something took a long time, merely delaying other stuff until they can be sequentially calculated too, but whatever).
So far, I found ways to get past that limit and no delays in functions though. For example, recently I tagged 160 sectors in a tesselation. I wanted to make the program calculate the neighboring adjacent sectors per sector (because I didn't want to do it by hand). I used a funny trick where for each sector: turn the light off, then for each OTHER sector turn to darkest adjacent. IF it changed dark then you know its adjacent so add it to the list of neighbors for that sector (then turning lights back on).
However I put the above in a function, and it turned out to be maybe quadruple 500,000 actions so made a "runaway script terminated". So I needed a delay and thought, I'll just put a delay(1) after checking each fourth of the sectors (so there will only be 4 delay(1)s and it'll still go fast essentially.
But no delays allowed in functions, so I made functionPart1(), functionPart2() etc part 3/4. then put the delay(1) in the script after every part. Would have been better to just make that neighbor calculating function a script instead so I could put the 4 delays directly inside without redundant mostly identical copy pasted function parts, but whatever.
Another slight hangup is you can only move a floor/ceiling once per tic, so sometimes best to just use a variable representing height so it can change multiple times, then only move actual floor at end of tic.
I didn't think of recursion since I almost never use it. Lol at deSwizzle().
And since there's no defined order for scripts, a seemingly obvious workaround could be put a delay(1/2/3/etc) at the beginning of each script depending on how you want them to sequentially run.
Last edited by gggmork on 02-22-13 at 17:28
|