Author Topic: Downloading the combat reports  (Read 3854 times)

Offline bontchev

  • ****
  • Posts: 408
    • View Profile
Downloading the combat reports
« on: 21 June 2011, 14:29:47 »
Would be nice if it were possible to download a selected list of saved combat reports (in BBcode or even just plain text), so that the user could do their own processing (like, "how much I gained and lost during these battles?"), post them to alliance forums and so on. (They can't be posted to the game forum, because they aren't detailed combat reports.)

Offline eX0du5

  • Administrator
  • ****
  • Posts: 560
    • View Profile
Re: Downloading the combat reports
« Reply #1 on: 24 June 2011, 22:14:20 »
The detailed combat reports are not uploaded because the names of the entities are shortened by OGame so far :-(
What exactly do you want to download? All available data as CSV for external processing like in excel?

Offline bontchev

  • ****
  • Posts: 408
    • View Profile
Re: Downloading the combat reports
« Reply #2 on: 25 June 2011, 05:47:17 »
The detailed combat reports are not uploaded because the names of the entities are shortened by OGame so far :-(

Don't I know it... :'( And, what is even worse, they mix short and long names in those reports. >:( I've written a script that indicates how many units were actually lost - but it doesn't account for the recovered defenses, because the names of those are in long form and don't match the names used in the tables...

Quote
What exactly do you want to download? All available data as CSV for external processing like in excel?

Anything usable for automated processing. CSV data would be great, yes.

Offline eX0du5

  • Administrator
  • ****
  • Posts: 560
    • View Profile
Re: Downloading the combat reports
« Reply #3 on: 26 June 2011, 22:57:05 »
What data besides:
  • attacker name
  • defender name
  • combattime
  • winner
  • public combat report (yes,no)
  • owner of that combat report
  • loot metal, crystal and deut
  • debris metal and crystal
  • losses for attacker and defender

would you need?
If you upload any combat reports to the test server, you can already check it.
« Last Edit: 26 June 2011, 23:14:39 by eX0du5 »

Offline Omar Hawk

  • Administrator
  • ****
  • Posts: 900
    • View Profile
Re: Downloading the combat reports
« Reply #4 on: 27 June 2011, 01:21:52 »
If you upload any combat reports to the test server, you can already check it.

If that would work.  ::)

Of course, you need one account in universe 680, otherwise the data (players <-> coords) will not really match and the combat reports might not get uploaded. ;)

Offline bontchev

  • ****
  • Posts: 408
    • View Profile
Re: Downloading the combat reports
« Reply #5 on: 27 June 2011, 05:48:41 »
I don't really need to know who is the owner of the report and whether it is public, but it doesn't hurt to include that information there.

I would also need:
  • the coordinates of the battle
  • the coordinates of the attacker
  • the coordinates of the defender
  • the techs of the attacker
  • the techs of the defender

Offline eX0du5

  • Administrator
  • ****
  • Posts: 560
    • View Profile
Re: Downloading the combat reports
« Reply #6 on: 01 July 2011, 21:08:19 »
Okay, the data is included in the CSV. I just noticed that open office or excel (more excel) is doing some "fancy" conversions of some of my entries once I open the csv. it will convert coordinates 1:2:3 into 01:02:03 or techs 6 / 6 / 7 into 06.06.07 (date) :-(

Offline bontchev

  • ****
  • Posts: 408
    • View Profile
Re: Downloading the combat reports
« Reply #7 on: 02 July 2011, 06:02:47 »
Yeah, Excel thinks that the numbers are time and date respectively. Sadly, enclosing them in quotes doesn't help.  :( I don't know how to fix this...

P.S. Found two possible solutions:

1) Enclose the data in quotes and precede it with an equation sign. This way Excel will interpret it as a formula, instead of as date/time:

Code: [Select]
="1:2:3",="6/6/7"
2) Use XML, instead of CVS. Excel can handle XML to a certain degree. Here is a minimalistic example:

Code: [Select]
<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
 <Worksheet ss:Name="SHEETNAME">
  <Table>
   <Row>
    <Cell><Data ss:Type="String">1:2:3</Data></Cell>
    <Cell><Data ss:Type="String">6/6/8</Data></Cell>
   </Row>
  </Table>
 </Worksheet>
</Workbook>

You'll have to change "SHEETNAME" to something more meaningful (and no, you can't omit it) but the rest is straightforward.

BTW, why do you want to put the combat techs in a single cell? Wouldn't it make more sense for them to be in 3 separate cells?
« Last Edit: 02 July 2011, 11:19:14 by bontchev »

Offline eX0du5

  • Administrator
  • ****
  • Posts: 560
    • View Profile
Re: Downloading the combat reports
« Reply #8 on: 03 July 2011, 13:23:16 »
Thanks :-)
I tried "" already but this did not work. Luckly ="" works fine also for open office.

Offline bontchev

  • ****
  • Posts: 408
    • View Profile
Re: Downloading the combat reports
« Reply #9 on: 09 July 2011, 07:31:40 »
Looking at the single combat report currently saved at the test site, I have a few remarks:
  • Don't show a "download as CSV" button if there is nothing to download (e.g., the "Go" button hasn't been pressed yet).
  • "CSV" means "Comma-Separated Values", you know? Not "semicolon-separated values". ;)
  • The attacker coordinates need to be enclosed in quotes and preceded by an equals sign, too.
  • It might be useful to separate the "date" and "time" of the report into separate columns.
  • Although there is only one combat report saved there, for some reason the CSV file contains two copies of it.

Offline eX0du5

  • Administrator
  • ****
  • Posts: 560
    • View Profile
Re: Downloading the combat reports
« Reply #10 on: 11 July 2011, 20:56:41 »
Looking at the single combat report currently saved at the test site, I have a few remarks:
  • Don't show a "download as CSV" button if there is nothing to download (e.g., the "Go" button hasn't been pressed yet).
It will download the results of your search without performing an intermediate search for a page you don't want to see in most cases. So the button = Go & download in one step.

  • "CSV" means "Comma-Separated Values", you know? Not "semicolon-separated values". ;)
I have seen CSV with semicolon for quite some time. But I can change it easily to comma if this fits better to a "standard". But when I open this in Excel or OpenOffice I am anyway asked for the separator as the separator seems to be different from CSV to CSV :)

  • The attacker coordinates need to be enclosed in quotes and preceded by an equals sign, too.
  • It might be useful to separate the "date" and "time" of the report into separate columns.
  • Although there is only one combat report saved there, for some reason the CSV file contains two copies of it.
Changed the two points.
I could not reproduce the last point after I deleted the two inconsistent combat reports for the "test" account and added four of my own reports to test this.

Offline bontchev

  • ****
  • Posts: 408
    • View Profile
Re: Downloading the combat reports
« Reply #11 on: 12 July 2011, 06:09:56 »
It will download the results of your search without performing an intermediate search for a page you don't want to see in most cases. So the button = Go & download in one step.

OK, that's nice. I was worried that the first time when you go to the Combat reports page, there are no search results yet - but I guess the default in this case is "everything", which is indeed the reasonable choice.

Quote
I have seen CSV with semicolon for quite some time. But I can change it easily to comma if this fits better to a "standard". But when I open this in Excel or OpenOffice I am anyway asked for the separator as the separator seems to be different from CSV to CSV :)

The standard is definitely a comma. I have no experience with OpenOffice, but my admittedly old Excel 2002 refused to recognize the semicolon-separated values at all. Didn't ask; just put everything into a single column. So, it is better now.

Quote
I could not reproduce the last point after I deleted the two inconsistent combat reports for the "test" account and added four of my own reports to test this.

Yes, it works correctly with 4 reports now. Maybe the problem occurs when there is one report?

Another thing. Perhaps it would be better if you put in the "winner" column the name of the winner, instead of "attacker" or "defender"?

Offline eX0du5

  • Administrator
  • ****
  • Posts: 560
    • View Profile
Re: Downloading the combat reports
« Reply #12 on: 12 July 2011, 09:05:04 »
What shall I enter in case there was no winner or looser because of a tie? "none" ?

Offline bontchev

  • ****
  • Posts: 408
    • View Profile
Re: Downloading the combat reports
« Reply #13 on: 13 July 2011, 05:01:22 »
Admittedly, I didn't think about this case, but maybe leaving the field empty would be logical?

Offline eX0du5

  • Administrator
  • ****
  • Posts: 560
    • View Profile
Re: Downloading the combat reports
« Reply #14 on: 21 July 2011, 20:33:09 »
I just checked what I would return.
"attacker", "defender", "nobody"

I think this should be ok for the first version. If there are complains, we can change it again :-)