Jump to content


Photo

Sabriath's Multiplayer 39dll Scripts


  • Please log in to reply
34 replies to this topic

#1 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 11 October 2009 - 11:57 AM

I am now working toward a much different design altogether, event driven rather than straight calling. This is a new concept with most programmers, especially of this community, but I hope it will be much easier to implement in a lot of people's games. I ask that knowledgeable programmers take a look at the following file and let me know how the commands themselves look. The file is not runnable, it is for reading and sending me a comment on what you think of event-driven code. Not all arguments have been commented on what they do, but it should be apparent, if not, you can ask me if you need some understanding on any of the ideas behind the functions. Here's the file:

Download 22.2KB zip

The idea is that when you "start" a connection, it "compiles" the scripts into a single object and creates an instance of it. This takes the pain of writing switch blocks away from the programmer. I will be working on the current setup, but I would really appreciate any ideas/thoughts/comments/opinions/whatever.

I will still be supporting the other version, but no major updates will be done to it (only fixing errors).

Version 2.2
download:

Download 55KB gml

I apologize if this does not work. Ever since WHFF dropped, I had to sort through all my files, and unfortunately I was in the process of upgrading this to the next version and was not finished. I wrapped up as much as I could, hopefully it still works. Please report any errors, thank you.

mp_init(DLLFilename) - call this first once. It will check if you've already called it, but it's bad programming practice calling init functions more than once.
mp_free() - call this at the closing of your game.

Database

db_create()
db_load(filename)

These create a database map either new or loaded from a file. It returns the 'dbID' used in other functions.

db_save(dbID, filename)
db_close(dbID)

The first saves a database to a file, the second destroys the 'dbID' map, freeing up memory.

db_entry_new(dbID, name, md5password)

This creates an entry in the database. 'md5password' must be the hash of the password, not the password itself because communications will never know the password ahead of time. It will return 0 if 'name' is already in database, 1 if successful entry.

db_entry_remove(dbID, name)

Removes name from database, returns 0 if name wasn't found, 1 if successful.

db_entry_get_md5(dbID, name)

Returns the 'md5password' corresponding to 'name' in the database, or an empty string ("") if 'name' not found

db_entry_get_uid(dbID, name)

When using db_entry_new, it creates a 16 byte random and unique ID based on files, although I need to update this to check the database itself...haven't had time. This was to be used in creating player extension files to be able to store extra information (like location, equipment, whatever is needed to be saved on server-side for the player). Returns an empty string ("") if 'name' not found.

BetterINI

These functions were created to be able to open ini files in any directory, not just the game directory. They mimic the regular built-in ini functions. You will need to use 'bini_init()' after 'mp_init()' has been called, because it uses some of the functions included with 39dll to operate, here's the list:

bini_init() - initialize
bini_new() - clear current INI cache
bini_load(filename) - load file to cache (clearing if needed)
bini_save(filename) - save current cache to file
bini_write(section, key, value) - write a key, or overwrite
bini_read(section, key, default, setit) - read a key, default if not there (if 'setit' is true, it will do a bini_write with default if needed)
bini_section_exists(section) - returns if 'section' exists
bini_section_delete(section) - deletes 'section'
bini_key_exists(section, key) - returns if key exists
bini_key_delete(section, key) - deletes key

Server Connections

mp_server_create(Port, dbID, pObject)
mp_server_step()
mp_server_destroy()

Placed in one object's specific events to perform login services. 'Port' is the listening port for incoming connection requests. 'dbID' is the database used for authentication purposes, put '-1' if you want no authentication. 'pObject's are created and assigned a socket ID automatically, the 'pObject' should contain the next set of functions. If 'create' returns 1, there was a problem (and object will automatically be destroyed at end of script)

mp_player_create()
mp_player_step()
mp_player_destroy()

These functions initialize and control the incoming and outgoing transmissions on the specific client connections. To save network space and time, I have made the data buffer before sending, so that it sends in one shot instead of several smaller ones. 'bufferleft' variable is used to determine how much data is left on the incoming transmission (all 'read' message functions automatically drop this value as needed). If 'mp_player_step' returns a '1', you can break out of your script because there's nothing to read.

mp_player_sendmessage(pObjectInstanceID)

All 'write' message functions currently write to the default buffer. Calling this function will copy the current data on the default buffer to the specific clients buffer for them. The default buffer is cleared afterward.

Groups

Other than sending messages to a specific client, you can also set up groups and allow messages to several people at the same time based on a commonality. You can put people in "zone" groups and have their positions registered to their specified 'zone' so that someone in a different 'zone' will not get the message. You can put people in "channels" and allow communications...etc. etc. Most functions applies to the object it is contained in, you will need to use "with" in order to target a different client.

mp_group_add(GroupName, nSubgroups)

Each player is allowed to be in only 1 of each group, and each group can have several subgroups. Placing players in a different subgroup will automatically degroup them from the other subgroup. This function creates the actual groups. For example: mp_group_add("Zones", 100) - creates a group named "Zones" numbered 0 to 99. Returns 1 if 'GroupName' already exists.

mp_group_find(GroupName)

Returns '-1' if not found, otherwise it is an index of an array used by other functions. It is best not to directly affect this return or the array itself, simply checking if the return is '-1' should be sufficient.

mp_group_player_add(GroupName, Subgroup)

Puts player in 'GroupName', moving him to 'Subgroup'. Returns: '-4' if 'GroupName' isn't found, '-3' if 'Subgroup' is out-of-range, '-2' if player is already in the group, '-1' if player joined the group for first time, otherwise the number of last subgroup player was in.

mp_group_player_remove(GroupName)

Removes player from 'GroupName', doesn't matter what subgroup they are in. Returns: '-2' if 'GroupName' was not found, '-1' if not in 'GroupName' at all, or a number of subgroup player was removed from.

mp_group_sendmessage(GroupName, Subgroup)

This copies the current default buffer into all clients currently in the specified Group/Subgroup. It clears the default buffer when finished.

Client

mp_login_create(Host, Port, Name, Password, cObject)
mp_login_step()
mp_login_destroy()

These are placed in a single object on the client-side to connect to a specified 'Host' and 'Port'. It uses 'Name' and 'Password' for authentication purposes (use empty strings if no authentication required). 'cObject' is created upon successful login and should contain the next set of functions. 'mp_login_create' returns 1 if there was a problem, and 'mp_login_step' returns a number 0-4 depending on situation (0=success, 1=problem finding server, 2=handshake problem or bad name/pass, 3=disc or time out, 4=no server

mp_client_create()
mp_client_step()
mp_client_destroy()

Same as 'mp_player_*' functions but this is client-side. It controls the incoming and outgoing buffer transmissions and also uses 'bufferleft' for your convenience. It also returns '1' from 'mp_client_step' if you should break out of your script because there's no data to read.

mp_client_sendmessage()

Since client-side does not use groups or several client connections, it has a single communication point, this is how to send messages to the server. Simply 'write' your info, then call this function to copy to the outgoing buffer. This will clear the default buffer just like the other 2 'sendmessage' functions.

mp_id_me(sID)
mp_id_new(sID, oObject)
mp_id_translate(sID)
mp_id_remove(sID)

These functions are quick convenience to map the server's ID points 'sID' to the client's created objects 'oObject'. You have the server send a code and ID for each player, and each player uses 'mp_id_me' to map the ID to themselves. 'mp_id_translate' returns either '-2' to identify that specific client, '-1' if not in map, or the instance of the oObject ID on that specific client. 'mp_id_new' creates a new 'oObject' and assigns the 'sID' to it.

Messages

All the messages are similar to the ones from 39ster's functionality, but I will go over briefly the one's I created.

mp_key_increase_read()
mp_key_increase_write()

When using an authenticated login, a 16 byte crypto key is created between the connections. In order to increase the key size, simply call these functions in unison to create the key, either side can start the increase with 'mp_key_increase_write', and the other side must use the 'mp_key_increase_read' function. Each time these functions are called in combination, the key increases by 16 bytes.

readsecret()
writesecret(string)

This is where the crypto key comes in, these 2 functions write/read a string that is encrypted/decrypted. All other message functions are open. CAUTION: Using these sparingly is ok, but overly using the encryption can compromise not only the crypt key but your login ID and md5 hash password.

Internal

These are functions used by the other ones and should not be called directly at all.

Direct

These are the functions from 39ster's script file, modified slightly. Using these can be devistating to the other functions if you do not know what you are doing. I placed them here because some of my functions do use them, and just in case anyone needs to still use the others.


Authentication

I have altered the authentication system as such:

Client requests connection
Server accepts
Client sends name in plain text
Server finds name in database along with md5password. Server creates a random 16 byte cypher 'SeqA' and xors it with the md5password. If name is not in database, it sends a random 16 byte cypher anyway to stall.
Client takes the data and xors it with the md5hash of the password client provided, which should yield 'SeqA' if client put the right password in. Client then sends the md5hash of (SeqA + md5password) which is a 32byte to 16 byte one-way compression.
Server receives this and checks it against the real md5hash of (SeqA+md5password). If name was not in database or the check was unsuccessful, client is dropped...otherwise 'SeqA' is used for the crypto and Server and Client successfully authenticate.

Let me know what you think, ideas, if you break the scheme, etc.

Edited by sabriath, 07 November 2011 - 04:51 AM.

  • 2

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#2 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 13 October 2009 - 08:55 AM

[My legal bump]

Found out that my encryption scheme, although it works at keeping people from seeing what you write, is flawed. I came up with a scheme to check if my encryption is truly uncrackable and drew out a table, turns out that a person can fakely log in without knowing the password of anyone....although any secret messages would be jibberish without the proper password, it doesn't stop them from logging in:

Bogus can send server a 16 byte string X with a person's log in (This was suppose to be CypherA^md5)

Server will send back a 16 byte string with CypherB^md5

Bogus will then send server a 16 byte string Y (This was suppose to be CypherA^CypherD)

Server will send back Y^CypherA^CypherB along with CypherC^CypherA

Although Bogus does not know Any of the cyphers at all, the server is waiting for CypherC^CypherB, Bogus can create that string by doing (CypherC^CypherA)^(Y^CypherA^CypherB) which was received from the last transmission and results in CypherC^Y^CypherB, in order to get rid of Y, we just use the previous transmission we sent by (CypherC^Y^CypherB)^(Y) and we get CypherC^CypherB. Bogus has now succesfully infiltrated someone's account. Like I said, any "secret" stuff will not work because Bogus NEVER knows what md5 of the password is, so cannot recreate all the keys specifically.

I'm going to have to redo it, but on the same principles. Possibly use half the key for a keyswap instead of the key for a signature.

Please do not use these scripts for secure access, but any further feedback is welcome, thanks!
  • 1

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#3 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 15 October 2009 - 12:38 PM

[Another legal bump]

I think I may have solved the access issue. At first I was thinking of implimenting my shotgun encryption method (where it inserts the md5 hash in a nesting fashion expanding a random bitstream), but this method takes too long to process in GML. I was in the process of creating it when it hit me like a ton of bricks this morning. Still a bit groggy, but here it goes:

Client sends name in plaintext to server upon connecting. You can come up with all the encryption possibilities you want, but something has to be plaintext in order to verify information.

Server creates a 16 byte random cypher that is XORed with the md5 hash stored in the database and sends this. It is known as CypherA^Password (although the true password isn't used, it stands for the 16 byte md5 hash that is produced when the proper password is given). The server is sending a test out to verify toward the client.

Client only has the trash info of CypherA^Password, and any eavesdropper only knows it plus the plaintext name. The server is waiting for an answer, and this is what hit me. If the player enters the proper password, he can use the md5 hash xoring and leaving CypherA....can't quite just send that though, but...md5 the hash AGAIN and xor it with the cypher and you get a reply that is secure. This is known as CypherA^md5(Password) (remember, password was already a 16 byte hash, so md5() is yet another run of the one way hash function).

Server knows the proper md5, so hashing it will yield the md5(Password) required to verify CypherA response is in equality. Login successful or failed at this point. It also stands that CypherA has complete secrecy, so can be used to build a keyswapping to increase the encryption size.

Any disagreements, let me know. (Even though I haven't gotten a reply anyway, any is appreciated). I'm tired at the moment, I will have to work on the update after sleep.
  • 1

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#4 Frederick

Frederick

    GMC Member

  • New Member
  • 374 posts

Posted 15 October 2009 - 10:22 PM

This is very useful. Thanks for taking the time to write all this! :)
  • 0

#5 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 16 October 2009 - 11:23 AM

Version 2.0 is out now, maybe I'll get some replies, maybe not. I'll write up a simple TDS thing for the game.
  • 1

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#6 T-Bird

T-Bird

    GMC Member

  • New Member
  • 1326 posts

Posted 17 October 2009 - 08:47 AM

I haven't looked at the scripts, but if that encryption you are talking about is just for logging in/out then you don't really need something so elaborate. There isn't much of a reason for a host to have access to plaintext passwords is there? So the client can simply have their password hashed when the account is created and the hash can be stored in the DB. To verify login, hash the password the user supplies and compare that to the DB's hash.
  • 0

#7 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 17 October 2009 - 09:06 AM

I haven't looked at the scripts, but if that encryption you are talking about is just for logging in/out then you don't really need something so elaborate. There isn't much of a reason for a host to have access to plaintext passwords is there? So the client can simply have their password hashed when the account is created and the hash can be stored in the DB. To verify login, hash the password the user supplies and compare that to the DB's hash.

*shakes head*

Ok, not sure if you know this or not, but there are ways to "eavesdrop" on communications. So, let's say that all you needed was a hash of the password to login:

John puts in his name and password, which is "john" and his password is "2380sje" for example. Let's have the host hash this password with a well known operation that creates a 16 byte md5 hash. We will call this "md5password" because I can't show a proper ascii of it in the forums. Now, john's computer sends "john:md5password" to the server.
Earl is eavesdropping the server's communications....he sees "john:md5password" come through, yay for Earl. Earl waits for john to disconnect, then he sends "john:md5password" to the server, and looky, he logs into John's account.

The encryption isn't just about logging in, it also sets up a secure communication similar to SSL for encrypting any data after login, and it's a random cypher each login so making it harder to crack each time.

However, as I mentioned in the original post, there are 14 hashes of the password stored in the database. When John puts in his name and password, the client program sends "john" to the server, while it waits for a communication, it calculates this:

hashes[0] = md5string(password)
for (i = 1; i < 14; i += 1)
	hashes[i] = md5string(hashes[i-1])

The server creates a random cypher and xors this cypher with the first hash of the password. When the client receives this, they can xor the hash to get the cypher. The client also takes the 5th byte in the cypher and mods it with 13 to figure out which of the 13 additional hashes are the check, it xors the cypher with it and resends it.

Earl the eavesdropper sees "john" sent from John's computer, then sees a 16 byte unknown from the server, then sees another 16 byte unknown from the client. With those points of information, there's only a 7% chance that Earl will be able to login, unlike the previous setup where it's a 100% chance. And there's no way that Earl can get the cypher.

However, registering for an account there is no way to protect anonymous computers, the D-H method comes very close, but it's an expensive method to use for GM. I suggest using https over ssl to do registering, a webserver can easily communicate behind a firewall into the database (which these scripts come with the ability to save/load database). The method I use is only AFTER the registration is complete, changing passwords still can be done with my scripts.
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#8 lap202

lap202

    Programmer

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

Posted 17 October 2009 - 07:54 PM

Could you possibly create a tutorial on how to edit these/set this all up?
  • 0
Check out "Easy GML!" The free GML Guide! Just visit easygml.blogspot.com for your copy :)

Posted Image

#9 MrOpposite

MrOpposite

    Yesterdays games

  • New Member
  • 744 posts

Posted 17 October 2009 - 08:03 PM

This is really good! To bad you haven't got the attention you deserve :D
I'm not really into making an online game right now, but I'm putting this on my mind for sure.
  • 0
I'm working on a new project. The project name is "Timeline"

Reinventing the wheel is stupid, but stealing a car is illegal.

#10 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 17 October 2009 - 08:16 PM

Could you possibly create a tutorial on how to edit these/set this all up?

The file comes with a small example, download it and the 39dll.dll and you can run it out-of-the-box. The object's code is extremely small and should be understandable to any advanced user. I was busy fixing the authentication sequence so I didn't have time to make another example, since it's done, I'll work on that next along with my third tutorial.
  • 1

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#11 T-Bird

T-Bird

    GMC Member

  • New Member
  • 1326 posts

Posted 17 October 2009 - 08:54 PM

Eh. I appreciate what you're trying to do, but I don't see that as a necessary step. The only time I can see that harsh of an encryption really being necessary is if vital personal info is being stored on the server (this is always a no-no), or there is a money transaction.

GM has so many insecurities in general, I personally would never trust a GM-made server with a money transfer. So that takes me back to using Apache/PHP with SSL.

In the case someone does packet-sniff a simple hashword then if the webmaster does a little logging of their user's account data and access information, the users account can be restored with minor inconvenience.

That's just my two cents. I can appreciate, however, that you're trying to create a professional-quality system, just seems a little like overkill to me.

Soon I'll download the scripts and actually look at them, I like the description of what you made, I'll have to check it out.
  • 0

#12 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 18 October 2009 - 07:24 AM

Eh. I appreciate what you're trying to do, but I don't see that as a necessary step. The only time I can see that harsh of an encryption really being necessary is if vital personal info is being stored on the server (this is always a no-no), or there is a money transaction.

GM has so many insecurities in general, I personally would never trust a GM-made server with a money transfer. So that takes me back to using Apache/PHP with SSL.

In the case someone does packet-sniff a simple hashword then if the webmaster does a little logging of their user's account data and access information, the users account can be restored with minor inconvenience.

That's just my two cents. I can appreciate, however, that you're trying to create a professional-quality system, just seems a little like overkill to me.

Soon I'll download the scripts and actually look at them, I like the description of what you made, I'll have to check it out.

I acknowledge what you are saying, but it isn't about being professional, it is more on the fact that I don't know what people will make with it. I added it just in case, it shows some of my abilities for data manipulation. Although games like World of Warcraft may not have a "money transfer" ability, people on those types of games almost require some security measures. They use up years of their life to build up something great, they don't want to lose that to some hacker (although contacting staff will allow a rollback, if we can eliminate as much hacking ability as possible, this won't happen on a regular basis). There are even some people that use these types of games to make money on, which is like a transfer, but not directly....so security is a concern for them as well.

Like I said, I don't personally know what people will use it for, I did it because I could do it. I hope to build a good portfolio and get out of my dump of a job, move up into some programming status (I know GM isn't professional, but I have other projects outside of GM as well).

It's not quite "overkill"...it only took me a week to design it and an hour to program it, you should've seen the first scheme I came up with, ug, nightmare. This one is much faster and more secure, funny that simplicity overruled complex in this case. I'm glad you appreciate my work, and I appreciate you giving me your two cents, keep them coming so I can fix any issues. I look forward to your response.
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#13 Universal_X

Universal_X

    GMC Member

  • New Member
  • 126 posts

Posted 07 November 2009 - 10:40 AM

Amazing!

Is this an Online Engine?
  • 0
ѬѯҨ Cities of the Future

#14 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 07 November 2009 - 07:40 PM

Amazing!

Is this an Online Engine?

I am currently helping a friend with his game, when I am finished, I will be updating this into an engine. It isn't quite there yet.
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#15 Universal_X

Universal_X

    GMC Member

  • New Member
  • 126 posts

Posted 12 November 2009 - 10:05 PM

Amazing!

Is this an Online Engine?

I am currently helping a friend with his game, when I am finished, I will be updating this into an engine. It isn't quite there yet.


Okey. Yep I can see it now.. Nice scripts thou..
  • 0
ѬѯҨ Cities of the Future

#16 cori5555

cori5555

    GMC Member

  • New Member
  • 293 posts

Posted 22 November 2009 - 06:01 AM

Hey, i thought i should inform you of this, but i think you need to get a new file host, i went to WHHF and got this message...

Sorry guys, the gig is up. As I am in physics I receiced an email saying WHFFs files were deleted, and i am bring kicked ofd my host. WHFF most likely wont be able to return unless we get a substantial amount of donations. We would appreciate donations but we are not begging. If you do want to donate, we will need roughly $600-$900 dollars USD. Space and bandwith is expensive and I've serve you well, and it is all i can do anymore. I am sorry for all the broken links on the internet.

R.I.P. WHFF 2007 - November 20, 2009.


Edited by cori5555, 22 November 2009 - 06:05 AM.

  • 0

#17 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 23 November 2009 - 10:42 AM

[bump] I have updated the original post with a new link and better post. Sorry for the trouble.
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#18 Ace

Ace

    GMC Member

  • GMC Member
  • 372 posts

Posted 08 December 2009 - 06:14 AM

Does this support UDP? If so, how is it used? My particular game could use this if it were setup with UDP as an option.
  • 0
Posted Image Posted Image Online Fighting & Roleplay Game

ZERO ENGINE
Posted Image

#19 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 08 December 2009 - 06:22 AM

Does this support UDP? If so, how is it used? My particular game could use this if it were setup with UDP as an option.

At this time, UDP is not supported...I am currently reworking the entire structure and I'll think about introducing UDP.
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#20 Tahnok

Tahnok

    Friendly Madman

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

Posted 09 December 2009 - 12:42 AM

I took a look at your new concept. It's interesting, but I personally think you should stick with your current direction. Yes, painfully simple may be good for absolute beginners, but they're going to out grow that quickly. Online games require a lot of fine control over details, which I feel like your new idea isn't going to give. Besides, if you were to give users an example along with the scripts they could copy and paste a lot of it, since it would all be boilerplate code, and pretty easy to understand boilerplate code at that.

Speaking of which, I think providing an example with your scripts would increase ease of use for beginners and overall interest quite a bit.
  • 0

gmc_signature.png


#21 Tahnok

Tahnok

    Friendly Madman

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

Posted 09 December 2009 - 09:43 AM

I took a look at your new concept. It's interesting, but I personally think you should stick with your current direction. Yes, painfully simple may be good for absolute beginners, but they're going to out grow that quickly. Online games require a lot of fine control over details, which I feel like your new idea isn't going to give. Besides, if you were to give users an example along with the scripts they could copy and paste a lot of it, since it would all be boilerplate code, and pretty easy to understand boilerplate code at that.


I disagree; I find the simplicity would be very beneficial to learners for quite a while. The connection and initiation systems can be quite confusing when starting out, and a few quick scripts can get that complex code out of the way, and then the newbies can play around with code that has more obvious effect. I found the connection code very confusing when I started online coding (I knew nothing about that sort of stuff)...would have been great to run a simple script that did away with all the hard stuff. Of course, newbies can always look into the scripts later and see how the connection and initialisation is done (and how to do it properly).

-Tv

True, and I think those things, in particular, can be glossed over in a nice little script. Very little about the actual connection process changes between games. If I understand correctly though, the system sabriath is imagining gets rid of more than just the connection code. He mentioned it creating it's own objects, which apparently take care of all the network traffic. The way it compiles and creates it's own objects seems extremely limiting. I would hate for my networking code to be out of adjustment reach in an object created at run-time. Of course I realize that the scripts creating the object can be adjusted to fit whatever needs, but if you're going to do that you might as well not have the automatic creation at all.

Of course, it's also possible I've misunderstood the concept.
  • 0

gmc_signature.png


#22 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 09 December 2009 - 10:34 AM

I took a look at your new concept. It's interesting, but I personally think you should stick with your current direction. Yes, painfully simple may be good for absolute beginners, but they're going to out grow that quickly. Online games require a lot of fine control over details, which I feel like your new idea isn't going to give. Besides, if you were to give users an example along with the scripts they could copy and paste a lot of it, since it would all be boilerplate code, and pretty easy to understand boilerplate code at that.


I disagree; I find the simplicity would be very beneficial to learners for quite a while. The connection and initiation systems can be quite confusing when starting out, and a few quick scripts can get that complex code out of the way, and then the newbies can play around with code that has more obvious effect. I found the connection code very confusing when I started online coding (I knew nothing about that sort of stuff)...would have been great to run a simple script that did away with all the hard stuff. Of course, newbies can always look into the scripts later and see how the connection and initialisation is done (and how to do it properly).

-Tv

True, and I think those things, in particular, can be glossed over in a nice little script. Very little about the actual connection process changes between games. If I understand correctly though, the system sabriath is imagining gets rid of more than just the connection code. He mentioned it creating it's own objects, which apparently take care of all the network traffic. The way it compiles and creates it's own objects seems extremely limiting. I would hate for my networking code to be out of adjustment reach in an object created at run-time. Of course I realize that the scripts creating the object can be adjusted to fit whatever needs, but if you're going to do that you might as well not have the automatic creation at all.

Of course, it's also possible I've misunderstood the concept.

You have actually not misunderstood, however you have overlooked the greatest point. Using this type of coding allows for my code to throttle network traffic, so if your GM "server" is bogged down with clients, it can send codes to the clients to throttle down so it can handle data. This allows the programmer the ease of just programming the game, rather than doing his own dead-reckoning code or throttling. I have thought long and hard on whether this should be done or to stay with the straight-coding way, but I think this would benefit a greater crowd in network theory and gaming. When it gets to a point where it is not "good enough" for the programmer, then they have reached a point where they can program their own though right? I do see your point, but 39ster already has all of his scripts pretty much straight-forward, so I can only go so far in automating in that direction before it eventually leads me to the same conclusion...event-driven.

Now, as far as how it creates the objects, it will create the code on-demand into an object as "compiled" as possible. Before, I was using a bunch of ds_maps and ds_lists and it was just getting too hectic keeping track of where all my variables were, now I can just create a string with everything the programmer wants, then add it to the objects step code, add an instance, and bam...an object that is pretty optimized. Of course the programmer will have no way to reach these objects directly, but they really shouldn't be touched anyway.

I am up for suggestions if you don't like the current way I'm going with this....I'm still in the design-phase of the project.
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#23 lollola

lollola

    GMC Member

  • New Member
  • 56 posts

Posted 09 December 2009 - 08:07 PM

Does this support UDP? If so, how is it used? My particular game could use this if it were setup with UDP as an option.

At this time, UDP is not supported...I am currently reworking the entire structure and I'll think about introducing UDP.

Then I recommend to check out this one: http://gafferongames...d-flow-control/                  

It presents all the basic principles needed to create a custom protocol over UDP. But be warned - it's a hell of a job..
  • 0

#24 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 10 December 2009 - 06:13 AM

Does this support UDP? If so, how is it used? My particular game could use this if it were setup with UDP as an option.

At this time, UDP is not supported...I am currently reworking the entire structure and I'll think about introducing UDP.

Then I recommend to check out this one: http://gafferongames...d-flow-control/                  

It presents all the basic principles needed to create a custom protocol over UDP. But be warned - it's a hell of a job..

Actually, it looks like an easy thing to implement, I'll have to rewrite the dll file though (it's something best left for multi-threaded application), but I think you've just given me the next project until I can get some more event-driven ideas. I'll work on a fully UDP framework :D

Thanks
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#25 Ace

Ace

    GMC Member

  • GMC Member
  • 372 posts

Posted 11 December 2009 - 07:46 AM

I would seriously use an entirely UDP method like this if you were to make it in a similar way as you already have with the TCP version. Definitely let me know if you get this done! I wouldn't mind using something like this!

I am making an action game where updating the x,y nearly every step is necessary. The current method I'm using is fast but not very secure. Your security seems great, and that 'group' thing seems useful for sending data when (for example) an object is in the same room and near the player's view.

I would also enjoy an instance creation/destroying system such as I have in my game where it manages bullets (or other types of objects) that are created and can manage them across all clients (with tiny messages of their own) until they are destroyed. If that's hard to understand, let's say I have a sword attack, and a bullet. However, the bullet would only need to be created and will destroy itself. The sword will need to have its image index sent and must update its location to match another object (the player who created for example). Two totally different behaviors but both would still need to be managed.

If your system could do something like this without the programmer having to go in and manually edit the messages pinging around from client to server to other clients to get these simple behaviors, your system would be a must for me (as long as it included UDP of course :)). These two features would be all I would require of your system outside of being fast and efficient enough to use for an action game. Too bad TCP doesn't cut it in realtime applications. :/
  • 0
Posted Image Posted Image Online Fighting & Roleplay Game

ZERO ENGINE
Posted Image

#26 PrimuS

PrimuS

    GMC Member

  • GMC Member
  • 103 posts
  • Version:GM8.1

Posted 16 January 2010 - 12:17 PM

Some example would be good, but it's quite understandable.
  • 0

#27 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 18 January 2010 - 01:20 PM

Ace...thanks for the idea, I have been currently working on an unroll scheme for a TCP/UDP design (using ordered, reliable, disposable as send types). I will send you a message when it's completed.

PrimuS, I did have examples, but I am working diligently to getting the next version out. I had a virus, so all my files are on my old hdd, and haven't had time to search through to find the examples. You can check my host-a directory for the files I do have ( host-a.net/sabriath )

I appreciate both your posts.
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#28 Ace

Ace

    GMC Member

  • GMC Member
  • 372 posts

Posted 19 January 2010 - 04:26 PM

@Sabriath:

I am really glad you're still working on this. Sorry about your lack of replies too. It doesn't matter how long it takes, if you do happen to complete it, I could still definitely use something like this. Multiplayer is definitely bad enough without having to worry about managing huge switch statements to do stuff.

Though, I wonder, do you think you could implement file sending in there as well? I could send you some of my code if you want to add it as another default message type. Your encryption thing seems awesome and it would be very useful to put it into file sending messages as well. Aside from that request, the idea you have here is pretty sweet indeed! I can't wait until you do release this in full. I particularly like the zone functions. :)
  • 0
Posted Image Posted Image Online Fighting & Roleplay Game

ZERO ENGINE
Posted Image

#29 coolist

coolist

    The Coolist

  • New Member
  • 913 posts

Posted 17 February 2010 - 03:30 AM

I took a look at your new concept. It's interesting, but I personally think you should stick with your current direction. Yes, painfully simple may be good for absolute beginners, but they're going to out grow that quickly. Online games require a lot of fine control over details, which I feel like your new idea isn't going to give. Besides, if you were to give users an example along with the scripts they could copy and paste a lot of it, since it would all be boilerplate code, and pretty easy to understand boilerplate code at that.

Speaking of which, I think providing an example with your scripts would increase ease of use for beginners and overall interest quite a bit.

That is an excellent point. I've always knew that in my head, though you just said it properly in words. If you make it easier for a beginner then they are going to want more and more stuff implanted in their game while asking more and more questions until finally they give up.

Sorry, just wanted to respond.
  • 0

#30 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 17 February 2010 - 06:46 AM

That is an excellent point. I've always knew that in my head, though you just said it properly in words. If you make it easier for a beginner then they are going to want more and more stuff implanted in their game while asking more and more questions until finally they give up.

Sorry, just wanted to respond.

The idea is actually to make it easier for higher level programmers, not just beginners. And if a person easily gives up because they can't figure something out, then they would never have understood it anyway. The target audience is those beginners willing to go all the way upwards to experts who want to learn new tricks.

Sadly I have been slowed in my projects, I'm going to try and finish the UDP coding this week. Once that's done, everything else will pretty much fall into place (the UDP code that I'm working on has auto-throttling, so setting up a p2p node mesh will be easy).
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#31 Ace

Ace

    GMC Member

  • GMC Member
  • 372 posts

Posted 18 February 2010 - 07:14 PM

The idea is actually to make it easier for higher level programmers, not just beginners. And if a person easily gives up because they can't figure something out, then they would never have understood it anyway. The target audience is those beginners willing to go all the way upwards to experts who want to learn new tricks.


Thanks dude. I, for one, really do appreciate that. I just wanted to mention that I am doing the same with my Zero Engine actually. My engine isn't easy to understand at first, but it's definitely very easy to use once you do. It's made for people who are serious about programming games. If they aren't serious, they can just stick with whatever method they want until they give up because the tricks won't mean anything to them anyway. So, for what it's worth, I think you've got an excellent system going, and the fact that you're putting so much effort into it to help the people out who are willing to learn it shows that you've got a real gem on its way.

I really do hope you complete this. You've got some excellent ideas going here and, as much as you're probably thinking people on the GMC won't appreciate this but, the truth is, the only real responses you'll get are people complaining about how it doesn't work for them or if you've finally included a feature they really really wanted. Otherwise you can just think that people are happy with your stuff because it's probably very true. I'm sure you know this already of course, but although the GMC is finicky and unappreciative a lot of the time, those such as myself who suffer through all that and still scour the forums of our beloved Game Maker tend to really really appreciate the gems we find. That's pretty much the one reason I still work on the Zero Engine actually. People cool enough to study it and learn its intricacies make it worthwhile to program it because I know that what they will find there is something they'll appreciate quite a lot, no matter their skill level, as long as they try to understand it. :(

I really can't wait to see what you come up with! It already sounds like such a unique idea! I am definitely looking forward to your PM! :(

- Ace
  • 0
Posted Image Posted Image Online Fighting & Roleplay Game

ZERO ENGINE
Posted Image

#32 rizham147

rizham147

    GMC Member

  • New Member
  • 1 posts

Posted 26 February 2010 - 02:17 PM

There isn't much of a reason for a host to have access to plaintext passwords is there So the client can simply have their password hashed when the account is created and the hash can be stored in the Database
  • 0

#33 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 26 February 2010 - 09:27 PM

There isn't much of a reason for a host to have access to plaintext passwords is there So the client can simply have their password hashed when the account is created and the hash can be stored in the Database

?? *boggle*

The host doesn't take plain text passwords unless you purposely send it. In fact, the database takes a 16 byte string for the "password" entry for new records, which means that you must give it the hash of the real password. After registration, the functions for login are NEVER sent plaintext. It uses a secured authentication on top of a one-time key.
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image

#34 gmwiz2010

gmwiz2010

    GMC Member

  • New Member
  • 28 posts

Posted 27 April 2010 - 09:56 AM

This seems like a very cool concept, i am considering giving it a go in an upcoming game. Ill let you know how it goes if i decide to use it.

-Gmwiz
  • 0
Seventh Realm: Online - Coming soon.

Official SR:Online blog, watch for news on game progress.

#35 sabriath

sabriath

    12013

  • GMC Member
  • 3197 posts

Posted 27 April 2010 - 10:46 AM

This seems like a very cool concept, i am considering giving it a go in an upcoming game. Ill let you know how it goes if i decide to use it.

-Gmwiz

Thanks, appreciated...I do not recommend using the "nextgen", it is still beta. I am in the middle of setting up another website for all my work so I can centralize my work (and possibly get paid for it), so you won't see an update for a little bit longer....I know it's already been forever and a day, but I'm not getting paid for this right now and my family needs food, so my life-job gets in the way of my fun.
  • 0

Tutorials of Interest:
* Multiplayer: mine or True Valhalla's

Projects:
* Net39
* My 39dll scripts
* My 39dll lib
* Multiplayer Engine
* Artificial Chemistry

Posted Image