Is there any way to make the game/compiler run faster?

The game im making is getting pretty damn big, and i’ve been forced to increase various max_stuff several times over. This is what i’m currently using:

Use MAX_PROP_TABLE_SIZE of 50000000.
Use ALLOC_CHUNK_SIZE of 500000.
Use MAX_OBJECTS of 300000.
Use MAX_SYMBOLS of 800000.
Use MAX_STATIC_DATA of 5000000.
Use MAX_ARRAYS of 500000.
Use MAX_CLASSES of 5000.

I also use a whole lot of repeat throughs, which i could imagine would stress the game considerably.

I am however fairly sure that it’s not my pc lacking behind, but i could be wrong, so i’ll post my specs anyway:

CPU I-7 4771 3.50 GHz (8 CPU)
14gb ram
Windows 10

The problem is that every turn takes somewhere from 0.5 seconds to 2 seconds to actually go through with it. So if i simply type “Wait”, it takes a long time for it to proceed.

It also takes ages to compile everytime, somewhere from 2 to 3 minutes.

Are there anyway for me to increase something to make it go faster? Will older pc’s and laptops fall behind? Is it due to too many “Every Turn:” or simply too many things in the game at once?

Thanks for the help,

Lots of rules generally don’t matter, but one or two very slow ones could make all the difference. Are you messing around with scope? What repeats are you doing?

See this thread if you haven’t:

Yes, if WAIT is slow, that’s every-turn rules. And as Dannii said, it’s probably a few very slow ones.

Do you actually have hundreds of thousands of objects? Inform’s library is really not built for that.

I actually solved the wait every turn being slow, since it only happened in the built in-interpreter. When i use gargoyle it runs super smooth. The compiler is still ungodly slow, so if there was a way to give it some more power, then that would be nice.

Currently i was told that there was absolutely no way to ‘make’ or ‘create new’ items within the game whilst the game was running. That the workaround for that was to make a seperate room containing those items. The problem is though, that in my game you may kill multiple foes of the same category and acquire multiple amounts of the same item. If there suddenly isen’t anymore items to be dropped of that kind, then it will throw an ‘can’t move nothing exception’. My workaround for this was to simply make 100 types of each item in the room containing the items. I think i have 85x100 items right now, so not hundreds of thousands yet, but i will get there surely.

If you can rearrange your code so that there are only a hundred extra items total, and each object can stand in for any of the possible dropped items, you will see much better performance. I realize this isn’t a simple change.

There’s also a Dynamic Objects extension which really does let you create new objects on the fly.

But in general, it’s hard to think of a game experience where the player actually has 200 objects in their active inventory and is still having a good time. Even aside from speed issues, the parser interface just isn’t a good way to interact with that scenario.

I looked up the dynamic objects extension, and im gonna give it a try. The reason i never looked deeper into it was because i was told that it was virtually impossible for inform to do something like that whilst playing.

I’m using Dynamic Objects and it seems to be working fine, so i’ll be using that instead! Thanks!

The compiler is still super slow tho :frowning:

In case Dynamic Objects doesn’t work out, something else you can try is, instead of creating 100 arrows or something, make something like three collections of arrows (one for the player, two for opponents) with a number property measuring how many arrows are in the collection. Then, when the player picks up a pile of arrows, you can just increase the quantity of their collection by the number of arrows they just picked up, and move the collection they picked up back to the storeroom.

Another possibility is to limit the number of certain objects they can pick up (do they really need ten swords?) Then you can make sure you don’t run out of objects without having to create thousands of them.