dbuman
Member
|
Multiplayer Coding
Before you tell me to get the MMO code, or use RakNet, let me explain.
I have tried raknet but every time i try to build it, it poses problems which I cannot fix, like it cannot read the include file GetTime.h as it does not exist, or so it says.
I cannot afford to purchase a license so I cannot get the MMO code.
Now with this being said....
I would like to be able to see multiple players on the game, and be able to fight the same Obj and have the AI objs sync with each client, so its not like separate instances of the same game.
In order to do this, ive heard of using Net::obj but I am unsure on how to do so. So far I was able to use the tutorial from the SDK to create a fully working chatbox to intercommunicate between clients.
However, I do not know which variables, and what would need to change in order to make not only the text be sent, but also complete player actions and AI actions.
Please help me!
|
|
07-01-2011 03:14 AM |
|
Jben
Member
|
RE: Multiplayer Coding
MMO code includes the server and the client, you will not need RAKNET.
|
|
07-01-2011 04:02 AM |
|
dbuman
Member
|
RE: Multiplayer Coding
I said I cannot afford the MMO code, so is there any other way to learn how to transmit data to the server as far as character movement and actions?
|
|
07-01-2011 04:20 AM |
|
dbuman
Member
|
RE: Multiplayer Coding
Ok so Im working with the socket.cpp to try and mend it to my use, and so far im at a point where it will not send the player's pos to the other peers because it cannot convert a vec to a CPtr. Now the difference between my game code and the actual tutorial is that my Player class is based off of Game::Chr, so it doesnt have just player.pos, it has to be player.pos(). So is there any way to convert it to cptr so I can send the pos data to peers?
|
|
07-01-2011 06:20 AM |
|
Driklyn
Member
|
RE: Multiplayer Coding
Send each coordinate individually (i.e. send player.pos().x, then player.pos().y, and lastly player.pos().z). Then recreate the position manually as explained in this thread.
|
|
07-01-2011 06:52 AM |
|
dbuman
Member
|
RE: Multiplayer Coding
Im now trying a different approach, Id like to make a player as a Net Obj so I can make a client and a server. My outlook is it may be easier to make the server the full game, with npcs, enemies, terrain, plant placement, or as much as possible, and make the client simply have the graphics, models, and basic code to put a player on the server's instance. So client = only resources and basic coding. Server = all coding for players, enemies, etc.
The way I see it is the player saves no files at their current data location, but the server saves everything. Im thinking this could be done by simply making the client's player input send commands to the server, then in turn creates, moves, attacks, etc based on the server's coding. Is this possible
(This post was last modified: 07-01-2011 06:29 PM by dbuman.)
|
|
07-01-2011 06:29 PM |
|