Jump to content


Photo

Online Multiplayer Lobby Project


  • This topic is locked This topic is locked
44 replies to this topic

#1 xshortguy

xshortguy

    GMC Member

  • Global Moderators
  • 4345 posts
  • Version:GM:Studio

Posted 02 September 2009 - 07:26 PM

Multiplayer Lobby Project



The Goals:
  • Learn to create a lobby and in-game environment with the following features:
    • Server / Client system that stores user names and passwords.
    • Users can set display names other than their user name.
    • Users can maintain profiles and friends lists.
    • Users can create and join both public and private chat rooms.
    • Displays the number of users in a chat room and the maximum number of users.
    • Users can send messages to other members.
    • Users can connect to instances of the game that this lobby service is created for.
    • Voice Chat Capabilities, if feasible. (Low Priority)
  • After all that is learned, then a tutorial will be created to help other users design such lobbies.
Overview

This is a project that I will be working on during my spare time. I am expecting assistance from the community as a whole as I work on this endeavor. I never really (successfully) tried to do any multiplayer applications using Game Maker, so this task is quite the undertaking. In a nut shell, this project is designed to help players design a small service such as battle.net to connect players into their multiplayer game.

There are two reasons why I am starting this project. The first is that I really wish to gain some knowledge in working large multiplayer systems such as this. Second, there is no tutorial or underlying framework for this type of connection setting. Being able to help people create such systems will move game maker forward in the multiplayer department.

Finally, it may come to the event where I stop working on this project. Fortunately, this is primarily going to be an open source project aimed at community involvement. While it is not a major task such as the GMCG, it is still one that users can have fun with.

Tools

Currently, the two primary tools for this task other than Game Maker are the following:
  • 39DLL: This is to be used for transmitting data between computers.
  • Icuurd12b42's FMOD DLL: This hopefully can be used to handle voice chat through game maker.
Other tools may be added as the project continues.
Current Progress

September 2, 2009: This is when the project started. The topic has been created to help start the project. No programming has been started. Planning stage has begun.

Notes
  • It is my understanding that such features described here must be integrated into the game from the start. Hence the goal of this project should include providing a sample game to be included with the project. The game I have decided on is a knock off of Hasbro's Connect 4.
Contributors
Any person who contributes to the project will be added here.
GMC Name (Real Name--optional)
XShortGuy (James Pedid)
  • 0

#2 xshortguy

xshortguy

    GMC Member

  • Global Moderators
  • 4345 posts
  • Version:GM:Studio

Posted 02 September 2009 - 07:29 PM

The first focus of this topic is to develop a single player engine to display texts that scale automatically to the window. The goal here is to display a simple chat environment that will accept text as input and display it on the screen. Here is the starting point of such an engine, to be refined and later rebuilt with the idea of sending messages in mind.

I will periodically update this post with updates to our basic chat engine. Post improvements or alternate solutions to the problem here.

mp_chat
Create Event
key_chat = vk_enter;
sv_chatmode = 0;
sv_chat_array_max = 22;
var i;
for (i = 0; i < sv_chat_array_max; i += 1)
{
	sv_chat_array[i] = ""
}

Any Key Press Event
if (keyboard_check(key_chat) == true)
{
	if (sv_chatmode == 0)
	{
		sv_chatmode = 1;
		keyboard_string = "";
	}
	else
	{
		sv_chatmode = 0;
		if (keyboard_string == "") exit;
		for (i = 1; i < sv_chat_array_max; i += 1)
			sv_chat_array[i-1] = sv_chat_array[i];
		sv_chat_array[sv_chat_array_max - 1] = keyboard_string;
		keyboard_string = "";
	}
}

Draw Event
draw_set_color(c_white);
draw_rectangle(16, 16, room_width - 16, room_height - 16, 0);
draw_set_color(c_black);
draw_rectangle(16, 16, room_width - 16, room_height - 16, 1);
draw_rectangle(16, room_height - 16, room_width - 16, room_height - 48, 1);
if (sv_chatmode == 1)
	draw_text(24, room_height - 40, keyboard_string + "|");
var ypos, i, j;
ypos = 24
for (i = 0; i < sv_chat_array_max; i += 1)
{
	draw_text(24, ypos, sv_chat_array[i]);
	if (sv_chat_array[i] != "")
		ypos += string_height(sv_chat_array[i]);
}

  • 0

#3 databot

databot

    admin of moonlight games

  • New Member
  • 309 posts

Posted 02 September 2009 - 08:25 PM

With regards to coding of the server side application, have you decided on a programming language? Perhaps PHP/MYSQL or java mabye?
PHP/MYSQL would seem the best comprimise for ease of use and functionality as well as ease of deployment.
PHP Would provide all the needed functionality for a login system, along with display names, bio, firneds list and messaging. It could also hold server lists.

As for a chatroom system PHP would be inneffective due to large amounts of overhead.
GMsock came with a java based Proxy (GmProx 1.0) that would provide a basic way to run chatrooms, both public and private. Or it could be used as a model for your own code.

I would like to express my interest in this project, particuarly your idea for voice chat.
  • 0

#4 xshortguy

xshortguy

    GMC Member

  • Global Moderators
  • 4345 posts
  • Version:GM:Studio

Posted 02 September 2009 - 08:42 PM

The idea is to actually use Game Maker for all of it. (At least, initially, using only the two dlls listed as of now. That can change.) Game Maker can certainly create programs to handle data maintenance by storing information in local files. However, I am always open to suggestions and will always accept codes or concepts to perform a task. In fact, I encourage people to come up with solutions that will help meet this goal. I most likely won't finish this project if I do it all by myself. I'm looking for assistance from others.

I'm already rewriting the basic chat mechanisms to scale to the room size. I'll edit the second post when that arises.
  • 0

#5 cooldudetb

cooldudetb

    GMC Member

  • New Member
  • 190 posts

Posted 02 September 2009 - 08:45 PM

The idea is to actually use Game Maker for all of it. (At least, initially.) Game Maker can certainly create programs to handle data maintenance by storing information in local files. However, I am always open to suggestions and will always accept codes or concepts to perform a task. In fact, I encourage people to come up with solutions that will help meet this goal. I most likely won't finish this project if I do it all by myself. I'm looking for assistance from others.



I would highly suggest not using game maker for the server, and instead using php with MYSQL. Game maker was not built to handle the large amounts of data the server will have to send, receive and save. It also means you would have to have the GM server program running 24/7.

However, I'm interested to see how you would implement an effective voice chat system, as in my experience they normally are very laggy, and can go horridly wrong if the ping gets too low.

I too am very interested in this project, and would like to contribute towards it's success in any way possible.
  • 0

#6 xshortguy

xshortguy

    GMC Member

  • Global Moderators
  • 4345 posts
  • Version:GM:Studio

Posted 03 September 2009 - 12:16 AM

I'm still tinkering with a chat module and creating a set of functions for it. However, I feel like I should lay out an outline for this project:
  • Develop Messaging Module
    • Establish User Name System
    • Determine Message Aesthetics
    • Program Text Display
    • Program Text Entry
    • Develop Functions to Send Messages Between Users
  • Develop Chat Environment
    • Develop Chat Room Aesthetics
    • Program Creation of Chat Rooms
    • Program Connection to Chat Rooms
    • Program Chat Room Functionality
    • Develop Lobby System to Connect Chat Rooms
  • Develop Friends List Functionality
  • Develop Example Game Connection Environment
    • Develop Game (Connect 4)
    • Program Multiplayer Component
  • Delve into Voice Chat
  • Create Tutorial (this will be done periodically)

  • 0

#7 brett14

brett14

    GMC Member

  • GMC Member
  • 1151 posts
  • Version:GM8

Posted 03 September 2009 - 05:03 AM

not sure if you want to do this or not, but an easy way to add a serverlist to your application would be to use this.
http://gmc.yoyogames...howtopic=442985
It uses a ftp server to store data, so the players could host a game, and the games will be put up on that server, and when the client request to "find" games he can find the ones currently being hosted on the server.
  • 0

#8 cooldudetb

cooldudetb

    GMC Member

  • New Member
  • 190 posts

Posted 03 September 2009 - 07:03 AM

not sure if you want to do this or not, but an easy way to add a serverlist to your application would be to use this.
http://gmc.yoyogames...howtopic=442985
It uses a ftp server to store data, so the players could host a game, and the games will be put up on that server, and when the client request to "find" games he can find the ones currently being hosted on the server.


There are some issues with that idea.
FTP is:
1. Insecure
2. Quite slow

Plus the fact that as a lobby this program's main function is a server list, I think using a slow and insecure transfer protocol for the main function of the application is not a good idea.

I'm still tinkering with a chat module and creating a set of functions for it. However, I feel like I should lay out an outline for this project:


I feel we should lay out this project with the main engine more in mind, as you seem to have missed it out completely in your plan:

1. Develop Basic Client - Server connection
a. Develop server base
b. Develop client base
2. Develop Basic Account system
a. Develop serverside account database
b. Develop clientside login/logout
3. Develop Chat System
a. Develop Chat room functionality
b. Develop Basic chat relay system
c. Design Chat UI
d. Design chat lobby
4. Develop Game server connection system
a. Design game server lobby
b. Program test game
c. Implement multiplayer component
5. Design extended account system
a. Develop Friends list
5. Have a look at voice chat
6. Do large amounts of testing and bug-checking
7. Create Tutorial

That is just my idea of the plan, if you don't like it stick with yours.

Edited by cooldudetb, 03 September 2009 - 07:04 AM.

  • 0

#9 brett14

brett14

    GMC Member

  • GMC Member
  • 1151 posts
  • Version:GM8

Posted 03 September 2009 - 07:14 AM

I'm just putting suggestions out there. It'd be great if this would work, but would somebody be willing to host a 24/7 server that has a serverlist for multiple games? If not then you might want to use an online database (or a php page or something of the sort). If some one is willing to, then just ignore my suggestion and use the faster better more secure method.

However just against your arguments, it's not like your communicating via FTP, your just downloading a very small text file that contains server info. You read the info and connect to the server (I see what you mean insecure though, somebody could give you the ip to connect to a virus download site)

Edited by brett14, 03 September 2009 - 07:16 AM.

  • 0

#10 xshortguy

xshortguy

    GMC Member

  • Global Moderators
  • 4345 posts
  • Version:GM:Studio

Posted 03 September 2009 - 07:20 AM

I'm certainly open for discussion, since I have never embarked on this endeavor before. If you know more than me, then I'd be happy if you provided a better goal list.
  • 0

#11 brett14

brett14

    GMC Member

  • GMC Member
  • 1151 posts
  • Version:GM8

Posted 03 September 2009 - 07:36 AM

I'm just thinking, but wouldn't it be better to program most of the data handling in c++? The bulk of the program could be programmed in GML (easier, good for users to integrate into their games) but the slower[speed] part could be written in C++. I know it'd be faster [speed], but I do not know how hard it is - simply because I don't program in c++. Also for this to work, you'd need a few people who know c++ to help you develop the program.
  • 0

#12 sabriath

sabriath

    12013

  • GMC Member
  • 3175 posts

Posted 03 September 2009 - 07:40 AM

I see nothing wrong in writing the entire chat program in GML....both server and client. Good luck xshortguy on your endeaver, don't listen to these guys saying "don't do it, use php/sql".

p.s. *cough* where's my creds? :whistle: lol
  • 0

#13 brett14

brett14

    GMC Member

  • GMC Member
  • 1151 posts
  • Version:GM8

Posted 03 September 2009 - 07:48 AM

I'm not saying don't do it, I'm saying it'd be multiple times faster if you used those instead of gml.
  • 0

#14 cooldudetb

cooldudetb

    GMC Member

  • New Member
  • 190 posts

Posted 03 September 2009 - 06:53 PM

The reasons I am highly recommending php & MYSQL over game maker is simple. Performance and practicality.

As I said earlier, Gm was not built to manage large amounts of data in short spaces of time. The server would be constantly swamped with messages from all the client connected to it, asking it to retrieve, store and send data. A php server, with MYSQL, can efficiently read and write large amounts of data and send information to clients.

A GM based server would have to be running on someone's computer 24/7, and would have to be restarted manually if it crashed.
A php server can be up 24/7 running on a web server, and is almost impossible to crash in any way. The most that could happen is that the script simply returns an error.

However, if you feel for any reason that a Gm server would be better than a php one, go ahead. I'm not going to stop you. :whistle:
  • 0

#15 sabriath

sabriath

    12013

  • GMC Member
  • 3175 posts

Posted 04 September 2009 - 12:24 AM

*sighs* It is rediculous how many people in this community would turn to php/sql faster than they can bat an eye when it comes to online. I thought this community dealt with GM....and since GM can handle online things, why would you instantly turn somewhere else? PHP/SQL are interpretive as well, albeit programmed with much better wrapping than GM, it is still interpretive. It also needs to be 24/7 NO MATTER WHAT YOU USE! If the webserver is down, you're SOL because more than likely you got a free webserver and it's not like you can just walk up to their main office and say "hey, can you stop running maintenance, I need my chatserver to work." Not to mention that if they decide to stop running services for sql or server-side at any time, you are also SOL on that too.

This is a GM community, if you want to speak PHP/SQL, then go find one of those communities. As far as I'm concerned, everything we do here is 100% GM, or linked through DLL into GM.

Plus SQL is slow when all you are saving is name/password lists, that is an easy lookup table database, you don't need a relational one for it. That's like saying "I need to crack this egg open" and instead of using the side of the counter or a backend of a utensil, no...let's go grab a forklift, a bulldozer, maybe a treecutter, dumptruck and a crew of 12. Sure you won't get the file protection that sql offers, but you can always use md5 or other hashing techniques to obscure the passwords for your clients....which, incendentally, 39dll comes with...OH MY GOD WHAT?

There is no harm in at least trying to make it 100% GM....you people don't even understand the reasoning behind making this project. The code created here can help others in learning how to make small chat sessions inside their games, or did you want them to run their RTS/MMORPG against a webserver too? *laughs*
  • 0

#16 dimitri

dimitri

    GMC Member

  • GMC Member
  • 248 posts

Posted 04 September 2009 - 01:40 AM

If you were making a game which would be running in realtime, I'd say create the Server program in C++. However, since there is pretty much no massive amount of physics/graphics calculations going on every second, I'm going to agree with sabriath and say GM would be a good idea for creating both the Server and Client programs. This is coming from a person who has created multiplayer games with the GM 39DLL using the Server/Client system.

The only problem I see here is that someone is going to have to host this Server program and leave their computer on 24/7, which is pretty impractical.
  • 0

#17 xshortguy

xshortguy

    GMC Member

  • Global Moderators
  • 4345 posts
  • Version:GM:Studio

Posted 04 September 2009 - 03:04 AM

The point of this project is learn how to develop these types of systems and create a tutorial in doing so, and not to have a long-running server that's always online. As far as I'm concerned, details that regard to actually acquiring and maintaining the server is beyond the scope of what this project aims to do.

Instead of bickering about whether or not we should outsource things to external languages (excluding the 39DLL and FMOD if voice chat is deemed feasible), if anything we should cover each alternative in this tutorial.

For participation in this project, in addition to looking for suggestions on which way to begin creating such code are the codes (or pseudocodes) themselves. I'm not entirely familiar how to send more than a few basic concepts, and for me this is half of the challenge. Creating multiplayer environments such as lobbies, or even the games themselves, has a steep learning curve. The point of this project is to help alleviate the difficulty in developing these systems by providing an easy to use tutorial on how to develop these types of things.
  • 0

#18 Tahnok

Tahnok

    Friendly Madman

  • GMC Member
  • 1823 posts
  • Version:Unknown

Posted 04 September 2009 - 06:24 AM

Scanning through this topic I see a bit of confusion (or maybe it's only me that's confused). People seem to be confusing the master server listing server with the actual game servers. They are two different things and need to be treated as such. The master server listing server is the one that tracks the user accounts and logins, and keeps a list of all the servers for players to connect to. The game servers are the ones that players connect to in-game to actually play, and they handle the actual gameplay message handling. Trying to mesh the two into a single program or idea is just asking for trouble.

So now that that's cleared up, here's my opinion on how the two should be handled.

The master server (responsible for player accounts, the server listing, the main lobby system, etc):
Without one of these for your game players are required to manually find and enter the IPs of any online game server. Needless to say, that get's really old really fast. Therefore it also needs to be online 24/7, since when it goes down every single game server gets lost in the big wide open internet and players have no way of finding each other. As far as what language to write this in, yes you could write it in C++ or in GM, but that would require a dedicated server computer (which most of us can't afford). That's why I recommend the PHP/SQL combination that has been mentioned. With a bit of ingenuity you can use a basic online database to track servers and such in real time. ReflectGames.com does exactly this. I'll leave it up to Fred whether or not he want to reveal some of the inner workings of that though.

The game server (responsible for net traffic for the actual gameplay):
Of course, once in-game there's no point if you can't actually play, so you need a solid and fast game server. Fast is the keyword there, so there's no way PHP/SQL will work. I recommend C++ if you can handle it (since it's extremely fast and doesn't have the high overhead that GM games do). Of course though GM is a lot easier, and there are actually a few cases where it may be prefered. For example, in The Havoc Agency I used GM for the server program because I wanted it to be running a copy of the game logic under the hood, so I could make things like server-sided collisions and better anti-hack.

Now as far as the chat ability, that's a bit tricky design-wise. If you want system-wide chat capability you need a master server that can handle that amount of traffic in a reasonable time. Of course, PHP/SQL is right out for that. So if you want that kind of ability you're again looking at a C++ or GML master server program running on a PC somewhere 24/7. The alternative is to only allow chat within the actual servers, which is trivial if you've already gotten the gameplay communications going.

Likewise with voice chat. Does the application need voice chat system-wide, or only in-game? Neither one is easy, but in-game requires less resources as far as a master server.

The point of this project is learn how to develop these types of systems and create a tutorial in doing so, and not to have a long-running server that's always online. As far as I'm concerned, details that regard to actually acquiring and maintaining the server is beyond the scope of what this project aims to do.
[...]

If you're not thinking for the long run then the tutorial will be pointless. Real online games need their master server on 24/7 to be successful, so why design and practice anything less? Learning how to make a partially working system isn't going to help anyone make a successful online game.
  • 0

#19 xshortguy

xshortguy

    GMC Member

  • Global Moderators
  • 4345 posts
  • Version:GM:Studio

Posted 04 September 2009 - 06:48 AM

If you're not thinking for the long run then the tutorial will be pointless. Real online games need their master server on 24/7 to be successful, so why design and practice anything less? Learning how to make a partially working system isn't going to help anyone make a successful online game.


The tutorial is meant to discuss how to program such a server, not set one up. If you or anyone else would like to have such a tutorial as an appendix to what is to be considered, then go ahead and do so. The goal of this tutorial is to create a lobby system (as a separate program) that will connect players to instances of a built-in game, which is one program. Think of it as being the client-side visuals of a game such as Starcraft, Diablo, or Warcraft III--the early battle.net. The actual game servers run off of different programs, or even off of user computers, but the matchmaking programs run directly through the executable. This can be more or less desirable, depending on the game. The technique for doing it either way should be trivial.
  • 0

#20 sabriath

sabriath

    12013

  • GMC Member
  • 3175 posts

Posted 04 September 2009 - 06:56 AM

{snipped some crap}


Ok, I'm going to make it very clear to everyone in pictures, since people tend to not read very well.

Posted Image

There's nothing wrong with that set up....chatserve can handle logins as well as relay. I have said many MANY times, you CANNOT have more than 1 packet on an electrical line between devices at the SAME TIME....I feel like I'm talking to myself for real. Because of this rule of electronics, the socket and network card are not just gonna ignore data, they see it all....the lag would be in the congestion between the internet and the router. The socket will buffer the data if the server program is lagging reading the information...but it's not going anywhere. Sure if thousands of people suddenly tried to connect AT THE SAME TIME...there might be a few seconds of lag to send chat messages...but that's like saying there is a backup at the sewage plant at half-time at the super bowl because everyone flushes their toilet.....it doesn't.

I will show you what WILL lag the system though:

Posted Image

That is what you are suggesting, have 1 program do the logins, and another program do the chat relaying. The place marked "here" is the location you are now lagging information, although as I stated before no information is lost, but you push the lag from the router-internet location to INSIDE your own network.

If you use a webserver to login and have a separate network to do the "game" or chat program, that would be somewhat ok, but how would you possibly transfer a socket from one computer to the other after accepting a login? (you can't, it's rhetorical). Which means you would need yet ANOTHER accepting listening device and ANOTHER check authentication...which makes your webserver useless.

Debate it all you want, I think I've made my point clear. Do the chat program in GM, all of it, you'll be fine.
  • 0

#21 Tahnok

Tahnok

    Friendly Madman

  • GMC Member
  • 1823 posts
  • Version:Unknown

Posted 04 September 2009 - 08:52 AM

@xshortguy: Sorry, I'm not much of an MMO person so I don't know those examples. But from what I understand it sounds like we're thinking along very similar lines.

My point about the tutorial was that if you're teaching people how to program a server listing/lobby program in GM it's of little use to them in the real world, since that would require running the program 24/7, which most people can't do. A PHP/SQL solution would be much more helpful since it can be run on most standard web hosts, which people do have access to. I'm just thinking about it from a practical application standpoint and what will actually work for people in the end.

@sabriath: It's not crap, you've just misunderstood (or maybe I failed to completely explain what I meant). I'm not suggesting that the two programs be run on the same computer, behind the same router. That wouldn't make any sense since that would suggest that there's only one game server, which would eliminate the need for a server listing/lobby. I was suggesting that there would have to be a central method for keeping track of servers being run from other locations. Example:

Posted Image

So first the players communicate with the master server and get the list of all the servers that are currently online. Those servers are all elsewhere in the world, being hosted by either players or at dedicated hosting sites. When the player decides what game to join they disconnect from the master server and connect to the server they found.

Again, it's a similar method to what ReflectGames.com uses, along with bigger names like all the Valve titles.
  • 0

#22 sabriath

sabriath

    12013

  • GMC Member
  • 3175 posts

Posted 04 September 2009 - 09:12 AM

@xshortguy: Sorry, I'm not much of an MMO person so I don't know those examples. But from what I understand it sounds like we're thinking along very similar lines.

My point about the tutorial was that if you're teaching people how to program a server listing/lobby program in GM it's of little use to them in the real world, since that would require running the program 24/7, which most people can't do. A PHP/SQL solution would be much more helpful since it can be run on most standard web hosts, which people do have access to. I'm just thinking about it from a practical application standpoint and what will actually work for people in the end.

@sabriath: It's not crap, you've just misunderstood (or maybe I failed to completely explain what I meant). I'm not suggesting that the two programs be run on the same computer, behind the same router. That wouldn't make any sense since that would suggest that there's only one game server, which would eliminate the need for a server listing/lobby. I was suggesting that there would have to be a central method for keeping track of servers being run from other locations. Example:

So first the players communicate with the master server and get the list of all the servers that are currently online. Those servers are all elsewhere in the world, being hosted by either players or at dedicated hosting sites. When the player decides what game to join they disconnect from the master server and connect to the server they found.

Again, it's a similar method to what ReflectGames.com uses, along with bigger names like all the Valve titles.


OMFG!! *shoots self in head with a dull pencil*

*lies dying wondering why people think this is some sort of game, rather than a chatserver*

Your way suggests this:

(a) client connects to a webserver to get a listing of the servers currently online
(b ) client chooses one of those servers and connects to them using the webserver for authentication, even though it will require a double authentication because of a movement in sockets
(c ) when a client wants to send a message to someone else that is NOT connected to that same server, the communication now has to hop from 1 server in the listing to all the servers in the listing...hogging bandwidth. at the point, the server that actually contains the person you want to talk to, will relay that information
(d) same with playing a "match game" with that person, IDs would have to be passed between servers

however, if you plan to segragate the logins to the subservers, which means you cannot talk to people not in that server, then you reduce the amount of people you can play and talk to to save on server lag. but still have to do double authentications, and storage of character information separately.

My method is simple, 1 server program that handles all chat:

(a) client connets to server
(b ) server accepts and authenticates
(c ) client can talk to anyone and start a "match game"

what is NOT mentioned by me is the "game" part of this....I have been speaking merely on the chatserver. A match game would be handled similar to how yahoo messenger does gaming:

(a) player "a" sends request to play pool to player "b" (through chat server)
(b ) player "b" chooses to accept it, gets the IP address of player "a" from server and opens up a listening socket
(c ) server tells player "a" that it was accepted and gives him player "b"'s IP address
(d) player "b" connects to player "a"
(e) player "a" accepts the connection and verifies the IP address as the one the server gave it
(f) match is played between player "a" and player "b" WITHOUT INVOLVING THE CHAT SERVER ANY FURTHER for game relay information.

You could have a secondary server to handle "match watching" to ensure no cheating, but it is not necessary in games like "chess" and "checkers" since anybody can just say "oh my god, you're cheating! I'm not playing you anymore *clicks ignore and quit*".

Did a light bulb go off yet? Is there something that you might be missing? You could have multiple servers STILL in my diagram for clustering and tiering if you happen to get more people than you can handle in the lobby, but it's GM, it's for tutorial reasons and a learning experience for both xshortguy and the community.

{edit} and to add a final note: if your master server is down, then there is no way for more servers to add to the list, nor any player connect because it does not effectively know any servers are on.....which wastes costs and power (since the subservers may be on without the master on). In my example, the master server IS the only thing, so if it goes down (usually for maintenance), you don't lose any costs other than customers. You could make it a ring server so maintenance would run alongside a backup unit. Think AIM, Think Yahoo Messenger....don't think World of Warcraft right now.

Edited by sabriath, 04 September 2009 - 09:19 AM.

  • 0

#23 Tahnok

Tahnok

    Friendly Madman

  • GMC Member
  • 1823 posts
  • Version:Unknown

Posted 04 September 2009 - 10:53 AM

OMFG!! *shoots self in head with a dull pencil*

*lies dying wondering why people think this is some sort of game, rather than a chatserver*

Chill out already. This is the experts forum; we're working together here to find the best possible solution. So get off your soap box and speak to me in a civil manner.

Now reread my original post. I first stated the difference between game servers and the chat server/lobby server (since people seemed to be getting that confused). At no point did I suggest that if you're going to go for central chatting (where anybody logged in can talk to anybody else logged in) that it should be handled by more than one central server (I in fact pointed out that it would have to be handled in a central server and that it has certain complications). The only time multiple servers would work for chatting is when you only want to be able to chat with players within the game server (which is rather common, especially in indie games). So your suggestion on what you think I was suggesting is off.

Seeing as the genre for this idea has not been clearly defined you can't assume that you're dealing with simple 2 player games like chess and checkers. The moment it gets into more complicated games than that the system you're proposing will fall flat on it's face. Furthermore, point F is especially flawed. Communication between players without a server is just asking for router/firewall/port forwarding issues. You're essentially asking any player, regardless of their internet setup, to act as a server. Plus, you're basically recreating my system but with the before mentioned downfall. Basically you're just having your players create servers as needed and then piping them off to those. Absolutely no different than what I already explained, except that my idea had the servers already running and players coming and going as needed.

As for your final note, did you notice that there's absolutely no difference between those two scenarios? In either case the user still can't access the server. And the fail safe method you mentioned can be setup using either idea. Therefore there's no real advantage or disadvantage to either method in that regard. As I stated in my original post, if your central server goes down and you have no backup plan then you have problems no matter whether you're running multiple servers or a single large server behind the scenes.

As for the scope of the tutorial, of course I realize that this is supposed to be a simple tutorial to educate people who are new to this sort of thing. On the other hand though it will be of little use to them if the methods we teach them don't scale well. Online game development is all about scalability, no matter the genre (or non-genre, in the case of a pure chat program). The method I'm suggesting isn't especially complicated either, it just allows for the necessary complications of bigger games. Therefore I propose that this project be given clearer guidelines as far as what precisely is required, especially the genre (since the standard for this sort of thing varies greatly between genres), a target player amount (so we know how much traffic the system should be able to handle), and the chatting requirements fine tuned (whether chatting has to occur as part of a main lobby or only within games). Of course, those should be xshortguy's call, since he's the topic creator.
  • 0

#24 sabriath

sabriath

    12013

  • GMC Member
  • 3175 posts

Posted 04 September 2009 - 11:03 AM

Well, my apologies then. it's late, should've gone to bed hours ago. I'm still having problems finding a proper textbox clone (gm widgets comes close and i JUST found maxwinapi but it is a bypass into the commons control), I need it to properly create a good chat program.

Any suggestions? I would like the richtext to be similar to how this forum is set up with bracket coding. I'd hate to have to program it myself from scratch. Otherwise I'll have to go with widgets for the time being.

{edit} I'm off to bed now before I say more stupidity.

{edit2}

The game I have decided on is a knock off of Hasbro's Connect 4.

That was the OP, and it was my assumption the chats were going to be set up in "lobbies" where you can play this game against other people. And you're right about portforwarding, I always forget that part...although if both people have the other IP, you can punch a hole in for a connection sweep, or resort to having a second server relay game stuff (not on same network as chat server). Ok, for real, going to bed now, good night

Edited by sabriath, 04 September 2009 - 11:12 AM.

  • 0

#25 Tahnok

Tahnok

    Friendly Madman

  • GMC Member
  • 1823 posts
  • Version:Unknown

Posted 04 September 2009 - 11:35 AM

Thank you. No worries :whistle: .

Hmm, I'm unaware of any richtext ones. The best plain text one I know of off the top of my head is Gamepad by IsmAvatar. It's a pure GML solution and quite nice. You can also check out Game Widgets by B&B_Gaming which uses the before mentioned Gamepad code but adds on more controls. WinApi is a powerful DLL, but it's not without it's flaws (I seem to remember it acting funny sometimes when I start switching between windows and shrinking/maximizing things).
  • 0

#26 cooldudetb

cooldudetb

    GMC Member

  • New Member
  • 190 posts

Posted 04 September 2009 - 03:02 PM

*Snip*

Irrelevant because it took so long to post.

Edited by cooldudetb, 04 September 2009 - 03:04 PM.

  • 0

#27 NakedPaulToast

NakedPaulToast

    GM Studio/Mac/Win

  • GMC Member
  • 8204 posts
  • Version:GM:Studio

Posted 04 September 2009 - 06:16 PM

This topic is not about creating the most efficient server model.

This topic is an exercise in learning how to write a client/server component. It's target audience is the GMC, the only assumption that can be made, is that the audience should have a fairly strong understanding of GML.

To create a tutorial that incorporates PHP/SQL or anything other than GML on the server side will reduce the value of the tutorial. The value it adds will be minimal.

If one does not know PHP, then not only does this tutorial have to teach them multi-programming concepts and techniques, but it also needs to teach them PHP. This is probably beyond the mandate of the learning exercise and tutorial. It also reduces the target audience considerably.

However, if one already knows PHP, then porting the server side component to PHP, using the concepts and techniques presented shouldn't be a problem. I'd suggest that those of you promoting a PHP or other server-side solution quit hijacking this topic.

If you are so adamant about the benefits of your solution then create a co-topic implementing your solution in place of the GM based solution, presented in this topic and eventual tutorial.

I have said many MANY times, you CANNOT have more than 1 packet on an electrical line between devices at the SAME TIME....I feel like I'm talking to myself for real.


So as not to further hijack this topic, I'll just refer you research broadband technologies. Broadband over glass, the air and copper certainly does allow more than one packet on the same medium, at the same time.
  • 0

#28 Yourself

Yourself

    The Ultimate Pronoun

  • GMC Member
  • 7352 posts
  • Version:Unknown

Posted 04 September 2009 - 09:15 PM

but it also needs to teach them PHP


And nobody should have to learn PHP because it sucks.
  • 0

#29 BBGaming

BBGaming

    Programmer

  • GMC Member
  • 2469 posts
  • Version:GM7

Posted 04 September 2009 - 09:26 PM

but it also needs to teach them PHP


And nobody should have to learn PHP because it sucks.

As apposed to what alternative? ASP?

Edited by B&B_Gaming, 04 September 2009 - 09:32 PM.

  • 0

#30 sabriath

sabriath

    12013

  • GMC Member
  • 3175 posts

Posted 04 September 2009 - 09:42 PM

but it also needs to teach them PHP


And nobody should have to learn PHP because it sucks.

As apposed to what alternative? ASP?

Actually, you can create your own server-side scripting in almost any language, if you're good enough. I made one in QB once, and vb2005. The QB one was very difficult, had to write the sockets in C++ and create a link manually in QB to use it, just as a challenge for myself to create somewhat of a "dll" for QB. Good times, good times. Anyhow, there are many server-sides other than making your own: PHP, ASP, CGI, CFM, JSP, Perl, SMX, Python, Ruby, Lasso, even Ansi-C.

{edit} almost all free webhosting sites will allow PHP/CGI for serverside scripting, therefore making it in PHP logical, but if you pay for your own hosting (which can be as cheap as 10 a month), you can usually use any server-side service above, even your own homebrew program (that option is usually very expensive though).

Edited by sabriath, 04 September 2009 - 09:45 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users