frpnit's Recent Forum Activity

  • Hey Scidave!

    I'm still messing with UDP socket stuff, yesterday i've done that simple example from mikepan and modifying some stuff, it worked. Seems that setting socket to setblocking(0) pushes socket operation to background thread. I'm trying to see if a external ip connects with properly port forward, i've searching on google about and teorically it works, but i've tested with some friend and nothing. Dunno what is wrong at all, perhaps client port must be forwarded too...

    Anyway, I will try to code something based on both libraries (mastermind and podsix), avoinding code that could hijack the mainloop.

    Wish me luck! (PS.: i've never used python before, but reading documentation and sample code, it's not complicated as well)

  • I think you are talking about this call: server.serve_forever() which leads to netbase.py and the while loop. The problem is this pretty much hijacks the main loop and that doesn't play well with Construct. That is why I like PodSixNet so much because it uses the Pump() feature to check packets but doesn't steal the main event loop. I'll have to look at Mastermind closer to see if there is a workaround.

    I think it's not the while statement what's hijacking main loop, but the actions from inside of it. I think it's not polling data in asynchronous event like Pump() in podsix, as it uses asyncore lib from python and mastermind doesn't.

    From that point of view, podsix is much more efficient than mastemind. Damn!!

    • FRP -
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the great info frpnit! I didn't know Eve online used Python (UDP library).. that's pretty cool. I also noticed that this is your first post, so welcome to the forum! Construct is an awesome tool and this community is very helpful.

    Thank you, scidave! I've been observing Construct sometime ago, but my real interest came now i've seen it's possible to accomplish networking on games, even if has to be on small, simpler games.

    [quote:3ax109qh]

    That Mastermind library looks exactly like what is needed for higher speed over internet games. I don't know how good the performance will be, but it should be better. We will still have to do some interpolation/prediction to handle long lag times which unfortunately right now we have to manually do.

    I was reading superficially both Podsix and Mastermind code. Seems that what i told about podsix should work, just changing socket type on .py files. But both libraries does pretty much the same, connects two endpoints, and send encoded data to save traffic.

    About interpolation/prediction. Hmm, well, maybe even on Raknet library, this should be done by the programmer, since prediction may vary from each game style. A race game must use prediction in different way that FPS should. Dunno, just wondering here.

    [quote:3ax109qh]

    I did some more testing using a Network latency simulator and the Dungeon game actually performs pretty well up to around 150ms lag. That's not bad!! I think the slowness that MacieJ was talking about was how I made the game. The new version I uploaded seems about as laggy, but is more responsive so people may like that better. I've removed the old version and made a few server improvements and uploaded a newer version.

    Great! It becomes more and more interesting, keep the good work. I'm trying here do some silly stuff to test Mastermind library, used cxfreeze as on your tutorial, and library successfully exported, i own you thanks. Now i'm stucked, opened that Construct python script editor and seems the code is executing in infinite loop. When i initialize udp server, there is some function with while statement in there, and it freezes everything. Well, i'll try do something more today.

    • FRP -
  • Hey Dave.

    I'm new to construct and well, netplay is indeed interesting.

    Can't test yet your game online but on LAN, anyway, i've found someone experiments on Python and Blender Engine and appears it used UDP library. Dunno if it would help you or even help to change this netlibrary to a UDP aproach, below link for the experiment and basic UDP source code idea:

    http://blog.mikepan.com/very-simple-2player-networking-in-python/

    And a post where it all started, i think:

    http://blenderartists.org/forum/archive/index.php/t-100682.html

    Hope it helps in some way...

    EDIT 2: I've found something like Podsixnet (i guess), but with UDP protocol support as well. Maybe you should see that one too:

    http://www.pygame.org/project-Mastermind+Networking+Lib-859-.html

    Edit: Seems that you can transform your TCP socket to UDP socket just changing type on plugin lines like this one:

    self.create_socket(socket.AF_INET, socket.SOCK_STREAM) - this is a TCP Socket, changing to:

    self.create_socket(socket.AF_INET, socket.SOCK_DGRAM) - would transform to UDP socket.

    Dunno what it could implies on PodSixNet anyways, but it's a start.

    • FRP -
frpnit's avatar

frpnit

Member since 17 Apr, 2010

None one is following frpnit yet!

Connect with frpnit

Trophy Case

  • 14-Year Club
  • Email Verified

Progress

15/44
How to earn trophies