data driven game development

32
Kostas Anagnostou Game developer Adjunct Lecturer in Videogame Technologies

Upload: kostas-anagnostou

Post on 20-Aug-2015

3.057 views

Category:

Technology


0 download

TRANSCRIPT

Kostas AnagnostouGame developerAdjunct Lecturer in Videogame Technologies

Who am I?

Freelance game developer Adjunct Lecturer in Videogame Technologies,

Ionian University Game Engine programmer at Microsoft Game

Studios (Rare, UK)

What is this talk about?

Making great games!

What is this talk about?

Not really, I don’t have the recipe for that…

What is this talk about?

How to enable talented and creative people to make great games!

How are great games made?

It is a trial-and-error, iterative process. Mechanics and content must be tried and fine

tuned in-game

Who creates a great game?

Game designers and artists mainly All effort in game development must be

focused on making their jobs easier What we call Power to the Artist!

Data-driven development

Decouple game data and logic from game code

Let data determine game behaviour/aesthetics

Make data accessible to all

Data-driven development (DDD)

Data-driven game development requires more initial work

Much easier to hardcode everything! Why should we care?

Benefits of DDD for artists

Much easier to add new content Much easier to add new behaviour Faster iteration times Reduces artist dependency on programmer

Benefits of DDD for programmers Tighter, easier to maintain code Flat class hierarchy

No artists bugging us! No artists bugging us!

Scott Shumaker, Outrage Games

Elements that can be data-driven

Level design/content Game object data/behaviour UI/localisation Game configuration

How can data affect game behaviour?

Data driven development goes nicely with a Component-based engine architecture

Game Entities are just containers Data specify which components/functionality

are required

Scott Shumaker, Outrage Games

Requirements of DDD

Some form of data description Efficient and artist-friendly tools

Levels of Data driven development

#define ENEMY_KAMIKAZE_HP 20

void ApplyEnemyDamage(Enemy* enemy)

{

if (enemy->Type == ENEMY_KAMIKAZE)

{

enemy->Shield -= ENEMY_KAMIKAZE_HP;

}

}

Levels of Data driven development

File: EnemyHitPoints.txt

ENEMY_KAMIKAZE_HP 20

ENEMY_KILLER_HP 10

ENEMY_BRUTE_HP 2

ENEMY_BOSS2_HP 2

…..

Levels of Data driven developmentFile: EnemyDefinitions.xml<?xml version="1.0"?><enemies>

<enemy type="Warrior" texture="enemies_sheet.png" shield="100" speed="30" weapon="Laser" explosion="Muffled">

<frames interval="0.3"><frame x="0" y="0" w="32" h="32"></frame><frame x="32" y="0" w="32" h="32" />

</frames></enemy><enemy type="Kamikaze" texture="enemies_sheet.png" shield="50" speed="40" weapon="" explosion="Strong">

<frames interval="0.3"><frame x="0" y="32" w="32" h="32" /><frame x="32" y="32" w="32" h="32" />

</frames></enemy>

</enemies>

JSON is quite trendy too!JSON is quite trendy too!

Levels of Data driven development

First taste of Data Driven Development At Rare we focused on the content pipeline a

lot! Extensive framework built around Maya and

the in-house game engine. The artist could fully customize assets in Maya One click asset deployment Enabled iterative development

First taste of Data Driven Development Rare’s solution focused on data/game entity

customization No game engine support for

components/data driven behaviour Still, artist empowerment was huge!

Space Debris by Rotten Fish GamesSpace Debris by Rotten Fish Games

Space Debris is a retro Space Shoot’em UpSpace Debris is a retro Space Shoot’em Up Designed for smartphones (iPhone and later Designed for smartphones (iPhone and later

Android)Android) 15 multilayered levels in total, tens of 15 multilayered levels in total, tens of

enemies, lots of weapon/weapon upgrades, enemies, lots of weapon/weapon upgrades, bonuses, animations etcbonuses, animations etc

We relied on a data-driven system to set all We relied on a data-driven system to set all that up.that up.

Data-Driven system design

Game Entity is a container for data/behaviour By default only supports transform/rendering Designer can add weapons, animations, sprite

animations, bonuses, upgrades, sound effects, explosions etc externally

Game stats are set externally as well

Hierarchical structure of XML files

Level.xml

spritesheets.xmlanimations.xml

spawners.xml bonuses.xml enemies.xml

explosions.xml

Sample XML definitions layout<?xml version="1.0"?><stages> <stage name="stage1" spritesheets="spritesheets.xml" enemies = "enemies.xml" spawners = "spawners.xml" weapons = "weapons.xml" animations = "animations.xml" bonuses = "bonuses.xml" explosions = "explosions.xml" > <levels>

<level name= "s1level1" file= "tilemap_s1l1.tmx" music = "STAGE1_LEVEL_1.mp3"> </level> <level name= "s1level2" file= "tilemap_s1l2.tmx" music = "STAGE1_LEVEL_2.mp3"> </level> </levels> </stage></stages>

Enemy definitions

Bonus definitions

Level tilemap

Sample XML definitions layout<?xml version="1.0"?><spawners> <spawner type="S1LNKamikazeeHunterChase" enemytype="Kamikazee_Hunter" spawn="Chase" animation=“ZigZag" number="6" rate="2" bonus="Invisibility"> </spawner></spawners>

<?xml version="1.0"?><enemies> <enemy type="Kamikazee_Hunter"> <parts>

<part sprite="alien_kamikazee_hunter“ shield="1" weapon="EnemyKamikazee1" explosion="MediumExplosion"> </part> </parts> </enemy></enemies>

<?xml version="1.0"?><spritesheets> <spritesheet name="spritesheet_normal.png"> <sprite name="alien_kamikazee_hunter"> <frames interval="0.3"> <frame x="432" y="96" w="48" h="48"></frame> <frame x="0" y="144" w="48" h="48"></frame> </frames> </sprite> </spritesheet></spritesheets>

<?xml version="1.0"?><animations> <animation name="SPath" type="Bezier" track="Player"> <parts count=“3"> <part p0="0 0" p1="1 0" p2="1 -0.25" p3="0 -0.25" duration="3"></part> <part p0="0 0" p1="-1 0" p2="-1 -0.25" p3="0 -0.25" duration="3"></part> <part p0="0 0" p1="1 0" p2="1 -0.25" p3="0 -0.25" duration="3"></part> </parts> </animation></animations>

Sample XML definitions layout<?xml version="1.0"?><spawners> <spawner type="S1LNKamikazeeHunterChase" enemytype="Kamikazee_Hunter" spawn="Chase" animation=“SPath" number="6" rate="2" bonus="Invisibility"> </spawner></spawners>

<?xml version="1.0"?><enemies> <enemy type="Kamikazee_Hunter"> <parts>

<part sprite="alien_kamikazee_hunter“ shield="1" weapon="EnemyKamikazee1" explosion="MediumExplosion"> </part> </parts> </enemy></enemies>

<?xml version="1.0"?><spritesheets> <spritesheet name="spritesheet_normal.png"> <sprite name="alien_kamikazee_hunter"> <frames interval="0.3"> <frame x="432" y="96" w="48" h="48"></frame> <frame x="0" y="144" w="48" h="48"></frame> </frames> </sprite> </spritesheet></spritesheets>

<?xml version="1.0"?><animations> <animation name="SPath" type="Bezier" track="Player"> <parts count=“3"> <part p0="0 0" p1="1 0" p2="1 -0.25" p3="0 -0.25" duration="3"></part> <part p0="0 0" p1="-1 0" p2="-1 -0.25" p3="0 -0.25" duration="3"></part> <part p0="0 0" p1="1 0" p2="1 -0.25" p3="0 -0.25" duration="3"></part> </parts> </animation></animations>

Game data specification

Game data specification

Experiences from the DD system

Programmer becomes obsolete! Designer can iterate level design faster Easier for the team to work remotely Cleaner code, almost flat Class hierarchy

A few weaknesses

Some initial coding overhead We should have used a visual editor XML files not artist friendly enough Tiled editor was a halfway solution

Let’s wrap it up!

DDD can benefit even small teams Content decoupling and iteration are

important Some coding overhead, usually acceptable Need good tools to exploit DDD fully Give power to the artist to express herself!

Thank you for listening!

Kostas [email protected]