bugFreeciv - Bugs: bug #20824, Problems in...

 
 
Show feedback again

bug #20824: Problems in server/generator/mapgen.c: part 1, balance in make_island() and create_island().

Submitted by:  Micke <mss_8734>
Submitted on:  Fri 17 May 2013 04:31:18 PM UTC  
 
Category: generalSeverity: 2 - Minor
Priority: 5 - NormalStatus: None
Assigned to: NoneOpen/Closed: Open
Release: 2.6, possibly older onesOperating System: Any
Planned Release: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Fri 17 May 2013 11:33:06 PM UTC, comment #3:

After some further tests I have determined that create_island() does create an island of the requested size, so the problem must be in make_island(). Three log entries from a function bypassing make_island():

: ADAPTISLAND: (2or3) required 1 attempt(s) to create an island. Requested mass: 236, mass passed to create_island(): 236, spent checkmass: 236.
: ADAPTISLAND: (2or3) required 1 attempt(s) to create an island. Requested mass: 236, mass passed to create_island(): 236, spent checkmass: 236.
: ADAPTISLAND: (2or3) required 1 attempt(s) to create an island. Requested mass: 354, mass passed to create_island(): 354, spent checkmass: 354.

Micke <mss_8734>
Fri 17 May 2013 04:50:20 PM UTC, comment #2:

Short summary, just in case:
1. Initialising ‘balance‘ to 0 in make_island means the first call will consistently result in an island 1 tile larger than any following calls requesting the same size, because balance will be set to 1 (I have so far not seen any other result).
2. Created islands are consistently 1 tile smaller than the requested size, either because of line 2007 in create_island() or the handling of balance on lines 2221 - 2233 in make_islands(). There are no explanatory comments.
3. There are no explanatory comments for the abbreviations used in the logging on lines 2235 - 2236.

Micke <mss_8734>
Fri 17 May 2013 04:33:20 PM UTC, comment #1:

Erm, did trying to use verbatim tags as recommended by https://gna.org/cookbook/?func=detailitem&item_id=236 truncate my submission or is it just my browser?

Micke <mss_8734>
Fri 17 May 2013 04:31:18 PM UTC, original submission:

Problem 1>
On lines 2169 - 2172 in make_island() we have:
if (islemass == 0) {
/* this only runs to initialise static things, not to actually
* create an island. */
balance = 0;

I have so far not seen balance set to anything but 1 after an island have been created, meaning the very first one is consistently one tile larger than the rest, assuming equal size is requested. This is easily solved by initialising balance to 1, but it seems to indicate something is wrong with line 2007, in the initial part of create_island():

Micke <mss_8734>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mss_8734 (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):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup