Network Plugin

This forum is currently in read-only mode.
0 favourites
From the Asset Store
[C3] Banner ads, Interstitial ads, Rewared video ads, Rewarded Interstitial Ads
  • I don't know about the rest of you but I'm fairly certain most, if not all, are on the same page as me when I say that I really want a network/online plugin.

    I've taken computer science classes in high school and in university but only at the introduction level so it's not much to work with but it's something.

    Right now, I'm in pain from having both wisdom teeth removed from my lower jaw but also curious as to what goes into making a networking plugin and what it consists of?

    I'm hoping to get a discussion flowing where anyone can contribute to the actual development of a networking plugin instead of waiting around for one to be developed.

    Hopefully this discussion will also help teach people how to create plugins. (Although a guide probably already exists, I can no longer recall)

    At the same time, I DO recall that someone was working on a networking plugin. If you are still working on it, care to pitch in or let us know how we can help out?

    Let's get some motivation flying!!

  • I've been considering giving this a go lately, although learning Winsock is currently a roadblock as there's not much in the way of decent tutorials for it, nor are there any other decent networking libraries that I can find.

  • I notice there's been a lot of requests for this lately, and frankly I'm not too terribly interested in it, especially since I don't have a server to test things out. So that makes me wonder how many people here already have a server ready to test things on?

  • I notice there's been a lot of requests for this lately, and frankly I'm not too terribly interested in it, especially since I don't have a server to test things out. So that makes me wonder how many people here already have a server ready to test things on?

    Is a server absolutely necessary? What about connecting to another computer instead?

    I'm hoping most of it is simply tedious work; in which case, I wouldn't mind dogging away at it.

  • A player can act as a server so there doesn't need to be a hosted server somewhere else to connect to, but this can cause issues with players behind routers (it's possible to work around though I believe, but I don't know much about networking).

    There definitely are libraries for networking around - you could have a look at SFML for example, which has an OOP layer over TCP and UDP sockets, which should make things a bit simpler. You'll probably still be working with raw bytes and addresses though - might want to find a higher level library.

  • ooo! I actually have a friend who majored in networking, I'll definitely ask him for him for help but for the time being where would I start? It's been years since I've touched Java and C++ (I'm in school for Fitness and Health Promotion now so it's pretty much the opposite end of all this hahaha)

    My understanding so far is that I'd use the SDK and import the networking library, is this correct?

  • So that makes me wonder how many people here already have a server ready to test things on?

    This is not a big deal since any player can host a game. Unless we are talking about large persistent worlds then a player can host any online multiplayer game by doing:

    1. Enable NAT passthrough on their router. This is really easy to setup. You then run the "server" on an internal IP on your home network and the router forwards traffic from a particular port to your system.

    2. Use a free networking tool like Hamachi. https://secure.logmein.com/products/hamachi2/ Now everybody is on a virtual LAN and you host the server on your Hamachi IP address. Added benefit of this is you get lower lantency and more reliable connections.

    I DO recall that someone was working on a networking plugin.

    Dataflashbot mentioned a few weeks ago that he was, but he didn't want anybody to hold him to it so I'm not sure if he will end up making one or not.

    but this can cause issues with players behind routers

    This will only be an issue for all players if the plugin is a peer-to-peer type. Even in that case the best solution is to have everybody use Hamachi or as secondary solution all players would have to enable NAT passthrough. An alternative is to have the online plugin itself use NAT punch-through like what Raknet uses.

    Edit: If someone starts making a plugin definitely DON'T write from scratch using sockets. Like Ashley mentioned there are libraries out there. For example, Sun99 pointed out the Zig library which wraps HawkNL. Take a look at this thread before starting out on making a plugin.

    http://www.gamedevid.org/forum/archive/ ... -3577.html Some of the libraries are old and haven't been updated but it's better than starting from scratch!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • An alternative is to have the online plugin itself use NAT punch-through like what Raknet uses.

    That sounds like the smartest thing to do, so nobody has to set anything up to play. I think that's what I was thinking of but didn't know the name. I think it's actually very important since a lot of gamers are behind routers which do NAT.

    RakNet looks promising, and is free for indy games (revenue under 250k) but some restrictions ("Must display RakNet logo in your game's splash screen or credits", "Downloadable distribution"), and has NAT punchthrough. SDL_net might be a good alternative, but I can't find much information about it.

  • First off I know very little about networking but am using a free very nice game system that you might want to see how it is done since it works so well. http://rptools.net/

    I play a weekly on line game using MAPTool (by RPTools) where one of us has to be the server, and all the others just log in to the name of the server. So that may mean someone has some kind of host set up? I am the server but see all the other people's servers for the game too.

    Anyway the players just use my created server name and log in to my game with an optional password.

    I also have a router and it was very easy to open the port for this program.

    Here is a picture of the Start up Server

    http://lmwcs.com/rptools/wiki/Image:mt-start-server.jpg

  • First off I know very little about networking but am using a free very nice game system that you might want to see how it is done since it works so well. http://rptools.net/

    I play a weekly on line game using MAPTool (by RPTools) where one of us has to be the server, and all the others just log in to the name of the server. So that may mean someone has some kind of host set up? I am the server but see all the other people's servers for the game too.

    Anyway the players just use my created server name and log in to my game with an optional password.

    I also have a router and it was very easy to open the port for this program.

    Here is a picture of the Start up Server

    http://lmwcs.com/rptools/wiki/Image:mt-start-server.jpg

    We get to see the results but unfortunately, not how it was implemented. Thanks for sharing though!

    With regards to conditions and actions, the most basic form of data to transfer would be text (at least that's what comes to mind) I'm not sure about receiving though, would the game have to constantly check for incoming data? Let's get a list of conditions and actions going!

  • Basically port forwarding on either given IP ranges, or open completely will bypass any port blocks. Firewall may need to be adjusted as well...

    Also route table may need to be adjusted depending on how the trafficking is set up.

    If you go with a VPN for testing purposes (selected audience of testers for example) then you may need to manually set metric intervals in order to get the connection working properly.

    There are numerous ways to make it work.

    ~Sol

  • There definitely are libraries for networking around - you could have a look at SFML for example, which has an OOP layer over TCP and UDP sockets, which should make things a bit simpler. You'll probably still be working with raw bytes and addresses though - might want to find a higher level library.

    I've been messing around with the SFML network library lately and it seems solid. It's definitely easier than straight up Winsock, and its Packet class greatly simplifies data transmission.

    However, it gets really wonky whenever I try using it within a Construct plugin, which leads me to believe that something within the SDK is screwing it up to the point that it's useless.

  • it gets really wonky whenever I try using it within a Construct plugin

    Any details on the wonkyness? Does it try to steal the main loop for processing or is it something more minor that isn't working? I know very little about the SDK so not sure if I'd be much help. I was going to try making a simple screen capture plugin just to learn more about it.

  • Any details on the wonkyness?

    Things like packet corruption and crashing if you do things a certain way. These problems don't happen when the client is a C++ application, so I don't know what's up.

  • Alright, i've gone through with a debugger and it seems that at least some of the problems are due to heap corruption related to std::string. Why this is happening only in cases concerning the SFML library, I have no idea. Maybe somebody could help me out with this if I were to supply the code?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)