Download

Roadmap for a Multiplayer Game?

Hi; I am not quite sure what the best way of going about a few different concepts of my game are.

I am interested in having an inventory system that you can pick things up and it fills your inventory, and also you can pick backpacks up and that will increase your inventory space. (how should I hold the inventory? an array? or is there another class that I can use)

I am also interested in having a weapon system, with different fire rates and things. What is the most efficient way to have a weapon system that also detects picking up new weapons and swapping weapons? (for example, in a gun blueprint itself, or do it all in the character)

Keep in mind that this game will be multiplayer, so I would like to create it with as much security as possible.

Have you ever finish any game project before you try multiplayer?
I ask because I can guarantee you will not be able to make multiplayer if this is your first game ever…
Specially if you’re working alone. Starting from a game template made by someone more experienced helps.

I would appreciate it if you kept the negativity away. I asked if anyone could help me with the most efficient way to set up a few systems. I have completed games before; I am asking for people’s advice on a roadmap.

Heh okay :slight_smile:

To be reasonably realistic isn’t being negative… It’s just, recognizing and accepting limitations.
Nobody here know how experienced you are, your question sounds like beginner stuff this is why I asked and probably the reason why nobody have replied to your question yet although a lot of people have read your post.

Good luck.

Yes, use an array for this. The question is rather if you use structs or objects for items. Make sure you don’t replicate the array, you don’t want a client to be able to extract information about the inventory of other clients. Let the server be the only one who is able to move / use items within the inventory. Let clients only request changes and let the server decide if those are done.

If the items don’t have individual variables (such as rock, stick, etc), you can use an array of classes. If the items have variables (such as weapons with ammo) then you’ll do well to create a structure that holds the variables of each item, and store it in an array that way. In multi-player, the inventory array should be stored in a custom “player state” blueprint, this type of blueprint exists on the server, which is where you want these variables stored. Good luck!

The player state exists on all clients therefore saying in multiplayer the inventory should be stored in the player state is a bad advice. PlayerController would be a better advice here. However that depends on whether the player should lose his items on death or not. If he should saving it directly in the character is also fine.

I know you didn’t really ask for a tutorial, but if you have SOME experience with UE4 or the nerve to go through some trial and error then check out this website:

The guy does NOT do video tutorials or explain every single click. Usually just enough to get you through each chapter if you try a half dozen times and learn a bit yourself. But he does cover inventory, weapons, animation, multiplayer mechanics and so on. Even if you didn’t plan to make a multiplayer shooter then you can only learn from there. The experience you gain from these lessons will be very valuable on your way. You can also buy some 100 hour video lessons, but you won’t learn much more.

Thank you all so much for the advice. I have almost finished my inventory system. All of your replies were very helpful.