Creating your own asynchronous server... •--•

12346

Comments

  • HopscotchHopscotch Member, PRO Posts: 2,782

    @StormyStudio‌ ... technical accomplishments aside, I can just watch your interface actions all day. Really nice.

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited May 2014

    @Hopscotch . :smiley: thanks. Its all a bit smoother in real life. The screen capture makes it a little jumpy. I'll be sure to continue adding more swipe bouncy things as I go.

  • clee2005clee2005 http://Donkeysoft.caMember, PRO Posts: 194
    edited May 2014

    @StormyStudio‌ it looks really great! That user interface is more than I would have thought to do, and it really shines. Good work.

  • Braydon_SFXBraydon_SFX Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,271

    I think that's a little too good. Simply amazing!

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989

    Thanks for the very positive feedback.

    The amount of effort and time that can be eaten up by a menu and connectivity is quite amazing. Hoping to find another wave of time some evenings this week.

  • MarsStudiosMarsStudios Member, PRO Posts: 40

    @StormyStudio said:
    Thanks for the very positive feedback.

    The amount of effort and time that can be eaten up by a menu and connectivity is quite amazing. Hoping to find another wave of time some evenings this week.

    It is amazing;

    I have been working on mine for a few weeks, still I'm nowhere near what you have created. I end up staring at the screen with lines of PHP in all pretty colours.

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited May 2014

    KEEP CALM AND STAY LOGGED ON

    Thinking about the cleanest way for the game to behave after a password has been entered (via email link)... it seems do nothing is the answer.

    Again I looked into how 'Song Pop' has integrated its registration system.

    Once you setup a password (via the webpage link sent in an email) it doesn't ask you to enter the password on the device you first registered with, you just keep on playing.

    You only need enter the password if you'd logged out of the account on the device, or were logging into your account on another device.

    So to replicate a similar approach, I need my game to know that it's ok to remain logged in without the user entering their password, even when a password exists for the account on the server (if it was already logged in prior to the setting up of the password).

    So I think this should be fairly simple to do and pretty much functions like this already.

    If you log in or register successfully, a game attribute 'game.logged_in' is changed to 1. As long as that attribute remains at '1' game updates and everything is allowed to function. If you log out it's set to '0'. At which point you can only login with a password.

    It seems 'Keep calm and carry on' is the best approach.

    It gets a little trickier if they still haven't setup a password and find themselves wanting to login. Though I think the 'forgot password' button will suffice for now (I need to check it will send a verification email link rather than a 'change password' link if they've never verified their email).

    *Also noticed on Song Pop.. When you log out, they have buttons that display previously logged in users, so you can press one, enter a password and your back in. Again minimizing the amount of typing required.

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694

    Cool!!!!

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989

    Quick update on this:

    After a little detour working out my own little Pathfinding method for my players characters. I'm now back into a world of asynchronous gaming.

    I also lost a bit of time changing it to landscape rather than portrait.

    I have the basic rules in place so you can click on a game (that already exists on the server) and it's info is loaded and the camera pans over to where the game play takes place. (no changing scene required).

    At the moment the only info being handled properly is how many steps you have available. It needs tidying up a little but it works and gives me the basis for passing other game info, i.e. the location of player 1 and 2 etc.

    As my game works more like a roll of the dice game, rather than a scrabble type game (where you might keep trying ideas first). I need to force a players move to be final.

    So I need to build a way in to stop a player from cheating the system. At the moment a player could load up their game whilst on wifi (3G etc), turn off wifi, play their move whilst out of signal and see how it goes. Quit, reload, play it again, and repeat until they've made a move they're happy with. Which would let them explore more of the game board without passing their turn back to the other player.

    Hopefully I can sort this by having the player have to press a tick to confirm each move they want to make. At which point I'll save the info to a local table. If they fully close the game and open it again, when it loads up the players current games from the server it can check the time stamp of the last played move for a particular game. If its the same as the one currently stored locally (from the last time it was connected) it won't update that games info and so will not reset the number of steps available.

    My head hurts.. but I think it should work.

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited June 2014

    Oooh...

    ... it's alive... it's ALIVE!! .. just about... and its very very ugly...

    1. I've got it set up so you can create a game.
      (it searches on the server for a game that is awaiting a 2nd player, and one where the 1st player has already completed their turn). If none can be found it creates a new game, and the player can make their first moves.

    2. Once a player has used their allocated number of steps, its the end of their go, they can't make any more moves, the server is updated, ready for another player.

    3. When another player creates a game, and they join one that has been started, they become player 2.

    4. Their name is added to the game, it's loaded up, along with the current position of their opponent.

    5. They can play their go straight away, as player 1 has already finished their go.

    6. As they complete each successful move, the server is updated, once they've used all their steps the server is updated and the play moved over to the other player.

    7. When the 1st player opens up the game, they can see where they left their player on the grid, and see the position of player 2.

    8. And it works for as many games as you like, swapping in and out between them.

    9. Also if you leave mid turn (before you've used all your steps up) it saves this as well, and will load it from the server, so you can't cheat by closing and opening the game or changing device.

    .. All really cool, but as I say.. it's ugly... with a wide scattering of bugs to fix, and 'display text' boxes to turn off.

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694
    edited June 2014

    Cool. Man I need to get back to work my muliplayer.

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989

    @scottharrrules43 said:
    Cool. Man I need to get back to work my muliplayer.

    Its pretty crazy getting back into it. I stepped away from it for a few weeks and had to remind myself a lot of what's doing what. Definitely pays to label everything and put notes where necessary.

  • Braydon_SFXBraydon_SFX Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,271

    Amazing what you've accomplished, Stormy. I really want to see a demo. Maybe that'll persuade me to get going on server multiplayer rather than waiting on PlayTogether. ;)

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694
    edited June 2014

    Plus how did u make the upload scripts? I got the script to receive but how do you send?

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited June 2014

    @scottharrrules43‌

    My 'upload script' is all based on the php script @jonmulcahy‌ originally shared with the forum.

    I've changed it a bit to suit my own understanding and needs, also changed mysql to PDO but the sending from Gamesalad,connecting to server, reading the received JSON file are all based on his script.

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694

    Cool thank you

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited June 2014

    @scottharrrules43‌
    Here you go, I've slimmed down a bit of my code and change some of the names and tidied up some of the comments.

    This gives a basic run down of how my script looks for receiving data from Gamesalad.

    Bare in mind this is setup for receiving a single row table. If you wanted it to have more rows you'd increment the '$i' value by 1 and keep looping round adding it to an array.

    I highly recommend checking out Komodo Edit 8, for doing your scripting. Cool dark interface, does a decent job of pointing you towards errors (ish) and it's FREE.

    Example PHP script attached.

    *I haven't actually run this since I changed a few names but it should all be correct.

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited June 2014

    @Braydon_SFX‌ ... I'll get a little demo video out once she is looking a bit prettier... (can a game project be a she? ... I know a boat can... hmm... )

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited June 2014

    @Braydon_SFX here's a slightly haphazard demo video of it in action... bugs n all.

    The video shows how two players can create games and join games when ready.

    Play their move, and receive the updated game info.

    There are a few bugs yet to be fixed, i.e. players walking one step too far and games need to be forced to update by dragging down on the current games menu.

    So far the server is just sharing the two players positions, number of steps allowed and whose turn it is.

    All artwork is definitely placeholder art for now. Ideally I'll have little 3d animated people/robots/monsters/birds/zombies/flowers/bats/rockets etc.

    Sorry audio is a bit cack this time, lots of button tapping too: There's an old mac pro in my room that's struggling with the heat...

  • Braydon_SFXBraydon_SFX Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,271

    @StormyStudio‌ -

    That's crazy awesome!

  • unbeatenpixelunbeatenpixel Game Developer Member, PRO Posts: 568

    @Braydon_SFX said:
    StormyStudio‌ -

    That's crazy awesome!

    +100

    Check out my games on the App Store!

    Wordgraphy / Polycolor / 20 Seconds / Minimal Maze

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694

    @StormyStudio said:
    scottharrrules43‌
    Here you go, I've slimmed down a bit of my code and change some of the names and tidied up some of the comments.

    This gives a basic run down of how my script looks for receiving data from Gamesalad.

    Bare in mind this is setup for receiving a single row table. If you wanted it to have more rows you'd increment the '$i' value by 1 and keep looping round adding it to an array.

    I highly recommend checking out Komodo Edit 8, for doing your scripting. Cool dark interface, does a decent job of pointing you towards errors (ish) and it's FREE.

    Example PHP script attached.

    *I haven't actually run this since I changed a few names but it should all be correct.

    Where did the attachment go i just got home to my computer? :'(

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited June 2014

    @scottharrules43
    Here it is again... hopefully it won't vanish this time.

    ...Edit: just refreshed, it disappeared.... refreshed again it came back, and so did the earlier one... grrrrr

  • colandercolander Member Posts: 1,610

    @ForumNinja ^ can GS fix this problem it has been going on for sometime now and is a pain in the butt. Also have to keep re-logging in all the time when trying to post.

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited June 2014

    @colander ... Sorry for being a problem and a pain in the butt... I'll clear my desk and go.

    .. Oh wait now I see B)

  • ForumNinjaForumNinja Key Master, Head Chef, Member, PRO Posts: 554
    edited June 2014

    I sent a message to Vanilla last time you guys mentioned having the issue and quoted the thread you guys were talking about it in and here's what I got:

    "If I understand the issue, this has been resolved in a later version. The problem related to a cache of file uploads for the editor. When the next push to our live assets is completed, the problem should disappear.

    Have a good day,"

    So not too much I personally can do about it. I hope it's fixed soon for you guys though!

    -FN

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited June 2014

    Another brief update:

    • Fixed all current known bugs. So I can go straight into the game once it is created and play the first move without having to manually refresh. The hero character always (touch wood) walks the correct number of steps. etc. No more rogue squares remaining highlighted.

    • I've also temporarily added the current 'working title' game name into the project. Plus a couple of animated png sequences of some characters that I made back in September last year. (All ready for an upcoming pitch to try and get a small indie game grant... interview/pitch next week. exciting nerve racking stuff.)

    • The current game buttons now highlight and tell you if it's your turn to make a move. Or are slightly dimmed and provide appropriate text if your waiting for your opponent to play.

    • Also re-arranged some bits in the scene, ready to add a side menu that can be slid in.. It will hold the games options, users profile/account settings section, etc etc. The boring stuff.

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited July 2014

    A longer rambling update.

    So... I've been on a mental digital walk about (i.e. tinkering with other tools, doing hours of tuts for other SDKs, learning a bit more PHP, some C#) and nearly made my way back to GS. ( I was never leaving completely, just broadening my horizons.)

    I've been doing lots of thinking on my long running, slow growing multiplayer game.

    I kinda slowed down and eventually stopped developing it. There was a quick bit of renewed energy working on the pitch process a few weeks ago. (no news on that yet). But ultimately making any game is very hard and making a multplayer game is very bloody hard. But I kinda got past all of that, everything was (is) coming together I just ran out of steam.

    Four main things are of concern at the moment for the project

    1. Loading times (dreaded Loading times still seem to be an issue and I've barely got any art in, I do have a lot of rules).
    2. Push notifications (without it my current game design just wouldn't ever seem complete or professional)
    3. Facebook, (again my current game design would benefit from being able to login, play friends, search friends, invite friends.. it's on the way but when and with what limitations?).
    4. The ability to know if someone is or is not able to connect to the web. (currently I can have a timer and if it doesn't receive a reply I know, but that might seem buggy if someone is connected but my server is down, ideally I'd be able to tell the difference in game and tell the player)..

    So... push and Fb are on the roadmap and due "soon". But we won't know in what incarnation with what limitations or additional 3rd party fees till it arrives. Since I'm rolling my own server I'd really like to be able to handle my own facebook connection and push notifications.

    Loading times, may improve 'slightly' over time as the game gets tidied up a bit by me (i.e. I won't always be spawning the game grid) and GS improve the engine.

    So what to do:

    _The gameplay idea has to evolve

    I don't think I want to wait for extras from GameSalad any more, I've not finished a game for so long that I might very well not finish this if I don't start crossing the t's and dotting the i's soon.

    So it's time to simplify... a lot... and combat the dreaded feature creep.

    So I'm planning on ditching my whole clever little swipeable, deletable, updateable 'current games' menu.

    A player when opening the game will have an online account automatically generated for them. With their own unique gamer id. They'll be allowed to add a email address and password to it, if they so wish.

    • All games will be against an unknown random opponent. (no friend finding)
    • Both players will start the game at the same time, (no turn based gameplay, no need for push notifications, no limited number of steps).
    • As soon as one player finishes the other player is notified and their go ends.
    • One player will win one will lose.
    • 5 second completion screen, showing any rewards, bonus's, level ups,
    • Straight into the next game and a new opponent.
    • Repeat.

    No Character creation, minimal account profile, no in-app purchases (at least not at launch), no need for push notifications.

    Just simple short game play against real players from around the world.

    No facebook, no in-app purchases, no push notifications.

    I could build in some server side code so that the random opponents are at a similar skill level in the game.

    The number of straight wins could work as a multiplier.

    Time to complete the level could be another bonus etc etc..

    Then I guess adverts..

    ....

    It's a shame I can't yet make the full game I want to, but it's that classic case of thinking too big and complex for the time or motivation I've got. Which I always knew but hoped I'd make it. I've learned a tonne doing all of this and thanks to @jonmulcahy‌ I've been introduced to PHP, local servers, MySQL, PDO and as a result have now made in roads into other languages too, which open up other game doors and ideas.

    So expect some new posts here soon, as I slim this thing down and try and finish something... maybe I'll give my self a ridiculously short deadline as I generally work better that way.

  • HopscotchHopscotch Member, PRO Posts: 2,782

    @StormyStudio‌, I actually think your new automatic account creation and instant gameplay is a positive development. Knuckle down! :)

Sign In or Register to comment.