Multiplayer

362 views
Skip to first unread message

Darrell Blake

unread,
Nov 15, 2012, 6:02:18 AM11/15/12
to corsix...@googlegroups.com
Right, after mahoosive crunch and a bit of a rest the project has shipped and I'm ready to get cracking with the multiplayer stuff. I thought it best to create a discussion so we could have a discussion about what we want to do (coding design decisions, design of the game modes etc.)

First of all, has anyone ever played the original Theme Hospital in multiplayer? I presume the first task will be to replicate this before extending the feature and adding game modes. I believe the original was IPX based so it'll be a bit of a bugger to test these days. I think first of all I'll get VMs or a TCP/IP - IPX tunneling system running so I can play the original multiplayer and see how it works.

After getting an idea for how the original worked I'll start writing the network library for the game. My first question in this area though is: do we currently have a threading system? I'd like to thread the connection and have separate threads for incoming and outgoing packets, unless anyone has any major objections? I don't mind keeping it all on the main thread if I have to but I'd rather do it properly ;) I could use SDL_threads too but I'm of the ilk who likes to do things manually so I'd probably rather write a threading library for us too. What do you think?

Another question I have is, how will we integrate the networking into the Lua stuff? I'm not particularly au fait with how we do the scripting (well, I'm not particularly au fait with how we do anything!). I presume we will just write some script natives to hook into the networking? Actually, this part worries me a bit as, depending on how the game has been scripted, we might have to do a bit of refactoring to get it to play nice with the networking. I suppose we'll just cross that bridge when we come to it.

Anyway, I think that's enough for now :) I'll be popping on to IRC later (I'm probably logged in now actually, but I'm at work) if you have any questions or anything, though we should probably try a keep most of the discussion in this thread. I'm redneon, for those who don't know.

Last but not least, in true shameless plug fashion: GO OUT AND BUY SONIC & ALL-STARS RACING TRANSFORMED, OUT TOMORROW! ;)

Darrell

MarkL

unread,
Nov 15, 2012, 7:51:45 AM11/15/12
to CorsixTH Development
I have updated ProgrammingIdeas to show that work on this has started
and provided a link from there to here

MarkL

unread,
Nov 15, 2012, 8:57:36 AM11/15/12
to CorsixTH Development
I was never able to play multiplayer with TH as I never knew anyone
else with the game. I can though make some assumptions by looking at
the available maps and adviser strings. I also have some questions as
follows.
AI’s: This is the one we are all familiar with, you never see their
hospitals and they could never win or lose. They could be better or
worse than you in some ways (the number of cured, the amount of
income, the value of hospitals etc), from looking in the SAM files it
looks like there was some algorithm that determined their strengths
and weakness and thus how well they played.
Network game: I assume that this was for four player’s, could you play
with less than this? Was this the same as AI’s? Could you see their
hospitals or were they just names in the progress reports? Were
there two modes of play, one with a shared plot of land and another
where you competed against others, but you never saw their hospital?
From the strings it looks like there were mini challenges, was this
another option for playing or the only one?
Modem mode: by the very nature of this method you could only have
played against one other person (unless there is something about
modems I have forgotten about!). There are some maps that look like
they were shared as there was more than one helipad. Some had more
than two, so perhaps one multiplayer mode was on a shared plot. This
may be where the auctions came in.
Does this mean for emergencies you are offered your own or was it the
quickest to accept that got the emergency? Was this the same with
VIP’s, the quickest to send an invite got the visit?
There were bombs you could place in other player’s hospitals, as they
would spread litter after they exploded. You could send patients that
were close to death to other hospitals, you can do this in single
player mode too.
Hopefully there will be someone that has played all these modes and
can fill in the gaps for us.
> > Darrell- Hide quoted text -
>
> - Show quoted text -

Stephen E. Baker

unread,
Nov 15, 2012, 9:46:32 AM11/15/12
to corsix...@googlegroups.com
Had replied via email, but it's been an hour, so I'm going to assume it's lost.  (Sorry for the double post if it comes back):

I've played the original multiplayer. Dosbox supports ipx emulation so it's not too bad for testing, though there is no lag correction of any kind so over the internet the game plays horribly slow - best if you have two systems locally.

So basically when you play multiplayer, you select one of the multiplayer campaign maps, then each player is given one parcel of hospital.  Every time you try to buy another hospital parcel it goes to auction.  You can see what's happening in other player's parcels but you generally can't affect them, except through the use of 'litter bombs', which show up in the purchase menu along with bins and plants.  A litter bomb will cover a small area in garbage.  When one player refuses an emergency it cycles to the next player and so on, if no one accepts the emergency it keeps cycling.  Every few months there is a new criteria to stay in the game (buy a parcel of land, treat x patients, etc.) which get progressively harder.  The last player to remain in the game wins.

It's really a lot of fun, I suggest trying it out.

Lego3

unread,
Nov 15, 2012, 10:04:26 AM11/15/12
to corsix...@googlegroups.com
I guess mine have been lost too then...

Here is my first reply to Darrell:

Great! I wrote a quick guide for TH'97 multiplayer here a while ago: http://code.google.com/p/corsix-th/wiki/MultiplayerTH

I would really like to try it out with you.

When it comes to Lua there a few things we will need to change, yes. There are comments here and there that it won't work in multiplayer. The main question is which type of structure we want. For example, should the hosting player "own the world", and the other players then poll that world from their own "hospital" (the Lua entities world and hospital) and ask if they can build a room here and there? That could manifest itself in that the "world" object is not real, it just relays the commands to the host.
Or do we believe in our players and let it be a peer system (to lower latency) where information is just copied across the network? It would be a possibility since you still just manage your own hospital (if we just mimic the original that is!), there are very few critical player interactions.

The first step would be to be able to connect to each other at all, for example a lobby, chat, possibly some master server? There you have free hands how you want to do it.

/Edvin







And then my second reply - to Marks first post:

You could play two or three too. You played on the same map (this is what the NETXX.SAM levels are for) so you could see what the other players did and also sabotage with e.g. litter bombs. Each time you want to buy a plot of land there is an auction for all players to bid on it. Each time a mini challenge occurs the one who comes last is defeated, so you only play until there have been three mini challenges, then there is a winner. If I remember correctly the one who responds to an emergency first gets it. We should simply play and check it out!

/Edvin

Darrell Blake

unread,
Nov 15, 2012, 10:21:35 AM11/15/12
to corsix...@googlegroups.com
Cool. I'll get DOSBox set up and we should try a game over the net and see how it fairs.

I'm happy to go with either peer to peer or client/server but as both will require completely different game-side networking we'll have to pick one and stick with it. I have to admit, I have a bias towards p2p as that's what I work with mainly in the industry and it balances the strain across all peers as well as allowing easier host migration for drop-outs, etc. but again, I'm happy to go with client/server too. We should probably just go with the path of least resistance. If there's going to be a lot of arbitration and a requirement for things to happen in exactly the same order on each machine then it might be easier to go with client/server. Though we could still do it this way in p2p, we'd just have to implement a request system for the host.

Darrell

MarkL

unread,
Nov 15, 2012, 10:49:51 AM11/15/12
to CorsixTH Development
I'm up for testing TH, I'll check the link to see what I need to do
first. Weekends are good, but the best time might be over the
Christmas Holidays, question is how long do the games last? If they
are shortish due to the challenges then weekend is fine too.


On Nov 15, 3:21 pm, Darrell Blake <darrell.bl...@gmail.com> wrote:
> Cool. I'll get DOSBox set up and we should try a game over the net and see
> how it fairs.
>
> I'm happy to go with either peer to peer or client/server but as both will
> require completely different game-side networking we'll have to pick one
> and stick with it. I have to admit, I have a bias towards p2p as that's
> what I work with mainly in the industry and it balances the strain across
> all peers as well as allowing easier host migration for drop-outs, etc. but
> again, I'm happy to go with client/server too. We should probably just go
> with the path of least resistance. If there's going to be a lot of
> arbitration and a requirement for things to happen in exactly the same
> order on each machine then it might be easier to go with client/server.
> Though we could still do it this way in p2p, we'd just have to implement a
> request system for the host.
>
> Darrell
>
>
>
> On Thursday, 15 November 2012 15:04:26 UTC, Lego3 wrote:
>
> > I guess mine have been lost too then...
>
> > *Here is my first reply to Darrell:*
>
> > Great! I wrote a quick guide for TH'97 multiplayer here a while ago:
> >http://code.google.com/p/corsix-th/wiki/MultiplayerTH
>
> > I would really like to try it out with you.
>
> > When it comes to Lua there a few things we will need to change, yes. There
> > are comments here and there that it won't work in multiplayer. The main
> > question is which type of structure we want. For example, should the
> > hosting player "own the world", and the other players then poll that world
> > from their own "hospital" (the Lua entities world and hospital) and ask if
> > they can build a room here and there? That could manifest itself in that
> > the "world" object is not real, it just relays the commands to the host.
> > Or do we believe in our players and let it be a peer system (to lower
> > latency) where information is just copied across the network? It would be a
> > possibility since you still just manage your own hospital (if we just mimic
> > the original that is!), there are very few critical player interactions.
>
> > The first step would be to be able to connect to each other at all, for
> > example a lobby, chat, possibly some master server? There you have free
> > hands how you want to do it.
>
> > /Edvin
>
> > *And then my second reply - to Marks first post:*

Alan Woolley

unread,
Nov 15, 2012, 2:09:37 PM11/15/12
to corsix...@googlegroups.com
I assume you're familiar with the SDL_net library? http://www.libsdl.org/projects/SDL_net/docs/index.html

Would it make sense to use this?

Darrell Blake

unread,
Nov 15, 2012, 2:20:21 PM11/15/12
to corsix...@googlegroups.com
Yeah, I'm familiar with SDL_Net. It's actually quite a nice thin abstraction layer and I have considered using it... I just like to do things myself, especially when they layer of abstraction is as thin as it is with BSD sockets. Still, I suppose I would just be re-inventing the wheel. I'll have a think about it :)

Darrell

Lego3

unread,
Nov 17, 2012, 3:11:18 PM11/17/12
to corsix...@googlegroups.com
Just testing to make a reply, Maarten's responses are deleted somehow.

Joe#

unread,
Nov 15, 2014, 11:53:53 AM11/15/14
to corsix...@googlegroups.com
I've created a Github issue now for implementing a LAN multiplayer system and multiplayer mode:
https://github.com/CorsixTH/CorsixTH/issues/386


On Thursday, 15 November 2012 11:02:18 UTC, Darrell Blake wrote:
Reply all
Reply to author
Forward
0 new messages