scidave's Recent Forum Activity

  • Minecraft is extremely addictive.. and I have you all to thank for sucking me into it! Spent about 20+ hrs building tunnels and making a little fort, and armor, etc. However, after burrowing to the bottom of the world and back up the game all of a sudden has lost appeal to me.

    I'm hoping that some more new stuff/objectives gets added or maybe mutiplayer to bring some of the excitement back.

  • Someone should look in to the actual stats first!

    I think the number of users will be more like %90+, but I still don't think officially supporting JNI is a good idea. I believe most manufacturers HP, Dell, etc ship JVMs with their custom loads which most users will have. If you do a fresh install the JVM will not be installed.

    http://news.cnet.com/HP,-Dell-to-ship-J ... 15723.html

    http://www.highbeam.com/doc/1G1-108111914.html

  • Yeah, I saw this just three weeks ago. Good movie! Crazy ending too...

  • I use Windows 7 x64. Everything works fine.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think most end users will have the JVM (if you use older Java features), so I wouldn't let that hold you back trying to do this. Also, C++ meshes with JNI much better than C.

    But I agree with Ashley that this probably would not be good to support officially, but as a school project it sounds interesting to attempt. Doesn't sound easy at all though.

  • Would moving up and down be okay

    Yes, just up and down. Nothing else needed.

    If you could have any power-up you wanted, what would it do?

    First would be temporary shields. Second place would be a either a triple shot, or a large radius explosion bomb.

  • n the subject of object picking, isn't it best if the server dishes out a unique ID to each player that is permanent while they are online, then when you send a movement packet to the server, it affixes your ID to the packet, then sends it to all clients near you (in my game, it would be all clients in your sector). When they recieve the packet, they use events to pick the correct Player instance (Player.Value('ID') = IDinPacket]) or something? (we could pass the contents of the packet to construct using a function with parameters. Or can we do all this in python now without having to pass anything to construct's events?)

    On object picking...I've been getting hung up on using Sprite[instance] access which with the new version of Construct perhaps this is not the best way to go. You will notice in the tuts that that method is used ALL over the place to move objects. It is nice because it has good performance.. I'm not sure what the performance would be to pick an object based on ID (of course you could improve it by only picking objects in your sector/screen which should be sufficient).

    So you could probably do something like this:

    1. New player connects

    2. Server issues unique ID to the client with command to spawn a new "myplayer" instance. You are planning to use instances of the same player sprite, correct? When the new sprite is spawned, the 'ID' of the sprite is set in Python using:

    System.Create('Sprite',1,0,0)
    objRef=SOL.Sprite  #this gets the reference of the new Sprite.
    objRef.Value('ID') = uniqueID [/code:1927f3g8]
    
    3. This same info is sent to all other players in the same sector so they too can spawn the new instance.
    4. Each tick, player movement, etc is sent to the server along with the uniqueID.
    5. The server forwards the movement info to all clients in same sector
    6. Each client then picks by value as you mentioned to update the correct myplayer instance.  This can all be done in Python now.
    
    So instead of:
    [code:1927f3g8]# function to manage player movement
       def Network_move(self, data):      
          myplayer[data['player']-1].SetPosition(data['playerx'],data['playery'])    
          [/code:1927f3g8]
    
    You would have:
    [code:1927f3g8] def Network_move(self, data):
         if myplayer.Value('ID') == data['uniqueID']:
              myplayer.SetPosition(data['playerx'],data['playery'])
    
    [/code:1927f3g8]
    
    I haven't tested the above out, but believe it will work.  You would of course need to limit your search through myplayerto only those objects in sector for performance reasons.
    
    See this thread, which you probably have already read.
    
    So with this new approach you lose the coolness of being able to act on your sprite instances directly, you get around all the problems of accessing instances by index when a sprite is destroyed.. which screws up the numbering system.
  • Nice example Lucid, clean and simple.

    In regards to the error.. If you are trying to run it as an exe then follow this guide:

    -------------------------------------

    As far as getting PyGame to work with Construct just use this:

    http://www.box.net/shared/kcoxzzt7bz

    This has the dependencies for Pygame. You will need to unzip the contents of the Library.zip file into your Construct/Data/Python directory. You will need to check all of the .pyc files per the quickguide, but you can skip PodSixnet and other unrelated .pyc files. The other dependencies (modules.zip) have to be redistributed with your game. Now you don't need ALL of those, but it will be up to you to decide which ones you need based on which parts of Pygame you use!

    ---------------------------------------------------------

    Also, make sure you are using .99.93. (from your screenshot looks like 94) so you should be good.

  • Nice game! Very smooth graphics, explosions, and sound effects.

    Some suggestions for improvements (but I suck at games sometimes so take it for what it is worth):

    1. I found it too hard. On average, I'm only able to last 1-2 min.

    2. It was too monotonous even though it was very short play. I just hold down the W & E keys and swing back and forth trying to shoot down green ships. There is little chance for strategy and all the explosions are mind numbing (can't see where enemies are) after awhile.

    3. A game without strategy isn't bad, it is just that I think some variety is needed and a chance to use more skill in shooting. As of right now, it is pretty much try to get in front of the green ships without getting hit by bullets from the larger ships.

    4. I wish I could move forward and backwards, because the enemy will always kill you once it reaches the end of the screen. Or instead give a temporary bomb/force-field capability.

    5. Needs additional types of enemies.

    6. Add some powerups to give player more capability.

    Still really nice work for a beta.

  • Congrats! That is fantastic to hear such good news. Nothing better than to work on things you love to do!

  • But that seems to cause an infinite loop because the message continually sends. I know I could just make pressing the Enter key a separate event, but I was just curious about this OR operator. Sorry if that has nothing to do with this. I appreciate the help.

    Try adding a "Trigger Once While True" system condition to that OR condition to see if that solves the problem. Cheers!

  • Good questions! btw... I really hope you finish your space game, because that is my #1 favorite genre. and online is even cooler!!

    1) It seems you use lists to give each player a unique ID (based on their location in the list). In a MMO style situation, you'd want to make sure that everyone has a unique ID that stays the same for the whole time they are online. Lists would work fine, however, when user 2 disconnects, we want the next user who logs in to take his place, this way we don't end up with a huge list (because the list re-uses empty entries). I assume this is the best way to do it? How do you do this in python, or is there a more appropriate way?

    A couple of clarifications... I don't use lists to give each player a unique ID. On the server side, I assign each player a playernum based on their location in the WeakKeyDictionary.

    player.Send({'action': 'number', 'num': len(self.players)})
          player.playernum = len(self.players)[/code:13ofx2w7]
    
    When a player (client) connects to the server the following code is called:
    [code:13ofx2w7] def Connected(self, player, addr):
          self.players[player] = True [/code:13ofx2w7]
    
    This adds a reference to the player to the Dictionary.  This reference is what is used to send data to the player:
    
    [code:13ofx2w7]def SendToOthers(self, data, player):
          for p in self.players:
             if p != player:
                p.Send(data)[/code:13ofx2w7]
    
    Notice that in the above function, a check is made if the current player connecting is "yourself" and only sends to everybody else.  Also note that the player number is not part of any of the sending of data from client to server or vice-versa. The player number is primarily used on the client side to determine which myplayer instance to control.
    
    Also, each time a player disconnects their entry is indeed removed from the list/Dictionary, so the dictionary can never grow out of proportion:
    [code:13ofx2w7]def DelPlayer(self, player):
          statusText.AppendText("Player dead/disconneted" + str(player.addr) + "\n")
          if System.globalvar("listenServer") == 0:
             myplayer[player.playernum - 1].SetPosition(deadp.X,deadp.Y) 
             del self.players[player]
             self.SendToOthers({'action': 'dead', 'player': player.playernum},player)[/code:13ofx2w7]
    
    If you wanted 
    

    also, wouldn't each client need a unique "ID" so you can send messages directly to certain clients from the server?

    You already can send messages to certain clients using the "player" weak reference. It is important to note that an instance of a client connecting to the server is a channel. The channel and player are one and the same. There is no private channel that multiple players exist on. For example, lets say in your game you want "Bob" to chat only with "Jill" instead of flooding the message to all players. When "Bob" sends his chat message to the server, he could tag it with an option that inlcudes "Jills's" name. Then the server would have a function called "Send to Player", which would take the name as input, figure out which player had a class variable name called Jill (for p in players... if p.name == "Jill", p.send...) and only send to that specific player.

    2) I couldn't quite work out how channels work. Can we send messages to all players on a channel? And can channel names be strings? Surely its important to ensure that we can send messages to certain groups of clients, but not everyone connected?

    Remember that a channel is a player connected to the server. I get what you are asking for though...you want groups of players. You can do this by creating additional dictionaries and adding the "Player" references to those dictionaries. Then when you want, let's say friendly factions/groups to communicate with each other, instead of sending to the "players" dictionary/list you instead send to "Faction1", etc... You could add an additional capability to each client to be able to create a new faction or group or whatever and you could even add some authentication word/string as well. So clients might have to connect with the name of the faction and the code word.

    Keep in mind that PodSixNet is client-server architecture... all data must travel through the server. There are no peer to peer channels between different clients. You can however, create "logical" channels, but lets call them groups so it doesn't confuse the issue.

    Now that Python support really rocks, I plan on updating the Tuts (sometime in the next couple months.. don't want to make any guarantees and may add in a few extra features to the chat example to describe this.

    There are some areas for abuse to look out for:

    1. Right now, when a player connects they are a new "myplayer" instance on the client side. They send their player number to the server to update their position. However, there is no check on the server to make sure that the player they are updating is indeed themselves. A simple check to see if their self.playernum (which is only settable by the server) is equal to the "player" the incoming player want to control should solve this.

    2. When a player is dead or disconnects they are removed from the dictionary on the server and packets no longer go to that player. However, their character still exists. This could cause a DOS if somebody repeatedly connected/disconnected creating a plethora of players. I can't remember why I didn't delete the player... I believe it threw off the numbering system. For example, lets say that you were player #3 and player #2 got killed. If you deleted the #2 instance of myplayer, I believe the #3 instance now becomes #2. Well, that is a problem because now player #3 doesn't have anybody to control because his instance is now #2. A couple of options: don't use playernumber tied to instances...this solves the problem of controlling the wrong or non-existant instance.. but then how do you control the instance? You need some type of mapping to an instance (for sake of code simplicity, unless I'm missing a better way). The second option is to update everybodies ID's when somebody dies, well actually this would have to happen in all cases since instance numbers change. When somebody disconnects or dies, you could send out an update to all of the players changing their global playernum (and thus which instance they control) and also send out a delete player "X". Some synchronization would need to be done to make sure this happened smoothly. I didn't want to overly complicate the Tut so I went with the simple/naive solution of copying the dead/disconnected instance off the playing board (which is not practical due to the DOS possibility in your MMO case).

    Any ideas from Construct gurus (that bothered to read this far on better ideas to control a sprite instance?

    Well that is enough of a brain dump for now. Please let me know if you have any questions!

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