Xojo Network Card Games

  1. 3 weeks ago

    Are there any online/LAN card games written in Xojo that I can browse the source to help me understand how to set it up? Or at least a Xojo written 2-player multiplayer app/game that I check out the source to learn how to do it?

    The TCG game I am writing, I have some of the basic elements for only one player (no AI programmed) to play but I need help learning how to handle connecting to instances of an app to one another so that 2 humans can play against each other. LAN is fine for now. I do plan on setting up a way to play someone online but I was told to at least get the LAN part finished before I tackle something harder.

    I don't need anything fancy, just how to send over each player's actions. A game of Hearts, Go Fish, something simple like that.

  2. Markus W

    Aug 31 #JeSuisHuman Europe (Germany)...

    Did you have a look st the examples included with Xojo?

  3. Markus W

    Aug 31 #JeSuisHuman Europe (Germany)...

    There's also a webinar about making a simple chat app which might be helpful:

    http://developer.xojo.com/videos

  4. I've seen that already. I just don't understand how to send variable information from one app to the other. My game has hundreds of variables at any given time duel the main game and I have no idea how to send those over.

  5. scott b

    Sep 1 Pre-Release Testers, Xojo Pro local coffee shop

    There several ways to approach it. One way is to convert them to a string/text and send them back in forth. In my opinion is to put them into a JSON object then use .toString to .toText (old vs new framework) and send it over the “wire” to the other host(s). Then in this example, you take the string/text and convert it back to JSON then you can read the values. Depending on how many variables change on what frequency, you might send a “full set” of data every # times, and only the variables that have changed in the interactions in between. That would cut down on the amount of data/traffic you are sending between hosts. Now if majority of the variables are changing constantly then it maybe not worth the extra work to figure out what has changed to send over the wire, and just send everything.

    If you ask 100 Xojo programmers on how best to do this, you will get 112 different answers. There is no “perfect” way. You have to make some determinations yourself.

    Good Luck!
    sb

  6. Dave S

    Sep 1 San Diego, California USA

    The BEST thing is to try not to send "hundreds" of values... but let each client calculate them based on a minimum set of parameters. When your player makes a "move" they are not doing "hundreds" of things... just one or two.... serialize THAT information and send IT to the other player.... ie... "Hey I moved Card A from X1,Y1 to X2,Y2", and both clients can calculate the results the same way

  7. @scott b There several ways to approach it. One way is to convert them to a string/text and send them back in forth. In my opinion is to put them into a JSON object then use .toString to .toText (old vs new framework) and send it over the “wire” to the other host(s). Then in this example, you take the string/text and convert it back to JSON then you can read the values. Depending on how many variables change on what frequency, you might send a “full set” of data every # times, and only the variables that have changed in the interactions in between. That would cut down on the amount of data/traffic you are sending between hosts. Now if majority of the variables are changing constantly then it maybe not worth the extra work to figure out what has changed to send over the wire, and just send everything.

    If you ask 100 Xojo programmers on how best to do this, you will get 112 different answers. There is no “perfect” way. You have to make some determinations yourself.

    Good Luck!
    sb

    I was afraid I would get answer like that. I'm just trying to figure out a good way of sending variable info between apps

  8. 2 weeks ago

    I am really confused on how to convert a JSON text into the variables and values that the app can understand. The JSON example isn't helping me understand that part.

  9. Markus W

    Sep 2 #JeSuisHuman Europe (Germany)...

    @Charles F I was afraid I would get answer like that. I'm just trying to figure out a good way of sending variable info between apps

    Why? Programming - like writing in any language - is an Art form, not a Science.
    Some will only manage prose, others are like Shakespeare or Whitman.
    There is no right or wrong way, just more or less elegant working solutions.

    That you do not understand the example probably means you assume something which is not correct. Difficult to say what that is unless you tell more about how YOU think is should or shouldn't work.

  10. I've partially figured out some of how to parse a JSON string but I still can't parse when it contains an array.

    MsgBox Persons.Lookup("Kids", "oops")

    results in an error.

  11. Also can I keep a connection between Windows if the Windows that initiated the connection close?

  12. Dave S

    Sep 3 San Diego, California USA

    If the connection object is closed or goes out of scope the connection is terminated automatically

  13. @Dave S If the connection object is closed or goes out of scope the connection is terminated automatically

    Then how do I start a connection in one Window and keep it for other Windows to use?

  14. Dave S

    Sep 3 San Diego, California USA

    put it in a method in a module and make it public..
    Windows should ONLY include code that is specific to the scope of the window.

    Perhaps some research into OOP, scope and events might be in order before you attempt a project this ambitious

  15. Edited 2 weeks ago by Charles F

    What is OOP? I'm not a fan of acronyms.

    It appears that I did have an AutoDiscovery module that I must have added a while ago.

  16. Dave S

    Sep 3 San Diego, California USA

    @Charles F What is OOP? I'm not a fan of acronyms.

    If you are going to work or play in this industry, you best become acustomed to TLA (three letter acronyms)
    OOP is OBJECT ORIENTED PROGRAMMING

    of course 30 seconds of that research I mentioned would have told you this :D

  17. Stupid Auto Incorrect changed it to oops. I'm only doing this as a hobby and nothing more. I am familiar with Object Oriented Programming. I avoid using acronyms because I don't like when people use them in texting or forums and I have no clue what they are so I don't want other people to have to go through that.

    I've been working on this project on and off for the past 15 years or so. I started it with RealBasic 2005 or so.

  18. Dave S

    Sep 3 San Diego, California USA

    @Charles F because I don't like when people use them in texting or forums and I have no clue what they are so I don't want other people to have to go through that.

    Deal with it is all I can say..... the use of TLA is a shortcut that here to stay....

    Hmmm.... 15 years and you started with RB2005..... somehow the math doesn't work out.....

    But since it seems that you are unable/willing to focus your efforts in a manner that increases you knowledge except at the intervention of others.... I bid you good luck.

    FYI (in reality, what you are attempting is really not that difficult at all.... and any "chat" example would contain everything you would need to know)

  19. I am not unwilling to learn, I just have a hard time when I don't understand stuff and I find this stuff very hard to understand. When I mentioned RealBasic 2005 it was the first version I started with before that I was using Visual Basic 6 when I wrote a very small app that displayed a Yu-Gi-Oh! Card list from the very first American released set. Just search for Yu-Gi-Oh! Card Library v2 on Google and you should find it.

    When Microsoft moved to .Net, I simply couldn't understand anything so I searched for another option especially when I was switching to a Mac. I tried to learn C but couldn't understand the simple "Hello World" example that every book starts with. After going back to it a few dozen times over the last 20 or so years I still can't understand it.

    The Simple Chat example doesn't help me understand how to start a connection that can stay for multiple Windows. You may think it's easy to do but I don't since I just can't understand it as no one seems willing to completely explain it to me in a way that I understand. When you have people that don't seem to want to help you learn, it can very difficult to learn something especially when they are teaching it in a way that you don't understand. It seems that almost every time I ask for help in trying to understand something I get responses that absolutely don't help and make me want to give up. Try learning a language like Japanese and then try to tell this stuff is easy. The Language Reference only does so much and it doesn't help me at all in trying to learn how to do what you say is simple.

  20. Tim P

    Sep 4 Pre-Release Testers, Xojo Pro
    Edited 2 weeks ago by Tim P

    @Charles F I tried to learn C but couldn't understand the simple "Hello World" example that every book starts with. After going back to it a few dozen times over the last 20 or so years I still can't understand it.

    This, I think, is your problem. You want to tackle massive tasks like networking an online card game, but still don't grasp the basics. The reason we point you to basic examples and the documentation is because if you don't grasp that, you can't grasp the more advanced topics.

  21. Newer ›

or Sign Up to reply!