[Freeciv-Dev] Re: Communications Protocol
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
> The packets are basically serialized structs. You can find the relevant
> code at common/packets.h and common/packets.c.
> Sometimes we serialize some fields in some special way to pack the data
> more tightly. It would be easier to make the network code using something
> like Sun RPC or Java but this is an easily portable C program so we have
> to do this kind of stuff by hand ourselves. Of course this gives more room
> for optimization.
>
> Every packet follows this format:
>
> <uint16:packet length><uint8: packet type><data bytes>...
>
> Integers are sent in so called network byte order or big endian.
>
> The per struct serialization functions are called receive_packet_*().
Cool! Thanks for the rapid response!
> About AI... I don't think neural networks are the most suitable candidates
> for the kind of problems presented by a game like freeciv. In freeciv the
> rules, even if more complex than in some games, are explicit and
> inflexible. Neural networks are good for perceiving patterns in the middle
> of noise. I would use a mix of several other AI technologies like A*
> search for pathfinding, influence maps for status assessment (which player
> controls what zone, what is dangerous terrain and what is not etc) and
> some kind of rules based system for taking high level decisions using
> predefined tactics that are chosen according to the situation.
Hrm. Well, I'll ponder that. :-)
The cool thing about writing this Perl module is it'll make it a lot easier
for people to implement AI clients how they want - Perl, with the Inline
modules, can now parse lots of other languages, so I feel even if my NN
solutions don't work, it'll certainly open the flood-gates for other people
to try.
Thanks again
+Pete
|
|