Toma400 / The_Isle_of_Ansur

Python-based text RPG game, successor of Between Shadows and Light.
Other
9 stars 0 forks source link

Location cache #49

Open Toma400 opened 1 year ago

Toma400 commented 1 year ago

One of most interesting things to limit issues regarding overflow of quest/event lists is to separate them into various ones. I think there could be easy, yet powerful catch for one specific thing: locations.

Everything exclusive to locations could be stored in their respective user-based file (similarly how chests worked in original BSaL), which would not only make things less one-list-heavy, but also could serve as nice way of adding data. Each list of such caches would have a name based on LID (location ID), so those would not be able to double.

Example of use: In #48, instead of caching "ring was found searching the deck" into some general events/quests lists shipped with userdata, it would store that info in location cache ("ansur:tutorial_ship" or something). Checking for ring being found would be simply

if not "ring_found" in loc_data():
   search_for_ring; if found: loc_data(append ring_found)
else:
   search_for_other_stuff

instead of appending to list of general events, which will increase over time rapidly. Of course, probability of overflowing this list is still small and would require long gameplay, but see, how easily we can lighten everything with such simple trick.

Toma400 commented 1 year ago

Additional idea: those loc_events could be reached also from outside, allowing for pushing more events into locations, freeing space from personal events, as loc_events would be useful not only for really specific cases, but also for cases related to location, but not called from this specific place.