【原创】移动平台跨平台游戏的解决方案(Proton )

概述

    随着社会的进步和科技的发展,如今的游戏市场已经不仅仅局限于PS2/3、XBOX360、PC客户端等游戏。android,ios,webos等系统大规模推广之下产生了各种各样的智能手机,平板电脑等。。这就为游戏的发展注入了新的方向。这些系统各不兼容,所以,极端情况下,如果你想制作android,ios,webos这三个平台的游戏,那么,你需要部署三套代码,这样无形中就增加了制作成本。好在android有ndk,ios用的objective c也可以使用传统C++代码,webos也是如此。。这就为大家提供了一种整合的思路。我能不能只写一套核心代码,在不同的平台上只是工程文件不同就行了。目前整合的解决方案有一些,ogre,proton等。。。ogre我感觉还是有点臃肿,内存占用不是小事。。经过研究,proton算是符合我的需求了。

Proton是什么

    Proton的wiki定义 http://www.rtsoft.com/wiki/doku.php?id=proton

    Proton SDK (aka p+) is an open source component based C++ framework with its own touch-optimized GUI system that is optimized for GL/GLES based cross-platform app/game development. Both 2D and 3D apps (using the included but optional Irrlicht 3D engine) are supported.

features列表:http://www.rtsoft.com/wiki/doku.php?id=proton_features

其中第一条feature就是:Create 2D and 3D games that run on six platforms in C++: OSX, Win, iOS, Android, WebOS, RIM Playbook

BBS:http://www.rtsoft.com/forums/forumdisplay.php?27-Proton-SDK-General-Discussion

The Proton SDK License (based on the XFree86 1.1 license)

Copyright (C) 2010 Seth A. Robinson All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer.

2. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: “This product includes software from the Proton SDK developed by Seth A. Robinson (www.rtsoft.com )”, in the same place and form as other third-party acknowledgments. Alternately, this acknowledgment can appear in the software itself, in the same form and location as other such third-party acknowledgments.

3. Except as contained in this notice, the name of Seth A. Robinson shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior authorization from Seth A. Robinson.

THIS SOFTWARE IS PROVIDED 'AS IS' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SETH A. ROBINSON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Note:

Irrlicht engine modifications are released under the Irrlicht ZLIB style license. ( http://irrlicht.sourceforge.net/license.html )

Any source based off ClanLib (located in the shared/Clanlib directory) is released under the current ClanLib license.

Some of the libraries Proton may link to may have additional requirements or restrictions. The Proton SDK license only applies to the Proton SDK

他本身的协议是BSD的,但是他用到的一些第三方库可能是其他类型的授权

 

注意

  proton只是个游戏的跨平台解决方案,对于其他方向可能无能为力或者没必要。比如你做一个传统的app(通讯录浏览器,美图秀秀之类),proton并不擅长做这些事情。

proton游戏下载

  Tanked是一款跨平台的线上多人坦克对战游戏,这是一款免费的游戏,支持你和全世界各地的玩家在线进行对战和聊天。这款游戏支持Android、iPhone和WebOS。

  google市场:https://play.google.com/store/apps/details?id=com.rtsoft.tanked

  安智迷:http://www.androidmi.com/xz/yxyl/dongzuo/201108/Tanked-v1.01.html

代码获取

   proton提供了svn下载,你可以用任意一款svn的客户端软件(我用的是TortoiseSVN)check out。地址是:svn://rtsoft.com/rtsvn/proton

下载完成后的Repository Brower截图如下

RT3DApp, RTAdTest,RTBareBones,RTBattle(需要账号,没有下载下来),RTLooneyLadders,RTPhysics,RTSimpleApp这些是poton提供的demo

shared就是proton的核心代码了

tools是一些工具,RTPack打包用的和一些编译脚本

从这个图里(列表的右侧)就可以看到,

android,linux,osx,webos,windows,等是各平台的工程配置

source是工程的实现代码

media是资源目录。。

proton的介绍和下载就到这里了,本人没有webos,ios的平台,所以接下来我会介绍windows(vs2005),android的平台搭建教程

此教程为本人原创教程,转载请标明出处(http://www.cnblogs.com/ldr123/archive/2012/03/17/2403371.html

感谢@hellotony兄弟对博文的指正!!!

原文地址:https://www.cnblogs.com/ldr123/p/2403371.html