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.

Dark GDK / character selection/online multiplayer

Author
Message
thm120
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location:
Posted: 27th Jun 2009 05:56 Edited at: 27th Jun 2009 07:51
multiplayer and character selection in the multiplayer window/menu(before the game begins) how do you do it? what do i need to learn in order to do it?
UPDATE:
ok i found multisync but i see weird screen flickering(sumhow a retarded frame rate)
maybe its something i'm doing wrong, teh cleint i used didnt work at all(eighter i didnt put it in teh right place or it sux
if u have a better cleint and server code please let me examine it
thm120
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location:
Posted: 27th Jun 2009 07:03
seriously people i need your help
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 27th Jun 2009 18:01
In order to do what you want, you need to read up on networking in general, and client/server networking from a gaming point of view, a google search should find you what you need...

First, make sure the ports that you are going to use for connections are open properly so your client and server can talk to each other, you are using the localhost i see atm(127.0.0.1) on port 23.. try using your IP instead of the localhost, whatever it is, and opening a random port number to connect to.

Next, get some form of network monitor, if your firewall doesnt have something built-in. That way you will be able to watch if the client/server are actually trying to send anything or not, which will tell you if it is your code or your network you need to look at

But, I have had a play with Multisync, and while I havent actually deployed it in any apps as yet or thoroughly tested it, I didnt have any problems at all with using it to establish that it worked and did what i needed, connected/disconnected multiple users, sent/recieved data to/from all of them without causing silly latency spikes..

If it ain't broke.... DONT FIX IT !!!
thm120
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location:
Posted: 27th Jun 2009 19:33
ok i changed the ports on the server and client, but the client still doesnt work, i get errors that i know are not errors when i debug, idk what i'm doing wrong
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 27th Jun 2009 20:02
sorry to ask the basic questions, but you do have the DLL in the project folder/environment path or where you are running your EXE from ? and have the static lib linked to ur project ?

Perhaps if you could post the errors you are getting it would help, maybe someone has had a similar error... also, if you have a look through the WIP thread for multisync, or PA thread(cant remember which) you should be able to find alot of small usage hints and tips, I know the author is pretty active there helping people with their problems.

If it ain't broke.... DONT FIX IT !!!
thm120
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location:
Posted: 7th Jul 2009 20:39
yes
thm120
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location:
Posted: 1st Aug 2009 03:04
ok about the IP to connect to
is there a way to make it so the program finds the IP of the person running the App and uses that as a host IP?
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 1st Aug 2009 03:10
Try removing the NetSetPort calls.

thm120
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location:
Posted: 1st Aug 2009 03:19 Edited at: 1st Aug 2009 03:23
if i remove the port calls it will fix the frame rate or make the program get the users ip and use that..

besides, my client doesnt work when i debug, i get
it saids the unmatched '{' is on line 190 (which is around where the Main Loop begins)


i know there are no unmatched '{' heres the WHOLE code for the client
ps... if anybody uses the above code in their game or modify it to use on their own, please just give credit
Drowneath
15
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 1st Aug 2009 10:08
However, your code looks messed up
thm120
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location:
Posted: 1st Aug 2009 20:27
yea i know, but it works fine without the client part.. i just gotta clean it up a bit
Drowneath
15
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 2nd Aug 2009 05:59 Edited at: 2nd Aug 2009 06:13
Basically, before doing anything, I would make a concept of that first.
In this case,

Firstly, you'll be thinking of a database to store the players' data.
Then design the database structure concept.

Then create a server as a mediator for the client and the database. (In my game, I made 3 kind of servers. Login server, World server, and the actual Game Server. each server will do its own job.)

Beside that, you'll also need to think of the client. Its game screen state, perhaps.

Splash screen, login screen, CHARACTER SELECTION SCREEN, then the main (playing) screen.

Then think of the scenario. This time you'll need to imagine that you're the player. You'll need to think of the procedure to get into your game.

For example, in the login screen, the user will have to type his/her username and password, and click the login button, then send a message containing the user's login information to the login server, then the login server will check whether the login information is correct or not, then the login server will return a response to tell the client whether the login is valid or not.

If the login is valid, then the login server will store a server session to tell the other servers (character server, game server, etc) that this user is validly authenticated.

Once the login is OK, then change the client's game screen state to the character selection, connect to the char server, and the client will ask the server for a character list for this player, then the char server will return a list of this player's characters data, then the client will parse the datas, and show them as 3D models that the user can select. Here you'll need to implement your own character selection style. Maybe position all of the characters from left to right, then if the player clicked one of them, the character information will be shown, and if the player clicked START button, the player will be taken to the main (playing) screen.

Once a character is picked, then tell the character server that this player is picking this character, then the char server will store it again to the session.

Then in the main screen, the client will have to routinely send the game server about current character's datas. Its current position, current map, current state, current experiences, etc. to make the synchronisation between others. And so for the game server, it will have to send the information of current information around the current position of the character, to the client.

Something like that.
You can't just simply pasting someone's codes and paste it to your own code without understanding it. And that's why your code looks messed up.

I know that some parts of your code were taken from this thread: http://forum.thegamecreators.com/?m=forum_view&t=154067&b=22 . That's OK if you really understand what you're doing.

But I really got no idea what's the point of pasting Multisync header files in your client but you also included multisync.h in your code at the same time.

But that's good if you do understand of what the codes do. Then take my statements as an advice.

if(asleep) sheep++;
thm120
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location:
Posted: 3rd Aug 2009 03:21
i pasted some part of the multisync.h in the code too because sometimes i get random errors, then i put those lines in there and suddenly its fine, so its more of a better safe than sorry situation.

as of right now i'm just trying to get the basics down, create a player to player online connection.


what i'm trying to do in the future is :
1. person hosts the game,
2. enter your name
3. character selection
4. play

i dont have servers or anything like that so i wanted it to be able to be hosted on anybody's PC and allow others to join.

btw if u know how to setup a server, guide me to a place where i can learn it.
Drowneath
15
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 3rd Aug 2009 08:09 Edited at: 3rd Aug 2009 08:09
Server is just another program that receives client request and sends response based on client request.

You need to create 2 type of programs for a multiplayer game: server and client.

Server will accepts client request, and send a response back to the specified client.

For example, read my previous long post carefully. It describes how server and client works, also its scenario example.

You can use NetHost command from Multisync to make the program acts as a "server", and NetConnect command to make the program acts as a "client".

Say you wanted to verify a login information entered by a user in a client machine.
So the client will send a message containing login information to the server, then the server will verify the login information, then the server will return a response back to the client whether the login information is valid or not.

if(asleep) sheep++;
thm120
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location:
Posted: 3rd Aug 2009 22:12
ok, i have a server setup now, i just cant get my client to debug without errors... can u help me?

Login to post a reply

Server time is: 2024-10-01 08:48:10
Your offset time is: 2024-10-01 08:48:10