forum.webdiplomacy.net

webDip dev coordination forum / public access todo list
It is currently Thu Aug 17, 2017 9:23 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Impeded movement
PostPosted: Thu May 01, 2014 9:31 am 
Offline

Joined: Sat Jun 13, 2009 1:21 pm
Posts: 16
Esteemed developers and code enthusiasts!

Does the current code base allow for provinces that are more difficult to enter and move through than regular provinces?

I've been thinking about a variant that might include terrain that would require support to enter even if it were unoccupied. These might include swamps, high mountains, glaciers et cetera.

Are there perhaps variants that implement something like this?

Thanks,
gjdip


Top
 Profile  
 
 Post subject: Re: Impeded movement
PostPosted: Thu May 01, 2014 1:26 pm 
Offline

Joined: Tue Nov 15, 2011 2:54 pm
Posts: 44
Hi gjdip,

I can't remember a variant, that implements something like this. But theoretically it should be possible.

The easiest way I could imagine at the moment would be to add a neutral player like it is done in some other variants. During the game this player do not have any units. But when it comes to the adjudication of the diplomacy or retreat phases 'imaginary' units are added in all difficult terrain territories that are not occupied. So the moves into these territories are only successful if they have at least one supporter to disband the occupying neutral unit. After the adjudication all neutral units are removed from the database again, so the players only see the empty territory.

If you are somehow familiar with the webDip code you should be able to find the classes and functions that have to be extended. It's probably enough to extend adjudicatorDiplomacy (gamemaster/adjudicator/diplomacy.php) for the diplomacy phase this way (not tested!):
Code:
class xyVariant_adjudicatorDiplomacy extends adjudicatorDiplomacy
{
   function adjudicate()
   {
      //check if difficult terrain territories are unoccupied (via SQL, wD_moves)
      //add a neutral units in all unoccupied difficult terrain territories (update wD_moves)
      
      $standoffs = parent::adjudicate();

      //remove all neutral units from wD_moves

      return $standoffs:
   }
}


Top
 Profile  
 
 Post subject: Re: Impeded movement
PostPosted: Fri May 02, 2014 9:08 am 
Offline

Joined: Sat Jun 13, 2009 1:21 pm
Posts: 16
Thanks for your help, tobi1. I am completely inexperienced when it comes to webDip code but at least it seems like this is possible.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group