Главная » Просмотр файлов » Wiley.Games.on.Symbian.OS.A.Handbook.for.Mobile.Development.Apr.2008

Wiley.Games.on.Symbian.OS.A.Handbook.for.Mobile.Development.Apr.2008 (779888), страница 40

Файл №779888 Wiley.Games.on.Symbian.OS.A.Handbook.for.Mobile.Development.Apr.2008 (Symbian Books) 40 страницаWiley.Games.on.Symbian.OS.A.Handbook.for.Mobile.Development.Apr.2008 (779888) страница 402018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 40)

‘Backwards’ transactions, where the server sendsthe request and the client sends the response, are also supported (althoughAIRPLAY ONLINE: A MULTIPLAYER SDK AND SERVICE SOLUTION169by their very nature, they only work once the client has connected to theserver). Transactions are fully pipelined (more than one transaction canbe happening at the same time) but, unlike HTTP pipelining, responsesdon’t have to return in the same order that the requests are made.Real-time packets can be flagged so that if there are two packets ofthe same type in any queue, the old one will be discarded. Using thisfeature, the game can throw real-time data at Airplay Online as fast asit likes, and Airplay Online will transmit the newest available packet asrapidly as the link (or the QoS settings) allows.

Because this feature usesa separate notion of packet type to other parts of the system, a differentplayer’s data will be treated as a different type, despite the fact that eachplayer is using the same packet format.The Airplay Online protocol monitors the latency of the link, and usesthis information to guess available bandwidth and to provide a sharedclock for synchronizing game events. It can also attempt to implement asimple QoS system by sharing the available bandwidth among differentservices, meaning that a relatively bandwidth-intensive service, like thedownload service, can’t swamp everything else when bandwidth brieflydrops for some reason.When a client first connects, the protocol client code on the deviceautomatically sends quite a lot of useful information to the server, such aswhat game is being played, what kind of handset it is, and what languagethe user is using.

The server-side half of the login service will add tothis information with the user’s player ID and tag (if defined). Servicescan then make use of this information, for instance to supply localizedresources, to supply the correct resources for a particular game, or just tokeep track of who the user is. If the session is disconnected for any reason(including time outs) then it is efficiently resumed and the server restoresall the settings it had last time.It’s worth mentioning that the standard login service can be replaced byanother one if required; for instance, the standard login service currentlyties the identity of the player to the handset being used.

If a game wantedto allow people to log on from a friend’s handset, it might want to writea username and password-based login service. This custom login servicecan use the same mechanism that the standard login service uses for useridentification.The client-side code has various features to help the developer keeptrack of memory usage. Game developers like things to be very predictable so that memory allocations don’t happen at unexpected timesin order to ensure that the game will not run out of memory at somecritical moment in the game. Keeping things predictable is a challenge, because network programming is inherently unpredictable, andincoming packets or failures to transmit outgoing packets may happenat any moment.

Solutions include creating fixed-sized pools of commonly allocated structures (notably packet buffers), allowing the game170MULTIPLAYER GAMESto supply memory to be used for particular operations, and allowing allonline allocations to be routed through a special allocator, for instanceallocating on a separate heap.The server provides a general framework for running the variousservices, making it easy to set up a redundant cluster with no single pointof failure. Each service is run in a separate process so that games areisolated from one another.

The server infrastructure generally keeps trackof multi-threading, a logging framework and everything else that you’dexpect from a server infrastructure. Because all data is stored in a database,managing failover and backup for the data is reduced to a standard taskthat will already be well understood by system administrators.5.4.3 Custom ServicesMost online game frameworks let people write custom code on the server.Airplay Online makes this as easy as possible, instead of making surethat the standard services do everything anyone could ever want them to.This approach was chosen because even apparently ‘standard’ functionsneed to interact with custom aspects of game logic.

For instance, a gamemight have some complex rules about who can play who online, basedon exactly what single-player objectives have been achieved. A standardlobby can’t be expected to cope with that. The Airplay Online approachis to provide the source code to the standard lobby as an example,allowing a game to write its own custom lobby that just re-writes thematchmaking code.The key to making custom service development easy is a tool calledthe ‘service builder’ which takes an XML description of the format ofmessages that need to pass between the client and the server, describingthe data structures in each message. From there, the service builder willbuild client and server framework code to pack and unpack the data,make requests, monitor the status of requests and return unpacked results.On the server, services can be implemented in either C++ or Python,with Python being preferred. Typically, writing the server componentsimply involves filling in a group of stub functions that have been autogenerated, each of which is passed the request data structure and providesa response data structure to fill in.

On the client side, the service buildergenerates both the polling and the callback-based API for each message.The client code can be customized in complex cases, but it usuallydoesn’t need to be.The goal of this architecture is to isolate the developer from any ofthe complexities of network programming or server-side development.The developer is isolated from the network layer and only sees unpackedmessages; on the server, developers don’t need to concern themselveswith the server process’s creation of different threads for handling differentclients and so on.N-GAGE ARENA1715.4.4 SummaryOnline gaming allows a richer gaming experience, in ways varying fromthe obvious (playing against other people) to possibly less obvious ones(more and bigger textures due to incremental asset downloading).

It cancertainly be very popular. As we were completing this book, Halo 3for Xbox 360 was launched. Within the first day of its launch, Halo 3players worldwide racked up more than 3.6 million hours of online gameplaying, and 40 million hours by the end of the first week, representingmore than 4500 years of continuous gameplay!5However much fun it may be to play online games, game programmersoften perceive network programming as a difficult and unfamiliar task.This difficulty can be overcome by the use of a middleware productsuch as Ideaworks3D’s Airplay Online, which lets people create onlinegames with the minimum of effort.

Games performing common onlineoperations can be written with no server-side coding at all. More complex games will make the network and server side coding as simple aspossible – but no simpler.5.5 N-Gage ArenaN-Gage Arena is an end-to-end solution for online multiplayer andcommunity services for N-Gage games running on a range of S60 smartphones. Chapter 8 discusses the N-Gage platform in more detail, butN-Gage Arena is described here because it forms a natural part of themultiplayer gameplay chapter.N-Gage Arena was originally part of Sega.com’s SEGA Network Application Package for mobile multiplayer gaming. Nokia acquired Sega.comInc. (a subsidiary of SEGA) in early 2003 to enable them to offer networked multi-play and a virtual community to N-Gage gamers. Nokiareports almost 700,000 N-Gage Arena members in 190 countries andacross 320 network operators.6Players log into N-Gage Arena to play multiplayer N-Gage gamesover the network, and participate in other aspects of social gaming, forexample, by:• entering game tournaments and other hosted events such as celebrityinterviews and live chats• storing their player statistics (scores and standings) online, with scoreboards listing top-ranked players.5More information about the Halo 3 phenomenon can be found at www.microsoft.com/presspass/press/2007/oct07/10-04Halo3FirstWeekPR.mspx6See www.gamesondeck.com/feature/1364ngage arena nokias tomi huttula.php formore details about N-Gage Arena and the N-Gage experience.172MULTIPLAYER GAMES• monitoring their ranking on the score boards.

When setting up amultiplayer session for the game, the user can choose whether toplay with someone of similar rank or play freestyle, with whomeverhappens to be available to play• using the chat and message boards• sharing custom content they have created, such as photos and avatars• checking their friends list to see who is online and ready to playa game• updating their player profile.N-Gage games rely on the server infrastructure shown in Figure 5.3to provide scalable network application package (SNAP) game services,instant messaging and presence service (IMPS), and web services.• SNAP Game services provide connected, multiplayer functionality togames with high performance, scalable event routing.

For example,when one player takes a turn in a game, SNAP notifies the other Arenaclients in the game, which in turn notify the game code and thus theplayer.• IMPS Backbone Services support instant messaging (in-game or outside of games) and presence services. IMPS uses standard XMPP/Jabberprotocols, extended in places to add custom Arena features.N-Gage Arena ClientsCommunity ServicesOperator Gateway(operator IP)S60 3rd ed.

OSS60 Mobile DeviceBluetoothconnectionGameN-Gage Arena APIsWeb servicesGameAuthenticationdatabaseN-Gage Arena APIsS60 3rd ed. OSS60 Mobile DeviceIMPS servicesGameN-Gage Arena APIsS60 3rd ed. OSS60 Mobile DeviceSNAP Game servicesFigure 5.3 The N-Gage Arena system architectureN-GAGE ARENA173• Web services provide user account management.

Характеристики

Тип файла
PDF-файл
Размер
2,71 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
А знаете ли Вы, что из года в год задания практически не меняются? Математика, преподаваемая в учебных заведениях, никак не менялась минимум 30 лет. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6455
Авторов
на СтудИзбе
305
Средний доход
с одного платного файла
Обучение Подробнее