Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Creating Multiplayer Game

Author
Message
Ignatios
9
Years of Service
User Offline
Joined: 6th Feb 2015
Location:
Posted: 22nd Apr 2015 16:43
So, I am working on creating a multiplayer card game that connects via lan since I am deploying soon...

I have gotten the code where there is a host and then a client connects to the host, what I cannot figure out how to do is allow the client to see the same screen in a sense (obviously they will have a different perspective via their hand/field/etc)

If anybody can help it would be very appreciated
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 22nd Apr 2015 17:51 Edited at: 22nd Apr 2015 17:54
the host collect and send data to its clients.
means the server have all data.
host & client can be the same app, just the connection is
different. u can start/connect via buttons.
u can make a function DisplayCards with Parameter Player.
Player is a user defined type with fields Name,Nr, etc.

For Network Messages myself using a command name and then the parameters, then at received a select case and call a function for this command. http://www.appgamekit.com/documentation/Reference/Multiplayer.htm




AGK 108 (B)19 + AppGameKit V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Ignatios
9
Years of Service
User Offline
Joined: 6th Feb 2015
Location:
Posted: 23rd Apr 2015 02:56
Still a little confused..I code in T1 agk...A little more indepth elaboration e.e?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 23rd Apr 2015 11:07
At the simplest level, everybody runs exactly the same program.
You load exactly the same level data.
One player is the HOST. They will maintain the master copy of any game data and distribute it to all other players.

For example, you have 4 players in 4 different places in your game. Each one reports their position to the HOST.
Then they request (or are given) the position of all other players. They take this information and use it to construct their version of the game world to look like every other player's world, but from their position.

All other data is shared in the same way. Any decisions (e.g a player was hit and died) are made by the host, and sent out to all other players.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 23rd Apr 2015 11:16 Edited at: 23rd Apr 2015 11:16
this is a good start, but you should spilt source code more into functions.
http://www.appgamekit.com/documentation/examples/multiplayer/0_getting_started.htm

AGK 108 (B)19 + AppGameKit V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 23rd Apr 2015 14:15
This is what i used to make to achieve what you described.
Maybe you can tinker with the codes to fit your purposes

The medias:
https://forumfiles.thegamecreators.com/download/2554594

The codes:

Login to post a reply

Server time is: 2024-11-25 21:49:47
Your offset time is: 2024-11-25 21:49:47