Difference between revisions of "Talk:Code structure"

From VCMI Project Wiki
Jump to: navigation, search
(Purpose of lib: new section)
Line 6: Line 6:
  
 
--[[User:Tow dragon|Tow dragon]] 09:58, 2 May 2010 (UTC)
 
--[[User:Tow dragon|Tow dragon]] 09:58, 2 May 2010 (UTC)
 +
 +
== Purpose of lib ==
 +
 +
In adventure map objects, however, things look a little bit different. All decisions and mechanics are described in ObjectHandler.cpp (hence its name), the server passively processes the requests and updates game state (hero stats, bonuses, object owners, player resources etc). It may be resonable to precise the role of each of these modules so that further implementation of scripts would be more consistent and predictable.

Revision as of 19:21, 24 May 2010

A comments about additions to lib sections:

  • handling general game mechanics and related actions

I think this statement makes the difference between server and lib in handling mechanics less clear. 'Server' is responsible for responding to any actions clients want to take, while lib just performs appropriate changes. Lib doesn't handle game mechanics in the meaning I understand it. When for example player wants to attack an enemy stack during a battle, clients asks server "I want this stack to attack that one". Server checks if it is allowed and calculates all necessary parameters of that action and tells the lib "Stack A moves to position B and attacks stack C dealing D damage. Stack C retaliates to stack A dealing E damage. Stack A dies.". Lib just updates gamestates of server and client to match these changes.

--Tow dragon 09:58, 2 May 2010 (UTC)

Purpose of lib

In adventure map objects, however, things look a little bit different. All decisions and mechanics are described in ObjectHandler.cpp (hence its name), the server passively processes the requests and updates game state (hero stats, bonuses, object owners, player resources etc). It may be resonable to precise the role of each of these modules so that further implementation of scripts would be more consistent and predictable.