Grofit
June 23rd, 2009, 08:04 AM
Hey,
Im working on a project at the moment that contains alot of WCF services, however one of the services is getting to be quite large and im not even sure if what i want is possible...
Now simply speaking its a multi user game, but in each game room (of which there can be many) there can be up to 8 players, and there can be lots of other entities in there... now there are duplex connections set up between each of the 8 players to be notified of changes in the other players positions etc. That bits simple enough and works fine, although there may be a better way... at the moment my service stores a dictionary<uint, RoomNode> and each RoomNode stores the data about who is active and some other information.
However at the moment im wondering on how to progress with how to get the other entities to do anything, now i can either have a timer that about 10 times a second updates the *AI* (although it wouldnt really be anything more than following a target) which would update the state and position, but would this work within a singleton service, and if i am having lots of rooms, lets say i have 10 rooms active with 8 people in each and each room has 20 entities, that would be like 200 AI path updates, but i cant think of any way round this as if i get players to do the logic of the entities, then they would have to send the updates over to the server for it to be synced up with others, and also its slightly vulnerable to people messing with it too...
Sorry if im being a bit vauge, but im basically wanting to run a multiplayer server within a WCF singleton thread (for the moment it would be put on shared hosting online, which would be fairly slow as a test to see if it would be popular enough to warrent some meaty hardware)
Any help on the game logic or the WCF service point of view would be great...
Im working on a project at the moment that contains alot of WCF services, however one of the services is getting to be quite large and im not even sure if what i want is possible...
Now simply speaking its a multi user game, but in each game room (of which there can be many) there can be up to 8 players, and there can be lots of other entities in there... now there are duplex connections set up between each of the 8 players to be notified of changes in the other players positions etc. That bits simple enough and works fine, although there may be a better way... at the moment my service stores a dictionary<uint, RoomNode> and each RoomNode stores the data about who is active and some other information.
However at the moment im wondering on how to progress with how to get the other entities to do anything, now i can either have a timer that about 10 times a second updates the *AI* (although it wouldnt really be anything more than following a target) which would update the state and position, but would this work within a singleton service, and if i am having lots of rooms, lets say i have 10 rooms active with 8 people in each and each room has 20 entities, that would be like 200 AI path updates, but i cant think of any way round this as if i get players to do the logic of the entities, then they would have to send the updates over to the server for it to be synced up with others, and also its slightly vulnerable to people messing with it too...
Sorry if im being a bit vauge, but im basically wanting to run a multiplayer server within a WCF singleton thread (for the moment it would be put on shared hosting online, which would be fairly slow as a test to see if it would be popular enough to warrent some meaty hardware)
Any help on the game logic or the WCF service point of view would be great...