I was so proud that my dynamic allocation system didn't rely on static arrays anymore, but on dynamic arrays instead.
And then realized that dynamic arrays can have a size only up to 1,000,000 elements - thus dividing the power of my module by 20 after a long and painful refactor.
This post has no other object than to whine. :)
I'll even add [SOLVED] in the subject, to close it definitely.
1 million elements in an array require 1MB of storage (I know, I know, that amount of installed RAM in a modern system is in the GB range...), even though the elements are just of the char type, and I think that's more than enough for "general adventure games" (AGI only provided 256+256/8 = 288 bytes for in-game states, to state an outdated reference). ;)
But yeah, there are some certain evil situations that we may need more of this. It is certainly annoying to be not able to do stuff in such occasions but anyway it can be worked around.
Actually it takes 4MB because the integers are stored on 4 bytes :-)
(You have no idea the time I spent doing nerdy tests on that scripting language :D)
...And using a huge array actually is the workaround ;) (I'm using algorithms that compensate low speed with high memory usage).
Anyway. I'll survive. I was just sharing my pain ;)
The 1,000,000 element limit on dynamic arrays is completely arbitrary and is designed to stop people accidentally using up all the RAM without realising it. Of course, I appreciate that sometimes you might be doing something advanced where you would actually need this, so would a 10 million limit be more reasonable?