Plan for shop improvements

From OHRRPGCE-Wiki
Jump to navigation Jump to search

Here are some improvements I would like to make for shops

  • Make menus capable of connecting to shops
  • Make shops capable of having more than 50 items
  • Create shop groups that a shop can belong to
  • Make shop items that can be global for all shops that belong to a particular group (this would make it easy to have special selling rules that apply to all shops)

Implementation of shops-in-menus[edit]

  • Add four new menu item types. Buy from Shop, Sell to Shop, Hire from Shop, and Stay at Inn.
    • The subtype for each would be the shop id number.
  • No special work would be required for the Equip , Save, Map, and Team feature of shops, since menus can already do those things.
  • Explore whether or not it makes sense to completely automatically convert all shop menus into menus and then remove the shop data.
    • Right now I am thinking "No", but I am remaining open-minded about the idea.
    • Would only do it if seamless backwards compatibility could be maintained.
  • Should menu's be able to display their names, much in the same way that shops display their names?

Implementation of Shop Groups and Globals[edit]

  • Add a data-member to shop stuff records that indicates which shop the stuff belongs to.
    • Pre-populate the shop membership data with correct defaults so all stuff will still be coordinated with the right shops.
  • Start treating the STF lump more like the MENUITEM.BIN lump
    • Records in STF will not need to be in any particular order
    • Loading shop data for the editor or to use in-game will search the STF lump for records that match the desired shop id
    • Writing shop data in the editor will put new stuff records in the next free slot, marked with the appropriate shop id
    • doing this will result in cleaner wrapper subs for saving and loading shop data, so a conversion to RELOAD format will be easier if we indeed decide to go that route.
    • This change does not automatically fix the 50-things-per-shop limit, but it will make it easier to raise that limit when the SAV format limitation is gone.
  • Allow the game author to designate certain shops as being "shared"
    • This alone does not make the shop behave any differently
  • Allow the game author to mark a shop as including the stuff from any shop marked as shared.
  • Update the buy and sell screens in game to allow buyable stuff from multiple shops (and sellable item rules from multiple shops)
    • Make the tracking of current shop inventory smart enough to update the right shop's inventory.
      • This can be done even before the SAV format limitation on shop stock data saving is lifted.
  • Including a shared shop into another shop can be used to:
    • Make global shop stuff that applies to every shop
    • Make groups of shops that share the same inventory but also have their own unique stuff
    • Effectively bypass the limitation of 50 items per shop by including several shops into one
      • Although that isn't an excuse not to raise the stuff-per-shop limit after the SAV format changes.
    • I see no reason to disallow recursive shared stuff inclusions, although obviously loops-back-to-self should not be followed.
  • How should sell rules be handled when more than one sell rule exists in a shop?
    • It is already possible to have more than one conflicting sell rule in a shop
    • Currently, just one "Refuse to Buy" stuff entry is enough to forbid an item from being sold
    • Currently, multiple "Acquire" and "Increment" stuff entries are all evaluated
    • Would some other behavior be better? Would some other behavior break any existing games?
      • Maybe it should only care about the first matching stuff entry?
      • Maybe it should check the current shop's stuff first, and then check included shared shops' stuff in a deterministic order, stopping on the first match?
        • This would make it easy to have a globally unsellable item that can be sold in one specific shop.