Wiley.Games.on.Symbian.OS.A.Handbook.for.Mobile.Development.Apr.2008 (779888), страница 44
Текст из файла (страница 44)
This uses// Pythagoras theorem in calculating lengths.distance = (r-aColor.Red())*(r-aColor.Red()) +(g-aColor.Green())*(g-aColor.Green()) +(b-aColor.Blue())*(b-aColor.Blue());// If target color is within 125 radiusif(distance <= 15625) // 125^2{aGc.DrawRect(TRect(TPoint(x,y), TPoint(x+2, y+2)));}}}}This completes our admittedly simple example that illustrates a littleof the potential of the camera API provided by Symbian OS for mobilegame developers.188EXPLOITING THE PHONE HARDWARE6.3 LocationAlthough there has been a lot of publicity in Europe and the US aboutlocation-based games, they are still considered by many as a fringegenre.
There are a few reasons for this: first, it is an immature industrythat is particularly susceptible to the fragmentation of mobile standards;second, the games often require a critical mass of players to becomesuccessful, which is difficult to obtain within the limited distributionoptions available. Whilst we won’t be addressing questions relating togenerating revenue from such games in this chapter, we can point out thatinfrastructure and handset support for location-based games is growingall the time, and that some games described have generated high levelsof public interest.Providing location information is far from straightforward, often requiring significant changes in the software and hardware of the mobile systemand/or the handset to ensure that the information is relevant to the user’sactual position.
Location information is essentially a two-stage process, inthat we have to provide both the geographical position of the mobile userand the information on a particular product or service related to that location. In the following section, we will highlight the location positioningtechnologies available to mobile games developers and highlight someof the location-based games which have utilized some of these methods.6.3.1 Obtaining LocationOften those new to the subject consider finding the location of a mobilephone user as a new problem, whereas, in fact, all mobile phone systemseffectively track a user’s whereabouts at the cellular level. Each cell sitehas a unique id that enables the particular mobile phone network systemto locate a mobile phone subscriber, so that it can route calls to thecorrect cell.
However, to improve on this relatively crude accuracy, othertechniques treat location-finding as a relative exercise; in other words, thelocation of the mobile phone user must be estimated against some knownframework. This framework could be the locations of the base stationsof a mobile phone network or the satellites of the global positioningsystem (GPS). Each system will provide different levels of performanceand capabilities, and in the following paragraphs we discuss the relativemerits of the various methods together with highlighting mobile gamesdeveloped around these techniques.6.3.2 Cell IDFrom the previous discussion, the most obvious location method is thatof the GSM cell ID, as it requires no modifications to either the phonehandset or the network infrastructure.
While the cell ID has a typicalLOCATION189location acquisition time of around three seconds, its accuracy dependsupon the size of the cell, which varies depending upon the capacityrequirements of a particular geographical area (for 3G systems this couldrange between a cell radius of 100m to 10 km).Whilst there are a numbers of location-based games using cell ID, inthis discussion we will consider probably the most well known, which isBotfighters (www.botfighters.com). The game was launched in 2000 by aSwedish company called It’s Alive as a search and destroy combat game.
Itis fairly representative, in terms of technology and gameplay, of a numberof other games in this genre such as UnderCover and Gunslingers. Inthe first version of Botfighters, players sent an SMS to find the locationof another player and if that player was in the vicinity, they couldshoot the other player’s robot by sending another SMS message. Whilegaining some initial recognition, Botfighters’ use of SMS and its crudelocation accuracy meant that it suffered from delay and minimal levels ofsocial interaction, as players were physically distributed over large areas.Botfighters 2 attempted to remedy this situation by using a Java ME clientand GPRS connectivity to upgrade gameplay to incorporate collaborativegame playing, character upgrading, weapons and bonus material trading,as well as AI-controlled opponents.
Despite its aspiration to become amassively multiplayer online role playing game (MMORPG), a greaterdegree of location accuracy and social interaction would undoubtedlybe required to attain this goal.16.3.3 Time of ArrivalTo estimate location, time of arrival (TOA) systems measure the differences among the multiple signals arriving at a device. In order toenable a two-dimensional calculation (i.e., latitude and longitude), TOAmeasurements must be made with respect to signals related to at leastthree geographically distinct framework elements.
These measurementsallow us to infer either the absolute or the differential distance of signalpropagation between the framework elements and the device. A systemthat is based on differential distance estimation is generally referred toas time difference of arrival or TDOA. TOA requires a common timingbase, which is fine for synchronous mobile systems like cdmaOne, butfor non-synchronous systems such as GSM, special timing units must beadded to the infrastructure. The accuracy of such systems can be between50 and 250 meters, and is extremely susceptible to multipath accuracyproblems.
Therefore, we have yet to see such systems implemented forthe general consumer and, as such, TOA has been unused for games.6.3.4 Global Positioning System (GPS)GPS was originally developed by the US military for defense purposes;it is based on a system of 24 satellites that orbit the earth. A GPS190EXPLOITING THE PHONE HARDWAREreceiver can triangulate its position using TOA methods, as long as atleast three satellites are visible.
Typically, accuracy is around 2 to 10meters. The cost of GPS hardware continues to fall, and GPS remainsa free service to consumers. Integrating GPS hardware technology intomobile phones is seen as an increasingly viable solution, as can be seenwith devices such as the Nokia N95. However, GPS has a number ofmajor restrictions, such as limited coverage in urban environments andinside buildings due to the requirement that mobile users be in ‘view’ ofthe satellites, and a slow location acquisition time (in the region of 10 to60 seconds).There have been a number of mobile GPS games, the most famousbeing Mogi Mogi which was a treasure hunt game developed by NewtGames, for the Japanese mobile operator KDDI to publicize the launchof their eight new GPS-enabled handsets in 2003.
The game was basedaround a Java ME application that allowed players to accumulate as manypoints as possible by collecting virtual treasure items spread randomlyover a virtual map of Tokyo. Items could be collected once the userreached within 400 meters of the virtual item and players could meetother players to trade items. The location tracking was provided by eitherGPS or cell ID, and the developers recommended that GPS should onlybe used when looking for a particular item or players in a small area. CellID is used to get a general bearing to reduce heavy battery consumption.Mogi Mogi is by no means unique in this area and other pioneering GPSmobile games worth mentioning are Raygun by Glofun and Undercover2 by YDreams6.3.5 Assisted GPS (A-GPS)Assisted GPS systems overcome some of the limitations of GPS positionacquisition by using the fixed mobile network infrastructure to reduceacquisition time to less than 5 seconds, and may provide indoor accuracyto within 50 meters.
However, as with infrastructure TOA schemes, multipath interference and the lack of a line of sight measurement can degradeperformance, so A-GPS can be less accurate than GPS under certainconditions. For network operators, the main benefit from integration ofA-GPS is the ability to charge users for positioning information, becauseit uses the network infrastructure.The use of A-GPS systems in games has been seen predominantlyin the US. An example is Swordfish, which is a location-based fishinggame developed by Blisterent, where players use their mobile phonesand A-GPS to find and catch virtual fish. A player’s general movement inhis or her local area will bring the player into the vicinity of the fish, andthe player can then move to a particular location to try and catch the fish.The positions are all relative, in that they do not have to be in a particularcity or area to play the game.