Multyplatform and mono part 2 - Matteo Nicolotti

21
ROME 11-12 April 2014 – Matteo Nicolotti To realize such a complex game as D&D with only two full time people we had to make use of all the tools we could afford: GAME DESIGN, MAPPING, SCRIPTING FORMAT CONVERSION TO XML CONVERSION TO COMPACT BINARIES XBOX PC-WIN W8,WP IOS ANDROID RPG-Maker .Net Ruby What’s behind D&D?

description

Slides form Matteo Nicolotti talk @Codemotion roma 2014

Transcript of Multyplatform and mono part 2 - Matteo Nicolotti

Page 1: Multyplatform and mono part 2 - Matteo Nicolotti

ROME 11-12 April 2014 – Matteo Nicolotti

To realize such a complex game as D&D with only two full time people we had to make use of all the

tools we could afford:

GAME DESIGN,

MAPPING, SCRIPTING

FORMAT CONVERSION

TO XML

CONVERSION TO

COMPACT BINARIES

XBOX

PC-WIN

W8,WP

IOS

ANDROID

RPG-Maker

.Net

Ruby

What’s behind D&D?

Page 2: Multyplatform and mono part 2 - Matteo Nicolotti

Developing a game in C#

● Strongly Typed language

● Power and ease of use of VS .Net and c#

● DirectX + Garbage Collection = FUN

● Natively on XBox,Windows e Windows Phone

● Many free tutorials,samples and books.

ROME 11-12 april 2014 – Matteo Nicolotti

Page 3: Multyplatform and mono part 2 - Matteo Nicolotti

C#

.Net

XNA

XBOX 360

PC

WIN

WIN

PHONE

ROME 11-12 april 2014 – Matteo Nicolotti

Page 4: Multyplatform and mono part 2 - Matteo Nicolotti

C#

.Net

XNA

XBOX 360

PC

WIN

WIN

PHONE

ROME 11-12 april 2014 – Matteo Nicolotti

Page 5: Multyplatform and mono part 2 - Matteo Nicolotti

Multiplatforming an XNA game

C#

.Net

XNA

C#

Mono

MonoGame

XBOX 360

PC

WIN

iOS,

MacOS

PSM

Linux

ANDROID

WIN 8

WIN

PHONE

ROME 11-12 april 2014 – Matteo Nicolotti

Page 6: Multyplatform and mono part 2 - Matteo Nicolotti

So what is Monogame?

Monogame is an Open Source Library of XNA compatible functions.

One source code for all the platforms !

ROME 11-12 april 2014 – Matteo Nicolotti

Page 7: Multyplatform and mono part 2 - Matteo Nicolotti

MonoGames you might know

Monogame is currently used in many well known games:

Infinite Flight

Skulls of The Shogun

Bastion

Fez

Draw a Stickman : Epic

Armed

Have all been developed using Xna and Monogame.

ROME 11-12 april 2014 – Matteo Nicolotti

Page 8: Multyplatform and mono part 2 - Matteo Nicolotti

Using Open Source is cool!

Advantages of using Open Source tools to develop a video-game:

● Optimize, specialize and add features without workarounds (i.e. adding

support to a specific file format)

● constant updating, optimization and debugging of libraries

● Volounteers add constantly new platforms (recent news is that PS4 and XB1

will be supported by the end of 2014)

● less hassles = more game programming

ROME 11-12 april 2014 – Matteo Nicolotti

Page 9: Multyplatform and mono part 2 - Matteo Nicolotti

IDE compatibili

Visual C# Express 2010

Windows Phone SDK

Visual Studio Pro 2010-12-13

VS Express and VS Pro 2012-13

Xamarin Studio*

Monodevelop

ROME 11-12 april 2014 – Matteo Nicolotti

Page 10: Multyplatform and mono part 2 - Matteo Nicolotti

Where to start?

● Official site is monogame.net– Installer for Visual Studio

– Forums

– Documentation

● Repository is at github.com/mono/MonoGame– Clone or download zipped source

ROME 11-12 april 2014 – Matteo Nicolotti

Page 11: Multyplatform and mono part 2 - Matteo Nicolotti

ROME 11-12 april 2014 – Matteo Nicolotti

Page 12: Multyplatform and mono part 2 - Matteo Nicolotti

The XNA Loop

XNA Game's loop consists of an Update and Draw methods, depending on our choice

they can be called exactly once each frame (with a variable Time-Step duration) or

the game class might be given a fixed Time-Step to respect.

To expand our game we have two options:

1 We can create a new class (for example a SceneManager or a Scene itself) that

inherits the XNA DrawableGameComponent class and add it to our game's

GameComponents collection.

2 We can implement our logic directly in our game's Update and Draw method.

ROME 11-12 april 2014 – Matteo Nicolotti

Page 13: Multyplatform and mono part 2 - Matteo Nicolotti

ROME 11-12 april 2014 – Matteo Nicolotti

goo.gl/zvNqhP

Page 14: Multyplatform and mono part 2 - Matteo Nicolotti

Content Loading in XNA-MG

Content Management is an issue in Multiplatform games as different platforms have

different optimization for file formats (ie. Android => ogg, Apple => m4a

)

For mobile games with a large amount of content like Doom & Destiny, pre-built binary

content will easily skyrocket package size over 200 MB.

ROME 11-12 april 2014 – Matteo Nicolotti

CLASS WINDOWS LINUX MACOS IOS ANDROID WINDOWSPHONE

Texture2D .xnb .png .jpg .tiff

.xnb .png .jpg

.tiff.xnb .png .jpg .tiff

.xnb .png .jpg

.tiff.xnb .png .jpg .tiff

.xnb .png .jpg

SoundEffect .xnb .wav .xnb .wav .xnb .wav .xnb .wav .m4a

.wav .mp3

.ogg.xnb

Song .xnb .wav .xnb .wav .mp3

.xnb .mp3 .xnb .m4a .mp3 .ogg .xnb

Model .xnb .xnb .xnb .xnb .xnb .xnb

Effect .xnb** .xnb** .xnb** .xnb** .xnb** .xnb**

SpriteFont .xnb .xnb .xnb .xnb .xnb .xnb

Page 15: Multyplatform and mono part 2 - Matteo Nicolotti

What about the physics?

Farseer Physics Engine is a collision

detection system with realistic physics

responses.

Inspired by Box2D, compatible with XNA

and MonoGame.

Implementation can be as simple as

instancing a new physic “World”, adding

bodies to it and calling its update method.

ROME 11-12 april 2014 – Matteo Nicolotti

goo.gl/E3HYOs

Page 16: Multyplatform and mono part 2 - Matteo Nicolotti

Why should i learn XNA/MG?

Actually XNA is no longer supported by Microsoft so there is no reason to keep it as a main engine,

unless you seriously rock with it, like we do :)

On the contrary Monogame is still a vibrant community and with its open source mind can be the

primary learning tool for all the young guns out there. The MG core connects directly to the native

methods of each platforms using only OpenTK bindings to invoke the OpenGl and OpenAl

methods.

Aside that, the powerful Visual Studio IDE and Debugging environment allows quick debugging of

complex code, logging and fast device deployment.

If licensing prices are a problem, XNA and Monogame are completely free on all platforms but on

Ios and Android, where an Indie license costs about 300$ per platform for Xamarin Studio IDE or

1000$ per platform to get Visual Studio Professional and TFS support.

ROME 11-12 april 2014 – Matteo Nicolotti

Page 17: Multyplatform and mono part 2 - Matteo Nicolotti

ROME 11-12 April 2014 – Matteo Nicolotti

Platforms: Xbox 360, Windows, Linux, Mac, Windows Store, WP, IOS, Android

Total Development Time: 2 years

People Involved: 1 programmer 1 game designer

Doom & Destiny

goo.gl/0i5N1x

Page 18: Multyplatform and mono part 2 - Matteo Nicolotti

ROME 11-12 April 2014 – Matteo Nicolotti

Platforms: Xbox 360, Windows

Total Development Time: 4 weeks

People Involved: 1 programmer 1 game designer

Miner Warfare

Page 19: Multyplatform and mono part 2 - Matteo Nicolotti

ROME 11-12 April 2014 – Matteo Nicolotti

Platforms: Xbox 360, Windows

Total Development Time: 4 months

People Involved: 1 programmer 2 game designer 1 artist

Spyleaks

Page 20: Multyplatform and mono part 2 - Matteo Nicolotti

ROME 11-12 April 2014 – Matteo Nicolotti

Platforms: Windows Phone, Android

Development Time: 1 week

People Involved: 1 programmer 1 game designer 2 artists 1 music artist

DKLB

goo.gl/OYCh5h

Page 21: Multyplatform and mono part 2 - Matteo Nicolotti

Domande?