Tutorial: Online Multiplayer with PodSixNet

This forum is currently in read-only mode.
  • Thanks everyone! I really hope this will get more people to try Python and Construct.

    If you can't do that then multiplayer games are impractical for anything more than a 2-4 person game.

    so we still can't do a 8-16 players games?

    only small games like chess, monopoly, pong, etc?

  • so we still can't do a 8-16 players games?

    You are confusing two separate things here. You can make a thousand player game if you have the bandwidth and computing power. There is no inherent set limit on the number of players in PodSixNet. The example game in the tutorial is a 2-10 player and could easily be a 20 player just by changing 1 line of code. There may be some limit with Construct itself, but I have yet to run into one.

    I was referring to if someone made a network plugin they would need to add sprite indexing. It is unrelated to Python.

    only small games like chess, monopoly, pong, etc?

    You can make them as big as performance/bandwidth allows.

  • hmm ok thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm pretty new to Construct, though I've done a lot of coding. Very little in Python though.

    I did get these tutorials working, but I have a question.

    In order to get them working, I had to export the server program to an EXE before I could run a client on the same computer. Construct says that I already have a preview running, and I need to close it first if I try to run both otherwise.

    Is there a way around this, or is this the intended usage of the server program?

    Thanks

  • I had to export the server program to an EXE before I could run a client on the same computer. ..... Is there a way around this, or is this the intended usage of the server program?

    I ran into the same issue. I did the same thing, either ran the server in Construct and exported the client to EXE or ran the client in Construct and exported the server to EXE. I couldn't do both through the Construct IDE. So it is expected behavior and I didn't investigate further to see why.

  • So did the bugs/limitations you mention in the read me get address?

    Python not having access to behaviors, etc? And the crash bug with direct access to strings?

  • I've been using PodSixNet for multiplayer since 0.99.90. Accessing private variables works, though the string problem still exists, and python's inability to access behavior variables is still a problem. I have found workarounds to deal with it though. If I need access to a behavior variable, I've just been adding it as a PV for the object, and setting the PV to the value of the behavior variable I want.

    My only big complaint is that when you have a condition with python script AFTER a set of actions, the python script will run first, before the actions. This means that when an object is created, and you try to send information about it to all other players, you can't actually access the variables associated with that object until the next tick. I have yet to find a workaround for that problem that isn't a bandaid style fix. That has nothing to do with PodSixNet though.

    EDIT:

    Oh, I thought I'd add one more thing here. Earlier I had posted about having to run the server as an EXE. Turns out, I was able to combine the server and client into one file. When you enter the game, you have the option to be the server, or join as a client. This works well, and has allowed me to create one version of the game, rather than struggling with separate server and client programs. When I'm ready to test, I just copy the game to each computer on the network using autohotkey. Pretty neat.

    Also, Lucid's PY plugin turned out to be a very handy tool for dealing with picking, and multiple instances of objects within python. Sorry, I don't have a link for it atm.

  • When you enter the game, you have the option to be the server, or join as a client.

    Very cool Zaaephod! Nice to see this capability being used and tested. Maybe we can fix some of the Python quirks you are finding.

    Also, Lucid's PY plugin turned out to be a very handy tool for dealing with picking, and multiple instances of objects within python.

    Great plugin. Here is a link to list of plugins that include the python fix plugin

    Looking forward to seeing some network games soon!

  • just a question.. why do we have to replace the data in construct directory with those python files..

    also, i seem to be having errors egarding strioIO.pyc when running execs..

  • why do we have to replace the data in construct directory with those python files..

    I said to replace them all for simplicity....but it is not necessary. All you really need to do is put all of the new files in the Construct directory. So if you do a copy and paste you could select "don't overwrite existing files". Now the reason you have to paste the new files is that the libraries required for Podsixnet do not exist in the regular Python distribution that ships with Construct.

    also, i seem to be having errors egarding strioIO.pyc when running execs..

    Do you have errors when you run the execs I built for the example games (pong and dungeon escape)? If you do not have errors for those, then it means you are not checking all of the include boxes when it comes time to build the executable in Construct.

  • also, i seem to be having errors egarding strioIO.pyc when running execs..

    Same here. I tried also ticking all the modules instead of the pre-ticked ones. Still gives me that error, but doesn't give me the error when i run it from construct.. :S

    I'm running 0.99.92 - Could this be the problem?

  • tried also ticking all the modules instead of the pre-ticked ones.

    This shouldn't be necessary. My previous answer might have been confusing about checking all the boxes (I meant only checking the boxes for modules that have errors). If you have checked "stringio" and it is still giving the error then I think a bug has been re-introduced.

    I'm running 0.99.92 - Could this be the problem?

    Maybe, a bug might have been re-introduced in newer versions.

    To help troubleshoot could you please run the exectuble pong, chat, or dungeon escape games I posted to the forum? I need to see if those binaries cause you errors.

  • where are these executables? Theres only .cap files in the link you posted initially.

    I tried compiling dungeon escape client. Same error. If i put StringIO.pyc into the same folder, it no longer shows the StringIO error. However, it just says no module named random or a similar module related error.

    It seems construct isnt exporting the modules properly? Have i configured something wrong?

  • where are these executables?

    Dungeon Escape

    Network Pong

    Network Chat

    It seems construct isnt exporting the modules properly? Have i configured something wrong?

    No, I don't think so...but I don't have my dev system setup right now to confirm. Try out the above executables. I think they will work fine. Python was broken in versions prior to 99.8 and this was the exact problem so I think somehow the bug is back. Need to post bug report to say Python is broken....anyone else having problems with Python???

  • Hmm i get the same error with your .exes (i've tried dungeon client and the server so far). I get this error when running it in a folder with python26.dll, _socket.pyd, select.pyd, and StringIO.pyc in:

    "Traceback (most recent call last):

    File "<string>", line 1, in <module>

    ImportError: No module named random"

    If i run it straight from the zip i get an error about no module PodSixNet.Channel

    :S i confuseeee

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