Production/Consumption report.

G

Guest

Guest
Archived from groups: rec.games.empire (More info?)

Perhaps I've missed it, is there a way to report on the total production
and consumption of resources during the last update. Perhaps even offering
a delta value. i.e.

Resource Produced Consumed Net TTE
lcm 334 400 -66 13

Where TTE would be time (updates) to resource/commodity exhaustion at the
current burn rate.

I've been recording the counts in my distribution centers by hand and it's
a little tedious.

Thanks,
Ed
 
G

Guest

Guest
Archived from groups: rec.games.empire (More info?)

Edward Roper wrote:
> Perhaps I've missed it, is there a way to report on the total production
> and consumption of resources during the last update. Perhaps even offering
> a delta value. i.e.
>
> Resource Produced Consumed Net TTE
> lcm 334 400 -66 13
>
If you use WinACE, it has report called Production Summary Report under
Tools menu.

This provides the information for the country or distribution center
except
for the TTE.

This a custom report built in WinACE and is not available from the
server.

Example

ITEM ON HAND MAKING USING DELTA LEFT THRSHLD EXCESS
food 1,100 0 0 0 1,100 0 1,100
iron 1,664 1,275 573 702 2,366 2,001 365
lcm 221 286 1 285 506 271 235
hcm 0 0 0 0 0 1 -1
dust 1,126 276 0 276 1,402 1,308 94
bar 0 0 0 0 0 0 0
gun 0 0 0 0 0 0 0
shell 0 0 0 0 0 0 0
oil 466 478 0 478 944 68 876
pet 0 0 0 0 0 0 0
mil 0 0 0 0 0 0 0
rad 0 0 0 0 0 0 0
civ 4,527 1,346 0 1,346 5,873 19,968 -14,095
uw 228 34 0 34 262 22,568 -22,306

Distribution mob. cost: 2112.434

iron Summary - 573 used
573 used in making 286 lcm

lcm Summary - 1 used
1 used in making 1 grad

Sector 0,0 100% g - 513 civs needed
Sector -3,-3 100% o - 218 civs needed
Sector 4,-2 99% l - 194 civs needed
Sector 5,-1 90% t - 160 civs needed
Sector 6,0 100% j - 32 civs needed
Sector 0,-4 3% o - 194 civs needed

Sector 5,1 100% h - is idle.

Ron K.
 
G

Guest

Guest
Archived from groups: rec.games.empire (More info?)

Thank you for the information, I was afraid that there would be a
client-specific solution. Not running windows here, so no winace for me.
I'm starting to think I'm going to be forced to write my own client to be
competitive :p

Of course if I were going to go to all that trouble I should probably team
up with someone else already working on such a beast.

On Sun, 05 Jun 2005 19:44:21 -0700, rkoenderink@yahoo.ca wrote:

>>
> If you use WinACE, it has report called Production Summary Report under
> Tools menu.
 

jay

Distinguished
Mar 7, 2001
581
0
18,980
Archived from groups: rec.games.empire (More info?)

If you can read/run perl, give this a try. I'm not that proud of the
code, but it works. Just issue a 'prod *' to a file the program can
read.

Jay

#!perl
#
#
# Bank dust support
# Really need the dust on-hand, especially in the warehouse & the g
sector.

use strict;
use constant TRUE => 1;
use constant FALSE =>0;

my ($idx, $pct);

my $sect;
my $des;
my $eff;
my $avail;
my $make;
my $pe;
my $cost;
my $use1;
my $use2;
my $use3;
my $max1;
my $max2;
my $max3;
my $max;
my $making;
my ($make_iron, $max_make_iron) = (0,0);
my ($make_dust, $max_make_dust) = (0,0);
my ($make_oil, $max_make_oil) = (0,0);
my ($make_rad, $max_make_rad) = (0,0);
my ($make_lcm, $max_make_lcm) = (0,0);
my ($make_hcm, $max_make_hcm) = (0,0);
my ($make_edu, $max_make_edu) = (0,0);
my ($make_bar, $max_make_bar) = (0,0);
my ($make_gun, $max_make_gun) = (0,0);
my ($make_shell, $max_make_shell) = (0,0);
my ($make_mil, $max_make_mil) = (0,0);
my ($make_tech, $max_make_tech) = (0,0);
my ($make_research, $max_make_research) = (0,0);
my ($make_happy, $max_make_happy) = (0,0);
my ($use_iron, $use_dust, $use_oil, $use_lcm, $use_hcm) = (0,0,0,0,0);
my ($max_iron, $max_dust, $max_oil, $max_lcm, $max_hcm) = (0,0,0,0,0);
my ($tot_use_iron,$tot_use_dust,$tot_use_oil,$tot_use_lcm,$tot_use_hcm)
= (0,0,0,0,0);
my ($tot_max_iron,$tot_max_dust,$tot_max_oil,$tot_max_lcm,$tot_max_hcm)
= (0,0,0,0,0);

sub calc_use {
# Retutning: $use_iron, $use_lcm, $use_hcm, $use_dust, $use_oil
my ($u1, $u2, $u3) = @_;

my ($using1, $using2, $using3);
my ($rtn_iron, $rtn_lcm, $rtn_hcm, $rtn_dust, $rtn_oil);
$rtn_iron=0; $rtn_lcm=0; $rtn_hcm=0; $rtn_dust=0; $rtn_oil=0;

if ( substr($u1, length($u1)-1, 1) =~ /[a-z]/ ) {
$using1=substr($u1, length($u1)-1, 1);
}
if ( substr($u2, length($u2)-1, 1) =~ /[a-z]/ ) {
$using2=substr($u2, length($u2)-1, 1);
}
if ( substr($u3, length($u3)-1, 1) =~ /[a-z]/ ) {
$using3=substr($u3, length($u3)-1, 1);
}
$u1=int($u1);
$u2=int($u2);
$u3=int($u3);

#print "u1[$using1]=($u1)\n";
#print "u2[$using2]=($u2)\n";
#print "u3[$using3]=($u3)\n";
if ( $using1 eq "i" ) { $rtn_iron += $u1; }
if ( $using2 eq "i" ) { $rtn_iron += $u2; }
if ( $using3 eq "i" ) { $rtn_iron += $u3; }

if ( $using1 eq "l" ) { $rtn_lcm += $u1; }
if ( $using2 eq "l" ) { $rtn_lcm += $u2; }
if ( $using3 eq "l" ) { $rtn_lcm += $u3; }

if ( $using1 eq "h" ) { $rtn_hcm += $u1; }
if ( $using2 eq "h" ) { $rtn_hcm += $u2; }
if ( $using3 eq "h" ) { $rtn_hcm += $u3; }

if ( $using1 eq "d" ) { $rtn_dust += $u1; }
if ( $using2 eq "d" ) { $rtn_dust += $u2; }
if ( $using3 eq "d" ) { $rtn_dust += $u3; }

if ( $using1 eq "o" ) { $rtn_oil += $u1; }
if ( $using2 eq "o" ) { $rtn_oil += $u2; }
if ( $using3 eq "o" ) { $rtn_oil += $u3; }

return ($rtn_iron, $rtn_lcm, $rtn_hcm, $rtn_dust, $rtn_oil);
}

sub calc_max {
# Retutning: $use_iron, $use_lcm, $use_hcm, $use_dust, $use_oil
my ($m1, $m2, $m3) = @_;

my ($max2, $max2, $max3);
my ($rtn_iron, $rtn_lcm, $rtn_hcm, $rtn_dust, $rtn_oil);
$rtn_iron=0; $rtn_lcm=0; $rtn_hcm=0; $rtn_dust=0; $rtn_oil=0;

if ( substr($m1, length($m1)-1, 1) =~ /[a-z]/ ) {
$max1=substr($m1, length($m1)-1, 1);
}
if ( substr($m2, length($m2)-1, 1) =~ /[a-z]/ ) {
$max2=substr($m2, length($m2)-1, 1);
}
if ( substr($m3, length($m3)-1, 1) =~ /[a-z]/ ) {
$max3=substr($m3, length($m3)-1, 1);
}
$m1=int($m1);
$m2=int($m2);
$m3=int($m3);

#print "m1[$max1]=($m1)\n";
#print "m2[$max2]=($m2)\n";
#print "m3[$max3]=($m3)\n";
if ( $max1 eq "i" ) { $rtn_iron += $m1; }
if ( $max2 eq "i" ) { $rtn_iron += $m2; }
if ( $max3 eq "i" ) { $rtn_iron += $m3; }

if ( $max1 eq "l" ) { $rtn_lcm += $m1; }
if ( $max2 eq "l" ) { $rtn_lcm += $m2; }
if ( $max3 eq "l" ) { $rtn_lcm += $m3; }

if ( $max1 eq "h" ) { $rtn_hcm += $m1; }
if ( $max2 eq "h" ) { $rtn_hcm += $m2; }
if ( $max3 eq "h" ) { $rtn_hcm += $m3; }

if ( $max1 eq "d" ) { $rtn_dust += $m1; }
if ( $max2 eq "d" ) { $rtn_dust += $m2; }
if ( $max3 eq "d" ) { $rtn_dust += $m3; }

if ( $max1 eq "o" ) { $rtn_oil += $m1; }
if ( $max2 eq "o" ) { $rtn_oil += $m2; }
if ( $max3 eq "o" ) { $rtn_oil += $m3; }

return ($rtn_iron, $rtn_lcm, $rtn_hcm, $rtn_dust, $rtn_oil);
}
sub dispsummary {
my ($prodtype, $max_make, $make, $tot_use, $tot_max) = @_;
#("hcm", $max_make_hcm, $make_hcm, $tot_use_hcm, $tot_max_hcm)
#
if ( $prodtype eq "header" ) {
printf("%7s %11s %4s %11s %4s %12s_____%%\n",
"produce", "make/max", "%", "usage", "%", "max_usage__");
return;
}
if ( defined $max_make and $max_make > 0 ) {
$pct=int($make*100/$max_make)
}
else {
$pct=0;
}
printf("%7s %5d/%5d %3d%% ", $prodtype, $make, $max_make, $pct);
if ( defined $tot_use ) {
if ( defined $make and $make > 0 ) {
$pct=int($tot_use*100/$make);
}
else {
$pct=0;
}
printf("%5d/%5d %3d%% ", $tot_use, $make, $pct);
if ( defined $make and $make > 0 ) {
$pct=int($tot_max*100/$make);
}
else {
$pct=0;
}
printf("%5d/%5d\t%3d%%", $tot_max, $make, $pct);
}
print "\n";
}

sub main {
my $DumpFile="prod.new";
open(DUMP, "<$DumpFile") or do {
$DumpFile = "prod.last";
open(DUMP, "<$DumpFile") or die "Can't open dump file!";
};
print "File: $DumpFile\n";

$idx=0;
while ( <DUMP> ) {
++$idx;
my $desused='N';
$_ =~ s/[\n\r]//g;
next unless $idx > 3;
next if substr($_, 3, 7) eq "sectors";
$sect = substr($_,3,4);
$des = substr($_,10,1);
$eff = substr($_,12,3);
$avail = substr($_,17,5);
$make = substr($_,23,5);
$pe = substr($_,29,4);
$cost = substr($_,34,7); # Maybe 35,6 and strip the $ ??
$use1 = substr($_,40,5);
$use2 = substr($_,45,5);
$use3 = substr($_,50,5);
$max1 = substr($_,56,5);
$max2 = substr($_,61,5);
$max3 = substr($_,66,5);
$max = substr($_,72,5);

# Collect
undef $making;
if ( substr($make, length($make)-1, 1) =~ /[a-z]/ ) {
$making=substr($make, length($make)-1, 1);
}

if ( $making eq "i" ) { # or $des eq "m" # iron
$make_iron+=$make;
$max_make_iron+=$max;
}
elsif ( $making eq "d" ) { # or $des eq "g" # gold dust
$make_dust+=$make;
$max_make_dust+=$max;
}
elsif ( $making eq "o" ) { # or $des eq "g" # gold dust
$make_oil+=$make;
$max_make_oil+=$max;
}
elsif ( $making eq "r" ) { # or $des eq "u" # radiation
$make_rad+=$make;
$max_make_rad+=$max;
}
elsif ( $making eq "l" ) { # or $des eq "j" # lcm
$make_lcm+=$make;
$max_make_lcm+=$max;
($use_iron, $use_lcm, $use_hcm, $use_dust, $use_oil) =
calc_use($use1, $use2, $use3);
$tot_use_iron+=$use_iron;
($max_iron, $max_lcm, $max_hcm, $max_dust, $max_oil) =
calc_max($max1, $max2, $max3);
$tot_max_iron+=$max_iron;
}
elsif ( $making eq "h" ) { # or $des eq "k" # hcm
$make_hcm+=$make;
$max_make_hcm+=$max;
($use_iron, $use_lcm, $use_hcm, $use_dust, $use_oil) =
calc_use($use1, $use2, $use3);
$tot_use_iron+=$use_iron;
($max_iron, $max_lcm, $max_hcm, $max_dust, $max_oil) =
calc_max($max1, $max2, $max3);
$tot_max_iron+=$max_iron;
}
elsif ( $des eq "r" ) {
$make_research+=$make;
$max_make_research+=$max;
($use_iron, $use_lcm, $use_hcm, $use_dust, $use_oil) =
calc_use($use1, $use2, $use3);
$tot_use_lcm+=$use_lcm;
$tot_use_dust+=$use_dust;
$tot_use_oil+=$use_oil;
($max_iron, $max_lcm, $max_hcm, $max_dust, $max_oil) =
calc_max($max1, $max2, $max3);
$tot_max_lcm+=$max_lcm;
$tot_max_dust+=$max_dust;
$tot_max_oil+=$max_oil;
}
elsif ( $des eq "p" ) {
$make_happy+=$make;
$max_make_happy+=$max;
($use_iron, $use_lcm, $use_hcm, $use_dust, $use_oil) =
calc_use($use1, $use2, $use3);
$tot_use_lcm+=$use_lcm;
($max_iron, $max_lcm, $max_hcm, $max_dust, $max_oil) =
calc_max($max1, $max2, $max3);
$tot_max_lcm+=$max_lcm;
}
elsif ( $des eq "t" ) {
$make_tech+=$make;
$max_make_tech+=$max;
($use_iron, $use_lcm, $use_hcm, $use_dust, $use_oil) =
calc_use($use1, $use2, $use3);
$tot_use_lcm+=$use_lcm;
$tot_use_dust+=$use_dust;
$tot_use_oil+=$use_oil;
($max_iron, $max_lcm, $max_hcm, $max_dust, $max_oil) =
calc_max($max1, $max2, $max3);
$tot_max_lcm+=$max_lcm;
$tot_max_dust+=$max_dust;
$tot_max_oil+=$max_oil;
}
elsif ( $des eq "l" ) {
$make_edu+=$make;
$max_make_edu+=$max;
($use_iron, $use_lcm, $use_hcm, $use_dust, $use_oil) =
calc_use($use1, $use2, $use3);
$tot_use_lcm+=$use_lcm;
($max_iron, $max_lcm, $max_hcm, $max_dust, $max_oil) =
calc_max($max1, $max2, $max3);
$tot_max_lcm+=$max_lcm;
}
elsif ( $des eq "b" ) {
$make_bar+=$make;
$max_make_bar+=$max;
($use_iron, $use_lcm, $use_hcm, $use_dust, $use_oil) =
calc_use($use1, $use2, $use3);
$tot_use_dust+=$use_dust;
($max_iron, $max_lcm, $max_hcm, $max_dust, $max_oil) =
calc_max($max1, $max2, $max3);
$tot_max_dust+=$max_dust;
}
elsif ( $des eq "d" ) {
$make_gun+=$make;
$max_make_gun+=$max;
($use_iron, $use_lcm, $use_hcm, $use_dust, $use_oil) =
calc_use($use1, $use2, $use3);
$tot_use_oil+=$use_oil;
$tot_use_lcm+=$use_lcm;
$tot_use_hcm+=$use_hcm;
($max_iron, $max_lcm, $max_hcm, $max_dust, $max_oil) =
calc_max($max1, $max2, $max3);
$tot_max_oil+=$max_oil;
$tot_max_lcm+=$max_lcm;
$tot_max_hcm+=$max_hcm;
}
elsif ( $des eq "i" ) {
$make_shell+=$make;
$max_make_shell+=$max;
($use_iron, $use_lcm, $use_hcm, $use_dust, $use_oil) =
calc_use($use1, $use2, $use3);
$tot_use_lcm+=$use_lcm;
$tot_use_hcm+=$use_hcm;
($max_iron, $max_lcm, $max_hcm, $max_dust, $max_oil) =
calc_max($max1, $max2, $max3);
$tot_max_lcm+=$max_lcm;
$tot_max_hcm+=$max_hcm;
}
elsif ( $des eq "e" ) {
$make_mil+=$make;
$max_make_mil+=$max;
($use_iron, $use_lcm, $use_hcm, $use_dust, $use_oil) =
calc_use($use1, $use2, $use3);
($max_iron, $max_lcm, $max_hcm, $max_dust, $max_oil) =
calc_max($max1, $max2, $max3);
}
else {
print "*************************> Unparsed: $des
<*************************\n";
}
}

if ( 1 == 1 ) {
# For commodities, need the dump to determin levels on hand.
dispsummary("header");
dispsummary("iron", $max_make_iron, $make_iron, $tot_use_iron,
$tot_max_iron);
dispsummary("oil", $max_make_oil, $make_oil, $tot_use_oil,
$tot_max_oil);
dispsummary("dust", $max_make_dust, $make_dust, $tot_use_dust,
$tot_max_dust);
dispsummary("lcm", $max_make_lcm, $make_lcm, $tot_use_lcm,
$tot_max_lcm);
dispsummary("hcm", $max_make_hcm, $make_hcm, $tot_use_hcm,
$tot_max_hcm);
dispsummary("bar", $max_make_bar, $make_bar);
dispsummary("rad", $max_make_rad, $make_rad);
dispsummary("happy", $max_make_happy, $make_happy);
dispsummary("guns", $max_make_gun, $make_gun);
dispsummary("shells", $max_make_shell, $make_shell);
dispsummary("mil", $max_make_mil, $make_mil);
dispsummary("edu", $max_make_edu, $make_edu);
dispsummary("tech", $max_make_tech, $make_tech);
}

close(DUMP);
if ( $DumpFile eq "prod.new" ) {
unlink "prod.last";
rename "prod.new", "botdata/prod.last" or die "$!";
print "Renamed file to .last\n";
}
}

main();
 
G

Guest

Guest
Archived from groups: rec.games.empire (More info?)

Edward Roper <empire@wanfear.com> wrote:
> Thank you for the information, I was afraid that there would be a
> client-specific solution. Not running windows here, so no winace for me.
> I'm starting to think I'm going to be forced to write my own client to be
> competitive :p

> Of course if I were going to go to all that trouble I should probably team
> up with someone else already working on such a beast.

Eif has about the same functionality in its contrib scripts...

8 [0,1000]% lcm #2
Produced: 942
Used: 802
8 [0,1000]%

Zlo
 
G

Guest

Guest
Archived from groups: rec.games.empire (More info?)

"Edward Roper" <empire@wanfear.com> wrote in message
news:pan.2005.06.06.01.20.02.512966@wanfear.com...
> Perhaps I've missed it, is there a way to report on the total production
> and consumption of resources during the last update. Perhaps even offering
> a delta value. i.e.
>
> Resource Produced Consumed Net TTE
> lcm 334 400 -66 13
>
> Where TTE would be time (updates) to resource/commodity exhaustion at the
> current burn rate.
>
> I've been recording the counts in my distribution centers by hand and it's
> a little tedious.
>
> Thanks,
> Ed

The PEI (Perl Empire Interface) client has exactly what you are
asking for. It is called the 'delta' command. However, PEI is
old and has many 'tools' not compatible with the current server.
I think there is a revision being made but it is not complete.
I believe new downloads of the PEI client get the new, partial
revision. Is the old version still available somewhere?

Tom
 
G

Guest

Guest
Archived from groups: rec.games.empire (More info?)

Jay wrote:
> If you can read/run perl, give this a try. I'm not that proud of the
> code, but it works. Just issue a 'prod *' to a file the program can
> read.
>
> Jay
>
[---Snip %<---]


Thank you very much everyone for the replies, pointers to clients, and
especially the perl script for an immediate solution. Does anyone know
if pei, eif, etc. are maintained at present? It sounds like someone
started a pei overhaul.

Ed
 

jay

Distinguished
Mar 7, 2001
581
0
18,980
Archived from groups: rec.games.empire (More info?)

Well, I'm using the ptkei-1.18.1 Python client and yes, it has some
bugs and lacks some features. Still, it is OK.

But then, I'm working on my own client (of which the prod report will
be intragrated). It is my play project that just doesn't gat worked on
much though.
 
G

Guest

Guest
Archived from groups: rec.games.empire (More info?)

Edward Roper wrote:

>
> Thank you very much everyone for the replies, pointers to clients, and
> especially the perl script for an immediate solution. Does anyone know
> if pei, eif, etc. are maintained at present? It sounds like someone
> started a pei overhaul.
>
> Ed

Eif is being maintained by Marc Olzheim (who pointed to the contrib
scripts a few posts back). For other clients I suggest that you check
their webpaes of readme files.

--
Synchron