Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Request! (WTB "Inventory Tetris" System)

Discussion in 'Assets and Asset Store' started by Hrothvitnir, Mar 23, 2014.

  1. Hrothvitnir

    Hrothvitnir

    Joined:
    Apr 26, 2013
    Posts:
    109
    Apologies if this isn't the right place on the forum for a request. Just to be clear, I am not announcing something I'm making, I'm advertizing a need I have for my project that isn't being filled by any asset on the asset store, and that I would certainly pay for if someone wants to make it. What I need is a type of inventory system sometimes referred to as "inventory tetris," similar to say the inventory system in Resident Evil 4 (with one key addition, equipment slots).

    I know there are a lot of inventory systems on the asset store - none of them have the key features as far as I know. I know of only one project that's even close, but it appears to be dead. Searching online, the only thing I come up with are other people looking for the same thing but coming up empty handed. So I know I'm not the only one who would want this.

    I personally don't have time to do this myself, and don't really know enough about 2D and gui programming anyway. I have NGUI, so if someone wanted to make something compatible/dependent on NGUI that's perfectly fine with me, but not mandatory (I think the asset would sell more if you do though). If someone sees this and wants to add these features to their pre-existing inventory system, that's fine with me too.

    Key features (*= most important):

    -player can enter the inventory screen by pressing a button, this locks the view and enables the mouse cursor.

    *- objects must be able to occupy more than one grid space, ie certain small objects might be two units wide and one unit tall, whereas a large object might be six units long by two units tall.

    -Players can click to drag items around the grid space, but they cannot put down an item if any grid space it would then occupy is already occupied by another object.

    *-player should be able to press a button to rotate the object 90 degrees, so they can fit things into odd spaces.

    -Inventory screen should have a variable sized storage grid the contents of which gets saved, and a fixed size overflow/trash grid. New item go in the overflow area on pick up (automatically launch inventory screen), the user should then drag it into their storage area. When the inventory screen is closed anything in the overflow area gets dropped on the floor (when inventory window is closed, spawn item if it was in was put in overflow; destroy "pick up" object if it is not in overflow)

    *-Inventory screen should have an area for "equipment slots" - items can be dragged from inventory (or overflow) onto an equipment slot to equip/enable the item (equipped items don't take up inventory space). Equipment slots may just be separated grid spaces. The important thing is that objects that don't fit the grid's size and shape can't be put in the equipment slot.

    -size of inventory grids, number and location of equipment slots, etc needs to be accessible and modifiable. Equipping a bigger bad, or wearing different clothes may increase/decrease inventory space and equipment slots.

    - don't worry about art/design/layout aspects, just programming.
     
  2. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    There's a few WIPS like this, not sure if they have rotation or not, but surely trivial to add.

    But if you want it so bad why don't you pay someone to make it. If you think its going to sell then YOU can sell it on the asset store.
     
  3. Hrothvitnir

    Hrothvitnir

    Joined:
    Apr 26, 2013
    Posts:
    109
    Because paying someone to make something exclusively for me is a much more expensive proposition, and I just preordered Unity5 the other day. :D
    Ideally, someone with an already existing inventory system will see this and think, "oh yeah, that functionality would be "trivial to add" and would add value to my product, I can do that and maybe charge this guy an extra $50* on the side" or something.
    *: negotiable
     
  4. Tiki

    Tiki

    Joined:
    Mar 3, 2013
    Posts:
    299
    Did you make any progress?
     
  5. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    744
    He basically wants, a Day Z cloned inventory system + the ability to rotate the item.

    So basically if you drag an item into the slots, you not only have to check if its fits into those grids, but also, when you request rotate, you have to check if it'll even fit in that rotate position as well.
     
  6. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Yea Hroth I've been wanting this exact thing too, and despite the sheer number of Inventory systems on the AS, no one either thought to add this functionality or is capable of it. I'm going to assume its the former reason, but then that would be a bit of a surprise unless those that are making these inventory systems never played a game before 2005 (or any western RPG from the 80's or 90's :D)

    Ah well at least I have a partner now in search of this!

    Cheers

    -Steven
     
  7. Tiki

    Tiki

    Joined:
    Mar 3, 2013
    Posts:
    299
    I'm actually looking for ideas on what to create, what has a demand. If this is something people are looking for, I'll get started as soon as I can.
     
  8. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Well Tiki, pretty much a general purpose Inventory that has the aforementioned capabilities, primarily being what we'll conveniently call 'Tetris Inventory' (I feel this is fairly descriptive and vivid). Games such as Fallout, Arcanum, Silent Storm, System Shock 2 and Resident Evil 4 are great examples of this.

    An Inventory System that isn't aimed at just MMO's or RPG's or any one genre; it has to be generic, ideally be flexible enough to create user custom inventories that of course allow easy 'dressing' (making it look the way you need it to) and even better if you can adjust the size, the ability to drag and drop the panel (or not). Overall it needs to have as many customization options that when all is said and done, it is completely the users 'own'.

    It must have have the standards. Drag and drop, Drag-Over and Swap, Drag and Drop back into world (subsequently spawning the object back into the game world to be picked up again if so chosen), Drag and Drop from the world into an active Inventory panel (subsequently despawning the 3D object from the game world). Stackables that can be split into smaller piles, right-click/click-hold/touch-hold additional menu options (equip/unequip, drop/breakdown, consume, combine/split, reload/unload, compare, etc) with the option to create your own menu methods.

    I can't imagine the system wouldn't enjoy having a character system, ideally (my opinion) a 'Paper-Doll' system for seeing equipped items.

    Ability to quick-compare items for item-rich games (Diablo, Torchlight, Borderlands, etc). In other words the option to have explicit details of an item.

    Lastly (at least for my rambling post hehe), this can't simply be an array and a GUI. It must have clear methods for implementation. Lots of assets now that try to give you barebones systems, FPS systems for example, don't simply stop at playing FPS animations, swapping weapons and firing weapons, but have integration/extension so anyone who dives into the code can extend the system with clear methods that derive from their systems. Same goes for a useful and powerful inventory.

    Oh one more thing...I'm not an uber-coder but can do well enough. That said, Playmaker or visual scripting integration will be very helpful, as customizable inventory systems aren't the easiest systems to work with. Visual scripting support will help mitigate a lot of the implementation for the end user. Great examples are any of the new BT's such as Node Canvas and Behavior Designer, or all-in-one tools such as the much beloved Adventure Creator, all of which have great Playmaker support.

    I'm sure there's more and I'm certain a fellow member here can elaborate further, but this is at the very least a solid place to start.

    Good luck! :D

    -Steven
     
  9. Hrothvitnir

    Hrothvitnir

    Joined:
    Apr 26, 2013
    Posts:
    109
    Hadn't been following this thread since it went 2 months without a reply. Also I found a "candidate" for my inventory needs, but haven't purchased it yet, since it still seems to be a WiP and hasn't gotten onto the asset store yet (forum thread here).

    For my needs, most of what SteveB said is spot on - though I don't use Playmaker myself. The "paper doll" system should probably be able to discriminate based on item "tag" or type (ie is this a weapon? Then it can't go in an armor slot) and also grid size (you can't fit a Zweihander or a heavy machine gun in a pistol holster, even though they are "weapons").
     
  10. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Yea been loosely following that one too, and I'm a bit surprised/curious/skeptical due to the fact it seems unable to make it onto the AS. *shrugs*
     
  11. Tiki

    Tiki

    Joined:
    Mar 3, 2013
    Posts:
    299
    So, what I'm envisioning is an editor extension built into the menu that gives you access to a window that represents what your inventory screen looks like. You can place images for each of the layers of the inventory and it will show a visual feedback on what that looks like. The layout would be editable by you ( I hope with a drag-and-drop method in the same window ) as the user. You'd have to create images for the items to be inserted into the shapes, or models that would be rotated accordingly by the script, depending on the tech behind your game. Then you would be able to apply a tag or equivalent to each object that is wearable, that represents slots it can be inserted into, that will overlay it on a basic character model, which you can also swap out with your own model.

    Miss anything?
    I'm still working on CityScaper, but my planned features are almost complete... going so quickly actually that I'm just completing them all and updating it all at once. As soon as I'm done with that, I have another project I'd like to finish, but it's nearly complete as well. I might be able to start on it in a couple weeks, and then probably finish it a month or two after? I think I'm going to create this anyway because I can see so many places it'd be useful, just letting you know the timeframe I'm on right now, so you can gauge whether to buy another product.
     
  12. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Sounds great and you'll at the very least have two interested developers who can help you sculpt (IMHO) a strong and flexible system! :D

    Very excited

    -Steven
     
  13. Hrothvitnir

    Hrothvitnir

    Joined:
    Apr 26, 2013
    Posts:
    109
    Images. And so probably we should specify grid size, like say 32x32 pixels, or 64x64. Either works for me,

    Another thing I thought of (more like forgot to mention) - would it be possible to have multiple separated inventory grids for multiple bags? For example, having one bag that holds 4 units, and another bag that holds 2 units does not allow you to hold one object that needs 6 units of space.

    3D representation isn't necessary for me, so long as equipment slots are clearly marked (armor goes here, weapon goes here, etc). I'd rather the inventory screen be something they can get into and out of quickly if needed (no pausing!). But I can see that being important to games with more of a "dress-up" aspect to them. Maybe make it optional?

    Below is an image from RE4's inventory screen - this is more or less what I'm picturing in my head.
    One important thing I don't think we've mentioned that is depicted here, is the grid on the right side, where new items that don't fit into your inventory appear on pick up, or junk items can be put to throw out on exit.

     
  14. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Yea something like that would be brilliant (I'm surprised I forgot to mention a fully 3D inventory in my ramble) :D
     
  15. Tiki

    Tiki

    Joined:
    Mar 3, 2013
    Posts:
    299
    Sorry I haven't responded in a bit, I've been pretty busy between my current asset and training a team of new unity developers...

    So I think all of this is pretty easily doable, I just have a lot on my plate at this moment, I'll let you guys know as soon as I get started on it!
     
  16. Hrothvitnir

    Hrothvitnir

    Joined:
    Apr 26, 2013
    Posts:
    109
    No worries. I've got lots of other stuff to finish before I need to worry about integrating an inventory system, I just like to plan ahead. I'm also working an unrelated part time job, so I totally understand being short on time.
    And you've been pretty responsive so far. With the new GUI system soon, it might be good to wait and see if it has anything that helps.
     
  17. Tiki

    Tiki

    Joined:
    Mar 3, 2013
    Posts:
    299
    So I've got a good chunk of the updates I had wanted for CityScaper done. I'll probably be spending an hour or two on it a day still as I set up some things like its texture atlas, other optimizations and more complicated noise and terrain interactions. Meanwhile, I think I'm going to shift gears towards this. I spent some time looking around the asset store, and you guys are right, there's hardly even anything that includes size representations. Very basic.

    I'll let you know as soon as I have some results. I never really know how long that takes when I dive into a new project honestly. With some luck - tonight.
     
  18. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Sweet...very excited now!
     
  19. Tiki

    Tiki

    Joined:
    Mar 3, 2013
    Posts:
    299
    So I decided to integrate a window interface for this project. I think using the window interface to set up the visual look of your inventory is at least a good start. I've never messed much with the EditorWindow class as it doesn't give easy access to the built-in SerializedObject methods. So I needed something small to get myself acquainted with the limitations I would encounter.

    My first thought when addressing this, is that you will need to be able to create multiple instances of the inventory system in order to take into account multiple bags. For instance, a satchel, a backpack, some pockets, etc. So I set up some simple code to allow you to add new ScriptableObjects to be modified representing individual inventory systems for each "bag", and attach a name to it. Next is to set up the visual modifications, which should look a lot more interesting than this screenshot. When I get that ready to show off, I'll start a WIP thread and link it here. Probably after that, I'll dress up the GUI a bit before diving into the guts of the inventory system.

    At the moment, I foresee only a handful of properties that need to be exposed through the API. Besides those needed for the user-end GUI, I think I'll need to allow scripting access to the weight and area variables. The idea would be to allow for each bag to adjust gravity as necessary, allowing for "magical pouches." Then each object can tie a weight into it's bag and you will have both mass and "size" requirements for fitting things in your inventory.

    Here's that screenshot of the barebones start:

     

    Attached Files:

  20. Tiki

    Tiki

    Joined:
    Mar 3, 2013
    Posts:
    299
    I'll probably start up that WIP post tonight.

    I worked my day job yesterday and didn't get much done here except for the morning, today I work again, but I'll have time tonight to work on this. I've managed to bring the interface up to scratch. I've really never done EditorWindows before, so this was kind of fun to learn something new in Unity. I had a little trouble getting settings to save properly, but now that it's done, there's a file called "InventoryManager.Asset" which you can transfer from project to project with the Inventory Asset itself and keep all your settings. Here's a picture of the window interface currently:



    You can see the .Asset in the bottom right, where all your settings are stored. This interface essentially is what you would use for setting up each bag type or inventory type. Here's another picture without one selected:



    Next is to start setting up the inventory runtime stuff now that I have variables to play with :)
     

    Attached Files:

  21. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Awesome Tiki and yea I too rather enjoy the 'unexplored territory' portions of my development when you end up learning something brand new (and many times helping you improve on stuff you thought you knew) :D

    Good stuff man

    -Steven
     
  22. Tiki

    Tiki

    Joined:
    Mar 3, 2013
    Posts:
    299
    Yeah, I learned a few things about asset control I hadn't spent much time in, specifically the hardcoded messages, and how to manipulate them. I.E. SetDirty. I saw the window control as being essential to this plugin, so I really wanted to achieve it if possible. Looks like this isn't as common as I thought it was though... maybe that plays in its favor as well? I have to say the ability to copy one file to save all your data is a huge perk of the result.

    Just added a save button real quick, even though it saves on window close as well.
     
    Last edited: Jun 16, 2014
  23. Tiki

    Tiki

    Joined:
    Mar 3, 2013
    Posts:
    299
    Don't know if it's infringing on WIP rules.. I don't think it is, seems like a good place to locate this idea at this point. Either way, it's up, and I've set up a basic grid view of the width/height. That's the last checkbox I had before doing the inventory behavior, so I'm diving into the runtime GUI now.