flare-game icon indicating copy to clipboard operation
flare-game copied to clipboard

TCP/IP Multiplayer Feature

Open Simon-Charest opened this issue 6 years ago • 18 comments

This would be the greatest thing ever! :D But yeah, it's something hard to implement, synchronicity and all.

The gaming mechanics would need to be split between server and client. Then, one of the players' machine would have to act as the server, feeding all the clients.

I humbly suggest the "simple" Minecraft approach: splitting the server and client apps. The game map would be saved locally to the server but the players should probably be saved on each of the remote client.

Simon-Charest avatar Nov 06 '18 17:11 Simon-Charest

We already have such an request in https://github.com/dorkster/flare-engine-next/issues/12 . Looks like there is no easy way to do it. And to do it correclty it will require a lot of effort and architecture changes. Don't thing we can allow large architecture changes in version 1.0x of engine...

igorko avatar Nov 08 '18 15:11 igorko

I am not a programmer so I do not know if this is any easier, but instead of full blown multiplayer, how about a 'social feature' whereby players can upload their character's stats/gear/skills, allowing other players to then 'summon' that character as an AI companion? (For the sake of balance, let's say players can only summon characters a couple levels above or below their own.)

It would go a long way to create a sense of community even without real-time multiplayer. Another benefit of this is that people would only see the pool of players getting larger and never shrinking.

ate088 avatar Nov 18 '18 02:11 ate088

Or just an in-game IRC chat client implement with a sharable stash or something. That could be a first step.

Simon-Charest avatar Nov 18 '18 04:11 Simon-Charest

If talking about full multiplayer, how do you see playing campaign in network mode? I am not a fan of multiplayer games so have no idea how it should be. What should be synced and what not. I could make a draft for game changes, but first of all I should know what functionality should be added.

igorko avatar Nov 19 '18 11:11 igorko

Personally, I would add the same features as Diablo 1, plus a sharable stash : players would see each other, be able to fight along side, share items, chat, host a game, join a game, the game could reset everytime it is launched as long as the quest flags remain individual / saved on the client-side, etc. PVP is a plus but wouldn't need to be implemented at first.

So it is more of a matter of splitting the code between client and server so that the game in sync'ed between players (1 hosting and the rest being clients).

Simon-Charest avatar Nov 19 '18 13:11 Simon-Charest

I do not remember how Diablo 1 multiplayer works. Give clarifications. E.g. if item is dropped, how much players can take them (for me more than one sounds illogical. Players should fight for item?..). How two players shouild finish the same quest if they are on the same location if quest depends on taking/giving items. We already have sharable stash, you want to share items between players? Sounds illogical too...

igorko avatar Nov 20 '18 09:11 igorko

I never played Diablo 1 but Diablo 2.

  • one player have to provide the game host and others can join (I can't remember what happens if the host lost connection, I guess the game is pausing)
  • If a player joined a multiplayer game the monsters become stronger (no idea if more HP or increasing the amount of monsters)
  • quest items are available for every party member if it drops by monsters or chest (because it should be possible to complete the story if someone leaves the game)
  • every player can collect quest items just one time (if player 1 own a quest item which has been dropped by player 2 it is not possible that player 1 can pick it up)
  • every non-quest items which drop by a monster, a chest or other party members are only available one time. Such items can be pick up only by one player. (it is a general rule for every item except quest items)
  • I'm not sure but I remember that the common stash is player related and not shared with other party members
  • it is possible to kill a monster together with other players. Every attack has to be sync to all players

nitramr avatar Dec 28 '18 11:12 nitramr

Guys, if you want to play Diablo, just do it. If you want to have multiplayer in Flare just think about how you see it, an not just say "hey devs, make in the same way as it was in Diablo, and after that we will bother you again to change something if we don't like it"

igorko avatar Dec 28 '18 14:12 igorko

I don't see any logic in allowing to do the same quest by few players on the same screen. For me it looks stupid when players are standing in "queue" to NPC to speak with him, report quest status, etc. Maybe in Diablo1,2 (if it was so) it was the only way to implement multiplayer, but nowadays this architecture decision is imho outdated. I don't play multiplayer games but I think game industry found some more elegant way for such things.

igorko avatar Dec 28 '18 14:12 igorko

Also note that Flare was not planned as MMORPG. so I don't think we should think about multiplayer as Massive Multiplayer.

igorko avatar Dec 28 '18 14:12 igorko

Question for everyone: What are your thoughts on local (split-screen) multiplayer? Networked multiplayer includes a lot of big problems to solve:

  • Verifying that the game data is the same for all players
  • Connecting players (e.g. p2p vs single server)
  • Making the game state suitable to be synced over a network

Split-screen multiplayer would avoid these issues. The new issue that would arise would be fitting the UI into the smaller screen real estate.

Maybe everything would be controlled by player 1, with the other player(s) acting as controllable minions.

dorkster avatar Dec 28 '18 17:12 dorkster

Hi @igorko, Diablo is a classic game and one of the first successful games for hack and slay. So it's normal for people to refer to it. Flare should not be a Diablo clone, it should be something else, something better. Do not get me wrong, my list is not a list of multiplayer features in Flare. It's just a list of how it works in Diablo 2. Sometimes it's a good idea to review the existing game mechanics as they have already been developed. I also disagree with some mechanics in Diablo because some of the features are more than 17 years old and are out of date.

I don't see any logic in allowing to do the same quest by few players on the same screen. For me it looks stupid when players are standing in "queue" to NPC to speak with him, report quest status, etc.

Another idea might be that each player take an individual sub quest of a common quest. e.g. Each player must find a single item on a map or kill a monster. So everyone do something individual, but for a common goal.

@dorkster I can imagine it works great for consoles where each player has their own controller, but I think it's not nice on a PC where you have to share a keyboard and a mouse.

nitramr avatar Dec 29 '18 00:12 nitramr

@dorkster how about remaking game loop as starting point. We could post keyboard and mouse usage "events" to separate queue and process them separatelly from current "logic()" functions. This will allow us to trigger avatar actions from other then IO source.

igorko avatar Aug 21 '19 09:08 igorko

@igorko I think that's reasonable. Abstracting the controls from the physical I/O in such a manner would also open up some other possibilities. For example:

  • AI controlled player / machine learning
  • Recorded game play in the form of Quake-style "demos"
  • Attaching the event queue to any entity. Could be useful for testing enemy abilities, but would require unification of all entity types.

dorkster avatar Aug 21 '19 13:08 dorkster

Our InputSate works on per-frame basis and watches for any change in input every moment, right? But we need to transform it into commands, which are dedictated to separate entity. We could leave menus and hud as is, but I think it is impossible to use both object commands and primitive input changes. Probably new inputstate should know all about current Game State and produce commands, which are dediacated to separate object (like "Move Avatar" or "Close MenuTalker"). Next step will be putting such commands to Queue like Push(Object, Method, Data).

igorko avatar Aug 22 '19 12:08 igorko

+1 for this!

lokize avatar Aug 05 '20 19:08 lokize

i was going to tell my LAN party friends to try this, but no multiplayer means we can't play this, unfortunately, when is this feature due?

dataf3l avatar Jun 16 '23 05:06 dataf3l

Actually there are so many hard works to do. Especially in architecture.

But if the flare game would never implement the multiple users feature, it's a pity.

ndkk avatar Jun 16 '23 08:06 ndkk