Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] Re: packet_conn_ping_info and connections
Home

[Freeciv-Dev] Re: packet_conn_ping_info and connections

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv-Dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: packet_conn_ping_info and connections
From: Jason Dorje Short <jdorje@xxxxxxxxxxxx>
Date: Tue, 19 Oct 2004 16:07:39 -0400

Andreas Røsdal wrote:
On Tue, 19 Oct 2004, Jason Dorje Short wrote:

Andreas Røsdal wrote:

Why should there be a limit to the number of connections? Also, why should
there be a limit to the number of players?

1.  Assumptions in the code.

2.  Limitations in the network code (arrays must be bounded).

If the first were fixed then MAX_NUM_PLAYERS could be made much larger.
 MAX_NUM_CONNECTIONS could easily be larger.  However without
redesigning the network packets or the core network code there must be
_some_ limitation.

The most common code assumption is that
MAX_NUM_PLAYERS+MAX_NUM_BARBARIANS<=32.  4-byte bitfields are used for
players.  However this has been fixed in a number of places already.

So the current limit for MAX_NUM_PLAYERS is 2^32, because 4-byte bitfields
are used for players. This should be way more than enough, for example 256
would be a more realistic limit.

No, the limit is 32.  One player per bit.

However with BV_DEFINEs this may no longer be needed. Surely you wouldn't need to change 1000 lines of code to fix it. But I don't know what might break if the limit were raised.

Changing MAX_NUM_PLAYERS to 60 has no problems, I just tested. However,
setting it to more than 60 means that the AI players run out of flags and
nations. So then either set MAX_NUM_PLAYERS to the number of nations, or
come up with a way to provide more nations. (eg. by randomly generating a
flag, or something....)

There are way more than 60 nations...

Although most games probably don't have that many players, I just thought
it would be interesting to see a MMOG-type of game-style. Maybe even a
large tournament where all the players play at once in the same game, not
in a hiarchy of consecutive games.

Yes. However since the map is limited to 29,000 tiles you can't fit too many players in. Raising this limit would require (at least) changing coordinate values over the network to be 16-bit instead of 8-bit values. And you may have to raise index values to be 32-bit instead of 16-bit values.

jason


[Prev in Thread] Current Thread [Next in Thread]