[Kde-games-devel] Re: Incomplete Information and KGame

Andreas Beckermann kde-games-devel@mail.kde.org
Mon, 17 Feb 2003 04:32:23 +0100


On Monday 17 February 2003 04:08, Neil Stevens wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Sunday February 16, 2003 07:00, Andreas Beckermann wrote:
> > For this you need to use the KGameProperty in PolicyLocal mode (meaning:
> > do not send out messages when the property changes - it behaves like a
> > normal variable except that it gets saved automatically when the game is
> > saved). Now you can modify this property on every client separately, so
> > that every client knows about those variables that the player owns/knows
> > only.
>
> Can't use that because I need the server to tell the player what the data
> is.

You *have* to use it when you don't want your data to be transmitted to other 
players (or you use normal variables which I consider the same).

> > Of course you'd need to use a lot of network messages here...
> > You can (as Martin pointed out) send a message with a single player as
> > receiver. But still every player would receive this message and a hacked
> > client could read the message then. So you need a way to send messages
> > to a single client only, instead of broadcast messages.
> > Here you have two options:
> > 1. Tell me that it is important and I'll see if I can do something.
> > KGameNetwork::sendSystemMessage() would need to be modified to recognize
> > the receiver parameter.
>
> It's important!  Without the ability to hide information, KGame will never
> be practical for a lot of multiplayer network games, because it will be
> too easy to cheat.  Only games like Chess with complete information will
> be possible.

Well - for most games it is more important how much data is transferred, than 
to try to make cheating impossible (doing this is imho too hard for open 
source games - you can always cheat).
Well on a simple 50x50 map of a strategy game with fog of war you'd have to 
hide basically everything from the player and transmit nearly every cell of 
the map over network when a player moves a unit. For every player. This is 
basically impossible (we did not yet speak about the units themselves).

And also this is one of the central point of KGame - every client knows all 
data of the game. So if one of the client is broken it can be replaced 
easily, e.g. by a computer player. Also we can easily save the game and 
continue later.

> > 2. Use KGame::messageClient(), which returns a pointer to the internal
> > KMessageClient. Burkhard Lehner did an excellent documentation for these
> > classes, so you should have a look :)
>
> OK, I'll look at that, and come back if I have more questions on how to use
> it. :-)

Ok

> Thank you!
>
> - --
> Neil Stevens - neil@qualityassistant.com

CU
Andi