游戏邦在:
杂志专栏:
gamerboom.com订阅到鲜果订阅到抓虾google reader订阅到有道订阅到QQ邮箱订阅到帮看

开发者分享《Crimson: Steam Pirates》制作经验

发布时间:2011-09-28 15:37:00 Tags:,,

作者:Aljernon Bolden

如果你还没玩过《Crimson: Steam Pirates》,不妨下载试试。《Crimson》是款回合制策略游戏,也是款基于加勒比海的恃强凌弱探险游戏。这是Harebrained Schemes制作和Bungie Aerospace发行的首款作品,游戏是我花费整个夏天携手Harebrained Schemes团队其他成员共同完成的。

《Crimson: Steam Pirates》和前8项任务2011年9月1日以免费形式入驻iPad平台,其他任务包则通过内置付费渠道售价1.99美元(游戏邦注:内容延续原始故事情节)。游戏很快就在8个国家的iPad Free App榜单位居第一,其连续5天保持在美国Free App的第一名位置,目前依然是38个国家排名前5的iPad策略游戏。

Harebrained Schemes的《Crimson》团队最多时期由7人组成,整个开发周期只有12周。作品得以顺利完成主要由于以下几大原因:

1. 清晰的创造构思

2. 经验丰富的开发者和美工

3. 99%的游戏内容都采用Lua脚本,运用Moai开源游戏开发平台

由于Moai游戏开发平台免费提供,其他游戏工作室或独立开发者完全能够通过相同平台在短期内创作出杰出Lua游戏。

我写此文旨在希望其他开发者能够了解我们制作《Crimson》过程中所做的某些决策,我们如何利用Moai平台,以及类似决策在你的项目中是否可行。

Flash内容:

multilayer render from gamasutra.com

multilayer render from gamasutra.com

Harebrained Schemes的美工团队更倾向制作Flash内容,我们选择Moai平台的一个原因是它支持我们现有的画面制作流程。《Crimson: Steam Pirates》的多数动画效果(游戏邦注:主要是旋转船上浆轮、爆炸和船头轨迹)都以Flash flipbook动画形式呈现。这些随后都通过Flash Javascript插件植入纹理地图,连同包含各动画画面时间、循环和特定游戏界面的对应Lua文件。自动装置作用突出,令Flash团队能够批量制作内容。起初他们先在1、2天内完成模型动画,然后程序员把这些内容整合入游戏中。整合工作完成后,美工就能在几周后重新更新动画内容和游戏画面,完全无需程序员的帮助。他们会导出所有新内容,查看它们在游戏中的运作情况,进行调整,然后重新输出内容。

在画面制作中采用Flash技术及游戏体验各观感的有趣之处在于船上的战斗动作顺序很像屏幕上呈现的Flash动画,但其实这些是通过MOAIEaseDriver进行程序上的处理,实现图像画面的移动。我们的美工团队并没有制作很多Flash动作,所以当游戏机制需要类似Flash的体验时,我们都通过程序操作实现。

多层次战场和渲染

multilayer render from gamasutra.com

multilayer render from gamasutra.com

空中、海洋和水下战场通过3个图层完成。水光浮动效果是通过结合flipbook动画和镜头上的Moai颗粒效果实现的。我们通过将MOAIShaders运用至潜艇处于表面时的画面,获得浅水和深水视觉效果。

小岛地形由4个图层构成。这致使内容的运作性能受到影响,因为其需通过4个关口保存内容和整个地图,但这不是什么严重障碍。我们曾考虑采用地形拼接地图,但最终没有这么做,因为它以原始方式运作,我们无法腾出额外时间。采用拼接地图会减少通关执行时间,若游戏需要大型任务地图,这么做就非常有必要。

用户界面和控制装置

user interface from gamasutra.com

user interface from gamasutra.com

起初《Crimson: Steam Pirates》是通过次级线程决定输入活动。这能够快速进行编码,对简单游戏而言是个相当有用的途径。由于《Crimson》具有类似鼠标的控制装置系统,支持除多点触控变焦之外的所有功能,因此鼠标点击和触控活动均影射至相同游戏表面,在查询循环中引发相同玩法逻辑。

最后,随着游戏的日益复杂化,我们转而采用Moai提供的onTouch内容。此时屏幕已呈现许多能够接收输入内容的装置,而且基于活动的编码变得更加简洁。

PC和设备测试

Test on PC from gamasutra.com

Test on PC from gamasutra.com

《Crimson》控制方案及Moai PC和Mac本土载体的杰出之处在于从最初更新内容开始,开发者都能够在设备上(游戏邦注:Mac或PC)测试游戏玩法。我们无需在开发初期购买大量iPad设备,或给每个团队成员购买崭新Mac。此外,我们还能够在每个开发者周期中省下2-3分钟,用来把最新编码复制至iPad设备,进行反复测试。

当然,iPad是游戏的目标发行平台,所以即便是在开发头几星期我们也会让人到现场通过iPad体验游戏内容。在接近开发末期时,我们每天会使用iPad 3-8次,旨在进行全面测试。

GUI关卡编辑器:

Crimson Mission Design Tool Small from gamasutra.com

Crimson Mission Design Tool Small from gamasutra.com

早在游戏开发时,我们就觉得图像关卡编辑器能够帮我们省下许多时间,而我的伙伴Gorden Lee刚好开发了一个很棒的编辑器using .Net。我们的设计师利用这个工具自由创造和调节关卡,获悉个关卡如何连接,且无需处理Lua脚本。

在运动和冲突中运用Box2D物理引擎:

Box2Dphysics from gamasutra.com

Box2Dphysics from gamasutra.com

在其早期的更新内容中,《Crimson: Steam Pirates》通过动画曲线激活船舶、飞机和潜艇的运动。但这个方式促使游戏的交通工具运作出现不自然感觉。临近开发结束时,我们觉得应该要创造更流畅的运动画面,放弃最初的模式。我的同事Chris Kohnert想出一个更好的解决办法:利用Box2D物理引擎通过冲量移动交通工具车辆。在最终版游戏中,所有交通工具都呈现多边形(游戏邦注:小岛也是),运动曲线变成设置交通工具冲量和力量的输入信息,Box2D处理冲突情况。编写代码算出沿UI指示曲线移动船舶所需的合适力量并不容易,但这效果很好。为保持完整“棋盘游戏感觉”,所有物体在每个回合末尾都会在物理引擎中重新变成静止状态,下个回合再次移动。为保持交通工具移动的匝间冲量感,我们将保存所有插入UI,设置移动路线物体的属性,力量大小将运用于下个回合的移动。

Lua和C++:

LuaC++ from gamasutra.com

LuaC++ from gamasutra.com

我们以Lua编写《Crimson: Steam Pirates》中的所有内容,但有融入少量C和C++,整合Facebook和FMOD声音库。《Crimson》体验、运作和画面呈现的方式是:Lua代码驱动Moai平台。我们喜欢通过Lua制作内容,因为这是编写新功能的最快方式之一,我们能够在相同时间内容完成更多设计循环。

定制Moai PC载体:

custom host pc from gamasutra.com

custom host pc from gamasutra.com

虽然iOS载体对游戏来说已经非常充足,我们还是强化Mac和Windows PC Moai的shell,让团队成员能够在漏洞追踪系统中快速融入玩法截屏(游戏邦注:这是个小扩充,但在促进围绕玩法问题的团队交流中作用显著)。

扩充Moai颗粒系统:

osi standard logo from gamasutra.com

osi standard logo from gamasutra.com

我们开始通过颗粒效果激活游戏船舶后的优美船尾轨迹,但嵌入的Moai颗粒效果只支持单向循环,而我们需要底部循环和偏离基准的位移循环。所以船舶和平面潜艇有唯美的,由颗粒效果激活的船尾轨迹,这和移动存在密切联系。

开放源代码

osi standard logo from gamasutra.com

osi standard logo from gamasutra.com

除更新颗粒机制外,我们还拓展Moai,方便在游戏润色和测试的最后几周修补漏洞。新的漏洞修复功能包括Lua和纹理记忆追踪和诊断、Lua目标卸载和封闭测试。开发源代码的优点在于我们能够以希望的方式制作游戏,创造促使我们高效工作的工具。如今其他Moai游戏开发者都因此享有更丰富的颗粒机制和漏洞修复功能组合。我们期待未来利用其他开发者分享的扩展内容。(本文为游戏邦/gamerboom.com编译,如需转载请联系:游戏邦

How Crimson: Steam Pirates (#1 game on iPad) Was Built in just 12 Weeks.

by Aljernon Bolden

If you haven’t yet played Crimson: Steam Pirates, download it today and give it a try.  Crimson is a turn-based strategy game and swashbuckling adventure that takes place on, above, and below the Caribbean Sea.  It’s the first game developed by Harebrained Schemes, the first game published by Bungie Aerospace, and it’s what I personally spent my summer days and nights working on along with the rest of the team at Harebrained Schemes.

Crimson: Steam Pirates and the first 8 missions were released free to play for iPad on September 1st, 2011, with additional mission packs available via in-app purchase for $1.99 that continue the original storyline.  The game quickly gained the #1 position in the Free App category on iPad in 8 countries.  It held the #1 Free App slot in the United States for 5 days.  It’s still a top 5 iPad Strategy Game in 38 countries.

The Crimson team at Harebrained Schemes is made up of 7 people at its peak, and we had a total development cycle of just 12 weeks.  We were able to pull this off due to a few key things:

1. A clear creative vision

2. Experienced developers and artists,

3. 99% of the game was built in Lua script using an open source game development platform called Moai.

Since the Moai game development platform is free to use with attribution, there’s no reason that other game studios or indy developers out there couldn’t use the same platform to build a great game in Lua on a tight timeline.

In writing this post, I’m hoping other developers will get a sense of some of the decisions we made in building Crimson, how we made use of the Moai platform, and whether similar decisions might make sense for your own games.  If you’d rather just watch a video though, I’ve got you covered there too.  There’s a video interview with Jordan Weisman (CEO, Harebrained Schemes), Patrick Meehan (Creator of Moai) and yours truly that’s worth checking out.

Working with Flash content:

The art team at Harebrained Schemes prefers to work in Flash, and one of the reasons we choose the Moai platform is that it supported our existing art pipeline.  Most of the animation effects in Crimson: Steam Pirates (turning paddle wheels on ships, explosions, fore ship wakes, etc.) were created as flipbook animations in Flash.  These were then exported via Flash Javascript plugins to texture atlases (as PNGs), with corresponding Lua files containing the time, rotation and the specific sprites to use for each frame of an animation.  The automation worked well for the team, allowing the Flash team to generally work in batches.  They’d start by working up prototype animations over a day or two and the programmers would integrate these into the game.  Once the integration was done, the artists could come back and iterate on the animations and graphics weeks later without any programmer help.  They’d just export all the new work, look at it in game, and then make adjustments and export the art again.

One of the funny things about our use of Flash for art production and the look and feel of the different parts of the game experience is that the ship boarding action combat sequences look a lot like Flash animations on screen, but these are actually done programmatically using MOAIEaseDriver to move the art assets around.  Our art team really didn’t do much tweening in Flash, so when the gameplay called for a Flash-like experience, we built that into the game programmatically instead.

Multi-layer battlefield and rendering:

The battlefield of air, sea, and undersea is done with just three layers.  Water shimmering effects are done using a combination of a flipbook animation (imported from Flash) and a Moai particle effect attached to the camera.  The submarines are made to look shallow-submerged and deep-submerged through the application of MOAIShaders (partially transparent simple shaders) to the same art assets used when the submarines are at the surface.

The island terrain is made of four layers altogether.  There’s a cost in runtime performance, as it takes 4 passes to renderthings and the whole map is stored in memory, but this wasn’t a serious bottleneck.  We thought about moving to a tilemap for the terrain, but decided not to go this route because it worked the way we originally built it and we didn’t have extra time to spare.  Making the change to tilemaps would have reduced the compute time to one pass and may have become necessary if the game had called for extremely large mission maps.

User interface and controls:

At first Crimson: Steam Pirates used a sub-thread to poll for input events.  This was fast to code and is a really useful approach for simple games.  Since Crimson has a mouse-like control system for everything except multi-touch zooming, both mouse clicks and touch events were mapped to the same Lua wrappers and triggered the same gameplay logic in the polling loop.

Eventually, as the game grew more complex, we changed to using onTouch events provided by Moai. By that point we had dozens of objects on the screen that could receive input and the new event-based code was much cleaner to work with.

Testing on PCs as well as devices

One of the great things about the Crimson control scheme and Moai’s native hosts for PC and Mac is that from the earliest iterations everyone working on the game could test gameplay on their dev machine (Mac or PC).  We didn’t have to buy a stable of iPads early in development, or a shiny new Mac for each team member.  Plus we saved the 2-3 minutes per developer cycle that would have been spent copying the latest code to the iPad to test over and over.

Of course, the iPad was the target release platform for the game, so we put someone on point for game play on the iPad even in the first few weeks.  Toward the end of the development cycle, we were propping builds to iPads 3-8 times each day for thorough testing.

GUI level editor:

Early in the cycle we decided a graphical level editor would save us a lot of time, and my teammate Gorden Lee built a great one using .Net.  Our designers used this tool to create and tweak levels at will, had a ready overview of how each level was put together and didn’t even have to deal with the Lua script.

Using Box2D physics for motion and collisions:

In its earliest iterations, Crimson: Steam Pirates used animation splines for animating the motion of the ships, planes and subs.  But this approach left the game with an unnatural feel for vehicle motion.  Near the end of the project we decided we needed more natural-looking motion, and had to scrap the initial approach.  My colleague, Chris Kohnert, came up with a much better solution by using the Box2D physics engine to move vehicles by impulse instead.  In the final game, all vehicles have polygonal shapes (as do the islands), the motion splines serve as inputs to set impulse and forces on the vehicles, and Box2D handles the collisions.  It was tricky to write the code to figure out the appropriate forces to apply to move the ships along the spline path dictated by the UI, but it works well.  To keep the “board game feel” intact, all the objects are reset to an inert state in the physics engine at the end of each turn and are moved again from scratch the next turn. In order to keep a sense of turn-to-turn momentum based on vehicle motion the previous turn, properties are stored for each object (outside Box 2D) that factor into the UI for setting motion paths and the magnitude of the forces that will be applied for motion in the next turn.

LUA and C++:

We programmed everything in Crimson: Steam Pirates in Lua, except for a bit of C and C++ code to integrate the Facebook and FMOD sound libraries.  Everything else about the way Crimson plays, runs, and looks is Lua code driving the Moai Platform.  We love working in Lua because it’s one of the fastest ways to program new features, and we can get more design cycles completed in the same amount of time.

A custom Moai host for PC:

Although the reference iOS host was sufficient for the game, we made an enhanced shell for the Mac and Windows PC Moai hosts to let team members snap gameplay screenshots for easy inclusion in the bug tracking system.  This was a minor extension, but it was super useful for team communication around gameplay issues.

Extending the Moai particle system:

We started using particle effects to animate nice-looking aft wakes behind the ships in the game, but the built-in Moai particle effects supported only a single rotation, and we needed a base rotation and an offset rotation from that baseline.  So we changed the source code in the Moai particle system to make this extension.  In the final version of Crimson, all the ships and surfaced submarines have nicely particle-effect-animated aft wakes that render in relation to their motion.

Open source contributions

In addition to the updated particle system, we also extended Moai for easier debugging in the final weeks of game polish and testing.  The new debugging features included memory tracking and diagnostics for Lua and texture use, Lua object dumps and leak detection.  The epic win of open source is that we got to make the game just the way we wanted to and create the tools we needed to work efficiently on our own timeline.  Now, every other Moai game developer has a richer particle system and debugging feature set due to these contributions.  We’re looking forward to making use of extensions made by other developers on future titles.

Thanks for reading.  Feel free to post questions or comments here and I’ll answer them as best I can.(Source:gamasutra


上一篇:

下一篇: