Stencyl and Servers and MULTIPLAYER

gamegirlxl

  • Posts: 713
I have been thinking about Stencyl and Servers and MULTIPLAYER.  I have a bit of experience with the idea of a server.  The internet is only composed of computer to computer connections, except a server connects with more than one computer, transferring and interpreting data.  I've actually gone through the process of setting up a Minecraft Server, which was a lot more involved than it sounds.  A Minecraft Server does not need to have Minecraft downloaded to work; there is a server thing it uses.  It is up to the client to interpret data sent by the server.  I don't see why you couldn't use Stencyl as the language for your server's program.  That server "game" would be different from the client's game, of course.

The client would send updates about their player, including its velocity, position, and other statuses (when applicable), which you can infer from Stencylpedia.  I think, unless I'm messing with public vs private IP's, that the server can respond to the "site", which just happens to be some client's computer.

It seems so easy to me that I think I'm missing something...But I usually have a pretty good handle on things, even if I'm using the wrong tools...



I also have another idea, which would plausibly work.  Some programs use a text file, usually located inside their file, to save data.  It's like a person is editing them.  But people can use Google Drive to all edit the same file all at the same time.  So, with some adjustments to HOW the file is edited, which would assign each computer a certain line in the file, data can be easily shared.  Of course this creates issues by itself, because of file security and some other stuff.  The thing with this path is that there's very little if any server stuff needed.  Maybe.  I guess you could also have a "server" game that goes to edit the data, which would need to be online for things to work.



But I would like to see what everyone thinks about these ideas, because while I have more sever experience than most people on this site (and I'm really asking the few people with more experience than me), it's not enough for me to be confident executing any of this (I also don't use the proper terminology, either...I might be describing something that already exists or something impossible).

Photon

  • Posts: 2697
I think perhaps the biggest problem you are going to run into is dealing with lag. You WILL have lag... period. Even if its only fractions of fractions of seconds, it takes time to go from one place to another. So I have a feeling one of the biggest issues would be to compensate for that.
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

Alexin

  • *
  • Posts: 3130
Learn about distributed systems.
"Find the fun"
alexin@stencyl.com

SadiQ

  • Posts: 1788
I don't see why you couldn't use Stencyl as the language for your server's program.  That server "game" would be different from the client's game, of course.

I don't think you can make an app in flash that LISTENS for an connection attempt like servers do.

Bottom line is : For multiplayer you'll need a socket server app. There are options like PlayerIO and SmartFox Server that are more or less easy to set up, have a lot of features, and offer some sort of free plan for people to try on. If you really want to make your own server have a look at node.js (and be prepared to really start from scratch).
On Stencyl's part...I think you need to create a socket connection to the server to communicate with it and receive back data.
 Then you need to figure out IF/HOW you can trigger a function, or change an attribute based on the data you get back from the server. And this is just the tip of the iceberg (you're lucky if you can create a multiplayer tic-tac-toe game with only this).
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

gamegirlxl

  • Posts: 713
   Photon-Yes, there would probably be lag.  Especially if I try to host it on my internet connection (not fiber optic, and loaded with computers using the network).  I realize that I'd have plenty of issues with real-timing, but that's why turned based games exist.  I doubt that my Google Docs idea would work any other way...

  Alexin- I will.  I honestly have no idea what that is now, though.

  SadiQ-  I don't really know what a socket server app is, except I can imply that it listens for a connection.  Maybe I'll have to white list IP's (which I guess can be done manually), so I can listen to those IP's or whatever.  As for my Google Docs idea, I don't think that it would NEED to listen for a connection.  Google does listen for connections, so it takes care of that stuff.  You just take a look at the document to see if the other person has responded.  I'm not really sure, also why you think it's hard to do stuff.  I just read an attribute from an array, and based on that attribute, stuff happens.  As for updating the files, there will be a structure, like an array.  If I can't figure out how to edit the file by line, I can download all the data, edit and re post.  Assuming I learn how to post in the first place.


    I'm going to look into flash file editing and file sharing, as well.  I'm sure Google might not be very happy if their Drive servers were used by bots.

gamegirlxl

  • Posts: 713
I'll first say that I have done some research.  I determined from said research that it would work really well if someone could get me some server and tell me what language to do stuff with and where.  I can probably deal with the coding if I knew what to use, because I can code my own outside of Stencyl.  I've done c++ programming and OpenGL!

Anyways, I've had a sort of epiphany as a result of my experiences in c++, specifically the mini program I wrote that edits .txt documents.  I realize now that I can have my own extension, which will probably be .ggxl, because I feel vain now.  Since you treat file names as strings, you can code something to remove your arbitrary file extension, and read it as any file extension you tell it to...meaning .txt, because I only have done stuff with txts before.  It would add a bit of file security, although not much, except I'm not sure how you'd go about marketing a file extension except by having it be very popular.  There might be a trend where everyone wants their own file extension.



Can I want my very own file extension for Christmas?  They're free, right, and you don't need to get a patent or something...?  I don't even know...  Merry Christmas Eve...

snake13

  • Posts: 126
I'll first say that I have done some research.  I determined from said research that it would work really well if someone could get me some server and tell me what language to do stuff with and where.  I can probably deal with the coding if I knew what to use, because I can code my own outside of Stencyl.  I've done c++ programming and OpenGL!

Anyways, I've had a sort of epiphany as a result of my experiences in c++, specifically the mini program I wrote that edits .txt documents.  I realize now that I can have my own extension, which will probably be .ggxl, because I feel vain now.  Since you treat file names as strings, you can code something to remove your arbitrary file extension, and read it as any file extension you tell it to...meaning .txt, because I only have done stuff with txts before.  It would add a bit of file security, although not much, except I'm not sure how you'd go about marketing a file extension except by having it be very popular.  There might be a trend where everyone wants their own file extension.



Can I want my very own file extension for Christmas?  They're free, right, and you don't need to get a patent or something...?  I don't even know...  Merry Christmas Eve...
You can code in C++! I am planning to make a game with 3D graphics. I learned coding is the only way. I don't know coding. But if you can code and make games with 3D graphics, please visit http://community.stencyl.com/index.php/topic,27557.msg158893.html#msg158893
Ludum Dare Game: Connected Worlds
URL:http://www.stencyl.com/game/play/27958

snake13

  • Posts: 126
I know you need to have a socket server to make multiplayer online games.
Ludum Dare Game: Connected Worlds
URL:http://www.stencyl.com/game/play/27958

mdotedot

  • Posts: 1569
Hello gamegirlx,

You can use Stencyl to make an application that listens to in-bound traffic, but you have to use code-blocks for that. Sockets are usually the way to go. (watch out for firewalls and port-forwarding especially when you are using ports that aren't standard ports like 80 and 443)
You can also use the haXe programming (used in Stencyl 3.0) to create a stand-alone application that does the logic.

If you are able to put the logic into a Stencyl application and need only data from the internet you can have other ways of doing that.
You mentioned Google Docs -> google Data API gives you the ability to tap into that.

In the past I've written a turn-based application that worked with a LAMP server (Linux, Apache, MySQL and PHP) but will not do this anymore since the band-width-costs are too expensive and home-based connection is'n't stable.

This time I'm going for the Parse.com route. At the moment I'm writing a Stencyl 3.0 extension to have the ability of interfacing with it. I'm using the REST API to access the data.
The real problem is with the way Flash does not allow headers to connect to a REST type of API.
I'm working around that using ExternalInterface.calls to javascript and am confident I will nail this in the future (not on all browsers, but close)

In the first place I want to make an extension that can interface with Parse.com and not really a multiplayer-API so the extension will not directly solve real multi-player capabilities.
Apart from the mentioned lag you need some logic in working with the multi-player aspect of things:


1. Lobby-kind of connection system where players select a room/area. Differs from the type of game, but if you have a chess-application there can't be more than 2 players in a session.
2. Turn-based logic that uses some kind of time-based action
3. If more than 2 players what happens when one players leaves / quits / has internet problems, does the turn go to the next player?
4. Keep track of the 'active player' in turn-based game. And when active player leaves? See 3.
5. Use a sort of heart-beat connection so that each player knows about the status of the others
6. Without a server application you have to watch out for cheating players
7. Fine-tune the time that the application wants the data from the server and keep data + frequency of connection low.

* forget about real-time-network connections like mmorpg <- this is really advanced stuff! *

The most difficult part with multi-player is not the technical side of things like a server (sockets) visit URL statements but rather the game-logic! What to do with bad/slow connections, players cheating, avoiding band-width costs and that kind of things.
If you have tackled the logic in Stencyl then it will be rather easy to connect to either an on-line database such as Google and Parse.

Hope this helps.

Best regards from
M.E.
Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

thegenericbanana

  • *
  • Posts: 494
I'll first say that I have done some research.  I determined from said research that it would work really well if someone could get me some server and tell me what language to do stuff with and where.  I can probably deal with the coding if I knew what to use, because I can code my own outside of Stencyl.  I've done c++ programming and OpenGL!

Anyways, I've had a sort of epiphany as a result of my experiences in c++, specifically the mini program I wrote that edits .txt documents.  I realize now that I can have my own extension, which will probably be .ggxl, because I feel vain now.  Since you treat file names as strings, you can code something to remove your arbitrary file extension, and read it as any file extension you tell it to...meaning .txt, because I only have done stuff with txts before.  It would add a bit of file security, although not much, except I'm not sure how you'd go about marketing a file extension except by having it be very popular.  There might be a trend where everyone wants their own file extension.



Can I want my very own file extension for Christmas?  They're free, right, and you don't need to get a patent or something...?  I don't even know...  Merry Christmas Eve...
You can code in C++! I am planning to make a game with 3D graphics. I learned coding is the only way. I don't know coding. But if you can code and make games with 3D graphics, please visit http://community.stencyl.com/index.php/topic,27557.msg158893.html#msg158893
Learn coding. You will never be able to make a 3D multiplayer game with Stencyl, Unity is probably your best bet for 3D. It's never easy to make a multiplayer game, and it will take years to learn how to make a 3D multiplayer game with any programming language, and with Stencyl, you can't (or well, nobody has done it yet, and it's just a better idea to do it with a tool that supports multiplayer). My advice is to either decide to make a simpler game with Stencyl (2D game with no multiplayer) or learn Unity- never expect to be able to do something so complex without programming knowledge and never expect somebody else to help you so much with something so complex that you don't have to learn it.
Johnny Turbo's Surgery Frenzy

snake13

  • Posts: 126
I'll first say that I have done some research.  I determined from said research that it would work really well if someone could get me some server and tell me what language to do stuff with and where.  I can probably deal with the coding if I knew what to use, because I can code my own outside of Stencyl.  I've done c++ programming and OpenGL!

Anyways, I've had a sort of epiphany as a result of my experiences in c++, specifically the mini program I wrote that edits .txt documents.  I realize now that I can have my own extension, which will probably be .ggxl, because I feel vain now.  Since you treat file names as strings, you can code something to remove your arbitrary file extension, and read it as any file extension you tell it to...meaning .txt, because I only have done stuff with txts before.  It would add a bit of file security, although not much, except I'm not sure how you'd go about marketing a file extension except by having it be very popular.  There might be a trend where everyone wants their own file extension.



Can I want my very own file extension for Christmas?  They're free, right, and you don't need to get a patent or something...?  I don't even know...  Merry Christmas Eve...
You can code in C++! I am planning to make a game with 3D graphics. I learned coding is the only way. I don't know coding. But if you can code and make games with 3D graphics, please visit http://community.stencyl.com/index.php/topic,27557.msg158893.html#msg158893
Learn coding. You will never be able to make a 3D multiplayer game with Stencyl, Unity is probably your best bet for 3D. It's never easy to make a multiplayer game, and it will take years to learn how to make a 3D multiplayer game with any programming language, and with Stencyl, you can't (or well, nobody has done it yet, and it's just a better idea to do it with a tool that supports multiplayer). My advice is to either decide to make a simpler game with Stencyl (2D game with no multiplayer) or learn Unity- never expect to be able to do something so complex without programming knowledge and never expect somebody else to help you so much with something so complex that you don't have to learn it.
I have saw YouTube videos about "3D coding" and they showed the code. FOR FREE! So maybe someone might volunteer. MAYBE.
Ludum Dare Game: Connected Worlds
URL:http://www.stencyl.com/game/play/27958

thegenericbanana

  • *
  • Posts: 494
I'll first say that I have done some research.  I determined from said research that it would work really well if someone could get me some server and tell me what language to do stuff with and where.  I can probably deal with the coding if I knew what to use, because I can code my own outside of Stencyl.  I've done c++ programming and OpenGL!

Anyways, I've had a sort of epiphany as a result of my experiences in c++, specifically the mini program I wrote that edits .txt documents.  I realize now that I can have my own extension, which will probably be .ggxl, because I feel vain now.  Since you treat file names as strings, you can code something to remove your arbitrary file extension, and read it as any file extension you tell it to...meaning .txt, because I only have done stuff with txts before.  It would add a bit of file security, although not much, except I'm not sure how you'd go about marketing a file extension except by having it be very popular.  There might be a trend where everyone wants their own file extension.



Can I want my very own file extension for Christmas?  They're free, right, and you don't need to get a patent or something...?  I don't even know...  Merry Christmas Eve...
You can code in C++! I am planning to make a game with 3D graphics. I learned coding is the only way. I don't know coding. But if you can code and make games with 3D graphics, please visit http://community.stencyl.com/index.php/topic,27557.msg158893.html#msg158893
Learn coding. You will never be able to make a 3D multiplayer game with Stencyl, Unity is probably your best bet for 3D. It's never easy to make a multiplayer game, and it will take years to learn how to make a 3D multiplayer game with any programming language, and with Stencyl, you can't (or well, nobody has done it yet, and it's just a better idea to do it with a tool that supports multiplayer). My advice is to either decide to make a simpler game with Stencyl (2D game with no multiplayer) or learn Unity- never expect to be able to do something so complex without programming knowledge and never expect somebody else to help you so much with something so complex that you don't have to learn it.
I have saw YouTube videos about "3D coding" and they showed the code. FOR FREE! So maybe someone might volunteer. MAYBE.
Nobody will help you make a 3D game because nobody on Stencyl can make a 3D game, and nobody will help you make a multiplayer game on Stencyl because nobody on Stencyl can make a multiplayer game, get real, and stop being annoying.
Johnny Turbo's Surgery Frenzy

snake13

  • Posts: 126
I'll first say that I have done some research.  I determined from said research that it would work really well if someone could get me some server and tell me what language to do stuff with and where.  I can probably deal with the coding if I knew what to use, because I can code my own outside of Stencyl.  I've done c++ programming and OpenGL!

Anyways, I've had a sort of epiphany as a result of my experiences in c++, specifically the mini program I wrote that edits .txt documents.  I realize now that I can have my own extension, which will probably be .ggxl, because I feel vain now.  Since you treat file names as strings, you can code something to remove your arbitrary file extension, and read it as any file extension you tell it to...meaning .txt, because I only have done stuff with txts before.  It would add a bit of file security, although not much, except I'm not sure how you'd go about marketing a file extension except by having it be very popular.  There might be a trend where everyone wants their own file extension.



Can I want my very own file extension for Christmas?  They're free, right, and you don't need to get a patent or something...?  I don't even know...  Merry Christmas Eve...
You can code in C++! I am planning to make a game with 3D graphics. I learned coding is the only way. I don't know coding. But if you can code and make games with 3D graphics, please visit http://community.stencyl.com/index.php/topic,27557.msg158893.html#msg158893
Learn coding. You will never be able to make a 3D multiplayer game with Stencyl, Unity is probably your best bet for 3D. It's never easy to make a multiplayer game, and it will take years to learn how to make a 3D multiplayer game with any programming language, and with Stencyl, you can't (or well, nobody has done it yet, and it's just a better idea to do it with a tool that supports multiplayer). My advice is to either decide to make a simpler game with Stencyl (2D game with no multiplayer) or learn Unity- never expect to be able to do something so complex without programming knowledge and never expect somebody else to help you so much with something so complex that you don't have to learn it.
I have saw YouTube videos about "3D coding" and they showed the code. FOR FREE! So maybe someone might volunteer. MAYBE.
Nobody will help you make a 3D game because nobody on Stencyl can make a 3D game, and nobody will help you make a multiplayer game on Stencyl because nobody on Stencyl can make a multiplayer game, get real, and your awesome!
Umm..  there was an old multiplayer kit that doesn't work anymore. So some people might know how to make a multiplayer game. It just takes LOADS of time and most games on Stencyl Arcade are created only in 48 hours(and thats SHORT!) Also thanks for the last part of the comment.
Ludum Dare Game: Connected Worlds
URL:http://www.stencyl.com/game/play/27958

Photon

  • Posts: 2697
Umm..  there was an old multiplayer kit that doesn't work anymore. So some people might know how to make a multiplayer game. It just takes LOADS of time and most games on Stencyl Arcade are created only in 48 hours(and thats SHORT!) Also thanks for the last part of the comment.
If you're talking about the recent selection of Ludum Dare 28 entries, they represent a small percentage of the games on the arcade, not to mention the special circumstances under which they were made.

Please don't make the mistake of thinking ANY kind of well-polished game just happening overnight is normal.
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

snake13

  • Posts: 126
Umm..  there was an old multiplayer kit that doesn't work anymore. So some people might know how to make a multiplayer game. It just takes LOADS of time and most games on Stencyl Arcade are created only in 48 hours(and thats SHORT!) Also thanks for the last part of the comment.
If you're talking about the recent selection of Ludum Dare 28 entries, they represent a small percentage of the games on the arcade, not to mention the special circumstances under which they were made.

Please don't make the mistake of thinking ANY kind of well-polished game just happening overnight is normal.
Huh, when did I say that?
Ludum Dare Game: Connected Worlds
URL:http://www.stencyl.com/game/play/27958