I don't have time for in-depth analysis aty the moment, but here are
some quick clarifications


On 12 September 2011 17:23, Sveinung Kvilhaugsvik
<sveinun...@users.sourceforge.net> wrote:
> (I noticed that modders using Lua
> is advised to use Freeciv's random number generator to make games
> repeatable.

 Every call to fc_rand(), even ones from which result is not used to
anything game state changing) changes state of random number
generator, so later calls will generate different numbers than without
such call. Also, if random number *is* used for game state changing
decision, it obviously needs to be generated with repeatable method to
get repeatable result.
 With same random seed, same settings, and same human player actions
you will always get the same game.

> An advantage of connecting to the AI-interface is, as far as I
> understand, that Freeciv knows it's an AI.

 Well, it sort of not know anything. AI-Interface has just callback
functions to be called in case of certain events. AI code is then
itself responsbiel to dig all the information it needs from global
(server-binary-wide) data structures. This also means that
AI-Interface can do anything, AI-module can be coded to contain any
kind of cheats.
 Whether player is under AI-control is different, if somewhat
connected, matter. It's just boolean flag in player structure and
things like difficulty level. Requirements code has no connection with
AI-Interface at all, AI -requirements depends on just ai-status of the
player.

> The advantages of connecting as a client is that everything available
> to the client will be available to the AI as well, nothing less and
> nothing more.

  And to avoid possibility of custom-made cheating clients, goal is to
have client to know only exactly what human player should know. This
answers also to your question if client knows *why* something
happened, or only results: it knows only game state changes that human
player is allowed to see - not reasons for those. With Fog of War and
other features this is actually rather complicated, as server cannot
simply send all state changes to client, but it has to carefully
determine if player should have access to that information, or it's
implications (we cannot remove unit that player should not know ever
existing)
 Server side AI is omniscient.


 - ML

_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to