Last Stop For Multiplayer Learning
#21
Posted 02 September 2009 - 07:55 PM
Also, gotta say it, love your programming style. Alot of people tend to abuse the game maker fix thingy, where you don't have to use brackets and double = etc.
Hope to see anything more from this tutorial :3. I give it a 10/10
P.S.: Please people, this is so you can learn how to create online games, Don't ask for a whole engine, with this you can easily see how to create like a bullet shooting engine. (just send the x and y of the bullet, then send it to everyone, and let them create a bullet -.-).
#22
Posted 02 September 2009 - 08:13 PM
#23
Posted 03 September 2009 - 04:59 AM
FATAL ERROR in
action number 1
of Begin Step Event
for object obj_dll:
COMPILATION ERROR in code action
Error in code at line 14:
iod = scr_translate_client(readint());
at position 28: Unknown function or script: scr_translate_client
#24
Posted 03 September 2009 - 05:22 AM
Maybe after my Part 2 and Part 3 of multiplayer learning I'll get into organization techniques for project creation. I'm bad when it comes to organization though, so I'll have to really think about how to write it.Then perhaps you can give some tips on organization techniques.
This will be covered in either Part 2 or Part 3 of this series, it is more an optimization technique rather then sending destructive objects through the net. I'm only one man, got lots to do, including job and wife lol.One thing I can never(and probobly other people too)is shooting. For some reason the bullet doesnt show up on the other players screen. Perhaps you could make a tutorial for shooting bullets with 39dll?
You are absolutely right, and I thank you for finding this error, it is "instance_number" that I wanted. I will fix it in my next update.Hi I think you made a mistake. In the end step event of the obj_dll on te server you used instance_count which is a variable that equals the total amount of instances in the room. You can't put (obj_player) infront of it it will cause an error and it would count obj_dll as 1 so I think you may want to use ic = instance_number(obj_player); instead.
In order: Thanks, Definate Thanks, More coming soon/Thank you, (p.s.) I might create an engine, but bullets are destructive objects and a waste of bandwidth, they will be covered in optimization techniques.Really a good tutorial, it goes deep into how a package works, what a connection is etc.
Also, gotta say it, love your programming style. Alot of people tend to abuse the game maker fix thingy, where you don't have to use brackets and double = etc.
Hope to see anything more from this tutorial :3. I give it a 10/10
P.S.: Please people, this is so you can learn how to create online games, Don't ask for a whole engine, with this you can easily see how to create like a bullet shooting engine. (just send the x and y of the bullet, then send it to everyone, and let them create a bullet -.-).
Patience young grasshoppa, patience. It's one of the requirements.None is asking for a whole engine, it would just be nice to have a tutorial for a 39dll shooter game.
You need to reread the tutorial where I said "client.gmk script 'scr_translate_client'". The script needs to be created, the code is in the tutorial.{} FATAL ERROR in {} at position 28: Unknown function or script: scr_translate_client
To everyone: As I said, I'm only one man, I appreciate any errors you bring forth so I can bring a flawless piece of code to you, and I will try and be as quick as possible getting these chapters out for you.
#25
Posted 03 September 2009 - 05:43 AM
#26
Posted 03 September 2009 - 06:23 AM
I must admit, this is very well written. I believe you should incorporate constants as a substitute for writebyte(1), etc., and that the first section of the tutorial (with the IP and port parts of the packet) was a bit unnecessary and more suited towards advanced users who are interested in the details (I actually did find this section useful, but a new user would not).
Depending on how far you intend to take this, the addition of an efficient movement system would be useful (I take it this will come with your optimisation section).
Overall, good tut, very well written, and another great starting point for new users.
-Tv
#27
Posted 03 September 2009 - 07:04 AM
Writes a 4 byte integer to the internal buffer. The value can be between
-2147483648 and +2147483647
Normally for message ID's a single byte will be fine since its not like your gunna be sending 255 different types of messages
Write 1 byte. The value can be between 0 and 255
PS:
When/If this tutorial include how to do non jump/laggy movement I will be downloading and using
Edited by general sirhc, 03 September 2009 - 07:08 AM.
#28
Posted 03 September 2009 - 10:29 AM
It wasn't dumb, any replies helps keep this post up top and more viewed. I'd like to know my nights of staying up weren't in vain. And thank you for the compliment.Oh, man, I knew it was a dumb thing to post. Anyway, a really great tutorial, I have to say. Coding is one thing, explaining it is another whole (was about to type whole nother) thing, and you, my friend, have it down. For one man that is Good luck with it, my friend was right to suggest your tutorial. Really helpful
I do prefer constants as well, but digits in GM are actually stores in a less planar system making it faster than defining a constant (blah). I haven't looked into making it a resource constant yet though, I'll think about it in the next set of tutorials. The reason for all the babble in the beginning is to let people know how complicated a connection is, and that the code presented in 39dll is nowhere near as complicated, it also gives them a basic foundation for internet workings and will help them move into more advanced topics later (which I can refer back to). If a new user cannot get through a few chapters of pseudonetworking, then I don't think they'd be able to make it through actual multiplayer creation...right? Plus I stated "this isn't going to be a test" and people can skip chaptersThought I'd give this a read through to see how it compares to my tutorial (which I should really redo considering how old it is now).
I must admit, this is very well written. I believe you should incorporate constants as a substitute for writebyte(1), etc., and that the first section of the tutorial (with the IP and port parts of the packet) was a bit unnecessary and more suited towards advanced users who are interested in the details (I actually did find this section useful, but a new user would not).
Depending on how far you intend to take this, the addition of an efficient movement system would be useful (I take it this will come with your optimisation section).
Overall, good tut, very well written, and another great starting point for new users.
-Tv
Yes, right now the code is not optimized for network transmissions other than no transmission is sent if the player doesn't move, and I will be touching on this in a later tut....thank you for the compliment!
This is true, except when you are dealing with encrypting code markers and in a game as massive as world of warcraft, you will need at least 30,000 codes. I could've used "writeshort" as a 2 byte code, but I'm use to "int" from my days in C++ so I used it.Normally for message ID's a single byte will be fine since its not like your gunna be sending 255 different types of messages
Everyone: This tutorial is finished for the scope of knowledge I created it for. When I get some time to get my webpage working, I'll link in the gmk files that are in this tutorial for you.
Edited by sabriath, 03 September 2009 - 10:31 AM.
#29
Posted 03 September 2009 - 12:25 PM
maybe if there is more to come I will surely check it out
#30
Posted 03 September 2009 - 01:46 PM
Edited by commander of games, 03 September 2009 - 01:48 PM.
#31
Posted 04 September 2009 - 01:28 AM
The files have been put up in the header, they follow along with the chapters laid out in this tutorial. I have tested the code and fixed all the errors I could find. The files automatically contain the "127.0.0.1" IP pointer, so it works right out of the box for testing purposes (the IP is pointing to yourself).I can really see that there is alot of time put into this. and that time is well used, really great to see the rest of the chapters, hope to see those gmk files :3
Instructions in order:
run chapter14_server.gmk
run chapter14_client.gmk
use up/down/left/right to move around a bit
run another chapter14_client.gmk
move the windows so you can see all 3
move around on either client and watch the other client move you
right click any of the player's images in the server screen and it will disconnect that player
maybe if there is more to come I will surely check it out
There will be more, and the next product will be dealing somewhat with a chat program (xshortguy is currently running a project on it, but I will be running one separate for tutorial purposes). I plan to impliment not only a lobby to chat in, but private messages and file transferring (to show how to set up double connections). This will be more intricate so I'm having to write the working product first, then I'll write the tutorial on it.The finished product is very good and helpfull, whats the next tutorial going to be about?
#32
Posted 04 September 2009 - 01:59 AM
Edited by commander of games, 04 September 2009 - 01:59 AM.
#33
Posted 04 September 2009 - 09:18 AM
I am honored to inspire a human being like yourself
- 39ster {1} for the 39dll so I didn't have to write it myself
- xshortguy for approving this tutorial before I was done
- the_recruiting for giving me a reason to make this tutorial
#34
Posted 09 September 2009 - 12:08 AM
#35
Posted 09 September 2009 - 08:03 AM
- Start with dllinit(0, true, false);
- servers listen with tcplisten()
- clients connect with tcpconnect(ip, port, 2 or 1)
- send stuff with clearbuffer(), writeint(x), sendmessage(recipent)
- receive stuff with clearbuffer(), recievemessage(), readint()
- Keep ids for freaking everything.
This guide was helpful, thanks for writing it!
#36
Posted 09 September 2009 - 10:58 PM
#37
Posted 16 September 2009 - 12:51 AM
-Thank you
#38
Posted 16 September 2009 - 01:22 AM
There is a chat program in my projects list, I'll get to it eventually, thanks for the suggestion.A chat program is something I would like to see. Hey, maybe the chat example could enclude sending URL links to everyone else?
Thanks and no problemthe_recruiting: I am honored to inspire a human being like yourself By the way awesome tut.
randomazin: wow this is a good basic tutorial, really helped alot. thanks for making it
zeddidragon:
So, in summary:
- Start with dllinit(0, true, false);
- servers listen with tcplisten()
- clients connect with tcpconnect(ip, port, 2 or 1)
- send stuff with clearbuffer(), writeint(x), sendmessage(recipent)
- receive stuff with clearbuffer(), recievemessage(), readint()
- Keep ids for freaking everything.
This guide was helpful, thanks for writing it!
No, but my second part tutorial contains documentation on port usage, I will put the link to it in the original post.I was starting a game a while ago with another tutorial, and it didnt tell me which port to open. This covers all of that right?
No, thank you for reading it. There is no way to "speed it up" because the lag you see is network lag, there is absolutely no way to speed this up aside from making the customer purchase a faster internet connection. It can however be compressed and the movement not sent in every step...but this was just a beginning tutorial, it will be covered in another part later. For now I'm working on a compiler and other projects.I really liked this tutorial it gives the basics really well but i was wondering if you could show how to like speed it up cause the movement is like delayed a couple seconds
-Thank you
Edited by sabriath, 16 September 2009 - 01:23 AM.
#39
Posted 23 November 2009 - 10:38 AM
#40
Posted 23 November 2009 - 04:38 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











