I'm working on a little WebVR game using Hayden Lee's library, Networked AFrame and I'd like to place the users on a specific position as soon as they arrive in the networked room.
I've tried using the 'onConnect' callback, but when it's called the NAF object connectList is empty, so I cannot know if I'm the first one in the room or if other clients are already connected.
What would be the best way to get this kind of information, I can't find information about it in the docs.
Thanks for your help!
Currently in Networked-Aframe you can only control the position of entities that you have created and there is not a mechanism for determining how many people are in the room.
The only way to do what you're suggesting with NAF 0.2.3 is to set an arbitrary wait period after the onConnect callback, say 10 seconds, in which you hope that all the other users connect to the room. If there are anomalies that take longer and you end up with a collision of two people choosing the same position you react to that collision (which is also hard given there isn't events for users connecting yet). NAF 0.3.0 will at least have events for other users joining.
Related
I am working on a app that relies heavily on monitoring user visits in possibly multiple regions / areas. I am currently experimenting with region monitoring which works pretty well, however, the location callback is not as accurate as I want it to be. I have seen CLVisit, but the documentation out there doesnt explain it very well, especially its use.
I think you are misunderstanding the concept of CLVisits. There is actually no Visit object that you need to create. The CLLocationManager delegate method is triggered by the algorithm that apple has determined (see wwdc lecture for more info). This is explained in the CLLocationManager documentation...
Getting the Visited Locations
In iOS, the visits service provides an alternative to the significant location change service for apps that need location information about interesting places that the user visited. For example, if the user is in one location for an extended period of time, the service might generate an event when the user arrives at that location and another when the user leaves that location. The service is intended for apps that might already be using the significant location change service and want an even lower power way to do so. You would not use this service to create navigation apps or apps that rely on regular location updates.
To begin the delivery of visit-related events, assign a delegate to the location manager object and call its startMonitoringVisits method. As the location manager generates visit events, it delivers that information to its delegate’s locationManager:didVisit: method. The event data delivered to your delegate includes only the information that occurred after you started the delivery of events. In other words, if you start the delivery of events after the user arrived at an interesting location, the event delivered by the system when the user departed that location would not reflect the actual arrival time. If the system terminates your app, this service relaunches it when new visit events are ready to be delivered.
That said if you look at this article from NSHipster, it references some current issues with CLVists (for iOS 8.1). It essentially goes on to say that if you want infrastructure that extremely precise don't use CLVisit. Seems like you're doing it right (for now at least).
CLVisit is, as of iOS 8.1, not all that precise. While start and end times are
generally accurate within a minute or two, lines get blurred at the edges of
what is and what is not a visit. Ducking into a corner coffee shop for a minute
might not trigger a visit, but waiting at a particularly long traffic light
might. It’s likely that Apple will improve the quality of visit detection in
future OS upgrades, but for now you might want to hold off on relying on CLVisit
in favor of your own visit detection for use cases where it’s vital your data is
as accurate as it can be.
I have requirement of developing an Quiz Game but real time. I have read a little about it and went through some tutorials and documentations.
I have a queries in my mind regarding making it real time and effective.
I want to ask that
Whether I should use Game Center or Socket Programming where server is made in PHP/Asp.net or Python.
As, the architecture which I am thinking to make is looks like as below...
Architect…..
Download All Categories.
Select Subject, or Category/topic, every category can have many subjects.
After selecting, you will press button, Play now, it will send query to server, that you want to play., server will choose any one who also want to play and searching for some opponent
After both opponents are selected, it will send data to both, means in response of previous request, a user along with data of questions will be send.
As every question has fixed time, fixed score, so locally it will be shown and calculated and score will be sent to server and server will also show score to both players. means another data will be send, but very small data, say one string or two.
As time will be over, another request will be sent and final result will be displayed.
Thanks
Proper guidance will be appreciated.
we are working on a game with real-time matches. 2 players. 1 against 1.
I have to define a list of items in common between the 2 players before the game start.
It's not really a problem in the case of 1 player invite another. In this case i can define the player receiving the invite as the "client". The app of the "server" player will generate the list.
But in the case of an "auto-match" not sure how i can define this kind of relationship between my players as the same code is going to run the same way on the two instance of the apps.
Edit:
Will try this idea:
Will use a timeelapsed between beginning of the connection and the accepted connection. Exchange the data between users and determine which one should be consider as master/server.
Will post a detail example if the implementation working.
Meanwhile, still opened to any others suggestion.
In peer-peer networking, each device can function as the server. Make your networking client/server agnostic once the connection is made so that it doesn't matter.
I had that same problem and ended up defining my own network classes on top of AsyncSocket so that I could communicate in a middle layer. It's here if you're interested:
github link here
It suited my needs and it may give you some ideas.
I am trying to develop a computer game. I want this game to be multiplayer playable. The game is an arcade space shooter
I plan to run the game at server level and then send updates at the clients. The problem that I am facing is object creation. Let's say if a player shots, the shots themselves are new objects. These will need to be created.
In my game I have a hierarchical structure and the shots themselves will be part of this structure. It will be something like a tree. The problem that I have is identifying objects on the clients and server.
How can I make sure that when the client receives some update then it will update the right objects?
What about new object creation. In my case the scene graph is traversed and each object is updated once it gets updates from the server. But updates which creates new object violates this principle. How should I handle them?
Also, I can't really get updates for the entire scene. I would only need to update specific objects that are visible to the player. What should I do with the rest of the objects that aren't visible? What will happen when they become visible? How can I track when objects become visible to a player?
How can I make sure that when the client receives some update then it
will update the right objects?
You can give an unique id to each object server creates. You might want to create a super Object class containing id and let all other game object classes inherit from it. Or, you can have a map to link between id and object. Or, you can mix them. To get an unique id, server can have a global 'nextID' as int and simply assign to a new object and increase it for next one.
But updates which creates new object violates this principle.
I don't really understand the principle you are talking about but if you are worried about editing your scene graph (or game object list) while traversing it, you can put the newly created objects into another list and just insert the new ones after traversing is done. They will start getting updated from next update. (You should consider how you will remove an object too)
What should I do with the rest of the objects that aren't visible?
What will happen when they become visible?
Well, you are the one who should figure it out because it really depends on your game system. My suggestion is that try to skip their updates and see what problems appear and fix them.
How can I track when objects become visible to a player?
Also, several ways to handle this. Server can detect everything for clients and send only visible object info for each client. Or, each client can detect them and send a request to server for starting to update visible ones. Or, it could be mixed way.
Try server-driven one first and see if server can perform it with maximum number of clients.To use client-driven one, remember each client still needs to update all object location regardless of their visibility but send a request for AI updates for only visible ones.
Again, there are many ways to handle this kind of problems and it really depends on your game system requirements. That's why it's hard to answer your question without knowing your game system well enough. Try to investigate how other similar multiplayer games are designed from some books or google. Good luck!
I have an iOS App where a sequence of three events spread across three Pages constitute a single Journey.
I can log each page view and single events via flurry.
But can I log the entire sequence as a single event ?
PS: I considered using timed events but didn't seem like the best fit.
Are you trying to track the conversion of this particular journey. If yes, then this is definitely possible by creating a funnel of these three specific events. For more information on funnels please refer: http://support.flurry.com/index.php?title=Analytics/Overview/Lexicon/FunnelAnalysis
However, if you are trying to log this particular journey as one single event, then that also can be done. You need to flag all the three events/pages and create an event, which gets triggered/logged when all three flags are true.
If you need further details please reach out to us in support#flurry.com.
Thanks