Game Development Community

Same scripts for both single player and multiplayer

by Jerrod Putman · in Torque Game Builder · 11/28/2007 (1:37 pm) · 1 replies

So I've just recently started messing around with the networking aspects of TGB. As one of the projects I'm working on is in the turn-based strategy genre, the checkers tutorial has basically everything I need. However, there's one thing that isn't covered in the tutorial.

I'd like to be able to have the same scripts (at least the client scripts) useable for the single player version of the game. I was wondering if anyone had any experience doing this, and if you had any pointers of where to start or things to keep in mind. I was thinking that the game could start normally, but instead of creating an actual network server, a virtual server is instead created, along with a virtual client (for the AI player), and then the scripts would "just work" like they would in multiplayer.

Any help would be greatly appreciated.

#1
12/15/2007 (3:50 am)
You can have the single player code the same as the multiplayer code. There is no problem. You must only turn off a possibility to connect other people to the single player game. And you don't need to create a virtual client for AI, you can program the AI player directly to the server code.