|
Post by Wayne Rayner on Jun 16, 2010 10:57:53 GMT -5
Ok so I was thinking about trying to create a little Online Game. As in a little map (I mean litteraly little). I'm wanting to know if this little theory below works.
Ok you have a client which you create a user (regester). Then you (the user) logs in with the information you gave in the registration. Once you are logged in as a user the main server then redirects you to a game server which has all the information of the little world. The thing is I actually want one server but it seems better to have the two servers one the main login server and the second the game server.
So my question is can a client view stuff from a server? If it can awesome. If not I will have to figure out something.
Can someone please tell me if what i have said can be done
|
|
|
Post by DJLinux on Jun 16, 2010 14:27:37 GMT -5
Hello Wayne Rayner can it be you start's every two week a new project but without any usable results ?
I think you would be more "happy" if you make one simple idea real first.
Networking isn't easy but a funy part.
Tip: Create a simple game first if it works fine add network support to it.
How a client (i'm as player) can connect to an running game (the server) without it's IP ?
I solved this problem in the last tiny TCP plugin.
If an server starts it resolvs it's online IP as first. Than it sends a simple text file with IP and Port via FTP protocol to an web server.
anyserver.com/AnyFolderWithRunningGames/GameName.IP
example of GameName.IP file : (123.123.123.123,8000) ip,port
If an server goes down it removes the GameName.IP file from web server.
Now if the player starts a new game/client it will look for the file GameName.IP on the web server.
If is empty or not aviable it means the Game server isn't running. In other case it use the IP and port from text file GameName.IP
Looks simple so far i know but often "the devil is in the details" ;D
Joshy
|
|
|
Post by Supermonkey on Jun 16, 2010 14:54:15 GMT -5
I'm with DJLinux, you'll learn more from sticking to one project for a while, you don't have to complete a project, just get further than just talking about it.
I don't know what you mean by "view stuff" from a server, a client sends messages to a server, a server processes the messages and sends data back to the server....but there is a lot more to it then that.
|
|
|
Post by DJLinux on Jun 16, 2010 16:46:57 GMT -5
In practice you don't need to write two parts an server and a client. The game you wrote can act as both (client or server) A typical game menu [1] Options [2] Play a game [3] Play online if the player pressed [3] [1] Create a game (server) [2] Join a game (client) Of course you can split it in two programs game_server.exe and game_client.exe but why more work as needed ? Remember "more code" = "more sources of errors" Joshy
|
|
|
Post by Wayne Rayner on Jun 16, 2010 18:38:24 GMT -5
I want the client and server seperate as I need the server on my computer and the client on another.
So can the client actually play the game that is say in the server? The person using the client connects to the server then plays the game. When the user signs out whatever he did say moved his position on the screen will be saved and then loaded when the player logs back in.
I really do hope I'm explaining this clearly
|
|
|
Post by DJLinux on Jun 16, 2010 18:49:23 GMT -5
You talk about save a game session and restore it for next play ?
No problem you can save all session data in a file and if the player comes back you have to reload the saved session data.
|
|
|
Post by shadow008 on Jun 16, 2010 21:52:37 GMT -5
Wayne, are you talking about an rpg type game or and fps/rts type game. The type of server would differ.
If its an rpg type game, then do what they've been telling you - hook up to a main server and go from there.
If its an fps/rts type game, make a dedicated server:
All players initially log on to a main server and join a game w/ other players. When the game starts, you test to see which player has the best connection/fastest internet and have that player run the server instead of the main running it. Also if u make a dedicated server do what MW2 did and if the host leaves then re-test connection and chose another host, reset server, ect...
Just my thoughts...
|
|
|
Post by Wayne Rayner on Jun 16, 2010 22:04:49 GMT -5
I'm making it a little hangout world. So there is going to be well a Main server. Basically thats why I need the Server and Client Seperate. Basically all the client does is connects to the server.
below is my little explanation of what the client and server does. Client: Connects to Server
Server: Has main menu scripts, Login scripts, register scripts, and of course the game scripts.
So here is a question. Say I have the game in the Server and the graphics in the server. Would the client be able to see the graphics?
|
|
|
Post by DJLinux on Jun 17, 2010 3:15:16 GMT -5
I you mean to "stream" the game like a movie all clients needs a high bandwidth an the server needs more high bandwidth*nClients this isn't the right way.
No problem if you mean Textures, Sprites, Sounds.
here a client server "talk"
c: hello server i'm new whats going on. s: hello client here are the list of all current files you needs c: ok i need Texture24 and Sound101 they are out of date s: here are the files c: ok i'm up to date now start the game
you know what i mean ?
Joshy
|
|
|
Post by Wayne Rayner on Jun 17, 2010 21:07:47 GMT -5
I you mean to "stream" the game like a movie all clients needs a high bandwidth an the server needs more high bandwidth*nClients this isn't the right way. No problem if you mean Textures, Sprites, Sounds. here a client server "talk" c: hello server i'm new whats going on. s: hello client here are the list of all current files you needs c: ok i need Texture24 and Sound101 they are out of date s: here are the files c: ok i'm up to date now start the game you know what i mean ? Joshy I understand. Ok so if I have all the graphics in the client instead and say I have functions in the server would the client respond to them? Also would I need an update server if I update the game further? But while I'm asking all these questions I'm going to have to learn the tcp/ip plugin. So while I'm taqlking about it I haven't really done much as I find using networking functions hard. Almost as hard as when I first begun using b4GL's sprite library. thanks for all your help. P.S. just because I haven't started working on it dosn't mean I won't. When I have used the plugin for little applications I will start to work on this.
|
|
|
Post by alovon on Jun 21, 2010 3:17:14 GMT -5
No. That is the answer. Ok you're looking at the whole server thing all wrong. A server does very little. The entire game is processed by the client. Ok so here is an example.
A client is running through its update loop.
It first checks for player input. The input is then processed by the client into whichever form it needs to be in. (thi is basicaly your math) After that the client updates its variables with the newly aquired inputs. Then the client contacts the server. The client sends its valuable data (x, y cordinates, ect.) the server then sends back the valuable data of all other players. From there the client begins drawing. First the player, then the other players once their data is sent through the server. then the process is repeated a bagillion times more until the player quits.
I hope this cleared some stuff up for you.
P.s. I haven't been on in a looooong time. XNA has been absorbing much of my time. Glad to be back.
|
|
|
Post by Wayne Rayner on Jun 21, 2010 4:25:39 GMT -5
Ok thanks for your help I suppose. Well I'm currently Just making the game side first and will add the server and client afterwards and see whats the best way to attack it.
Cool I looked at XNA and was like this would be useful if I actully wanted to learn C# But I don't feel like learning to much at the moment. The next couple of months will be spent doing stuff in B4GL and my last 4 months of school.
|
|