<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40283 >

> [EMAIL PROTECTED] - Sun Jun 15 23:02:28 2008]:
> 2008/6/16 Madeline Book:
> > I have also written the code with the future feature
> > of more than one base type being allowed per tile in
> > mind. This should be possible (since indeed it was
> > allowed to have a fortress and an airbase on the same
> > tile before), but I will start a new ticket for this
> > issue later.
>  You mean that since they have been stored as separate bits (and not
> as id number), it would have been possible to have them independently
> in same tile. I don't think it has ever been really possible for
> player. Fortress and airbase have replaced each other. I think this is
> correct behavior. Do you have some good use-case where multiple bases
> should exist in same tile?

In warserver (i.e. 2.0) games it sometimes happens that a city on
one island is 11 tiles (real distance) from a city on another island
and there is only one tile beside the first city that is 10 tiles
away from the second city. Now the player would like the send
fighters between the two cities (either to attack or to transfer
them somewhere) or paradrop, both of which are limited to 10 tiles
away. The usual trick in that case is to build a fortress+airbase
on the tile that is 10 tiles away and have some defenders protect
the fighters there. This is much faster and safer than say using
some transport+engineers to terraform ocean into land and build a
city 9 tiles away.

It doesn't happen often, but it does happen.

Anyway I'm sure many players would cry if they found out that
suddenly you are not allowed to build a fortress and an airbase
on the same tile. ;)

>  Note that even with just one base/tile main reason I have not pushed
> gen-base code in faster is memory and disk space (savegame) usage.
> There will be player num (FoW, what players believe)) + 1 (truth) base
> maps. If you allow multiple bases in the same tile, you need one
> bit/tile/basetype. With just one base/tile you can have
> 2^(bits/tile)-1 base types. I even consider adding just one more
> base type in next version by using those specials bits we have
> been using until now.

Let's assume there can be a maximum of 8 base types. Taking the
worst possible case of a 256x256 tile map with 32 players in it
means we have 33 maps of 65536 tiles or 2162688 tiles total for
the server to keep track of (or to be stored in the savegame).

Now if we allowed multiple base types on the same tile we need
a byte (8 bits) per tile to keep track of which bases are on
a tile, giving 2162688 total bytes used to keep track of this
information. If we allow only one base type per tile at a time,
then we need 3 bits per tile (lg(8)), or 811008 bytes total.

So in the worst possible case for our 8 base types of which
only one type can exist at a tile at a time, the server saves
not more than one and a half megabytes of memory. I would
think that this would be a very small portion compared to its
total memory use (which, for example in the worst case above,
would probably be a few 100 megabytes).

As for savegames, the saving would probably be a bit more
considering that the data is saved in a human editable format.
But I assume a server would also have much more disk space
(at least compared to RAM) and that the savegames would be
compressed. So the saving is not that useful in the first

Therefore, in my opinion, the advantages due to space savings
and the configurability of base types does not out-weigh the
disadvantage of losing a gameplay ability (which from the
vast majority of users' points of view would look like it
was removed for no obvious reason).

But there is a somewhat deeper problem that I have noticed
now; if we were to decide that multiple base types were
allowed to exist on a tile at the same time, then something
would need to be done about S_PILLAGE_BASE and related
code. We would need a new mechanism to encode the "activity
target" in the pillage activity both as entered in the client
and handled at the server. :(

Finally, for far, far future considerations, if ever specials
are generalized to be fully loaded from rulesets, I assume
that military bases could be merged into this ruleset type.
Then since most special types can coexist on a tile, we
would once again have multiple base types allowed on a tile
at the same time.


Freeciv-dev mailing list

Reply via email to