Original Post
Hi there,
I've added networking to my game engine and I can make a host & client between 2 laptops via hamachi ( school told me to use a vpn because of the school servers that blocks almost everything ).
So I can send data of both 'enemies' to each player ( x-position, y-position, width, height ) and then I can check for collision. But this is only for 1 little cube.
What should I do if I need to send 20 different objects with their own information ( armour, defence, attack, width, height, position, etc ) to both players? I'm using winsock for my connection by the way.
I would like to use XML to set the general informations( armour, defence, ... ) of all units and buildings. So suppose both players got that same XML file. Then I should just send the type ( which unit/building it is ) and the position right? Because I can receive all general information of that XML file. Is this a good/usual way to do this?
In big games they work with databases but I haven't practiced with that yet. The disadvantage of using 2 XML files for host & client is that both players can change some values and 'cheat'. But this is only for school so I don't really care about making it totally safe for 'not cheating'.
So the main questions are: How should I send all data? Should I use XML or not? Is there any disadvantage of using XML ( except it's not cheat safe )? Is there a better way ( except databases, I'm don't have a lot of experience with this )
B. Jonathan
I've added networking to my game engine and I can make a host & client between 2 laptops via hamachi ( school told me to use a vpn because of the school servers that blocks almost everything ).
So I can send data of both 'enemies' to each player ( x-position, y-position, width, height ) and then I can check for collision. But this is only for 1 little cube.
What should I do if I need to send 20 different objects with their own information ( armour, defence, attack, width, height, position, etc ) to both players? I'm using winsock for my connection by the way.
I would like to use XML to set the general informations( armour, defence, ... ) of all units and buildings. So suppose both players got that same XML file. Then I should just send the type ( which unit/building it is ) and the position right? Because I can receive all general information of that XML file. Is this a good/usual way to do this?
In big games they work with databases but I haven't practiced with that yet. The disadvantage of using 2 XML files for host & client is that both players can change some values and 'cheat'. But this is only for school so I don't really care about making it totally safe for 'not cheating'.
So the main questions are: How should I send all data? Should I use XML or not? Is there any disadvantage of using XML ( except it's not cheat safe )? Is there a better way ( except databases, I'm don't have a lot of experience with this )
B. Jonathan