patchFreeciv - Patches: patch #3447, map_claim_base()

 
 
Show feedback again

patch #3447: map_claim_base()

Submitted by:  Marko Lindqvist <cazfi>
Submitted on:  Thu 26 Jul 2012 11:03:35 PM UTC  
 
Category: generalPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Planned Release: 2.5.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 21 Nov 2012 01:18:49 AM UTC, SVN revision 22019:

Rewrote base claiming that it happens in one central place, in new
map_claim_base() function.

See gna patch #3447

(Browse SVN revision 22019)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 18 Nov 2012 03:44:26 AM UTC, comment #3:

- Updated against current svn
- Rearranged code so that bases on the same tile are not claimed recursively, but only from outer iteration

(file #16778)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon 30 Jul 2012 09:04:32 PM UTC, comment #2:

This patch (transitional state it produces) has some chicken-and-egg design problems with territory claiming bases. Though the version I finally submitted avoided (in a hackish way - code recurses more than it needs to, but changes between rounds make it to avoid infinite recursion) most obvious problems, I now think that it doesn't work correctly when tile has multiple bases. When the recursion causes other bases to change owner, tile is already owned by new owner and as tile owner is in this transtional phase used as base owner, new owner is considered old base owner -> base is not cleared from real old owner, and as it seems like base is not changing hands at all, some base capturing stuff is skipped too.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri 27 Jul 2012 01:32:40 AM UTC, comment #1:

This sounds a lot like what I was thinking of in bug #16385 (but I never got further than design).

> - All bases in a tile have same owner (which can be "nobody")

That's clearly what I was thinking before, but I don't think I'd thought about what happens if B's Engineer builds a new ownable base on a tile which already has A's ownable base of a different kind.

> - Can bases have no owner even if tile has owner (in a
> scenario with preset unowned bases)
> - If both tile and bases have owner, can bases be owned by
> player other than tile owner (unit walking to base claims base
> even if not territory)

For the latter, I convinced myself that base and tile should have separate owners (after originally thinking the opposite) -- see ticket.
I think that implies that the answer to the first question is yes.

Jacob Nevins <jtn>
Project Administrator
Thu 26 Jul 2012 11:03:35 PM UTC, original submission:

Attached WIP patch moves base ownership changes to central function of their own, map_claim_base().

This is going to be first one in series of base ownership patches. Goal of the series is to separate base ownership from border ownership. Primary reason is fixing problems related to vision providing bases (buoy).

My current plan:
- All bases in a tile have same owner (which can be "nobody")
- Bases on a tile can be owned even when tile is not (buoy can work on unowned territory)

I'm not certain about other border ownership and base ownership interactions.
- Can bases have no owner even if tile has owner (in a scenario with preset unowned bases)
- If both tile and bases have owner, can bases be owned by player other than tile owner (unit walking to base claims base even if not territory)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #16778:  ClaimBase-2.patch added by cazfi (9kB - text/x-diff)
file #16204:  ClaimBase.patch added by cazfi (9kB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jtn (Posted a comment)
  • -unavailable- added by cazfi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 21 Nov 2012 01:19:03 AM UTCcazfiStatusReady For Test=>Done
      Assigned toNone=>cazfi
      Open/ClosedOpen=>Closed
    Sun 18 Nov 2012 03:44:26 AM UTCcazfiAttached File-=>Added ClaimBase-2.patch, #16778
      StatusIn Progress=>Ready For Test
    Thu 26 Jul 2012 11:03:35 PM UTCcazfiAttached File-=>Added ClaimBase.patch, #16204
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup