Would you be interested in a book about GS MP?

Posted By: fastlane69

Would you be interested in a book about GS MP? - 07/14/10 23:57

Hi all,

What you see below is an overview of the book I'm writing. It's based off a book I wrote a year after getting into GS using A5/6. It's been years since then and both my experience with GS and my writing skills have improved. Hence while based on that old work, it's really been updated to take everything up to A8 (in beta) into account.

It's an intermediate level introduction to GS networking. The first 3rd is an overview of networking in general, to set the stage for what is to come. The second third of the book discusses the basic elements of GS. Not how they work insomuch as what they are and their relation to each other. The emphasis is on networking (and thus graphics or audio functions are not discussed) as well as presenting a unified view of the GS engine. Lastly, the final third takes everything up to that point and puts it together. It is here that how GS networks is specifically discussed. The purpose is NOT on how to make anything. The demo is there merely to showcase all the GS network functionality. But the idea is that there will be a followup book which would in fact talk about design and development strategies for specific projects (like MP, MMO, casual, etc). Al the same, an advanced user after reading this book should be able to take the demos and build on them to suit their needs.

The numbers are the current page numbers with chapters 1, 2, appendices, and images all done. Chapter 3 is about 80% done and I still need to put the final touches on the demos. The book length should hover around 100 pp. and the demos will be less than 10MB each. Thus the entire package, book + 3 demos, should be less than a 30 MB download. If there is interest in this work, it could be complete in as little as two months at which point I would put it up for sale via a digital download at a yet to be determined price.

Please let me know if this would be of use to you, suggestions on other topics or formats for the books, and generally any questions or comments you might have.


Code:
. 
                         Table of Contents

Introduction	4


Chapter 1:  Network Basics	7
     UML Diagrams	7
          Component Diagram	8
          Use Case Diagram	9
          Sequence Diagram	10
     
     Client/Server Architecture	11
          N-Tier architecture	11
          Client/Server vs. Peer-to-Peer Networks	13
          GS Client/Server 2-Tier Architecture	15
          If(Connection)	16
          My.Terminology	19

     Demo 1:  Non-Interactive Dedicated Servers	21


Chapter 2: GameStudio™ Basics	25
     GameStudio History	25

     Authorware Editors	26
          MED	27
          WED	28
          SED	30

     Data Structures	33
          Quants, frames, ticks, and seconds	33
          Strings and Text	34
          Vars, long, double	34
          Structs and flags	34
          Skills	34

     Event System	35
          Input events	37
          Detection  events	39
          Collision events	41
          Engine events	43

     Demo 2:  Interactive Non-Dedicated Server	44


Chapter 3: GameStudio Networking	46
     Network Communication Protocols	47
          GS Network object Indexing	48
          If(Event_Type == Event_Join)	49
          Automatic updates	54
          Scripted updates	58
          If(Event_Type == Event_Leave)	60
          Session_Connect()	62

     Network Entities	66
          Player=Ent_Create()	67
          Network Action()	70
          My, My.Skills, and My.Event()	72
          If(Event_Type == Event_Disconnect)	74

      Scripted Updates	76
          If(Event_Type == Event_Var)	78
          If(Event_Type == Event_String)	79
          If(Event_Type == Event_Data)	79
          If(Event_Type == Event_Receive)	80

      Network Engine Control	82
          Network statistics	82
          Packet control	83
          Function control	84
          Client  control	84

      Demo 3:  Non-Interactive Client with Zoning	86




                         Appendices

C-lite network  functions and variables glossary	87
GS and networking glossary	96
Bibliography	107
Revision notes	108



 
                         Table of Images

Figure 1: ScreenShot (SS) PAST™	4
Figure 2: Component Diagram (CD) Template	8
Figure 3: Use Case Diagram (UCD) Template	9
Figure 4: Sequence Diagram (SD) Template	10
Figure 5: CD 3, 4, and GS’ 2 Tier Architectures	12
Figure 6: UCD P2P and C/S Networks	13
Figure 7: UCD Client	14
Figure 8: UCD GS Client-Side and Server-Side networks	18
Figure 9: UCD Dedicated Server	24
Figure 11: SS MED	27
Figure 12: SS WED	28
Figure 13: SS SED	30
Figure 14: CD Events and Event Handlers	35
Figure 15: CD Detection Events	40
Figure 16: CD Entity Collision Events	42
Figure 10: UCD Non-Dedicated Server	45
Figure 17: UCD Joining	52
Figure 18: SD Joining	53
Figure 19: UCD Automatic and Scripted Updates	54
Figure 20: SD Automatic Updates	57
Figure 21: SD Scripted Updates	59
Figure 22: UCD Leaving	61
Figure 23: SD Leaving	61
Figure 24: SD Session_Connect()	65
Figure 25: UCD Client Ent_Create()	69
Figure 26: SD Client Ent_Create()	69


Posted By: Liamissimo

Re: Would you be interested in a book about 3DGS MP? - 07/15/10 00:06

Sounds very intresting, yes. Table of content also looks good wink
Posted By: Damocles_

Re: Would you be interested in a book about 3DGS MP? - 07/15/10 00:48

Good luck with writing this, and getting interest.

You should however also explain one of the Networking plugins here as alternative method for multiplayer.

In specific, you could talk to the author and bundle this with A-Net, which would serve you both.
Posted By: fastlane69

Re: Would you be interested in a book about 3DGS MP? - 07/15/10 01:18

Luck I don't need; the work is all but done. Motivation to actually finish on the other hand I could use. grin

Writing about any plugins or alternative network engines is outside the scope of this book.
Either topic could be a book of it's own and may be someday, just not in this first one.
Posted By: Germanunkol

Re: Would you be interested in a book about 3DGS MP? - 07/15/10 20:10

I believe if you had more demos of functioning network code (like, for example, the whole setup of joining, chat, kicking, disconnecting, rejoining, and, more importantly, movement interpolation and prediction) that would raise the number of sells dramatically. Examples that you could 1) learn from and 2) copy and paste, in part, into your project. The examples you mentioned sound good, but they're too basic. Everyone can setup a server and join it, after playing around for a few days. But when it gets to more advanced stuff, like smooth movement and shooting, people fail.
If I were you I'd make a basic, fully working, example game that is built up during the process of reading the book, including entity creation, deleting, moving, controling, but also level loading, chat and the like.
Also I'm missing serverlists. No gamer nowadays would want to connect via command line or IP address...

With all of that said, I like the idea of boosting the number of people who know about 3dgs multiplayer... and thus maybe the number of multiplayer projects.

Posted By: fastlane69

Re: Would you be interested in a book about 3DGS MP? - 07/15/10 21:46

BTW, I forgot to mention that the book is currently at 25k words. I figure that's a good length for an intermediate/reference text. This is also relevant because I attempted to write about everything listed two quotes down and found that it would have taken at least 2 or 3 times as many words not to mention increased development time in terms of creating the demo, testing it, packaging it, etc... doing this all at once was a little too much for me to do right now quite frankly.

So when you say...

Quote:
The examples you mentioned sound good, but they're too basic.


I say EXACTLY! grin


You see, most books or projects of this nature start with exactly the goal you have in mind...

Quote:
If I were you I'd make a basic, fully working, example game that is built up during the process of reading the book, including entity creation, deleting, moving, controling, but also level loading, chat and the like.


... which is fine if you already understand what joining means, what chat is in the context of GS, how the net engine kicks clients, how it connects initially, how it connects after the fact, what movement means on the network, the need for prediction, etc. That is the purpose of my demos: to help you understand, not just use, each of these individual components you listed below (with the except of chat and movement atm):

Quote:
the whole setup of joining, chat, kicking, disconnecting, rejoining, and, more importantly, movement interpolation and prediction)


If on the other hand a GS MP developer just dives with nothing but getting a game up and running on the brain, then while they may have initial success, eventually their lack of basic GS concepts and procedures will catch up with them. It's exactly as you say:

Quote:
Everyone can setup a server and join it, after playing around for a few days. But when it gets to more advanced stuff, like smooth movement and shooting, people fail.


... and thus my book is there to help your really grok those first few days and instead of just having a working server, you also have a working network knowledge which is much more useful in the long run and sets the stage for really understanding movement, chat, and all the rest and their implementations in GS.



It is my belief that people are failing at MP not because it's too difficult or large... it really isn't. It's just that the way it's presented is too advanced. Everyone wants build a MMOG but there is too much focus on the "MMOG" and not enough focus on the "build". This is also meant to be the first book of many. I'm hoping my book(s) will help bring more cohesiveness to the GS MP community and will help more newcomers join our ranks quickly and efficiently. From my book:

Quote:

My aim is to show you the main components needed to create a multiuser virtual environment, a MUVE, with GameStudio. A Multi-User Virtual Environment (MUVE) is defined in this book as:

1. A Computer Simulation using keyboard and mouse as the input devices and monitors and speakers as the output devices
2. …with a Network Architecture comprised of a Client, Server, and a database applications
3. … which implements a Virtual 3-dimensional space-time
4. … which is Shared by hundreds of simultaneously interacting players all of whom can
5. …Move within the environment,
6. …Interact, and Communicate with each other and the environment.

As the first book in a series, this work lays the foundation towards future works. In principle, this book covers points 1 through 4 of the MUVE definition given above. Book 2 will go on to cover points 5 and 6 and show how to use the basic elements of the GS engine to create basic MUVE systems such as move, chat, and mouse interaction. Books 3 & 4 will then go on and present the most advanced of MUVE development topics including registration, security, server farms, mysql database, scan event, collision events, animation, bots, and more.


Finally, as a intermediate GS programming book (but a beginner networking book), the first 2/3 are a great reference and way to make sure you really know everything needed from GS to go from SP to MP. For example, my glossary list has all the net functions and variables spread throughout the manual in one convenient place. My Event Handler diagram (#14) is unparalleled in showing you each and every event that you can enact in GS. And the Scripted Updates sequence diagram (#21) is equally unparalleled at showing you, at a glace, everything that a programmer can send from client to server and vice versa.

Quote:
Also I'm missing serverlists. No gamer nowadays would want to connect via command line or IP address...


But as this book is not about games or for gamers, then this is not a high priority for the first book. While gamers indeed will not input IP addresses, researchers, students, prototypers using the GS engine will think nothing of it until it becomes a problem. As well, by the time you need it, you are talking about POST/GET or SQL calls to some database with IP addresses and that is an advanced topic and again, outside the scope of this current book. Fantastic topic for future works, but as it requires the knowledge that I present in the first book and not the other way around, it will have to wait.
Posted By: HeelX

Re: Would you be interested in a book about 3DGS MP? - 07/15/10 22:01

Hey Fastlane, I really would love to see that such a huge amount of knowledge is given to the community. Multiplay programming is like "magic" to some people. I for example -never- ever touched the multiplayer functions in Gamestudio (maybe because I always was a bit biased towards developing singeplayer games...). So, this could be great!

I also recognized that you try to communicate your thoughts by using UML diagrams. I appreciate that, a lot of game developers never heard of the UML and that is really too bad.

Is your book somehow updated to the current state of the multiplayer functions or did you missed some features since a specific A7 version? That would be important to know regarding the up-to-date'ness of your examples. That is just meant in regard to my interest, don't want to blame you, of course :-)

I am literally excited!
Posted By: Damocles_

Re: Would you be interested in a book about 3DGS MP? - 07/15/10 22:10

The biggest problem of (hobby) multiplayer development is
not developing a Muliuser gameenvironment itself,
but that developers quickly loose motivation:

because noone wants to join and play the game.

There where several multiplayer demos going around here
(mostly FPS type), And some of them had the most of core points
running quite well.
But after some short public beta test, the game dies out, as
there are people missing to play with, and the developer
looses motivation to make a full game.

Thats why the point about serverlists (and other
topics to make it players easy to use the game, and motivate
other to join)
is very very important.

Even setting up a simple online Highscore (which presents some
small degree of interaction) pushes motivation.
(Beeing a part of unsyncronous gameplay, wich I think it
the best approach for small hobby online game)
Posted By: fastlane69

Re: Would you be interested in a book about 3DGS MP? - 07/16/10 09:32

Quote:

Is your book somehow updated to the current state of the multiplayer functions or did you missed some features since a specific A7 version?


First paragraph of my original post ol' boy. grin

Since I have beta access, I have included everything we know about what A8 Networking will look like. For example, the correct editions are referenced in my book with encryption/compression being pretty much the only pro feature as well a passing mention to the Dplay -> Enet transition.
Posted By: fastlane69

Re: Would you be interested in a book about 3DGS MP? - 07/16/10 09:39

"The biggest problem of (hobby) multiplayer development is
not developing a Muliuser gameenvironment itself,
but that developers quickly loose motivation:"

Couldn't agree more. That I'm still in it is more a testament to my stubborn bullheadedness than any real motivation at this point. tongue

But seriously, that is a good point and again, one which is worthy of entire books on the psychology of game development. I don't think that MP is any different than SP in that regard. You present anyone with a game that will take years to realize and they will balk... "years" just isn't in peoples vocabulary these days... "now" is... and so is "right" as in "right now". Which is another reason why I'm taking small steps with my book instead of trying to do it all at once.

Again, you and others bring up excellent points but they are just too big to be included in this book right now.



As a general question, what section or image of the book (not demo) would you like to see? What part of the book would you need to preview to get an idea of what it's about and it's usefulness to you? Consider that the Table of Content represents a work all but done so virtually anything there is open for preview.
Posted By: Germanunkol

Re: Would you be interested in a book about 3DGS MP? - 07/16/10 13:05

To answer your last post's question, for me personally, I would be most interested in "Event System" and "Multiplayer Entities" as a preview. Not because they are of the most importance but because I believe they could be the most motivating to buy such a book. Not sure what others think though.

As for the other remarks you made, thank you for clearing that up. I didn't realize this was to be one of multiple books, so I was missing the other parts. If the things I mentioned get worked on in other books, then this basic approach is indeed very good. Though on the other hand, we are mostly hobby programmers here. If we got payed for it, we could read loads of books, but as long as we don't get payed, the fastest way to get results is always the most motivating one. If I was only starting into mutliplayer programming, I would want to see a fully working game first and then learn how parts of it work, even with a basic approach like yours, that would be fine. But I hardly have the time to code my game, then I don't want to read 100 pages of a book, even if it saves me time (which I don't know at first).

With all that said, I think if you bring out more books that cover more advanced topics (and hopefully with loads of example scripts, because they are always a good way to learn) this is still a very good project.
Posted By: HeelX

Re: Would you be interested in a book about 3DGS MP? - 07/16/10 16:40

Originally Posted By: fastlane69
First paragraph of my original post ol' boy. grin


I think my subconsciousness tried to get a conversation started because, ya know... reading such good news from fastlane69, reminds me about some of the ol' days. I also assume that my dirty little black-hearted gamedeveloper brain tried to take this opportunity to let me look like a complete d***a** because I tortured it about 2.15 weeks now with dry and absolutely boring stuff about business informatics, so... well, sorry man! I owe you a german beer, a Heineken or 4 cl Lagavulin for my ignorance, your choice :-)

Seriously, I am interested in this. One thing, though - do you answer the following question: "Is my MP traffic absolutely like plain text and do I have to apply my own cryptographic algorithms and prototocols like DHKE, signatures, certificates and symmetric algorithms if I want to protect my traffic??"

Cheers,
-Chris
Posted By: fastlane69

Re: Would you be interested in a book about 3DGS MP? - 07/16/10 19:13

Hey, no worries mate.. but I sure will take you up on that beer when our paths cross... no doubt!!!! Mmmmmmm.....love that german beer... guess it's in my genes since I have strong german ties.... IN ANY CASE... laugh


To answer your question, your topic is about encryption and to some extent compression. While I mention the GS commands for this in my first book, as it is IMO an advanced topic I will defer this topic to future books.

Consider that while gamers need security, any other number of MP project don't. Hence it's important for me to cover all the things the EVERY MP project will have -- login, sending data, etc -- and then move onto more advanced topics. In principle, that would be a topic for the second book along with registration, security, and other advanced net programming issues.

And the answer is "yes data is in plain text (or binary at worst) unless you turn on encryption in which case". I'd actually never thought about this but a simple packet sniffer would be able to answer unequivocally... or JCL on the boards.
Posted By: fastlane69

Re: Would you be interested in a book about 3DGS MP? - 07/16/10 19:29

I hear what you're saying Germanunkol. And I know that game developers as a rule are not "instruction readers" and thus 100 pp. may seem like a lot.

But is it really?

Consider that you will be spending at least 2 or 3 months starting on an MP project That's 60-90 days. This means that if you read 1-2 pp a day you will finish the book and have a working network code and have working network knowledge. Or you can use my book as a reference, only reading those parts of the GS engine that trouble you.


Here's that preview for you. EVERY event (solid box) that GS has to offer is listed here along with the Event Handlers (box with two "prongs"). This is also an example of my use of UML to explain the GS engine.


Posted By: Germanunkol

Re: Would you be interested in a book about 3DGS MP? - 07/17/10 10:12

Neat. And those diagrams will also make understanding it a lot simpler than plain text would.
Will you be giving a link to the book-store to conitec? I think if you had it on their "link" site many people would check it out.

On a side note, I find one of the hardest aspects of multiplayer projects the proper disconnection proces... it's weird, but I find that difficult: clearing a player's data on all connected pcs so that a new client could join... sorry. This just came to mind when I read the last posts.
Posted By: fastlane69

Re: Would you be interested in a book about 3DGS MP? - 07/17/10 22:42

Quote:
I find one of the hardest aspects of multiplayer projects the proper disconnection proces


You mean something like this?


Posted By: Germanunkol

Re: Would you be interested in a book about 3DGS MP? - 07/18/10 15:34

Well I certainly didn't mean to write process with one s. But yeah, that's pretty much what I meant, I think. But I mean handling everything that needs to be handled in the event_disconcect. Not the structure of the multiplayer engine is my problem, but tying in all the right values that need to be set/reset if a client leaves. Anyways, since I'm working with ANet, all of this is a little different for me anyways.
© 2024 lite-C Forums