+ Reply to Thread
Results 1 to 6 of 6

Thread: ES5 server side coding, ES5 creating game logic

  1. #1
    Member
    Join Date
    Mar 2012
    Posts
    33
    Thanks
    1
    Thanked 0 Times in 0 Posts

    ES5 server side coding, ES5 creating game logic

    Hi

    I am in charge of learning ES5 and see how it fits to our game logic requirement. ( Particularly how and what API of
    Java Back-end satisfy my back-end game logic and at same time how and what API )

    I am already referring ES5 developer docs; however at same time i thought of posting question here to see input from relevant experience people. ( Thanks in advance)

    I am expecting comment/suggestion from development perspective; that which APIs i should consider for below game logic
    and if there is any example related to this; it will also give great help to me.

    Let me give brief idea of my game logic.

    It is not traditional GUI based game. rather it has little different logic.

    Back-end :
    Admin will create game.
    -Each game will have multiple events.
    -Each events will have price associated with it.
    -Events will be acting on time manner ( will expire after certain amount of time; admin will define that time)
    -Back-end will have simultaneous hit from multiple users for each game/event

    Front End ( Mobile)
    -We plan to enable first phase with Apple mobile platform.
    -User will see multiple LIVE games (Created by Admin)
    -User will select particular game and then user will be presented with multiple events of that game.
    - User select particular event and he can decide to stay in favor of that event or may decide to stay in oppose of
    that event. ( staying in favor or in oppose will have impact on user's virtual points; either he will loose or earn)

    Could anybody please help in above topic.

    Thanks

  2. #2
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,213
    Thanks
    80
    Thanked 1,086 Times in 1,075 Posts
    If I understand what you are describing above correctly, ES5 can work quite well for you. See Game Manager and most of our various game examples, particularly LobbySystem.

    We do not yet have an example of a lobby that shows multiple gameTypes, however that is very easy to do. You just display buttons or other UI elements for the various gameTypes even if nobody is playing them right now, and when a user clicks a button the client sends a QuickJoinGameRequest for that particular gameType, which would join the user to an existing game of that type if one is available, or create a new game game if there aren't any yet.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  3. #3
    Member
    Join Date
    Mar 2012
    Posts
    33
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for your reply,
    yes i have gone through API description and examples related to game. from that i have clue that Game Manager can hold details of
    game. However i have still doubt that which exact API will serve purpose of storing events ?
    ( events you can treat as details of game , to be on more simple side to explain logic-, for example cricket is game and then now it can hold events like how many overs it had, which player
    scored most, at which score my favorite batsman get out? etc.. Here each events will have weight associated with it. so that i can put all such events for forecast by user and user give it rating. )
    I hope you will have better clarification of my game after reading above simple approach of describing it.

    So if you can point me to few exact API to which i should carefully look at; it will be great help. At the same time i did configure in
    my local the lobby system.

    Thanks

  4. #4
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,213
    Thanks
    80
    Thanked 1,086 Times in 1,075 Posts
    A game's gameDetails object is an EsObject that usually contains the configuration of the game. Plugins can change this but you don't want to include information that changes rapidly. You have to create a fresh EsObject and then call getApi().setGameDetails, because if you modify the gameDetails directly you are likely to get a concurrent modification exception. Any information in gameDetails for a specific game will be lost when the game finishes and the room is destroyed, unless it is replicated elsewhere.

    What you are describing would be information more properly kept in a data structure in a Managed Object I think. All the game plugins would have access to it, and could call methods on it to update the data or retrieve the data. All other plugins on the server would also have access to it, so you could have a lobby plugin that a user could send a request to in order to get whatever information he needs to decide which game to play.

    Any information that needs to be available even if the ES5 restarts would have to be persisted to a database. RoomIds, zoneIds, and gameIds - no. High scores, yes.

    Let me know if you want more information on using gameDetails, or on ManagedObjects, or even on databases.

    edit: Look at the game example IronMongery for an example of a simple game that uses gameDetails and has a high score list that users can see. TopScoresFactory in the extension provides the ManagedObject.
    Last edited by tcarr; 03-21-2012 at 01:19 PM.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  5. #5
    Member
    Join Date
    Mar 2012
    Posts
    33
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Yes Thanks for the help. It helped me a lot to start on track.
    However it will be again great help .. if you can provide a little more details about managed object and it's database connections along with passing same info to mobile client.. which API i will need to use etc.

    Mainly i am more interested in managing large number of users and it's information into database; Also i will have one logic which will run every time a user submit data to server. So what is your suggestion on that logic to place. how and where i should place it.

    Thks

  6. #6
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,213
    Thanks
    80
    Thanked 1,086 Times in 1,075 Posts
    I suggest that you use the TwoStepLogin code example as a start. You can put your logic either into a second server level plugin or into DatabasePlugin.

    For the client api, use whichever one works with the type of mobile devices you need, and you can have separate iOS and Android clients both connecting to the same ES5 server. I know that you can use the AIR api and publish to iOS or Android, and I assume that you could do the same with Unity api.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts