bugBattle for Wesnoth - Bugs: bug #22382, Restore whitespace-aligned columns...

 
 
Show feedback again

bug #22382: Restore whitespace-aligned columns in map format

Submitted by:  Lari Nieminen <zookeeper>
Submitted on:  Tue 22 Jul 2014 02:00:09 PM UTC  
 
Category: Feature RequestSeverity: 3 - Normal
Priority: 5 - NormalItem Group:  None of the others
Status: NonePrivacy: Public
Assigned to: Simon Forsyth <alarantalara>Open/Closed: Open
Release: 1.11Operating System: all

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Sat 26 Jul 2014 01:11:26 PM UTC, comment #2:

There is one tangible benefit, the change reduces the installed size of Wesnoth by several megabytes if applied to all the maps (most still have the larger spacing). It's about 300K of whitespace in UtBS alone. While this doesn't matter too much on desktops, I suspect that it's a nice benefit on the assorted mobile devices now supported in one way or another.

Anonymous
Tue 22 Jul 2014 10:16:11 PM UTC, comment #1:

I don't think I made the change to eliminate the padding, though I did reformat all the maps after the code was changed.

Practically, I doubt it makes much difference from an editing standpoint, since I suspect almost no one edits the files directly. For those that do, treating it as a .csv file would restore the columns.

The longest terrain string is actually 11 characters thanks to starting locations (unless they've been removed from the map).
1 Xxxx^Yyyy

Anonymous
Tue 22 Jul 2014 02:00:09 PM UTC, original submission:

In ea3028 (see also 7f5f62 and possibly also 1a27a8), the old method of aligning up the columns in map data with spaces was dropped. This makes reading and editing of plain map data a lot harder for no apparent tangible benefit.

The old way padded each entry to a length of 12 (excluding the preceding space):

The new format only includes the preceding space:

So, I'd suggest restoring the old padding behavior, although the number of spaces could be reduced if necessary; since a terrain string cannot be longer than 9 characters, the column width could be reduced from 12 to 9. As future-proofing, the code should probably handle even longer strings gracefully, or to signal an error if one is encountered.

P.S. Alarantalara made the change, so I'm assigning to him initially just so he gets notified, in case he has input.

Lari Nieminen <zookeeper>
Project Member

 

(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 zookeeper (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