Zweshi Posted November 9, 2018 Share Posted November 9, 2018 (edited) Hello everyone,Isn't it high time that Torque3D had a easy to use, easy to maintain, and easy to expand upon inventory system? I think so too! And in that spirit here is a MMORPG style server to client inventory resource written in TorqueScript for stock Torque3D 3.10.1... probably works on any version of Torque but 3.10.1 is where it's been tested.Video showing off inventory functionality:llPf0IQMmDw Current Version: 1.0.0aDownload: https://www.dropbox.com/s/p4x4e8qvwf9e4q5/MMO_Inventory.zip?dl=0Installation: Instructions are found in the downloaded folder's base directoryLicense: Code: MIT | Art/Sound files: CC0General Notes:Networked with a "never trust the client" mindsetStandardized images/bitmap arraysStandardized data variables for all the thingsStandardized "helper" functionalityUsing a flat database systemUsing object namespaces to reduce redundanciesWritten in just TorqueScriptNo .gui files, the gui elements are built to a targeted gui(standard is set to PlayGui)Data driven gui approach with full customizationPlenty of example objects System Features:Base inventoryInventory MenuCurrency panelNotify panelExamine panelSound suiteSelect object behavior Network Optimizations:Full inventory data is only sent when player opens their inventory for the first timeSplit/drop/Move/pickup functions only send data for the affected slotsclient verifies data before a request is made reducing redundant server callsserver is only called if/when actions are taken not for redundant tasks such as open/close states Inventory Item Types:CurrencyStackable itemsNon-stackable itemsEquipable itemsFood items Inventory Item Functions(Menu System):Split stackPickup itemMove itemExamine itemDrop item A Word On Adding Content:One thing I've learnt over the years is that efficiency on the data layer is useless if it means the content layer suffers(learnt that the hard way), so with that in mind content additions are handles exclusively within a scope that a artist without code/scripting skills can master. A item addition requires a shape(.dae) used for world placement, a 2D inventory image(.png) of the item, and a datablock akin to a simple non-interactive spreadsheet.That is it, you do not need to even touch the codebase of the inventory system to fully interact with the content layer.A Word On System Customization:One of my biggest pet peeves is when developers build cool systems as external resources(for any engine or data system) that are very specifically engineered to do one thing very well but if you want to modify them at all you might as well re-engineer the worlds power grid first as that would probably be simpler.With that in mind i wrote this resource to be adaptable through the dankest of data driven approaches, for example: Want the inventory on the left side instead? No problem just change $InvBase_PnlPos and your done, more inventory slots and rows? Just change $Inv_Rows, $Inv_NumBtns and $Inv_InventoryMaxSize and your good to go.It's easy to change things and it should be easy.A Word On Data Management:You will notice that this resource uses a flat database as opposed to a more sophisticated separate database system for data handling. As i started this project i contemplated writing a database system to go with it and get some inter-server goodness going right of the bat for that sweet sweet efficiency. But limited time along with the fact that i was not gonna use the system myself made me lean towards a simpler solution, after all if you need a sophisticated database for your game then you probably already have a preference for a existing system.A Word On Client Login:This inventory system does not sport a client login system, instead it simply uses the client player name to connect the player to the server side inventory, this is what we in the industry call a complete lack of security bordering the absurd. This is by design though as i wanted to avoid writing a login system as at that point this resource would land in the security sphere which i'm not really comfortable with for a public resource like this. So keep this in mind for your multiplayer projects, you need to connect your login system to the inventory where appropriate.Feedback:If you decide to use this system for your project(s) and find some gaping flaw that i, in my infinite wisdom of course, overlooked completely i would very much appreciate if you would report back so i can break out the ol' shovel and get back in the trench to fix it.Lastly if you have any questions feel free to reach out to me either in this thread, on discord, or twitter and i will do my best to help you out.Twitter: ZweshiDiscord: Zweshi#0840All the best and happy inventorying!- Jonas Edited December 9, 2018 by Zweshi Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.