Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Multiplayer [mostly for devs]  (Read 4980 times)

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Multiplayer [mostly for devs]
« on: June 13, 2014, 06:26:32 am »

So i was working (on/and off) for quite a while on getting multiplayer to df. Now i have semi-working framework for that, so i want to share with potential programmers that want to help. So here goes: branch of dfhack

General architecture
Idea is to develop various ways of multiplayer. Some could even work in parallel. What i mean by that? Well server would broadcast what "modules" are supported, then if client has that module it could use it's functionality. To give more concrete example: server can allow to "look" at world, i.e. client can request a region of df (x1,x2,y1,y2,z). How this functionality is used is up to the client. Client can make a simple observer program or combined with e.g. module that allows to control individual dwarf, maybe some dwarf possesion thing.
Modules
So far there is only one working module. And can be improved. It's called "mod_control_view". It allows client to ask for general window into df.
Few other ideas of modules:
  • Inspect: gives info about <X> where it can be a position (tile type+ items+units in tile) or unit (by id, and then  returns some info about it)
  • UnitControl: some way of controling unit. This needs research- what can we do to units from lua side? what works, what does not? and so on
  • DesignationControl: a way of marking dig/chop tree, etc... designations. Could include building designations
I started working on "UnitControl" module.
Server
Server is actually very self contained and if nobody wants to make gui or needs many features it can be left as it is (though i'll probably add a way for modules to receive ticks)
Client
A client is two part: base and view. Base is network stuff and bare minimum for client to connect + module logic. View is a gui with logic to use those modules. Other types of clients will have other guis and views.


So what are your ideas and thoughts? I'm hoping to do some more work over the weekend and maybe releasing a client (server needs full dfhack rebuild) to play around. I'll post updates here, maybe a tutorial how to create a module.

Edit: some more links: Most of code is in lua some of it is in offscreen module that allows to draw stuff that is not on game screen. There is also my (crappy) socket implementation in lua and a syntax nice-ifyer
« Last Edit: June 13, 2014, 06:30:25 am by Warmist »
Logged

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Multiplayer [mostly for devs]
« Reply #1 on: June 13, 2014, 08:33:45 am »

Having your own map renderer is very cool, huge job I believe.
But does this mean that everything apart from the map (controls for designations, buildings, etc.) will have to be reimplemented on client? And other screens as well?

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Multiplayer [mostly for devs]
« Reply #2 on: June 13, 2014, 11:42:45 am »

Having your own map renderer is very cool, huge job I believe.
But does this mean that everything apart from the map (controls for designations, buildings, etc.) will have to be reimplemented on client? And other screens as well?
Only if we want classic df. But we are not really constrained by it...

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Multiplayer [mostly for devs]
« Reply #3 on: June 17, 2014, 01:48:14 pm »

So a little update:
Refactored modules, now they are easier to use. Also implemented dwarf_watch module: client can ask for unit and the view autofollows it. Also added chat.
I would say this looks quite simple: here though i would like for it not to repeat player so much...

Nopenope

  • Bay Watcher
    • View Profile
Re: Multiplayer [mostly for devs]
« Reply #4 on: December 02, 2014, 06:59:37 pm »

Only if we want classic df. But we are not really constrained by it...
What exactly did you have in mind?
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Multiplayer [mostly for devs]
« Reply #5 on: December 03, 2014, 01:27:45 am »

Only if we want classic df. But we are not really constrained by it...
What exactly did you have in mind?
Well the idea is: because re implementing every control is boring, so why not invent new modes of play? e.g my favorite idea is one player (server) is playing normal df while others are controlling individual dwarves as adv-mode.
Or adv-mode where everone is controlling companions. Or limited control on dwarf mode (e.g. only digging designations) could work as "advisor mode". As more controls are implemented more advisors could play at the same time. And so on...
What i'm saying is that there is no need to be limited by what is, and think about what could be done.

Sergarr

  • Bay Watcher
  • (9) airheaded baka (9)
    • View Profile
Re: Multiplayer [mostly for devs]
« Reply #6 on: December 03, 2014, 12:10:41 pm »

Except adventure-mode is turn-based and fortress-mode is real-time.

I see the problem in trying to run both these modes simultaneously.
Logged
._.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Multiplayer [mostly for devs]
« Reply #7 on: December 03, 2014, 04:04:54 pm »

Except adventure-mode is turn-based and fortress-mode is real-time.

I see the problem in trying to run both these modes simultaneously.
Well yeah, but we run into that anyway. My idea is something like Fallout tactics. Or just have ticks run by. There might be some fudging so that PC dwarves would not die from hunger (due to control-slowness) but imho the non-planned epicness would outweigh the drawbacks. Imagine a community fort where you can act out your dwarf!

Severedicks

  • Bay Watcher
    • View Profile
Re: Multiplayer [mostly for devs]
« Reply #8 on: December 04, 2014, 08:54:18 am »

Will mifki's protocol for game controls reimplementation be of any use?
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Multiplayer [mostly for devs]
« Reply #9 on: December 04, 2014, 09:35:31 am »

Will mifki's protocol for game controls reimplementation be of any use?
Maybe, but unlikely. It depends on how he's doing it. It might be useful for when we will be able to draw stuff correctly. If he is manually reimplementing e.g.  all the shop gui than it could be used to show different guis for multiplayer users.

Hmm... maybe even simple render each player a different frame (jumping from one location to other) if you draw custom controls would be possible (without any more complicated hacks).

Askot Bokbondeler

  • Bay Watcher
  • please line up orderly
    • View Profile
Re: Multiplayer [mostly for devs]
« Reply #10 on: December 16, 2014, 05:13:56 am »

ptw. this would be the geatest thing

Polemicist

  • Bay Watcher
    • View Profile
Re: Multiplayer [mostly for devs]
« Reply #11 on: December 20, 2014, 06:11:35 pm »

you're my hero. this should be a thing.
Logged

Insanegame27

  • Bay Watcher
  • Now versio- I mean, age 18. Honestly not an AI.
    • View Profile
    • Steam ID
Re: Multiplayer [mostly for devs]
« Reply #12 on: December 21, 2014, 09:58:03 pm »

One problem... Combat.
From what I hear one player controls the fort while other players act out adv mode in the same space. If we just run over ticks then that would mean you would be slaughtered in combat if the fort controllers running at ~60fps then that means that in 1v1 combat, the enemy would hit you about 60 times using a sword and fastattacking
Logged
Power/metagaming RL since Birth/Born to do it.
Quote from: Second Amendment
A militia cannot function properly without arms, therefore the right of the people to keep and bear Arms, shall not be infringed.
The military cannot function without tanks and warplanes, therefore the right of the people to keep and bear tanks and warplanes, shall not be infringed.
The military cannot function without ICBMs, therefore the right of the people to keep and bear ICBMs, shall not be infringed.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Multiplayer [mostly for devs]
« Reply #13 on: December 21, 2014, 10:57:41 pm »

10 times a second. It takes 6 ticks to attack with most attacks.

Insanegame27

  • Bay Watcher
  • Now versio- I mean, age 18. Honestly not an AI.
    • View Profile
    • Steam ID
Re: Multiplayer [mostly for devs]
« Reply #14 on: December 22, 2014, 03:31:12 pm »

my bad, thanks putnam.

one workaround would be a 'combat mode' triggered by the fortress controller which would be something like a 'action, clonfirm, wait for everyone else'
urist 1 makes an attack and waits while the  other urists select their attacks. game advances ticks until all attacks are done
Logged
Power/metagaming RL since Birth/Born to do it.
Quote from: Second Amendment
A militia cannot function properly without arms, therefore the right of the people to keep and bear Arms, shall not be infringed.
The military cannot function without tanks and warplanes, therefore the right of the people to keep and bear tanks and warplanes, shall not be infringed.
The military cannot function without ICBMs, therefore the right of the people to keep and bear ICBMs, shall not be infringed.
Pages: [1] 2