Game Development Community

T2D Turn Based MP

by Chris Labombard · in Torque Game Builder · 11/22/2005 (7:34 am) · 40 replies

I saw Matt's plan about his awesome multiplayer advancements in T2D but I can't find the actual code anywhere... or how to use it (if it's in the current build)

Could someone please point me at it? I'd really like to build a MP game this weekend.

About the author

I have been a professional game programmer for over 5 years now. I've worked on virtually every platform, dozens of games and released a few of my own games, including 2 iPhone titles and a title waiting release on Big Fish Games.

Page «Previous 1 2
#1
11/22/2005 (9:49 am)
I don't believe there is any new turn-based networking in the build. I too saw Matt's plan but that thread seems to have completely died.

How real-time do you need or want? If you want a game like hearts online, you already have everything you need from the engine. In most casual networked games, clients do not connect peer-to-peer. Instead, they use a web server as the proxy. Go rent yourself a $4.95US/month website with PHP. TorqueScript already has built in support to send and receive HTTP requests to servers, and have the PHP do the rest.

Unless you are trying to build the original Age of Empires or Warcraft II, you do not need a sophisticated network layer. Also, regardless of the level of net stack support you need, you can still build your game as a "hot-seat" turn-based game. For those without the history, in the the days before networks, people played turn-based games in turns at the same computer. The mode was called "hot-seat" because each player made his turn, then got out of the chair to the next player, leaving the seat "hot." While it may seem "way less sexy" to develop the hot seat version first, it's basically a pre-requisite. It's much easier to debug issues on a single machine without throwing in the whole complexity of the network.

Just my $0.02...
#2
11/22/2005 (9:53 am)
I have a site that's php enabled. I want to do it through commandtoserver and command toclient calls, like it's done in TGE.

I only want turn based multiplayer (a card game).

Matt's .plan said he had the gui's like TGE has set up and working (for LAN only) .. .

I want to get a connection set up like that so I can connect and start a game.
#3
11/22/2005 (9:57 am)
All I'm saying is, you could build commandToServer pretty easily, yourself, using only TorqueScript. You have all of the pieces. Look:

void HTTPObject::get(
    TransportAddress  addr,
    string  requestURI,
    [string query=NULL] ) 
 
void HTTPObject::post(
    TransportAddress  addr,
    string requestURI,
    string query,
    string post )

CommandToServer is Post, CommandToClient is Get. Have PHP pages on the other side that server the appropriate results.

(ed. Wow, it's hard to format code blocks to look nice.)
#4
11/22/2005 (10:01 am)
But why would I want to build my own php based middle man when the functionality I need is already built into T2D and working (see Matt's June 30th .plan) ?

Did Matt not release his code? Is it a part of 1.1 or something?
#5
11/22/2005 (10:09 am)
He did not release his code... and I've never heard about what he was doing as being "officially" part of 1.1. Melv has certainly never mentioned it.

Re: Why build a PHP middle man? Because if you really want to distribute your game, buying hosting of machines that support PHP is a lot cheaper than a dedicated Windows machine running your custom Torque exe. I re-read Matthew's plan and it looks clear that the implementation he's talking about requires a dedicated client-server network where all of the clients and the server are Torque engine based.

It's your call, but for the record, I would strongly encourage any user that is thinking of making a real, turn-based, play over the web game, to look at my suggestion and not wait for something that requires a Torque engine backend.
#6
11/22/2005 (10:14 am)
The implementation he has going on looks like the exact same thing TGE uses... I don't need a dedicated machine to run that. Why would I need a dedicated machine to run this?

I have no idea how I would even begin to set up the php scripts neccessary to run this. There has to be a simple solution.
#7
11/22/2005 (11:00 am)
I assisted GG in porting some of the TGE turn based code to T2D and configuring things to get it to work properly since a lot of it was trimmed or changed in T2D... turn based networking should be in the next release, including a chat room example I have completed :)

EDIT: Chris is right, I basically just got TGE turn based networking through commandToClient and commandToServer working properly in T2D
#8
11/22/2005 (11:03 am)
I mean no offence to anyone....

but I can find at least 5 references to people (mostly you Matt) saying you can do turn based multiplayer games now, including one reference on the T2D product pages.

Is that not true?

Is there any way you could package up the turn based code and send it to me Matt?
#9
11/22/2005 (11:05 am)
Presently you can use the TCP object to do turn based... Chris I cannot do that, the code/configuration belongs and is owned by GG... my best suggestion is wait until the "1.1 beta" release is out :) Once it is I (as well as other's familiar with it) can help you as much as you need (unless you are familiar with it yourself of course).
#10
11/22/2005 (11:21 am)
Oh, sorry, I thought it was yours.

Ok... I am definately going to need a leg up on this one. I have no idea where to begin.

What steps do I need to follow to get this to the point where I can send commands to server and client ?
#11
11/22/2005 (11:25 am)
I did the porting and configuring, though it was work done for GG, so they own the work... there's quite a bit that goes on behind the scenes, GarageGames is very dedicated in getting the work done using all resources available :)

The steps to get the commands working in T2D isn't massive, though it isn't exactly trivial though... If you really wanted to do it now I'd suggest comparing TGE networking code to T2D, prepare yourself for a headache and a good deal of hours though (especially if your not familiar to Torque networking code).
#12
11/22/2005 (11:38 am)
Would it be possible to decrease the work load by connecting directly using the ip of the computer Im trying to connet to, until 1.1 is available?
#13
11/22/2005 (11:40 am)
Hate to say it, but not really... the server query stuff really isn't much work at all to convert. The 1.1 beta is probably still your best bet.
#14
11/22/2005 (11:46 am)
I guess that's what I will do...

I don't want to sound like I'm bitching here... I just feel like I've been mislead into believeing turn based multiplayer code was usable.... when in fact it's not.
#15
11/22/2005 (11:52 am)
From what I understand you can use TCP to do turn based, in fact I think Harold has an example in one of these T2D forums... (I 'beleive')
#16
11/22/2005 (11:59 am)
I've been through the forums with a fine toothed comb and didn't see it.
#17
11/22/2005 (12:16 pm)
And just to be super clear, once again... the example Matt showed was client/server with both the client and the server being Torque engine based EXEs. If you are interested in building a casual turn-based, networked game like hearts on Yahoo! where you play with other people, you CANNOT use Torque as your server app. You are going to want to use something significantly lighter and more hostable like PHP, Java, ASP, or ASP.NET.

CommandToServer and CommandToClient as implemented in TGE are for dedicated servers running a Torque backend.
#18
11/22/2005 (12:25 pm)
Jason - Do you have a set up to do that ?

The php scripts and TScript code ?
#19
11/22/2005 (12:47 pm)
Quote:If you are interested in building a casual turn-based, networked game like hearts on Yahoo! where you play with other people, you CANNOT use Torque as your server app
What are you reasons behind this conclusion Jason?
#20
11/22/2005 (12:49 pm)
I thought Yahoo games had to be flash myself. But I am probably wrong and too lazy to actually check.
Page «Previous 1 2