Game Development Community

A server-side commander map?

by Daniel Buckmaster · in Torque Game Engine · 10/08/2008 (12:30 pm) · 2 replies

I've checked some commander map resources on the site, and noticed that they all sem to have a common problem - they're client-side, so if you want Players and stuff to show up, you can only see objects that have been ghosted. Which sort of defies the purpose of a commander map.
I'm guessing the solution here is not to simply ghost everything. The map should be processed on the server, and the client should then recieve an update of the map's status. This update could include the coordinates of all points of interest on the map, or whatever other changes you want to make.
This sort of thing goes hand-in-hand with a Tribes-style radar network. Enemy units within radar range would be visible on the map, but not those out of range.
My question is, how should I start going about implementing this? What class should I derive from? I've never worked with GUI coding, so I guess that will need to be worked into it. Although it might be nicer to not have a gui, but to render an overhead view of the terrain instead (like some resources already do), to allow different effects, like satellite images as opposed to static maps.

About the author

Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!


#1
10/08/2008 (1:20 pm)
I think you can set objects to be ghost-always for a particular client, no ?
yah, scopeToClient().

so something like might work

function Player::onAdd(%this)
{
   if (isObject($gTheCommandersSpecialClient))
      %this.scopeToClient($gTheCommandersSpecialClient);
}

function setTheSpecialCommanderClient(%client)
{
   if (isObject($gTheCommandersSpecialClient))
   {
      for all player objects()
      {
         %player.clearScopeToClient($gTheCommandersSpecialClient);
      }
   }

   $gTheCommandersSpecialClient = %client;

   if (isObject($gTheCommandersSpecialClient))
   {
      for all player objects()
      {
         %player.scopeToClient($gTheCommandersSpecialClient);
      }
   }
}
#2
10/09/2008 (9:45 am)
The thing is, it's not necessary to ghose the whole player. Plus, I'm figuring on having a LOT of players per level, most of them AI. I assume it would be quite inefficient to scope a hundred AIPlayers if all you need to know is their positions.