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

123457»

Comments

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989

    @hopscotch ... Definitely agree... but always stings a bit when you start cutting into things you've realised need to go :s

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989

    Break down how the new setup should run.

    • Open game on device

    • Scene 1
      • If new user (no saved game id in game attribute)

    • Send table to server to request a unique user id

    • (showing animation on device, "generating unique account"
    • Retrieve table from server
    • Save user id to an attribute and save attribute permanently.
    • Display on screen "account created"
    • Go to scene 2. the main game scene

    • If already got a unique_username

    • Send a table to server, just so it knows you're back.
    • Go straight to scene 2. the main game scene.

    • Scene 2
      Simpler animated menu screen

    • Play

    • Options/Profile
    • Leaderboard
    • (Space to expand if necessary in the future ... ie. in app purchases)

    Press Play
    - Sends call to server, requesting a game. Searches for an open game, or generates a new one and awaits an opponent.
    - Game keeps requesting a table back from Server, until it receives one with game info, with opponent, plus procedurally generated game info (so both players play the exact same game setup) and the server time.
    - Players games load up and they can play through the game level.
    - The game will send and receive gameplay updates as the game goes, so the player could be notified little tip bits about how their opponent is doing.
    - One Player completes the game level, table with info sent to server.
    - Info received by server,
    - Winner worked out, and confirmation sent back to winner, and notification back to loser.
    - If its very close and both players sent winning info at the same time, it will be deemed a drawer. (I could go down to the 10th of second but that seems picky, and anyway a drawer seems like a fun rare event).
    - Along with notification the server will also send any new points, awards, acheivements etc.
    - The players will have 5 seconds to read the notification. Mean while another game will be readied in the background.
    - A player could press 'Pause Game' during the 5 second window to stop them being thrown into another game right now if they want to maintain their winning streak and continue later. They'll only be able to do it after finishing a game, not during.

    That's it so far..

    Could allow for games with more that 2 players I guess without much extra effort. Whether that would be good or bad I'm not sure...

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694

    @StormyStudio said:
    Break down how the new setup should run.

    • Open game on device

    • Scene 1
      • If new user (no saved game id in game attribute)

    • Send table to server to request a unique user id

    • (showing animation on device, "generating unique account"
    • Retrieve table from server
    • Save user id to an attribute and save attribute permanently.
    • Display on screen "account created"
    • Go to scene 2. the main game scene

    • If already got a unique_username

    • Send a table to server, just so it knows you're back.
    • Go straight to scene 2. the main game scene.

    • Scene 2
      Simpler animated menu screen

    • Play

    • Options/Profile
    • Leaderboard
    • (Space to expand if necessary in the future ... ie. in app purchases)

    Press Play
    - Sends call to server, requesting a game. Searches for an open game, or generates a new one and awaits an opponent.
    - Game keeps requesting a table back from Server, until it receives one with game info, with opponent, plus procedurally generated game info (so both players play the exact same game setup) and the server time.
    - Players games load up and they can play through the game level.
    - The game will send and receive gameplay updates as the game goes, so the player could be notified little tip bits about how their opponent is doing.
    - One Player completes the game level, table with info sent to server.
    - Info received by server,
    - Winner worked out, and confirmation sent back to winner, and notification back to loser.
    - If its very close and both players sent winning info at the same time, it will be deemed a drawer. (I could go down to the 10th of second but that seems picky, and anyway a drawer seems like a fun rare event).
    - Along with notification the server will also send any new points, awards, acheivements etc.
    - The players will have 5 seconds to read the notification. Mean while another game will be readied in the background.
    - A player could press 'Pause Game' during the 5 second window to stop them being thrown into another game right now if they want to maintain their winning streak and continue later. They'll only be able to do it after finishing a game, not during.

    That's it so far..

    Could allow for games with more that 2 players I guess without much extra effort. Whether that would be good or bad I'm not sure...

    that is pretty sweet dude

  • jonmulcahyjonmulcahy Member, Sous Chef, PRO Posts: 10,406

    @StormyStudio‌ looks awesome
    I've also had some development fatigue. There are so many ideas I want to do, but I have about 1% of the time I need to do them, so things get pushed aside and when I finally have time to work on them, I forgot what I had originally done, so I spend 1/2 the time relearning my logic :)

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

    After a 5 month break.. I'm re-opening the dusty crate with this project inside.

    First some general house work needs doing:

    1. Change my isometric grid view to a simple top down view because it simply fits better on a phone/tablets screen.

    2. Finally get rid of the spawned grid, instead setting it up with 1 image and some extra individual tiles for highlighting etc... it was always the intention but never got round to it and spawning 256 squares has always eaten into the initial loading time. Just need to re-think the logic and apply a bit of math.

    3. Add the ability to scale the grid in and out, with a double tap or pinching action.

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

    That's great work on mine too :smile: smile:

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

    Happy to see this thread dusted off! Bookmarked for further updates!

  • deepanshi guptadeepanshi gupta Member Posts: 63

    @StormyStudio Sir , I am a student I am new to gamesalad . I develop games for my own interest but sir I am too much confused how to get data of players playing in all over the world and how my data automatically saved to them ? Can you have a sample project regarding this ? It will be a great help to me . Thankyou Sir.

  • jonmulcahyjonmulcahy Member, Sous Chef, PRO Posts: 10,406
    edited March 2015

    @deepanshi gupta said:
    StormyStudio Sir , I am a student I am new to gamesalad . I develop games for my own interest but sir I am too much confused how to get data of players playing in all over the world and how my data automatically saved to them ? Can you have a sample project regarding this ? It will be a great help to me . Thankyou Sir.

    I have a sample project in the first few posts of my thread for both the server snd game salad. This is an advanced topic though, unless you are comfortable doing some programming it might be something to hold off for awhile until you get more experience.

  • deepanshi guptadeepanshi gupta Member Posts: 63

    @jonmulcahy Sir, I already go through with your project that was in your send and receive data tutorial but i am unable to send data through my app to the server and i want to know can we run multiplayer without playstogther account . If not then how it is helpful in achieving multiplayer functionality?

  • jonmulcahyjonmulcahy Member, Sous Chef, PRO Posts: 10,406
    edited March 2015

    @deepanshi gupta said:
    jonmulcahy Sir, I already go through with your project that was in your send and receive data tutorial but i am unable to send data through my app to the server and i want to know can we run multiplayer without playstogther account . If not then how it is helpful in achieving multiplayer functionality?

    yes you can, but you need to design the system yourself, which is not a small task. If you are having trouble sending/receiving data I would say either your server is not setup properly, or your mysql databases are not setup properly. if you use my original code, i had some sections that outputted any errors to a log, you'll have to look at that to see why it's not working.

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694

    @deepanshi gupta said:
    jonmulcahy Sir, I already go through with your project that was in your send and receive data tutorial but i am unable to send data through my app to the server and i want to know can we run multiplayer without playstogther account . If not then how it is helpful in achieving multiplayer functionality?

    Yah it is definitely possible to set a server with Jons code. You do have to some research into this.

  • deepanshi guptadeepanshi gupta Member Posts: 63

    @jonmulcahy Thankyou sir , the thing is that I am new to gamesalad and the sample project is only sending and retrieving data how can we implement multiplayer functionality on that means how we connect it to another player?

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694

    @deepanshi gupta said:
    jonmulcahy Thankyou sir , the thing is that I am new to gamesalad and the sample project is only sending and retrieving data how can we implement multiplayer functionality on that means how we connect it to another player?

    I have a leaderboard demo which shows you that devices can be connect together using Jons demo and a some tweaking.
    http://forums.gamesalad.com/discussion/76504/cross-platform-leaderboarddemo#latest

  • loyaltyappsloyaltyapps Member Posts: 29

    @scottharrrules43 I'm trying to get this working for an HTML5 project. Does anybody know if it should work? It works fine in the GS Preview and Android app but nothing happens with my HTML5 version

Sign In or Register to comment.