forum.webdiplomacy.net

webDip dev coordination forum / public access todo list
It is currently Mon Nov 20, 2017 12:04 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sat Mar 27, 2010 6:34 pm 
Offline

Joined: Wed Jul 29, 2009 10:22 am
Posts: 841
Hi.
Can someone explain me why there are 2 tables with almost identical values in the new code?
I'm currently writing a graphical frontend for the border-generation, and I would like to know when to change what border.
I already know the basics from my variant-creations, but I'd like to have a better understanding because my program might mess with the database...

Some Questions:
If I have a child-coast I just alter the wD_coastalborder, if I have a parent I change only the wD_border table?
And If I generate some output it doesn't matter what table to change, because everything is handled by the addBorder function in install.php?

Oliver


Top
 Profile  
 
PostPosted: Mon Mar 29, 2010 3:30 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
The variant installer should automatically take care of the difference between the two border types. Basically coastal borders do link to coastal child territories, whereas regular borders don't

e.g. When doing a move order or build fleet order you want to be able to move a fleet to a coastal sub-territory, but when doing a support hold order you dont care about coastal sub-territories, and only want to know about the main parent territories

The reason this distinction is tricky and important is because coastal parent territories (with North/South coasts) are actually 3 territories which behave as one, but a unit can only occupy one of them (the parent territory)


This is really messy, and I have developed a way to get rid of these nasty distinctions between different types of border and territory, but it'll be quite a while before I can implement it

See http://webdiplomacy.net/doc/coasts.txt and http://webdiplomacy.net/doc/gotchas.txt for some information on how coasts are handled in webDip


Top
 Profile  
 
PostPosted: Tue Mar 30, 2010 3:34 pm 
Offline

Joined: Wed Oct 08, 2008 12:47 pm
Posts: 726
How will the new code work then?
I must admit this was a puzzle for me in the past, but unlike Sleep I didn't have the drive to question it & just accepted :P


Top
 Profile  
 
PostPosted: Wed Mar 31, 2010 7:22 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
The plan is to add positions to the map datastructure, so positions link to other positions rather than territories linking to territories, and units link to positions rather than territories.
You have at least one army position and one fleet position for each territory, and instead of borders having armyPass&fleetPass flags army positions only link to army positions and fleet positions only link to fleet positions

Doing it that way no special rules need to be made for coasts, they're just territories with two fleet positions, and it also makes borders simpler because there either is a border between two positions or there isn't, no need to know if it's a coastal border or which unit types can move across it

That's the idea anyway, but if I do decide to switch that around it'll be in a long time


Top
 Profile  
 
PostPosted: Wed Mar 31, 2010 10:33 am 
Offline

Joined: Wed Oct 08, 2008 12:47 pm
Posts: 726
Hmm, I can see the use, although it seems like a lot of work for a minor improvement.
Still, all improvements are good improvements.


Top
 Profile  
 
PostPosted: Fri Apr 02, 2010 7:00 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
Yup I'm not sure about making the change, whether it would save time overall is a gamble, but there's no doubt that the more work goes into variants and updating the JS order generation without it the more time will be wasted fitting new code into the current messy structure and the harder it'll be to change it later :(

Much like the 0.8 change from the occupations to terrstatus table structure sometimes you need to go a step backwards to take two steps forwards


Top
 Profile  
 
PostPosted: Sun Apr 11, 2010 12:11 pm 
Offline

Joined: Wed Oct 08, 2008 12:47 pm
Posts: 726
Fair enough. Well good luck deciding!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 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