Desenvolvendo Games Multiplataforma André Santee (@DecoSantee) -Programador de games da Jera (@JeraSoftware) -Desenvolvo ferramentas e soluções para gamedev Projetos: -Ethanon Engine -GS2D
 
 
 
Pensando multiplataforma -Por quanto tempo você quer que seu código sobreviva? -"Migrar" o código com pouco ou nenhum esforço? É possível?
Ficar preso a uma plataforma pode ser fatal
O código está pronto para novas plataformas? Não? Isso é OK (sério!) E sua equipe?
Existe linguagem flexível assim?
Podemos levar C++ a qualquer lugar
NinJump (Backflip Studios) Pinball Ride (Massive Finger) Angry Birds (Rovio)
Mas C++ não possui garbage collection! C++ possui bibliotecas de templates shared_ptr<>, weak_ptr<>, ...
Já eu, prefiro as linguagens dinâmicas e modernas! Justo! Sem problemas...
Linguagens de scripting...  
Como/Porque funciona
Interfaces (classes virtuais)
class   Texture { public :      virtual   bool   SetTexture ( const   unsigned   int   passIdx   =   0 )   =   0 ;      virtual   math :: Vector2   GetBitmapSize ()   const   =   0 ; protected :      virtual   bool   LoadTexture (          VideoWeakPtr   video ,          const   string &   fileName ,   GS_COLOR   mask ,          const   unsigned   int   width   =   0 ,   const   unsigned   int   height   =   0 ,          const   unsigned   int   nMipMaps   =   0      )   =   0 ; }; class   GLES2Texture   :   public   Texture { public :      GLES2Texture ( VideoWeakPtr   video ,   const   str_type :: string &   fileName );      ~ GLES2Texture ();      bool   SetTexture ( const   unsigned   int   passIdx   =   0 );      math :: Vector2   GetBitmapSize ()   const ; protected :      bool   LoadTexture (          VideoWeakPtr   video ,          const   string &   fileName ,          GS_COLOR   mask ,          const   unsigned   int   width   =   0 ,   const   unsigned   int   height   =   0 ,          const   unsigned   int   nMipMaps   =   0 );      GLuint   m_textureID ; };
Scripting scriptEngine->RegisterGlobalFunction (    &quot;void AddEntity(const string &in)&quot; ,   FUNCTION(engine::AddEntity),   CALL_GENERIC );
Outro modelo possível (também multiplataforma)
 
Mandamentos I - Não utilizarás código específico da plataforma explicitamente dentro do código do game. II - Lembrai do primeiro mandamento, SEMPRE.
Problemas comuns Resoluções de tela:  um desafio em games baseados em sprites Métodos de entrada:  teclado, mouse, dpad, touchscreen... Codificação de strings:  ANSI vs UTF-7 vs UTF-8 vs UTF-16  Suporte a RTTI e Exceptions: &quot;To boost or not to boost?&quot;          
Ferramentas disponíveis hoje Open source: -Qt -Ogre -SDL -Löve -GS2D -Ethanon* Proprietárias: -Unity -Unreal Engine -BatteryTech
www.ethanon.com.br
O futuro é multiplataforma Jamais fique preso a uma única plataforma
Perguntas? André Santee (@DecoSantee)

Desenvolvendo games multiplataforma

  • 1.
    Desenvolvendo Games MultiplataformaAndré Santee (@DecoSantee) -Programador de games da Jera (@JeraSoftware) -Desenvolvo ferramentas e soluções para gamedev Projetos: -Ethanon Engine -GS2D
  • 2.
  • 3.
  • 4.
  • 5.
    Pensando multiplataforma -Porquanto tempo você quer que seu código sobreviva? -&quot;Migrar&quot; o código com pouco ou nenhum esforço? É possível?
  • 6.
    Ficar preso auma plataforma pode ser fatal
  • 7.
    O código estápronto para novas plataformas? Não? Isso é OK (sério!) E sua equipe?
  • 8.
  • 9.
    Podemos levar C++a qualquer lugar
  • 10.
    NinJump (Backflip Studios)Pinball Ride (Massive Finger) Angry Birds (Rovio)
  • 11.
    Mas C++ nãopossui garbage collection! C++ possui bibliotecas de templates shared_ptr<>, weak_ptr<>, ...
  • 12.
    Já eu, prefiroas linguagens dinâmicas e modernas! Justo! Sem problemas...
  • 13.
  • 14.
  • 15.
  • 16.
    class   Texture{ public :      virtual   bool   SetTexture ( const   unsigned   int   passIdx   =   0 )   =   0 ;      virtual   math :: Vector2   GetBitmapSize ()   const   =   0 ; protected :      virtual   bool   LoadTexture (          VideoWeakPtr   video ,          const   string &   fileName ,   GS_COLOR   mask ,          const   unsigned   int   width   =   0 ,   const   unsigned   int   height   =   0 ,          const   unsigned   int   nMipMaps   =   0      )   =   0 ; }; class   GLES2Texture   :   public   Texture { public :      GLES2Texture ( VideoWeakPtr   video ,   const   str_type :: string &   fileName );      ~ GLES2Texture ();      bool   SetTexture ( const   unsigned   int   passIdx   =   0 );      math :: Vector2   GetBitmapSize ()   const ; protected :      bool   LoadTexture (          VideoWeakPtr   video ,          const   string &   fileName ,          GS_COLOR   mask ,          const   unsigned   int   width   =   0 ,   const   unsigned   int   height   =   0 ,          const   unsigned   int   nMipMaps   =   0 );      GLuint   m_textureID ; };
  • 17.
    Scripting scriptEngine->RegisterGlobalFunction (   &quot;void AddEntity(const string &in)&quot; ,   FUNCTION(engine::AddEntity),   CALL_GENERIC );
  • 18.
    Outro modelo possível(também multiplataforma)
  • 19.
  • 20.
    Mandamentos I -Não utilizarás código específico da plataforma explicitamente dentro do código do game. II - Lembrai do primeiro mandamento, SEMPRE.
  • 21.
    Problemas comuns Resoluçõesde tela: um desafio em games baseados em sprites Métodos de entrada:  teclado, mouse, dpad, touchscreen... Codificação de strings:  ANSI vs UTF-7 vs UTF-8 vs UTF-16  Suporte a RTTI e Exceptions: &quot;To boost or not to boost?&quot;          
  • 22.
    Ferramentas disponíveis hojeOpen source: -Qt -Ogre -SDL -Löve -GS2D -Ethanon* Proprietárias: -Unity -Unreal Engine -BatteryTech
  • 23.
  • 24.
    O futuro émultiplataforma Jamais fique preso a uma única plataforma
  • 25.