A downloadable Salt Sea

Explore with Red this dangerous city.

Technical Part:

I worked a long time on the inventory system, based on Resident Evil 4. This is how it works:

  • Items have size and it can be whatever you want. Even 2 separated parts can be one item if you as long as you write the base coordinates in the component.
  • If you click an item, it will be picked up by the specific coordinate you clicked on.
  • Every time you ungrab an item, it will calculate whether or not there is space in those cells, always having in consideration the coordinate you are grabbing the item from.
  • You can rotate the items using Q and E (or just R), using a Matrix to transform the item coordinates to the rotated ones.
  • Leaving an item on a chest or your personal inventory will be saved and stored separately in scriptable objects. I also made a component translate that info into a txt, but is not serialized, so it can be overwritten quite easily.
  • Chests spawn items randomly inside them, and you can choose the probabilities of each item as well as the amount that can be spawned.
  • There is 2 ways of getting items, grabbing the ones inside a chest and visually dragging them into you inventory, or picking items on the floor, in which case it will be automatically placed.

Some interesting facts: 

  • Everything looks simple, but when you ungrab and item the system runs 18 different methods, yes, only when ungrabbing.
  • The system has 4215 lines of code in total in and 28 different scripts.


Download

Download
Build.zip 34 MB

Leave a comment

Log in with itch.io to leave a comment.