I am new in Appwarp and also in multiplayer gaming. Superjumper is a great tutorial and its methodology seems incredible, but I do not know, how to build MultiplayerGameScreen.java from my own single player game.
Can you please give me maybe a step-by-step instruction or guidelines, how to make this file?
MultiplayerGameScreen.java is a game specific class. All the AppWarp related functionalities are implemented in the WarpController.java class which you can find here. MultiplayerGameScreen.java is just calling the required methods from WarpController.java.
To convert the single player game to multiplayer, you can use the following steps:
All the players who needs to play together must join same room
Once game starts, if player needs to send its information to other players, you can use either sendUpdatePeers or sendChat as per the game requirement
Once a player sends update then server sends notification to other players which you can receive in the corresponding callbacks such as onChatReceived in case of sendChat
Once you get the notification, you can update your game UI accordingly
You can always write to us on support#shephertz.com or on our forum in case of any problem.
Related
I have been trying to build video chat application using opentok. When User 1 calls User 2, I want User 2 to be notified that User 1 is calling.
I have made this work using Pusher and Laravel Echo using Laravel Broadcasting service. But I don't know if this is the best way to do it.Also, we need to integrate it to the mobile and I am not sure if Pusher and Echo are going work.
Using another service like Pusher is probably the best option. OpenTok does not currently provide a calling type API, it is instead based on rooms (sessions).
One alternative using just OpenTok would be to have the participants both connect to a session and have the call action be when you call publish(). Then when you receive the streamCreated event on the other side you can treat that like the participant trying to call you. Answering the call is subscribing to the created stream and publishing back the other way.
Depending on your application this might not really work though, eg. if you have lots of different participants all being able to call one another then you will need to connect to lots of different sessions at the same time.
i am currently developing a realtime multiplayer game for android and i got the example ButtonClicker working. I think the "quick game"(or maybe it´s called automatch) option is just what i need. But i need something like this: I would like to make the player play a match with a random player from his level. You see, on my game, every player will have a level and these levels and associated players will maybe be stored on a database. I want the player to have a quick game with only the players from his level. Is it possible to inform that criteria on quick game? What must i do?
I also want him to be able to choose his friends(the invite option) but only friends that are on his level.
In order to restrict automatching between players, you can use the variant option when building a room configuration, ie RoomConfig.Builder#setVariant(int).
In order to restrict invitations, I think you will have to create your own "invite player" activity, which I am less familiar with. You will presumably have to query for the player's friends, and then cross-correlate this list with each of their "levels" and filter it down to those of the same level before showing it in the activity. It looks like The Players API has some methods that you will be able to interact with, and hopefully would contain an Id that you use in your level-based DB.
Rob
When you create your RoomConfig for match making you can provide AutoMatchCriteria. The API just uses a bitmask, so it is up to you what data you put in that bit mask:
createAutoMatchCriteria
exclusiveBitMask: Exclusive bitmasks for the automatching request. The
logical AND of each pairing of automatching requests must equal zero
for auto-match. If there are no exclusivity requirements for the game,
this value should just be set to 0.
In your case this could contain a level range to match up with.
You can see it being used in the sample code here: Developing Real-Time Multiplayer Games.
I was creating an android app (actually a game) with customised Cocos2d and I was planning to add in a chat feature. kind of like a counter-strike where other players can send short IM to each other (I think the clash of clan's clan chat comes closest to what i want to make, you can get an idea from that)
I was trying to use AppWarp API to do this, but am finding it hard to do so. I liked appwarp because it handles server management on its own. I don't wanna get into implementing a XMPP/Smack customised code where scalability becomes an issue later on, because i dont know server management at all! (although i would love the freedom it gives me). Did i mention that its a two man team? Me and a friend :).
In my game in I need one global room (a static room) and an another special-group room (this will be dynamic, since its only created if the user selects to create the room).
But the problem with creating a dynamic group room in Appwarp is that it doesnt stay alive (remain persistent) after all the users in it have disconnected. According to the current implementation in the API, the dynamic group gets deleted if the last member logs out.
Q1) Is there a way for me to create a persistent/static room from client side? Q2) and if that isnt possible is there some way i can make the dynamic rooms persistent? Basically i'm asking anyone who has experience with Appwarp, If it requires some tweaking with the code can you please point me out in the right direction?, or is it not possible at all?
Q3) Also, i wanted to implement a chat history feature on the chat rooms. Is that already available via Appwarp API? or would I have to write a listener, so that each time a room receives a message it maintains a history file? Again this is only possible if the user can re-connect to the room.. Please guide me for this too.
Also,supposing i have to drop Appwarp idea (Gulp!) Q4) Can you please point me in the right direction to create a group-based chat with a similar api that can be integrated with an android app with cocos2D.
Currently creating static rooms through the API is not possible. However providing such flexibility is part of AppWarp's plan.
AppWarp doesn't maintain chat history on the server side currently. This is again something we are looking in to as it has been requested by other developers as well. Keep an eye on our blogs (http://blogs.shephertz.com) where we announce our updates.
We expect to release these features by early October.
I am planning on introducing Google play game services to my app. However I am not sure if i can provide the following capability. I need to be able to list the rooms available so the player can join any room he chooses rather than auto join.
Is there a way to do that? Thank you
In the current implementation of our API, there are no "open rooms" that you can voluntarily enter. You need an invitation to enter a room. So the method we have that's closest to what you're asking is the GamesClient.loadInvitations() method, which will list all the currently active invitations to rooms that the player has.
If the behavior you're trying to implement is "I want to join a room that's playing upside-down four-dimensional chess", without being specifically invited by a friend, then what you want is probably automatching. Automatching means you create a room and specify the number of players you want in your game and, optionally, a variant code (an integer) that indicates the game type. Then, the API will match together a set of players who is wanting to play that same variant at that moment, and will put them all in the same room.
You might need to use Leaderboards in Android
I can't see how you could do this in the current release of Game Services (at least not if you use the API in the way that Google wants you to).
However I just noticed this:
https://developers.google.com/games/services/web/api/rooms/join
Join a room. For internal use by the Games SDK only. Calling this
method directly is unsupported.
Maybe this sort of thing will be possible at a later date ?
I'd like to have an android app that would allow a given number of users to be "logged in" either as a player or ref. The players would just be able to increment their score, while the ref would have a screen that shows all player scores and alerts the ref with a tone/vibration when a player reaches a target score.
I have no android dev experience and in a perfect world I would just find an app that does something similar to this that I can just tweak. I'm not sure if this kind of functionality would depend on having a server or at all where to begin on learning the knowledge that would be necessary to create such an app.
Kind of a vague question... you will however need a server to keep track of all the scores - for example you can have an SQL database that contains all the users/scores and all the Android app is tell the server which user's count to increment.
Another alternative would be to use the Google Drive APIs - you can probably use forms or something to increment counts while the "ref" would have full access to the document.