]> git.pond.sub.org Git - empserver/commitdiff
New show product
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 27 Jul 2008 22:02:06 +0000 (18:02 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 28 Jul 2008 11:51:49 +0000 (07:51 -0400)
This is the human-readable buddy of xdump product, which dumps pchr[].
It duplicates much of the information in show sect c, but in more
accessible form.  It's in show_product().

Remove product information from info Quick-ref.  show reflects the
actual game, is more complete, and should be just as readable.

include/prototypes.h
info/Products.t
info/Quick-ref.t
info/show.t
src/lib/commands/show.c
src/lib/player/empmod.c
src/lib/subs/show.c

index c76c63e5be155b6883fb87ef49aa76360275f610..f3ed1be7929f24c1332c67c4b3399d72f5f4047d 100644 (file)
@@ -652,6 +652,7 @@ extern void show_sect_stats(int);
 extern void show_sect_capab(int);
 extern void show_item(int);
 extern void show_news(int);
+extern void show_product(int);
 extern void show_updates(int);
 /* shpsub.c */
 extern void shp_sel(struct nstr_item *, struct emp_qelem *);
index 2fed22581585f3275e3f9755df461df116b25e3c..45fbad5d88a5b4e4ec417d791ddf359aadc238bf 100644 (file)
@@ -8,121 +8,65 @@ Some of those products may, in turn,
 be considered raw materials for other industries
 which produce other products.
 .s1
-This table gives the constituents and costs for each type of product.
+The show command displays characteristics of products:
 .s1
-All costs given in the table are for 100% production efficiency.
-Many processes depend on technology level
-or educational level of the country;
-a note like \*Qp.e.=(tlev+10)/(tlev+20)\*U means
-that a country with a technology level of 0
-has a production efficiency of 50%
-and will only produce one-half of the specified product amount
-for the given costs,
-whereas a country with a technology level of 100
-will have a production efficiency of 92%.
+.EX show product
+.NF
+product    cost  raw materials  reso dep  level p.e.
+   iron i  $0                    min   0  1.0
+   dust d  $0                   gold  20  1.0
+   food f  $0                   fert   0  (tech+10)/(tech+20)
+    oil o  $0                  ocont  10  (tech+10)/(tech+20)
+    rad r  $2                   uran  35  (tech-40)/(tech-30)
+ shells s  $3     2l  1h                  (tech-20)/(tech-10)
+   guns g  $30    1o  5l 10h              (tech-20)/(tech-10)
+ petrol p  $1     1o                      (tech-20)/(tech-10)
+   bars b  $10    5d                      1.0
+    lcm l  $0     1i                      (tech+10)/(tech+20)
+    hcm h  $0     2i                      (tech+10)/(tech+20)
+   tech    $300   1d  5o 10l              (educ-5)/(educ+5)
+medical    $90    1d  5o 10l              (educ-5)/(educ+5)
+    edu    $9     1l                      1.0
+  happy    $9     1l                      1.0
+.FI
 .s1
-In addition, some sectors don't produce raw materials as well as others,
-and some produce much better than others.  Use the "show sector capabilities"
-command to see production efficiencies and other useful information on
-producing sectors.
+The columns are:
+.in \w'raw materials\0\0'u
+.L product
+The name of the product and the one-letter mnemonic of the commodity
+made, if any.
+.L cost
+Cost per unit of production.
+.L "raw materials"
+Raw materials for one unit of production.
+.L "reso dep"
+Natural resource exploited, and its rate of depletion.
+.L "level p.e."
+Level production efficiency, for 100% sector type production
+efficiency
+.in
 .s1
-The rate at which constituents can be turned into products
+How much a sector can produce
 is governed by the amount of \*Qwork\*U performed by its populace,
-divided by the units of constituents
-per unit of product.
+divided by the amount of raw materials
+per unit of production.
 E.g., it takes 3 units of \*Qwork\*U to produce 1 shell;
 2 units to incorporate the light construction materials
 and 1 unit for the heavy.
-\*QNatural resources\*U such as fertility
-count as one unit of constituents;
+Mining a \*Qnatural resource\*U such as fertility
+takes one unit of work;
 e.g., it takes 1 unit of work per unit of food produced.
 .s1
-.in \w'technology\0\0'u
-.L shells
-Shell production efficiency depends on technology level;
-p.e.=(tlev-20)/(tlev-10)
-Shells cost $3 each to manufacture.
-Each requires 2 units of light construction materials
-and 1 unit of heavy construction materials.
-You must have a minimum technology of 20 to produce shells.
-.L guns
-Gun production depends on technology level;
-p.e.=(tlev-20)/(tlev-10)
-Guns cost $30 each to manufacture.
-Each requires 5 units of light construction materials,
-10 units of heavy construction materials,
-and 1 unit of oil.
-You must have a minimum technology of 20 to produce guns.
-.L iron
-Iron ore production depends on the mine's mineral richness.
-Extracting iron ore is free,
-and doesn't deplete the sector's mineral richness.
-.L dust
-Gold dust production depends on the mine's gold richness.
-Extracting gold dust is free,
-but depletes the sector's gold richness.
-.L bars
-Gold bars cost $10 to produce and require 5 units of gold dust each.
-.L food
-Food production efficiency depends on technology level
-and the fertility of the sector;
-p.e.=(tlev+10)/(tlev+20).
-Growing food is free,
-and doesn't deplete the sector's fertility.
-.L oil
-Oil production efficiency depends on technology level
-and the oil content of the sector;
-p.e.=(tlev+10)/(tlev+20).
-Pumping oil is free,
-but depletes the sector's oil content.
-.L petrol
-Petrol production depends on technology level;
-p.e.=(tlev-20)/(tlev-10).
-A unit of petrol costs $1 to manufacture.
-Every 10 units of petrol require 1 unit of oil to produce.
-You must have a minimum technology of 20 to produce petrol.
-.L lcm
-Light construction material production efficiency
-depends on technology level;
-p.e.=(tlev+10)/(tlev+20).
-Producing lcms does not cost money, but requires 1 unit of iron ore. 
-.L hcm
-Heavy construction material production efficiency
-depends on technology level;
-p.e.=(tlev+10)/(tlev+20).
-Producing hcms does not cost money, but requires 2 unit of iron ore. 
-.L rad
-Radioactive material production efficiency depends on technology level,
-which must be at least 40.
-p.e.=(tlev-40)/(tlev-30).
-Producing rads cost $2 per ton,
-and depletes the uranium content of the sector.
-.L education
-A unit of education (a \*Qclass of graduates\*U),
-costs $10 to produce and requires 1 unit
-of light construction materials (see "info Education").
-.L happiness
-A unit of happiness (\*Qhappy strollers\*U),
-costs $10 to produce and requires 1 unit
-of light construction materials (see "info Happiness").
-.L technology
-Technology production efficiency depends on education level;
-p.e.=(elev-5)/(elev+5).
-A unit of technology (a \*Qtechnological breakthrough\*U),
-costs $5 times the number of ETUs per update
-to produce, and requires 10 units
-of light construction materials,
-5 units of oil and 1 unit of gold dust.  For more details about how
-technology level is calculated from technology units, see "info Technology".
-.L research
-Research production efficiency depends on education level;
-p.e.=(elev-5)/(elev+5).
-A unit of research (a \*Qmedical discovery\*U),
-costs $90 to produce and requires 10 units
-of light construction materials,
-5 units of oil and 1 unit of gold dust (see "info Research").
+How many products each unit of production makes depends on the level
+production efficiency, which is the product's level p.e. (shown by
+"show product") times the sector type's p.e. (shown by "show sect
+stats").  Production requires a level p.e. above zero, obviously.
 .s1
-Note that the resource depletion documented above can be customized by
-the deity.
-.in
-.SA "Producing, Updates"
+Say your country is at tech level 25.  Then your agribusinesses' level
+p.e. is (25+10)/(25+20) * 900% = 7, i.e. they'll make 7 food per unit
+of production.  Your shell industries' level p.e. is only
+(25-20)/(25-10) * 100% = 1/3, i.e. they'll make 1 shell per three
+units of production.  Your uranium mines can't produce at all, because
+their level p.e. is negative.
+.s1
+.SA "Producing, Updates, Item-types"
index ea828824d4e13f07af97591358d94296e49aa25c..652436ef4eb085dbbf7f63b45bafb91311f55754 100644 (file)
@@ -1,8 +1,7 @@
 .TH Concept "Quick Reference Card"
-.NA Quick-ref "A quick reference card for sector types and production"
+.NA Quick-ref "A quick reference card for sector types"
 .LV Basic
 .NF
-
 Sector-types:
     BASICS                   INDUSTRIES                MILITARY / SCIENTIFIC
     .  sea                   d  defense plant          t  technical center
@@ -18,25 +17,5 @@ Sector-types:
                              j  light manufacturing
     #  bridge head           k  heavy manufacturing
     =  bridge span           %  refinery
-
-(Petrol is per 10 units; others per unit)
-
-Products:
-Item      $    Lcm  Hcm Iron Dust  Oil  Rad   Tech   Production Eff.
-Shells:   3     2    1    0    0    0    0     20    (tech-20)/(tech-10)
-Guns:    30     5    10   0    0    1    0     20    (tech-20)/(tech-10)
-Iron:     0     0    0    0    0    0    0      0    0
-Dust:     0     0    0    0    0    0    0      0    0
-Bars:    10     0    0    0    5    0    0      0    0
-Food:     0     0    0    0    0    0    0      0    (tech+10)/(tech+20)
-Oil:      0     0    0    0    0    0    0      0    (tech+10)/(tech+20)
-Petrol    1     0    0    0    0    1    0     20    (tech-20)/(tech-10)
-Lcm:      0     0    0    1    0    0    0      0    (tech+10)/(tech+20)
-Hcm:      0     0    0    2    0    0    0      0    (tech+10)/(tech+20)
-Rad:      2     0    0    0    0    0    0     40    (tech-40)/(tech-30)
-Educate:  9     1    0    0    0    0    0      0    0
-Happy:    9     1    0    0    0    0    0      0    0
-Tech:  5*ETUS  10    0    0    1    5    0      0    (edu-5)/(edu+5)
-Resrch:  90    10    0    0    1    5    0      0    (edu-5)/(edu+5)
 .FI
-.SA "Sectors, Producing"
+.SA "Sectors"
index 2a0e5dce3e15a60a8ab581ccf05447af91a86005..168bd8d417f4d87e573728612f4c8b0b591a7912 100644 (file)
@@ -2,11 +2,11 @@
 .NA show "Characteristics of sectors, units, updates and more"
 .LV Basic
 .SY "show <land|nuke|plane|sector|ship> [b|s|c] [tech]"
-.SY "show <bridge|item|news|tower>"
+.SY "show <bridge|item|news|product|tower>"
 .SY "show <updates> [number]"
 The show command shows characteristics of sectors, units (ships,
-planes, land units and nukes), bridges (spans and towers), items and
-news, as well as information on updates.
+planes, land units and nukes), bridges (spans and towers), items, news
+and products, as well as information on updates.
 .s1
 Characteristics are more fully described in separate info
 pages (Ship-types, Nuke-types, etc.).
@@ -36,4 +36,4 @@ Printing for tech level '325'
 75kt  fusion     3  90   3  320 106 $  20000 
 .FI
 .s1
-.SA "Ship-types, Nuke-types, Plane-types, Unit-types, Sector-types, Ships, Planes, LandUnits, Nukes, Bridges, Item-types, newspaper, Updates"
+.SA "Ship-types, Nuke-types, Plane-types, Unit-types, Sector-types, Ships, Planes, LandUnits, Nukes, Bridges, Item-types, Products, newspaper, Updates"
index 85b7a4f782b76f4ff021f94ff265a88a6f826ed1..081133da4b5ab44760c6f0bfc154db5568fd41cf 100644 (file)
@@ -98,6 +98,10 @@ show(void)
        cfunc = show_land_capab;
        break;
     case 'p':
+       if (p[1] == 'r') {
+           show_product(99999);
+           return RET_OK;
+       }
        bfunc = show_plane_build;
        sfunc = show_plane_stats;
        cfunc = show_plane_capab;
index 8108f570545eeb27f6f9d9530c8ea76d05e88392..621d44131e3169cf7cc23a375a2ed314b48782d4 100644 (file)
@@ -230,7 +230,7 @@ struct cmndstr player_coms[] = {
     {"ship <SHIPS>", 0, shi, 0, NORM},
     {"shoot <c|u> <SECTS> <NUMBER>", 3, shoo, C_MOD, NORM + MONEY + CAP},
     {"show <TYPE> <\"build\"|\"stats\"|\"cap\"> [<tech>]\n"
-     "\tshow <bridge|item|news|tower>\n"
+     "\tshow <bridge|item|news|product|tower>\n"
      "\tshow updates [<NUM>]>",
      0, show, 0, VIS},
     {"shutdown <minutes> <disable update?>", 0, shut, 0, GOD},
index 8e4b34f29b30c6de2a65b12638c7040de4d35ee0..33040c2b1fab8a8499a8e81923e1562a51c7bb7f 100644 (file)
@@ -597,6 +597,43 @@ show_item(int tlev)
     }
 }
 
+void
+show_product(int tlev)
+{
+    struct pchrstr *pp;
+    int i;
+    char *lev;
+
+    pr("product    cost  raw materials  reso dep  level p.e.\n");
+
+    for (pp = pchr; pp->p_sname; pp++) {
+       pr("%7.7s %c  $%-3d ",
+          pp->p_sname,
+          pp->p_type < 0 ? ' ' : ichr[pp->p_type].i_mnem,
+          pp->p_cost);
+       (void)CANT_HAPPEN(MAXPRCON > 3); /* output has only three columns */
+       for (i = 0; i < 3; i++) {
+           if (i < MAXPRCON && pp->p_camt[i]
+               && pp->p_ctype[i] > I_NONE && pp->p_ctype[i] <= I_MAX)
+               pr(" %2d%c", pp->p_camt[i], ichr[pp->p_ctype[i]].i_mnem);
+           else
+               pr("    ");
+       }
+       if (pp->p_nrndx)
+           pr("   %5.5s %3d  ",
+              symbol_by_value(pp->p_nrndx, resources), pp->p_nrdep);
+       else
+           pr("              ");
+       if (pp->p_nlndx < 0)
+           pr("1.0\n");
+       else {
+           lev = symbol_by_value(pp->p_nlndx, level);
+           pr("(%.4s%+d)/(%.4s%+d)\n",
+              lev, -pp->p_nlmin, lev, pp->p_nllag - pp->p_nlmin);
+       }
+    }
+}
+
 void
 show_news(int tlev)
 {