Home » Stars! Clones, Extensions, Modding » Stars! Extensions » "message pane" scraper
|
Re: "message pane" scraper |
Tue, 27 August 2013 09:16 |
|
XyliGUN | | | Messages: 325
Registered: July 2004 Location: Russia, St.Petersburg |
|
|
XyliGUN wrote on Tue, 27 August 2013 16:38m.a@stars wrote on Fri, 23 August 2013 22:59XyliGUN wrote on Fri, 23 August 2013 19:21Player relation columns were added to players.csv.
They are per player, and their meaning are:
- 0 - "Neutral"
- 1 - "Friend"
- 2 - "Enemy"
Well, as long as you can only output the relations for one player per m file, why not put them all in one single column? It would look much cleaner.
Good point. Any other issues?
OK, export sample updated.
"Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
Robert A. Heinlein, Time Enough For LoveReport message to a moderator
|
|
| | |
Re: "message pane" scraper |
Tue, 27 August 2013 11:58 |
|
XyliGUN | | | Messages: 325
Registered: July 2004 Location: Russia, St.Petersburg |
|
|
m.a@stars wrote on Tue, 27 August 2013 18:55XyliGUN wrote on Tue, 27 August 2013 15:16OK, export sample updated.
Hmmm, something still looks weird about the designs export, in the Mass, Armor, BuiltCount and RemainingCount columns.
Ouups...
Thanks for pointing me, I finally found what was wrong with mass & armor values - debug version works OK, but release version works incorrectly due to optimization.
Sorry, but built & remaining count were excluded for a while, since I have to make a bit more research on them.
Mass & armor fixed. Export sample and beta reuploaded.
"Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
Robert A. Heinlein, Time Enough For LoveReport message to a moderator
|
|
| | | | |
Re: "message pane" scraper |
Sun, 01 September 2013 05:14 |
|
m.a@stars | | Commander | Messages: 2765
Registered: October 2004 Location: Third star to the left | |
|
XyliGUN wrote on Sun, 01 September 2013 09:46These values are skipped since I have to make some additional research. At the moment tool will only show these numbers for the own fleets. After all these numbers for the foreign fleets are pretty confusing and Stars! doesn't show them. Hope that makes sense.
Amazingly, yes. But these numbers would be very interesting for statistics/scoring/AI purposes, even if they aren't exact. Adding them "by hand" has never been really possible until this tool, and even now it wouldn't be exactly easy.
Is there any hope about the game's year, WormHoles, minefields, battle debris and the MT?
[Updated on: Sun, 01 September 2013 05:24]
So many Stars, so few Missiles!
In space no one can hear you scheme! Report message to a moderator
|
|
|
Re: "message pane" scraper |
Sun, 01 September 2013 06:17 |
|
XyliGUN | | | Messages: 325
Registered: July 2004 Location: Russia, St.Petersburg |
|
|
m.a@stars wrote on Tue, 27 August 2013 18:50XyliGUN wrote on Tue, 27 August 2013 14:38Good point. Any other issues?
The "relations" column would look cleaner if it was closer to the player names & ids.
Is there any info about the MT included yet?
What about packets, minefields, Wormholes, battle/minehit debris... ?
Sorry, looks like I've missed this post...
No problem: packets, minefields, wormholes, salvages and traders coming soon.
[Updated on: Sun, 01 September 2013 07:31]
"Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
Robert A. Heinlein, Time Enough For LoveReport message to a moderator
|
|
| |
Re: "message pane" scraper |
Mon, 02 September 2013 16:16 |
|
XyliGUN | | | Messages: 325
Registered: July 2004 Location: Russia, St.Petersburg |
|
|
m.a@stars wrote on Mon, 02 September 2013 12:11XyliGUN wrote on Sun, 01 September 2013 12:17Sorry, looks like I've missed this post...
It was a wormhole!
Quote:No problem: packets, minefields, wormholes, salvages and traders coming soon.
Yay!
BTW, internally there are no packets and salvages. Instead salvage is just a packet with zero speed.
"Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
Robert A. Heinlein, Time Enough For LoveReport message to a moderator
|
|
| | | |
Re: "message pane" scraper |
Wed, 04 September 2013 00:48 |
|
XyliGUN | | | Messages: 325
Registered: July 2004 Location: Russia, St.Petersburg |
|
|
m.a@stars wrote on Wed, 04 September 2013 02:37XyliGUN wrote on Tue, 03 September 2013 21:16* Battle recording details? In that case I have to said that I cannot give it to you, since the battle block are the only one I don't understand structure of. This needs to be researched later on.
That's the one I meant, the more interesting part!
(I emailed you all the details PaulCr told me, as well as his battle-jitsu demo, didn't I?)
Hmmm, I remember demo, but not the details.
"Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
Robert A. Heinlein, Time Enough For LoveReport message to a moderator
|
|
| | |
Re: "message pane" scraper |
Thu, 12 September 2013 16:48 |
|
XAPBob | | Lt. Commander | Messages: 957
Registered: August 2012 | |
|
Finally got round to starting to build the message pane reconstruction.
Not yet done percentages (P values look wierd) or design IDs.
Designs IDs are complicated by the fact that they can refer to any race.
Need to check the actual message pane to determine the "P" values proper meaning.
OK - percentages are just multiplied by 100 (so the code does stop bombs to 0.01% accuracy at least.
Haven't spotted any "location" references which are for fleets either, despite the notes.
XyliGUN - data in the normal place.
[Updated on: Thu, 12 September 2013 19:20] Report message to a moderator
|
|
|
Re: "message pane" scraper |
Fri, 13 September 2013 06:36 |
|
XAPBob | | Lt. Commander | Messages: 957
Registered: August 2012 | |
|
Hmm.
There can't be quite enough information ... yet.
Here is an excerpt of my scraper utility debug output, relating to one message:
150 17944 1715 1868 13 2 11 3
A battle took place at \n. Your \z*\i destroyed \z*\i, taking no damage.
#:A battle took place at [1715:1868]. Your [TODO:z-13]*2 destroyed [TODO:z-11]*3, taking no damage.
The first line is the message details as extracted from the SPT exported events file.
The second line is the message text (and this is correct according to the actual message pane).
The third is the "normal" output from my scraper (# is the message number, for easy correlation with the pane).
You can see that the location and numbers are all there, but that the design IDs are not yet processed.
There is no obvious mechanism for me to establish which race the destroyed ships belong to - and therefore which design they are.
I presume that the information is in the hint, which must refer to a battle block? This is the only instance of that number as a string in the exports/files used.
All instances of my own fleets are now resolved (they have unique words before the \z) - other's fleets are not identified.
Interestingly there is a missing message:
"You have recieved N battle recordings this year"
which is causing my message IDs (for easy reference to the message pane) to be out by one.
[Updated on: Fri, 13 September 2013 08:37] Report message to a moderator
|
|
|
Re: "message pane" scraper |
Fri, 13 September 2013 08:48 |
|
XAPBob | | Lt. Commander | Messages: 957
Registered: August 2012 | |
|
I have made a file called events.txt as follows:
$ head events.txt
0;4;The \v00 Colonists you dropped on \p were massacred by the ground troops of \l.
1;5;Of the \v00 Colonists you dropped on \p, \P were destroyed by planetary defenses, the rest were massacred by the ground troops of \l.
2;3;The \v00 Colonists you forced to transport down to \p died because you did not colonize the planet first.
...
I have also tweaked the map output file as follows:
$ head lowtek.map
#;X;Y;Name
1;1012;1921;Pin Prick
2;1017;1470;Midnight
3;1021;1486;Pearl
...
I have also made the following progress in terms of a script.
It is currently hard coded to the M10 of lowtek - so sue me.
#!/bin/bash
msg=0
while read line; do # From events export file
params=( `echo $line | sed -e 's/;/ /g'` )
if [ "${params[0]}" -eq "${params[0]}" ] 2>/dev/null; then # Message ID is numeric
text=`grep ^${params[0]}\; events.txt | awk -F';' '{print $3}'` # Get relevant message text
((msg++))
else
echo Ignore header row >&2
continue
fi
param=1
message=
for (( i=0; i<${#text}; i++ )); do
if [ "${text:${i}:1}" = "\\" ]; then
((i++))
((param++))
case ${text:${i}:1} in
e) # environment area (note: 0 - gravity, 1 - temperature, 2 - radiation)
case ${params[@]:${param}:1} in
0) message=${message}"gravity"
;;
1) message=${message}"temperature"
;;
2) message=${message}"radiation"
;;
esac
;;
E) # environment area value (seems to be in clicks from the left?)
message=${message}${params[@]:${param}:1}" clicks"
;;
F|o|s) # F ship id; o|s fleet id;
message=${message}"Fleet #"${params[@]:${param}:1}
;;
g|G|i|v|V) # g|G integer, not found yet; i signed integer; v|V unsigned integer
message=${message}${params[@]:${param}:1}
;;
I) # change type (0 = decreased, 1 = increased)
case ${params[@]:${param}:1} in
0) message=${message}"decreased"
;;
1) message=${message}"increased"
;;
esac
;;
j) # zero based research area id (0 - energy, 1 - weapons, 2 - propulsion, 3 - construction, 4 - electronics, 5 - biotechnology)
case ${params[@]:${param}:1} in
0) message=${message}"energy"
;;
1) message=${message}"weapons"
;;
2) message=${message}"propulsion"
;;
3) message=${message}"construction"
;;
4) message=${message}"electronics"
;;
5) message=${message}"biotechnology"
;;
esac
;;
k) # technology id (4 bytes unsigned integer), stored in format: bits 0-15 is an ItemId, bits 16-31 is a GroupId
message=${message}"Cool Stuff [${params[@]:${param}:1}]"
;;
l|L|O|S|Z) # zero based player id
message=${message}`grep "^${params[@]:${param}:1}\;" lowtek.m10.players.csv | awk -F';' '{print $3}'`
;;
m) # cargo type (note: 0 - ironium, 1 - boranium, 2 - germanium, 3 - colonists, 4 - fuel)
case ${params[@]:${param}:1} in
0) message=${message}"ironium"
;;
1) message=${message}"boranium"
;;
2) message=${message}"germanium"
;;
3) message=${message}"colonists"
;;
4) message=${message}"fuel"
;;
esac
;;
M) # mine field type (0 - standard, 1 = heavy, 2 - speed bump)
case ${params[@]:${param}:1} in
0) message=${message}"standard"
;;
1) message=${message}"heavy"
;;
2) message=${message}"speed bump"
;;
esac
;;
n) # this param consumed 2 args, it specifies location (can be either planet id, fleet id or space coordinates)
case ${params[@]:${param}:1} in
65535) # planet ID
((param++))
planet=$[${params[@]:${param}:1}+1]
message=${message}`grep "^${planet}\;" lowtek.map | awk -F';' '{print $4}'`
;;
*)
message=${message}" [${params[@]:${param}:1}"
((param++))
message=${message}":${params[@]:${param}:1}]"
;;
esac
;;
P) # percent value
percent=$[${params[@]:${param}:1}/100]
message=${message}${percent}%
;;
p) # zero based planet id (note: you have to add 1 to match a planet id as it shown in Stars!)
planet=$[${params[@]:${param}:1}+1]
message=${message}`grep "^${planet}\;" lowtek.map | awk -F';' '{print $4}'`
;;
X) # strange, but \X is always replaced by empty string in any event message, will be stored as empty Arg in export
((param--))
;;
z) #\z - design id (bits 0-4 - design id, bit 5 values: 0 - ship design, 1 - starbase design)
lastword=`echo ${message} | awk '{print $NF}'`
case $lastword in
new|your|Your|type) # Our fleets
isbase=0
slot=${params[@]:${param}:1}
if [ ${params[@]:${param}:1} -gt 16 ] ; then
isbase=1
slot=$[${slot}-16]
fi
message=${message}`grep "^9\;${isbase}\;${slot}\;" lowtek.m10.designs.csv | awk -F';' '{print $5}'`
;;
destroyed|by|nor) # Someone elses
message=${message}[design:${text:${i}:1}-${params[@]:${param}:1}]
;;
esac
;;
*)
message=${message}[TODO:${text:${i}:1}-${params[@]:${param}:1}]
;;
esac
else
message=${message}${text:${i}:1}
fi
done
#echo ${params[@]:0}
#echo ${text}
echo $msg:$'\t'${message}
#echo
done < lowtek.m10.events.csv
That gives a simple text output of the form:
$ ./Scraper.bash
1: <message>
2: <message>
...
With only the design name of enemy fleets being left encoded.
Additionally fleet names are not retrieved yet, so it's always "Fleet #130" rather than "My stack of 1000 nubians"
[Updated on: Fri, 13 September 2013 11:05] Report message to a moderator
|
|
|
Re: "message pane" scraper |
Mon, 16 September 2013 06:13 |
|
XAPBob | | Lt. Commander | Messages: 957
Registered: August 2012 | |
|
m.a@stars wrote on Thu, 08 August 2013 19:16XyliGUN wrote on Thu, 08 August 2013 20:08Oups, looks like I have to make it clear: there is no target coordinates.
There is just a target wormhole id, which is useless, since there are no wormhole with that id in m file if you cannot see it.
Ahhh, so less useful than I guessed, but still, once everybody gets to see the IDs of the WHs they know, they'll become just another piece of intel for trade. A valuable piece of intel that doesn't exist today.
Yay, innovation!
Would it not also indicate the presence of hidden wormholes - if I discover a wormhole with ID3, go through it and find WH4 then I know there is/was another WH around somewhere...
[Updated on: Mon, 16 September 2013 09:28] Report message to a moderator
|
|
| | |
Goto Forum:
Current Time: Sat May 04 05:08:11 EDT 2024
|