scidave's Recent Forum Activity

  • That's what I couldn't figure out what to do..it seems to restart me back at the start of the first level. How to start at second level? or is there only 1 level?

  • Very nice game! I played through the entire first level. When I completed the level it sent me back to the main menu. Then when on the main menu I clicked "Continue" option and the game crashed.

    This is probably the "prettiest" Construct game I've played. great music, ambiance. Really felt professional.

  • I'm not sure how you are updating your info, but one thing that might help is to do a "SendtoOthers" call versus a "SendtoAll". If one client has already moved and you just need to send that status to the other client (but don't need extra network traffic) you can do a:

    # this send to all clients but yourself
       def SendToOthers(self, data, player):
          for p in self.players:
             if p != player:
                p.Send(data)
    [/code:2v51d0ib]
    
    You call it like(within a Python class):
    self._server.SendToOthers(data,self)
    
    From a Python script within Construct...I'm not positive how it would be called without some testing (not sure if it is a number or Class instance address).  You can look at the Dungeon Server example from the tut for this.
    
    Not sure though that will solve the problem.  Perhaps it is just too much data to be sent during one tick.  The myserver calls are asynchronous to Construct events....so Construct isn't going to wait for one call to finish before it does the next action.  So Construct  is going to loop through all the Units very rapidly firing off a myserver.SendToAll calls almost all at the same time..which might be creating a bottleneck.  So maybe there is a way to experiment with breaking up not sending as much data each time or adding a slight pause (Wait plugin?..not sure how buggy it is) after each SendToAll in the "For Each Units" loop.  How many units do you have?
    
    As far as a limit:  You shouldn't be trying to send more than 1500 bytes at a time (the Maximum Transmission Unit (MTU) over most networks.  Although, I would suspect PodSixNet would handle that transparently, but I didn't check.
    
    Give the above a thought and let me know how it goes.
  • You need to create the HUD at the origin of the screen: which is in the upper left corner. Make sure you have the right layer selected when you are adding elements.

  • . As for multiple channels, do you mean like ports? or are these channels all recieved by the plugin?

    The channels are handled by the plugin so it is a "virtual channel" over UDP

  • So would this also lead to the possibility of being able to have online play between two computers that are in say, different cities, both connected to the internet?

    Yes and no.

    Yes in that you could have online play right off the bat.

    No, in that there would be lots of lag and hat would negatively affect game experience.

    The actual answer is the plugin only gives you message passing. It would require the user to implement interpolation and some type of lag syncronization as the library doesn't do it for you. At least not now. The plugin Arsonide is working on might be easier with respect to online games.

  • Just a little status update on Network plugin progress:

    I've implemented some basic functionality currently. Game can exist in one cap with the player choosing to be server or client. Reliable and unreliable fast UDP is supported with auto bandwidth utilization support. Communication can occur over channels so each channel wont interfere with network traffic on the other channels.

    I have basic message passing working (see my "game" release for One Buck Challenge). Once I get back from my trip in a couple weeks I'll start working on adding support for player IDs, position updates, and start testing for bugs. Should hopefully get an early Beta out in another two months or so.

  • In typical command line programming the first argument is always that of the program name you are executing..I don't know if that is what you are referring to here. So Arg1 is the program name and Arg 2 should be your first argument.

    Or maybe its a bug...

  • This sounds like an awesome plugin. I can't try out the examples though because after installing WIndows 7 SP1 I had to downgrade to the last 1.1 version for construct to still work (sxstrace error).

    Any ideas on if that bug will be fixed in the next version of Construct? or get examples in 1.1

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Also, is there no way to not even acknowledge incoming connections after I've gotten one player connected?

    Yes, you can just do:

    def Connected(self, player, addr):

    if len(self.players) < 2:

    add the player...and do stuff

    Once the player count reaches 2 the connection will be received but not processed. As far as not even receiving it goes, that would require some changes to the library.

    7. These actions are followed by myserver.Pump() (the one causing the problems I think) >>> and connection.Pump and myclient.Pump(), with the myclient.Pump in a try/except block

    Are you sure that the host acting as the server is not incorrectly acting as client too? I'm assuming you have that code in separate groups, etc (a server group and a client group).

    Have you run wireshark to see what the packets look like right before the disconnect occurs?

    When the server and client switch layouts there will be some desynchronization...the key is to get everybody synchronized again before starting processing events for the next layout.

    You can also do some tests...make sure that the server has switched to Layout 2.. then wait 10 seconds and switch the client, etc... different stuff to be sure the server is ready to process packets in the second layout. Above that, I might have to see a .cap.

  • Hi!

    When one player joins, I want to stop listening for other players.

       # function called on every connection
       def Connected(self, player, addr):
          statusText.AppendText("New Player" + str(player.addr) + "\n")
    [/code:10y9ykaa]
    
    In the above function in the Server code you want a line like this:
    
    if len(self.players) == 2:
       "Send a message to new client that game is full"  and don't add the client to list.
    else
       add player to list and send him his number...
    
    For the connection problem:
    
    You could try this:
    
    For the client:
    
    [code:10y9ykaa]
    try:
       myclient.Pump()
    except:
       pass   
    
    [/code:10y9ykaa]
    
    For the server:
    
    [code:10y9ykaa]
    try:
       myserver.Pump()
    except:
       pass   
    [/code:10y9ykaa]
    
    What may happen is packets are still being sent from client to server or server to client, but there isn't anybody there yet to handle it so you get an exception??  If so, then the above should solve it.  If not, I'd need more details.  
    
    Glad the tutorial is helpful!
  • Nice entries! Looking forward to playing both when I get back...maybe a few more will squeeze in by the deadline. For sure, mine won't win as it isn't really a game yet.

scidave's avatar

scidave

Member since 4 Jul, 2009

Twitter
scidave has 1 followers

Trophy Case

  • 15-Year Club
  • Email Verified

Progress

16/44
How to earn trophies