Jump to content


Photo

39dll V2.5


  • Please log in to reply
2525 replies to this topic

#31 GM6_Dude

GM6_Dude

    I am mikesgm6

  • New Member
  • 167 posts

Posted 04 July 2005 - 02:04 AM

Hey iv made a mmorpg engine for you guys to use. http://forums.gamema...howtopic=136369

<{POST_SNAPBACK}>


OMG THIS IS NEAT!!!!!!1

i needed this to make my new ...........
wait better keep it a secret

but when u see the best online game :huh: j/k
just remember u gave that project its life
  • 0

#32 Rebound->

Rebound->

    GMC Member

  • New Member
  • 152 posts

Posted 04 July 2005 - 05:17 AM

LMAO Yourself, you're so stupid :-P
Nice DLL 39ster, i'm actually going to try and test this against GMsock. Good job.
  • 0

#33 GM6_Dude

GM6_Dude

    I am mikesgm6

  • New Member
  • 167 posts

Posted 04 July 2005 - 06:20 PM

Hey iv made a mmorpg engine for you guys to use. http://forums.gamema...howtopic=136369

<{POST_SNAPBACK}>


OMG THIS IS NEAT!!!!!!1

i needed this to make my new ...........
wait better keep it a secret

but when u see the best online game :) j/k
just remember u gave that project its life

<{POST_SNAPBACK}>

:huh: <ME
  • 0

#34 DJ Gman

DJ Gman

    GMC Member

  • New Member
  • 685 posts

Posted 04 July 2005 - 11:06 PM

this dll is a bit confusing could use a more in depth help file :huh:
  • 0

#35 Zaltron

Zaltron

    GMC Member

  • New Member
  • 14 posts

Posted 05 July 2005 - 03:05 AM

Hey, I think this thing is great! I have seen one bug with 2 people though. When p1 and p2 and gone in and and of both maps then p1 was in the house map and p2 was outside of the house map, p1 could see p2 at the top of the house map except that p2 looks like he was stuck in the black on the outside of the house in the house map even though he wasn't on that map. Hope that helps :\. Also, I looked through your scripts and couldn't figure where and when you sent your x and y data to the server, I was just wondering, where in your scripts are you doing that?

Edited by Zaltron, 06 July 2005 - 03:06 AM.

  • 0

#36 39ster

39ster

    GMC Member

  • GMC Member
  • 898 posts

Posted 05 July 2005 - 08:59 AM

I have now made a tutorial for the dll! Its in the zip and its called tutorial.rtf.

I also updated the dll and scripts so if you have already started making your game using the old scripts then to use the new ones do this:
Under scripts, remove the folder the dll scripts are in
Go to File->Merge game and select the DllScripts.gm6

Updates:
The only real update to it is writestring() and readstring() are more extensive and now requires less programming to use.
This is the old way you could of used writestring() and readstring() (you can still do it this way in the new update):
writestring("hello");
readstring(bytesleft()); //had to put how much letters to recieve.

Thats all well and good if your only sending one string over winsock, but what if you want to something like x, y, user and password in one message? How are you going to know how long the username string is and the password string? The new update makes strings alot easier to use because you can use them like readshort() or readint() where you dont have to give an argument.
//Write the data
writeshort(x);
writeshort(y);
writestring("39ster", true);
writestring("123456", true);

//Reading the data
x = readshort();
y = readshort();
username = readstring();
password = readstring();

How does it work? Simple. If you set the second argument in writestring() to
true then that means to add a Null (ascii code 0) terminator character after the string. Now when you dont set argument0 or if argument0 is 0 in readstring() then it tells the dll to read until it reaches the null terminator.

What if i want to send a string over a text based protocol..Text bases protocols dont allow the ascii code 0.
You can define your own seperator string other than the ascii code 0!
Example:
//Writing the data
writestring(username + ":" + password + ":");

//Reading the data
username = readstring(0, ":");
password = readstring(0, ":");

Warning: Do not write a string with a null terminator if your going to read it using your own seperating string! This will crash the game.

Also i have removed the splitstring() function because its not needed anymore!

Edited by 39ster, 05 July 2005 - 09:24 AM.

  • 0

#37 DJ Gman

DJ Gman

    GMC Member

  • New Member
  • 685 posts

Posted 06 July 2005 - 03:51 PM

thanks the tutorial helps a lot
  • 0

#38 Stryke

Stryke

    fcuκô

  • GMC Member
  • 606 posts

Posted 07 July 2005 - 12:13 AM

I made an .gm6 for everyone that wants a online example that is less advanced. It only works with 2 players so if you want to work with unlimited players you gotta edit it. http://www.rocketsof...s/RPGClient.gm6
This example is probably good for a pong game.

Edited by Stryke, 07 July 2005 - 12:13 AM.

  • 0

#39 Timmo

Timmo

    GMC Member

  • New Member
  • 558 posts
  • Version:GM:HTML5

Posted 07 July 2005 - 12:18 AM

God dammit, this dll is so good. But why not there are much posts about it? This is much better than Gm's mplay functions and more simple too.
  • 0

#40 Stryke

Stryke

    fcuκô

  • GMC Member
  • 606 posts

Posted 07 July 2005 - 05:53 PM

Yeah, only 2 pages from December 2004 - July 2005.. sad :D
  • 0

#41 39ster

39ster

    GMC Member

  • GMC Member
  • 898 posts

Posted 09 July 2005 - 06:35 AM

Ok guys let this topic die if you want but what im about to say isnt just because i made this dll. This is the only dll on these forums that you can make professional lagless multiplayer games. MPLAY and no other winsock dll supports binary mode and the use of reading/writing in different data types. All professional online games you see use this method and if anyone here wants to make anything professional involving multiplayer then this is the only dll.
To understand why this dll is important read http://www.gamedev.n.../article712.asp in the section: "Birth of Lag: Building the Packet". This dll can do everything mentioned in that section.
  • 0

#42 Timmo

Timmo

    GMC Member

  • New Member
  • 558 posts
  • Version:GM:HTML5

Posted 09 July 2005 - 07:35 AM

"MPLAY and no other winsock dll supports binary mode and the use of reading/writing in different data types."

Wht does it mean?

Edited by Timmo, 09 July 2005 - 07:37 AM.

  • 0

#43 39ster

39ster

    GMC Member

  • GMC Member
  • 898 posts

Posted 09 July 2005 - 08:25 AM

When im talking about different data types i mean these scripts:
writebyte() - Utilizes 1 byte
writeshort() - Utilizes 2 bytes and can be a number between -32000 to +32000
writeint() - utilizes 4 bytes and can be a number between -2000000 to + 2000000
writefloat() - utilizes 4 bytes and can store numbers with a floating point (e.g 4.2)
writedouble() - Utilizes 8 bytes and is the same as writefloat but the number can be much much larger!
  • 0

#44 Jochem

Jochem

    Pagoe Lord

  • New Member
  • 232 posts

Posted 09 July 2005 - 01:19 PM

I was wondering something.
Is it necessary to send a string and the numeric values in different packets (when the numeric values are being packed with writebyte())?

I've made a string_split() script (how original!), which uses a character from the ASCII-table (like '|') to split different values from each other. Since some strings depend their size on their user, like names and passwords.
For example, I send the packet: "LG|Jochem|mypassword|5600" to log myself in. I could easily halve the size of bytes for 5600, but that isn't possible, because there is already used a ASCII-character for the strings, and the whole packet will be messed up when readed, thus leading to errors.

I did though of giving a name and password a fixed size, but that would be a waste of bandwith, wouldn't it?

Does anyone have any suggestions?
  • 0

#45 39ster

39ster

    GMC Member

  • GMC Member
  • 898 posts

Posted 09 July 2005 - 02:10 PM

I was wondering something.
Is it necessary to send a string and the numeric values in different packets (when the numeric values are being packed with writebyte())?

I've made a string_split() script (how original!), which uses a character from the ASCII-table (like '|') to split different values from each other. Since some strings depend their size on their user, like names and passwords.
For example, I send the packet: "LG|Jochem|mypassword|5600" to log myself in. I could easily halve the size of bytes for 5600, but that isn't possible, because there is already used a ASCII-character for the strings, and the whole packet will be messed up when readed, thus leading to errors.

I did though of giving a name and password a fixed size, but that would be a waste of bandwith, wouldn't it?

Does anyone have any suggestions?

<{POST_SNAPBACK}>

You do not need to have the packet seperated with "|".
Just do:
//Building the packet
writestring("LG", true);
writestrng("Jochem", true);
writestring("mypassword", true);
writeshort(5600);

//Reading the packet
lg = readstring();
username = readstring();
password = readstring();
short = readshort();

See when you set argument1 in writestring() to True then this adds a NULL terminator character at the end of it. This Null terminator will now be used to find when the string ends. Setting argument0 in readstring() to 0 (or leaving it blank) means to extract the string by finding the NULL terminator. This is also alot faster then a split_string() script written in gml.
Null terminator character is the ascii code 0 btw and is very rarely used in strings..apart from telling the app when the string finishes.

Edited by 39ster, 10 July 2005 - 08:20 AM.

  • 0

#46 Jochem

Jochem

    Pagoe Lord

  • New Member
  • 232 posts

Posted 09 July 2005 - 02:51 PM

Ah, now this makes sense. Thanks. I will be playing a little around with the DLL and see how it works. :D
  • 0

#47 39ster

39ster

    GMC Member

  • GMC Member
  • 898 posts

Posted 11 July 2005 - 08:07 AM

Ok iv made a new update. It now includes the zlib library so you can compress and decrompress the internal memory buffer. You can also create a checksum of the data inside the buffer!
  • 0

#48 Jochem

Jochem

    Pagoe Lord

  • New Member
  • 232 posts

Posted 11 July 2005 - 11:04 AM

"You can also create a checksum of the data inside the buffer!"

What do you mean with that? :/

"It now includes the zlib library so you can compress and decrompress the internal memory buffer."

Err.. since most of the data is already expressed as small as it could be, how could it be any smaller?
  • 0

#49 RiChArD_fLoOd

RiChArD_fLoOd

    GMC Member

  • New Member
  • 395 posts

Posted 11 July 2005 - 11:07 AM

is this better than gmsock cos i'm kinda in the middle of makin a game with gmsock
  • 0

#50 Jochem

Jochem

    Pagoe Lord

  • New Member
  • 232 posts

Posted 11 July 2005 - 11:12 AM

Well, it depends more on the way you work around with it, but that's already explained a million times by other people. Though, if you use both DLL's at their best, I think this DLL would win, but pretty close, though.
  • 0

#51 39ster

39ster

    GMC Member

  • GMC Member
  • 898 posts

Posted 11 July 2005 - 12:01 PM

"You can also create a checksum of the data inside the buffer!"

What do you mean with that? :/

"It now includes the zlib library so you can compress and decrompress the internal memory buffer."

Err.. since most of the data is already expressed as small as it could be, how could it be any smaller?

<{POST_SNAPBACK}>

Alright say you have a file and you load the file into the internal buffer using the file functions. Then use checksum() which will return a unique number and only a file with the exact same data in it will have that same checksum value. So if you have an online game that stores the levels on the server than when a player enters a level, you can use this to check if it needs updating.

Also for compressing wont be useful for sending messages that are already smaller than 12 bytes. You can use it to compress files or large messages. It will still be much smaller even though you have written in different data types!

Ok im not saying this cause i made the dll but this IS better than gmsock! Im saying this to help you. Being able to write in binary mode is very important for online games and this makes it very easy to write in different data types. If people just tried this and played around with it you will find it is faster, more powerful and more stable than gmsock.
  • 0

#52 RiChArD_fLoOd

RiChArD_fLoOd

    GMC Member

  • New Member
  • 395 posts

Posted 11 July 2005 - 01:55 PM

Well, it depends more on the way you work around with it, but that's already explained a million times by other people. Though, if you use both DLL's at their best, I think this DLL would win, but pretty close, though.

<{POST_SNAPBACK}>

@ 39ster and Jochem
right ok, cheers mate

Edited by RiChArD_fLoOd, 11 July 2005 - 01:56 PM.

  • 0

#53 Jochem

Jochem

    Pagoe Lord

  • New Member
  • 232 posts

Posted 11 July 2005 - 02:16 PM

Cool new functions, 39ster.

I think I've found a major bug:

If a program stops responding, it will fail to listen on any port, and perhaps using the whole DLL. I don't know how to solve this, I've tried to free the DLL, rebooted the pc, but it just doesn't work anymore.

I tried to let my program connect to my server (same pc), but I forgot to let the server handle the messages the client would send. (I did made the script, I just forgot to insert it in the server object.)
My time out code wasn't working (timed out way too fast), so I removed it (silly me). Result was that the while loop went on forever, making the program not responding, since the server wasn't handling its login-message, which he should be handling, if I had put in the script to handle them.

So, any way to fix this? I will try to use a different port for a temporary solution. :/

Edit: Nope, I can't use different ports either.

Jochem.

Edited by Jochem, 11 July 2005 - 02:18 PM.

  • 0

#54 Jonit

Jonit

    GMC Member

  • New Member
  • 130 posts

Posted 11 July 2005 - 02:28 PM

I was wondering something.
Is it necessary to send a string and the numeric values in different packets (when the numeric values are being packed with writebyte())?

I've made a string_split() script (how original!), which uses a character from the ASCII-table (like '|') to split different values from each other. Since some strings depend their size on their user, like names and passwords.
For example, I send the packet: "LG|Jochem|mypassword|5600" to log myself in. I could easily halve the size of bytes for 5600, but that isn't possible, because there is already used a ASCII-character for the strings, and the whole packet will be messed up when readed, thus leading to errors.

I did though of giving a name and password a fixed size, but that would be a waste of bandwith, wouldn't it?

Does anyone have any suggestions?

<{POST_SNAPBACK}>

You do not need to have the packet seperated with "|".
Just do:
//Building the packet
writestring("LG", true);
writestrng("Jochem", true);
writestring("mypassword", true);
writeshort(5600);

//Reading the packet
lg = readstring();
username = readstring();
password = readstring();
short = readshort();

See when you set argument1 in writestring() to True then this adds a NULL terminator character at the end of it. This Null terminator will now be used to find when the string ends. Setting argument0 in readstring() to 0 (or leaving it blank) means to extract the string by finding the NULL terminator. This is also alot faster then a split_string() script written in gml.
Null terminator character is the ascii code 0 btw and is very rarely used in strings..apart from telling the app when the string finishes.

<{POST_SNAPBACK}>


Hello, look what im trying to do...

SERVER ACTIONS(sending login informations to client.)
clearbuffer();
writebyte(3);
writestring(charname,true);
writestring(job,true);
sendmessage(sock);
show_message("message sent with "+string(charname)+":"+string(job));
the last line is just for test.

CLIENT, RECEIVING....

case 3:
    charname = "";job = ""
    charname = readstring();
    job = readstring();
    show_message("Account: "+string(charname)+"..."+string(job))

it isnt receiving anithing, the charname and job values stays ""

whats wroong?

Edited by Jonit, 11 July 2005 - 02:30 PM.

  • 0

#55 Jochem

Jochem

    Pagoe Lord

  • New Member
  • 232 posts

Posted 11 July 2005 - 02:41 PM

case 3:
   charname = "";job = ""
   charname = readstring();
   job = readstring();
   show_message("Account: "+string(charname)+"..."+string(job))


Switch is 'readbyte()?' And don't forget to use brackets. :/
You can remove this:
charname = "";job = ""
. It's not needed.

Edited by Jochem, 11 July 2005 - 02:48 PM.

  • 0

#56 39ster

39ster

    GMC Member

  • GMC Member
  • 898 posts

Posted 11 July 2005 - 03:08 PM

I think I've found a major bug:

Why would the program stop responding? I dont quite understand what your doing.
The while loops should not go on forever if youve made sure it exits the loop if recievemessage() return 0 or < 0.

Hello, look what im trying to do...

SERVER ACTIONS(sending login informations to client.)

From what i can see everything is correct so the error is occur somewhere else..like maybe before the switch function? I need the code for the actual recieving.
  • 0

#57 Jochem

Jochem

    Pagoe Lord

  • New Member
  • 232 posts

Posted 11 July 2005 - 04:09 PM

I just mean, that since the client game crashed, the server program refuses to listen on any ports.

Edit: That's weird, your example still works. Hmmm.

Edit2: I get my game to work again, silly me, I put the 'listen' script accidently in the step event. :/

Edit3: I think the reason why most people skip at looking this thread, is because of the name. You don't have a real name for your DLL. Look at GMsock, it has a name that you won't forget very soon.

Edited by Jochem, 11 July 2005 - 06:18 PM.

  • 0

#58 matu666

matu666

    GMC Member

  • New Member
  • 74 posts

Posted 12 July 2005 - 11:47 AM

hi im new to using online functions but i found your dll yes to use so far, im doing the pong example like you suggested but im having a problem. the player key control controls both players movement(player 1 and 2 use up and down keys to move but both players on my screen move when i use it and my player doesnt move on the other screen).what would be the problem what am i doing wrong is there something i missed out on.
  • 0

#59 Jochem

Jochem

    Pagoe Lord

  • New Member
  • 232 posts

Posted 12 July 2005 - 11:53 AM

Are you sure that you are sending the messages that they're moving? If so, are they received by the other pc?
  • 0

#60 matu666

matu666

    GMC Member

  • New Member
  • 74 posts

Posted 12 July 2005 - 12:11 PM

here is what iv done it just a rough example so i cn get us to it(hey youve got to start somewhere).
http://www45.brinkst...se/bal game.zip

Edited by matu666, 12 July 2005 - 12:11 PM.

  • 0




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users