Upload
coconut-island
View
1.032
Download
0
Embed Size (px)
DESCRIPTION
The Pros & Cons of Using Open Source Software to Rapidly Develop Cross-platform Indie Games and Tools
Citation preview
Brewing Your Brewing Your Own Game Own Game
EngineEngineThe Pros & Cons of Using Open Source Software to The Pros & Cons of Using Open Source Software to
Rapidly Develop Cross-platform Indie Games and ToolsRapidly Develop Cross-platform Indie Games and ToolsYe Feng
What’s In The Talk
No rocket science
From practical experience
Arguable
Who We Are
Project OneTap
One One ButtonButton
2D Action2D Action
Simple Simple PuzzlePuzzle
CasualCasual
CustomizabCustomizable Levelsle Levels
Challenge:Level Design
Wise Man Builds His House On The
Rock
Option 1: Cheap Commercial Engine
Option 2: Open Source Engine
Cheap Commercial Engine
Pros
IDE
Cross platform(when officially supported)
Moderate license fee
Cons
Offline IDE
Portability(when not officially supported)
No source code
Pure script driven
Open Source Engine
Pros
Source code
Cross platform
Free
Cons
No IDE
Pure native code driven
Open Source License
Choice
Option 1: Cheap Commercial Engine
Option 2: Open Source Engine
Option 3: Open Source Engine + Game Support Layer
Allegro
http://alleg.sourceforge.net/
✔
Demo
What’s In ItGame Object System
Script Integration
Physics Integration
Content pipeline tools
Others
Simple Scene Management
Action System
Script Key-Value Dictionary
etc...
Game Object System
Inheritance & Gameplay
Development
Gameplay dev nature: iteration
Iteration causes changes
Inheritance: not change-friendly
Good
Bad
Design Pattern
Favor object composition over class inheritance
Game Object & Game Component
Composition instead of inheritance
A object of gameplay logic
Is composed by multiple functional components
Game Game ObjectObject
Component Component #1#1
Component #2Component #2
Component #3Component #3
Game Object & Game Component
Add/remove component in runtime
Key to build an IDE
Composition To The Rescue
Basic ComponentsPositioning info: Transform
2D rendering: Sprite
Bitmap info: Bitmap Source
Input processing: Event Receiver
Rigid body entity: Body
Collider entity: Fixture
Particle effect: Particle Emitter
etc...
User Components
Arbitrary stuff that gameplay needs
Rotation forever
A goal in level
The behavior of characters
A spike need to be avoided
Line drawer needed by editor
etc...
Demo
Script Integration
Dilemma of Native
Compilation time
Runtime modification
Advanced language feature
“Glue” code
2-tiers System To The Rescue
Core: native code
Editor and gameplay: script
Lua
Related Works
Communication between native and script
Export tools/libraries
Script API
Communication - Native & Script
Simple interfaces/engine API
tolua
http://www.tecgraf.puc-rio.br/~celes/tolua/
Simple, no compilation cost
Complex interfaces
Lua C API
Related Works cont.
Serialization
Load/save, editor
Support for advanced features
Reference
Function object, closure
etc...
Serialization
Pluto
https://github.com/hoelzro/pluto
Write serialization code for every component
1000 lines of Lua code
Prefabricated Object
Take snapshot of object
Parameters
References
Hierarchy
Assisted object design
Level editor ➔ object editor
Patching
Patching binary ➔ patching data
Demo
Content Pipeline Tools
DCC Tools
Flash?
StaticStatic
AnimationAnimation
Pipeline
FlashFlash
PhotoshoPhotoshopp
ExporExportt ManuallManuall
y y Created Created
AtlasAtlas
IDEIDE
GameGame
☹
Solution
swfdec
Open source Flash player
LGPL
swfdec-dumper
Surface ➔ disk
https://github.com/fengye/swfdec-dumper
Pipeline 2.0
StaticStatic
AnimationAnimation
FlashFlash
PhotoshoPhotoshopp
IDEIDE
GameGame
swfdec swfdec dumpedumpe
rr ManuallManually y
Created Created AtlasAtlas
☹☺
Atlas Tool
Stitch bitmap into Atlas
Automation
Transparent process
Texture Atlas Gen
nVidia Texture Atlas Tools
File format support☺
Mipmap☺
Free☺
Only for sprite sheets☹
Pack algorithm
Pipeline 3.0
StaticStatic
AnimationAnimation
FlashFlash
PhotoshoPhotoshopp
IDEIDE
GameGame
swfdec swfdec dumpedumpe
rr Texture Texture Atlas Atlas GenGen
☺☺
Questions?