Tiresias
September 16th, 2004, 12:03 PM
Hello Gurus,
i am trying to do a game application, and i am starting the last module which is the NPC/Creature Controller (non player character controller)...
This module is an independant module that will connect to a server. (socket tcp)
THIS MODULE AND THE SERVER WILL BE LOCATED LOCALLY ON THE SAME COMPUTER.
the purpose of the module is to "play" creatures (make them move, speak, fight etc), plenty of them, and to do that i would like (very much) to use one tcp socket PER creature ... why? because in term of code it would be much more simple because the server assumes that each message received from a client on a socket is associated to 1 and only one player/creature, and so if i respect that the change on the server side would be minimal. In contrary if my mob application opens ONLY one socket and send message for all the creature on this socket the change that i would have to do would be enormous ...
my question is : is that possible ? i expect this Mob Controller to create up to (in the worst case) 8000-10000 creatures ... which would mean the same number of local sockets .... is it completly stupid ? should i try to avoid that? what would be the performance in term of select() on the server side (would it be too slow to scan such number of fd) ?? as well in term of ressources-memory ? (i know NT can accept up to 32K sockets but its just a number). Actually even without focussing on the select(), how the system would deal with the management of such a big number of sockets?
i would appreciate very much ideas on this. I m starting this way because with the other method (one socket for all the creatures) i will have too much work to do on the server ...
thank you very much!
Tiresias
i am trying to do a game application, and i am starting the last module which is the NPC/Creature Controller (non player character controller)...
This module is an independant module that will connect to a server. (socket tcp)
THIS MODULE AND THE SERVER WILL BE LOCATED LOCALLY ON THE SAME COMPUTER.
the purpose of the module is to "play" creatures (make them move, speak, fight etc), plenty of them, and to do that i would like (very much) to use one tcp socket PER creature ... why? because in term of code it would be much more simple because the server assumes that each message received from a client on a socket is associated to 1 and only one player/creature, and so if i respect that the change on the server side would be minimal. In contrary if my mob application opens ONLY one socket and send message for all the creature on this socket the change that i would have to do would be enormous ...
my question is : is that possible ? i expect this Mob Controller to create up to (in the worst case) 8000-10000 creatures ... which would mean the same number of local sockets .... is it completly stupid ? should i try to avoid that? what would be the performance in term of select() on the server side (would it be too slow to scan such number of fd) ?? as well in term of ressources-memory ? (i know NT can accept up to 32K sockets but its just a number). Actually even without focussing on the select(), how the system would deal with the management of such a big number of sockets?
i would appreciate very much ideas on this. I m starting this way because with the other method (one socket for all the creatures) i will have too much work to do on the server ...
thank you very much!
Tiresias