Not quite sure if this is the right section for this, but it’s about Networking & Multiplayer so i guess?
Okay so I got some little RPG game and for now I think it needs some Inventory System, Saved and Handled on the Server Side.
By the Way I’m using KryoNet for the Network Stuff
What I want to do: some 6x4 Inventory System:
[][][][][][]
[][][][][][]
[][][][][][]
[][][][][][]
And maybe some Slots for Armor and a Weapon but that’ll come Later.
I think of Storing this in an Item[24] Array (Slots are x+y*6 for that to access it like a 2 Dimensional Array when i just have a 1 Dimensional Array right?)
The problems I have are:
- I’m not sure on how to send and Array of Objects (registering the Object and send a Single one works but sending an Array of it somehow doesn’t?)
- I don’t know how often the Inventory should be send to the Player (guess just every time it changes and send it via TCP?)
- I don’t know how to handle when the Client wants to move Objects in his Inventory, In Minecraft, does the Inventory contain some extra slot for the item the Player has Dragged with the Mouse?
For example picking up these Ores, change them to Stone works but well i don’t have an Inventory System now: