"Dynamic" loot and events with Inform 7?

I’ve been trying for a number of months with Inform 7 to make a framework for the kind of game I want to write, but I keep getting frustrated and going on hiatus from it because it just doesn’t seem like I7 is the right language for what I’m trying to do. I6 certainly can accomplish it, but if I’m going to do it in I6 (which I don’t know), I might as well build my own program in a derivative of C or in something like Javascript at this point because I already know the language… except that that means I have to build my own parser and save system, which I don’t want to do and may be beyond the scope of what I am able to do as a part time hobby. I’ve posted topics/posts like this before, but not with a specific question I guess, so I hope the below will lead to some actionable advice from you helpful folks…

Basically, I want to make a game that is probably not like a lot of the other IF games out there, but I like the idea of using the IF parser model for the game regardless. I want to make a game where loot, fights, and events are somewhat dynamic and randomized similar to dungeon crawlers, ARPGs, and open world games like Diablo, the Elder Scrolls, but in text only.

I don’t know if I’d ever succeed at finishing such a project, but even if the journey is more important than the destination for me at least, I can’t even make headway on the journey of this project because of memory and performance limitations of the engine. If I pre-construct the thousands of items needed to give the appearance of random loot, there are just way too many items in the game such that performing functions on “things” or “chest armor” causes the program to have to process thousands of things a turn, sometimes more than once, making the game unplayable.

So, I’ve been trying to create a framework that takes a limited number of “props” (things with no properties in a “prop room”) and recycle them by using rules to add and change the properties of the items, and swap them around for placement, keeping their values stored in tables, to give the appearance of thousands of items, when in fact the program only has a limited supply. This has proven to be a nightmare, that as stated above, always ends up requiring I6 hacks or extremely verbose I7 rules and circumventing half of the standard rules to accomplish.

Does anyone have a “framework” for doing “randomized loot” and/or changing the properties (numeric values, special rules, colors, etc.) of things already built that could be used to make a text based version of a game like Diablo or the Elder Scrolls? Any advice on how to proceed with this concept in I7?

Why do you need to create thousands of items for it to be dynamic? Kerkerkruip does fine with dozens.

That’s exactly what I am asking though. I don’t want to have thousands of items, since the program can’t handle that… I want to have dozens of items, but use them as “props”. The only way I can think to do this though is to have tables that reference rules to change the properties of those dozens of items, but trying to get rules to be followed out of tables is driving me completely insane, as seen in my other topics, as it seems to become extremely unintuitive and convoluted to approach it this way.

How does Kerkerkruip go about it? What example should I be looking for? As long as it isn’t I6, and can be done with I7, I’m interested to see examples of how else this problem can be solved.

Well how many kinds of items do you have? You probably only need a handful of each.

I was actually thinking of not requiring even different kinds of items… I mean, this isn’t necessary if it becomes more of a burden than a boon to the process, but hypothetically I was trying to make things completely interchangeable and delocalized by giving all things properties, but by default the properties have generic values. Then each “item” is actually a data table where rules change the properties of the items and their location/ownwership based on other entries in the table row.

Instead of writing (for example):

Bracers 301 is in chest 102. Bracers of speed has speed increase 3. Bracers of speed have armor 1.

I would have a table like this:

Changing the property for is a rulebook.

Changing the property for something (called x) with something (called y) (this is the set speed rule):
        now the speed of x is y;

Table of Bracers 301
rule           number    text                      thing
set id         --          "Bracers of speed"    --
set speed   2            --                         --
set armor    1            --                        --
set owner   --           --                        Jack the Swift

When [something happens from some other rule and references the appropriate tables and selects a prop to be transformed by property changing rules]:
        follow the rule entry for the property [number, text, or thing] entry;

Of course this is psuedo code with lots of wrong syntax… I don’t know how to write it all correctly, that’s the point. I’ve actually had better working examples than the above that were partially right, but this is only the beginning and as I keep expanding the complexity of the program, I eventually lose what I was working on because I don’t have good version control in my hobby program here and it all comes unraveled and even harder to share than this psuedo example above.

I am wondering if there is an easier way to deal with the problem of too many items that this. I see that Kerkerkruip is perhaps not a person, but a framework? I guess I will read on that, but I’m kind of lost where to begin on the github for it.

Well kinds are most useful for specifying behaviours, if everything acts the same then you don’t need a lot of kinds.

The table approach looks okay, it’s longer than just specifying properties, but it will work. But it doesn’t explain why you’re making thousands of items.

I can create all the objects I want by just… not using the built in object code. Instead objects are just ‘archetypes’ with a property called ‘owned’, which you can increase or decrease as the player gains or loses the item.

If the player is only going to have 20 objects in her inventory, you would only need twenty objects in the system you described. I’m failing to see where the thousands come from.