summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c0b300d)
Food supply during update adds complexity to the update. How much
good it does to players is highly doubtful; certainly nobody can rely
on it. It isn't covered by the starvation command. Starving ships or
land units can steal enough food from their sector to make it starve,
too. Finally, the supply code is notoriously hard to use correctly.
We don't know of issues with the update's use, but we haven't
convinced ourselves that there aren't any either.
-Note that if a ship doesn't have enough food, it will try to draw it from
-supply sources (see info supply). If it still hasn't enough food, it will
+Note that if a ship doesn't have enough food, it will
attempt to grab unneeded food from any land units it is carrying.
.s1
attempt to grab unneeded food from any land units it is carrying.
.s1
-Land units eat food as well, an amount based on the total number of military
-in the unit (this is the efficiency times the number of mil needed to build
-the unit). If a land unit doesn't have enough food, it will try to draw it
-from supply sources (see info supply). If it still doesn't have enough, and
-it is on a ship, it will attempt to get food from the ship.
-.s1
The presence of food also affects the birthrate in Empire;
if there is no food in a sector no babies will be born.
A baby consumes 0.3 units of food in growing to adulthood.
The presence of food also affects the birthrate in Empire;
if there is no food in a sector no babies will be born.
A baby consumes 0.3 units of food in growing to adulthood.
-Units need supplies in order to attack. Each update, and each time they
-attack, units will attempt to draw supplies. See info \*Qsupply\*U.
-Really, I'm serious. If you don't read info \*Qsupply\*U, you'll die a horrible
-death. I'm not kidding.
+Units need supplies in order to attack. See info \*Qsupply\*U.
a) if the sector is a cap, it costs $1 per etu since
the last update
b) people in non-sanctuary sectors eat
a) if the sector is a cap, it costs $1 per etu since
the last update
b) people in non-sanctuary sectors eat
- 1) If not enough is available, the sector
- uses the supply routines to draw more.
- 2) If still not enough is available,
- the excess people will starve off.
- a) No more than 50% of the people
- in a sect can die;
- the uw's die first, then
- the civs, then the mil.
+ If not enough is available, the excess people will
+ starve off. No more than 50% of the people
+ in a sector can die; the uw's die first, then
+ the civs, then the mil.
c) if there was starvation, the work percentage is set
to 0, otherwise the work rate rises by
8+(1-15), max of 100
c) if there was starvation, the work percentage is set
to 0, otherwise the work rate rises by
8+(1-15), max of 100
.s1
With this syntax, the starvation command displays all sectors in
<SECTS> that currently do not have enough food. It does not take into account
.s1
With this syntax, the starvation command displays all sectors in
<SECTS> that currently do not have enough food. It does not take into account
-emergency food growing & supplying (see info supply)
It also does not worry about feeding babies... it merely
check for starvation. If you want population increase,
you'll need to chuck in some extra food...
It also does not worry about feeding babies... it merely
check for starvation. If you want population increase,
you'll need to chuck in some extra food...
to attack with. (depending on the intensity of combat. The more intense the
combat, the more chance the unit will use a basic load of supplies)
.s1
to attack with. (depending on the intensity of combat. The more intense the
combat, the more chance the unit will use a basic load of supplies)
.s1
-During the update, each unit will attempt to draw food supplies just before
-starvation is calculated.
-.s1
When a unit needs to draw supplies, such as when you use the supply command,
or the unit wishes to attack, or is attacked, etc, it must attempt to get
them from supply sources. Other things may use the same routines, such as
When a unit needs to draw supplies, such as when you use the supply command,
or the unit wishes to attack, or is attacked, etc, it must attempt to get
them from supply sources. Other things may use the same routines, such as
-loyal sectors, which will draw food from supply sources when in danger of
-starvation, and ships/forts/sectors, which will draw shells when they need
-them to fire defensively.
+ships/forts/sectors, which will draw shells when they need them to
+fire defensively.
.s1
.L "Supply Sources"
.s1
.s1
.L "Supply Sources"
.s1
In general, when any land unit/ship/fort needs shells, it will attempt to
draw them before use, if it does not already have them.
.s1
In general, when any land unit/ship/fort needs shells, it will attempt to
draw them before use, if it does not already have them.
.s1
-Also, units/ships/sectors will use supply sources to get enough food during
-the update so that they do not starve.
-.s1
/* Conjure up 1f to make life easier for the player */
manna = vec[I_FOOD] = 1;
}
/* Conjure up 1f to make life easier for the player */
manna = vec[I_FOOD] = 1;
}
- if (vec[I_FOOD] < needed && sp->sct_own == sp->sct_oldown) {
- /* steal food from warehouses, headquarters,
- supply ships in port, or supply units */
- vec[I_FOOD] = supply_commod(sp->sct_own,
- sp->sct_x, sp->sct_y,
- I_FOOD, needed);
- }
}
starved = feed_people(vec, etu);
if (starved > 0) {
}
starved = feed_people(vec, etu);
if (starved > 0) {
struct natstr *np;
int n, k = 0;
int start_money;
struct natstr *np;
int n, k = 0;
int start_money;
- int lastx = 9999, lasty = 9999;
for (n = 0; NULL != (lp = getlandp(n)); n++) {
if (lp->lnd_own == 0)
continue;
for (n = 0; NULL != (lp = getlandp(n)); n++) {
if (lp->lnd_own == 0)
continue;
sp = getsectp(lp->lnd_x, lp->lnd_y);
if (sp->sct_type == SCT_SANCT)
continue;
sp = getsectp(lp->lnd_x, lp->lnd_y);
if (sp->sct_type == SCT_SANCT)
continue;
- if (lastx == 9999 || lasty == 9999) {
- lastx = lp->lnd_x;
- lasty = lp->lnd_y;
- }
- if (lastx != lp->lnd_x || lasty != lp->lnd_y) {
- /* Reset the cache */
- bp_disable_cachepath();
- bp_clear_cachepath();
- bp_enable_cachepath();
- }
np = getnatp(lp->lnd_own);
start_money = np->nat_money;
upd_land(lp, etus, np, bp, build);
np = getnatp(lp->lnd_own);
start_money = np->nat_money;
upd_land(lp, etus, np, bp, build);
if (player->simulation)
np->nat_money = start_money;
}
if (player->simulation)
np->nat_money = start_money;
}
- bp_disable_cachepath();
- bp_clear_cachepath();
static int
feed_land(struct lndstr *lp, int etus)
{
static int
feed_land(struct lndstr *lp, int etus)
{
- int needed;
-
- if (opt_NOFOOD)
- return 0;
-
- needed = (int)ceil(food_needed(lp->lnd_item, etus));
-
- /* scrounge */
- if (needed > lp->lnd_item[I_FOOD])
- resupply_commod(lp, I_FOOD);
-
return feed_people(lp->lnd_item, etus);
}
return feed_people(lp->lnd_item, etus);
}
sp->sct_updated = 1;
work = 0;
sp->sct_updated = 1;
work = 0;
- /* do_feed trys to supply. So, we need to enable cacheing
- here */
- bp_enable_cachepath();
-
sctwork = do_feed(sp, np, vec, &work, etu);
bp_put_items(bp, sp, vec);
sctwork = do_feed(sp, np, vec, &work, etu);
bp_put_items(bp, sp, vec);
- bp_disable_cachepath();
- bp_clear_cachepath();
-
if (sp->sct_off || np->nat_money < 0)
continue;
if (sp->sct_off || np->nat_money < 0)
continue;
struct natstr *np;
int n, k = 0;
int start_money;
struct natstr *np;
int n, k = 0;
int start_money;
- int lastx = 9999, lasty = 9999;
for (n = 0; NULL != (sp = getshipp(n)); n++) {
if (sp->shp_own == 0)
continue;
for (n = 0; NULL != (sp = getshipp(n)); n++) {
if (sp->shp_own == 0)
continue;
}
np = getnatp(sp->shp_own);
}
np = getnatp(sp->shp_own);
- if (lastx == 9999 || lasty == 9999) {
- lastx = sp->shp_x;
- lasty = sp->shp_y;
- }
- if (lastx != sp->shp_x || lasty != sp->shp_y) {
- /* Reset the cache */
- bp_disable_cachepath();
- bp_clear_cachepath();
- bp_enable_cachepath();
- }
start_money = np->nat_money;
upd_ship(sp, etus, np, bp, build);
if (build && !player->simulation) /* make sure to only autonav once */
start_money = np->nat_money;
upd_ship(sp, etus, np, bp, build);
if (build && !player->simulation) /* make sure to only autonav once */
needed = (int)ceil(food_needed(sp->shp_item, etus));
/* scrounge */
needed = (int)ceil(food_needed(sp->shp_item, etus));
/* scrounge */
- if (needed > sp->shp_item[I_FOOD])
- sp->shp_item[I_FOOD] += supply_commod(sp->shp_own,
- sp->shp_x, sp->shp_y, I_FOOD,
- needed - sp->shp_item[I_FOOD]);
if (needed > sp->shp_item[I_FOOD]) {
/* take from embarked land units, but don't starve them */
snxtitem_cargo(&ni, EF_LAND, EF_SHIP, sp->shp_uid);
if (needed > sp->shp_item[I_FOOD]) {
/* take from embarked land units, but don't starve them */
snxtitem_cargo(&ni, EF_LAND, EF_SHIP, sp->shp_uid);