parte i - osorio.wait4.orgosorio.wait4.org/gdk/semcomp11-gdk-partei.pdf · 14h-18h00 projeto de um...
TRANSCRIPT
1
Outubro 2008
1
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
Prof. Fernando Santos Prof. Fernando Santos OsOsóóriorioProfaProfa . . KalinkaKalinka CasteloCastelo BrancoBrancoEmail: Email: fosoriofosorio [at] { [at] { icmcicmc . . uspusp . . brbr , , gmailgmail . com }. com }
kalinkakalinka [at] { [at] { icmcicmc . . uspusp . . brbr }}Material Material ComplementarComplementarPPááginagina Web: http://Web: http:// www.icmc.usp.br/~fosoriowww.icmc.usp.br/~fosorio //
Desenvolvimento RDesenvolvimento R áápido de Jogos em 3Dpido de Jogos em 3DUsando o Dark GDK com o Microsoft Visual C/C++
(Game RAD - Rapid Application Development )
Parte I15/10/08
Outubro 2008
2
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
Agenda
Temas Abordados:8h00-12h00 Introdução ao Desenvolvimento Rápido de Jogos
Ferramenta Dark GDK / TheGameCreators
Demonstração: Exemplos de Jogos feitos com o GDK
Introdução a Linguagem Dark GDK – Programação em C++
Hands-On: Criando Jogos em 3D!
14h-18h00 Projeto de um Jogo e Ferramentas Complementares
> Design Doc., Modelagem 3D, Som, Texturas, Animações
Técnicas de Desenvolvimento de Jogos
> Cenário: Skybox, Terrenos, BSP
> Atores: Movimentação, Animação, Ações, Comportamento
> Colisão: Cenário, Objetos, Atores, Gravidade
Jogos Multi-Player
> Conexão em Rede: P2P, Cliente-Servidor, MMOG
2
Outubro 2008
3
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:
Conceitos de Programação RAD para Jogos
Conceito de... BIBLIOTECA => LIBs, DLLs. Bibliotecas de
Gráficos 2D e 3D, Áudio (sons, músicas)
Interface, Rede/Multiplayer, Física, I.A.
ENGINE => Integração de Ferramentas e Bibliotecas
Ogre3D, Crystal Space, UnReal Engine, ...
Editores de Cenários, Editores de Nível, ...
Ferramenta RAD => Biblioteca + Engine + Ambiente Integrado
Ferramentas de Apoio + Simplicidade de Programas
Exemplos de BIBLIOTECAS, ENGINES e FERRAMENTAS RAD
Outubro 2008
4
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:
Conceitos de Programação RAD para Jogos
Conceito de... BIBLIOTECA => LIBs, DLLs. Bibliotecas de
Gráficos 2D e 3D, Áudio (sons, músicas)
Interface, Rede/Multiplayer, Física, I.A.
ENGINE => Integração de Ferramentas e Bibliotecas
Ogre3D, Crystal Space, UnReal Engine, ...
Editores de Cenários, Editores de Nível, ...
Ferramenta RAD => Biblioteca + Engine + Ambiente Integrado
Ferramentas de Apoio + Simplicidade de Programas
Exemplos de BIBLIOTECAS, ENGINES e FERRAMENTAS RAD
3
Outubro 2008
5
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:
Conceitos de Programação RAD para Jogos
Conceito de... BIBLIOTECA => LIBs, DLLs. Bibliotecas de
Gráficos 2D e 3D, Áudio (sons, músicas)
Interface, Rede/Multiplayer, Física, I.A.
ENGINE => Integração de Ferramentas e Bibliotecas
Ogre3D, Crystal Space, UnReal Engine, ...
Editores de Cenários, Editores de Nível, ...
Ferramenta RAD => Biblioteca + Engine + Ambiente Integrado
Ferramentas de Apoio + Simplicidade de Programas
Exemplos de BIBLIOTECAS, ENGINES e FERRAMENTAS RAD
Outubro 2008
6
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:
Exemplos de BIBLIOTECAS, ENGINES e FERRAMENTAS RAD
BIBLIOTECAS
OpenGL, DirectX, OSG, ODE, Allegro, SDL, SDL-Net, OpenAL, ...
ENGINES, TOOLKITS (SKD) [Framework]
Ogre3D, Crystal Space, UnReal Engine, Irrlich, Game Blender, Torque, …
Wikipedia - http://en.wikipedia.org/wiki/List_of_game_engines
Ferramentas RAD
[YoYo Games] GameMaker
[TheGameCreators - TGC]
DarkBasic Professional
Dark GDK (SDK)
3D Game Maker
FPS Creator
[3D RAD] 3D RAD
João Bittencourt, 2006
4
Outubro 2008
7
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:
http://www.garagegames.com/products/torque/
Outubro 2008
8
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:
http://www.3drad.com/
5
Outubro 2008
9
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:
http://www.3drad.com/
Outubro 2008
10
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:
http://www.yoyogames.com/gamemaker/
6
Outubro 2008
11
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:
http://www.fpscreator.com/
Outubro 2008
12
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:
http://t3dgm.thegamecreators.com/
Just Click to Create
Now anyone can build their ideal game in seconds. With just one click of a mouse, you can create a uniquely playable game…without needing any programming knowledge or artistic skills at all.
Offering over 12 billion gaming options, The 3D Gamemaker opens up a whole new concept in gaming, providing fun for all the family.
7
Outubro 2008
13
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:
http://darkbasicpro.thegamecreators.com/
Outubro 2008
14
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:http://darkbasicpro.thegamecreators.com/
8
Outubro 2008
15
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:
BIBLIOTECASENGINESSDKsTOOLKITSFRAMEWORKSFERRAMENTAS RAD PARA JOGOS...
Diversas e Variadas Opções!
Qual escolher?!?!
Outubro 2008
16
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:DARK GDK - http://gdk.thegamecreators.com/
9
Outubro 2008
17
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:
DARK GDK - http://gdk.thegamecreators.com/
Dark GDK porque...
- É uma ferramenta SDK-Toolkit com recursos de Game RAD- É a versão do DarkBasic Professional “DBPro” (Basic) em C/C++- É distribuída gratuitamente junto ao Visual Studio Express 2008- A Microsoft adotou como ferramenta RAD para Jogos- Encontramos muitos exemplos de código aberto...- Encontramos muitos modelos 3D compatíveis com a ferramenta...- Possui uma linguagem simples, completa e fácil de ser usada...
Outubro 2008
18
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
GAME RAD
Desenvolvimento Rápido de Jogos – Game RAD:
DARK GDK - http://gdk.thegamecreators.com/
Dark GDK porque...
- É uma ferramenta SDK-Toolkit com recursos de Game RAD- É a versão do DarkBasic Professional “DBPro” (Basic) em C/C++- É distribuída gratuitamente junto ao Visual Studio Express 2008- A Microsoft adotou como ferramenta RAD para Jogos- Encontramos muitos exemplos de código aberto...- Encontramos muitos modelos 3D compatíveis com a ferramenta...- Possui uma linguagem simples, completa e fácil de ser usada...
PORQUE, AFINAL, VOCÊ SE INSCREVEU NESTE CURSO!
10
Outubro 2008
19
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
TGC / DARK GDKDARK GDK http://gdk.thegamecreators.com/
Características: Dark GDK features
* Use virtually all of the DarkBASICProfessional 5.9 functions from within C++
* Works with Microsoft Visual C++ 2008 Express* Small EXE size (starting at 1.8 MB with the
3D engine invoked)* 6 types of 2D Image Formats Supported* 5 types of 3D Object File Formats Supported* Over 1000 game orientated commands* Binary Space Partioning (BSP) Support* Potential Visibility Set (PVS)* Nodetree Optimisation* Bump Mapping* Light Mapping* Environment Mapping* Sphere Mapping* Cubic Mapping* Multi-texturing* Bone Based Animations* Pixel and Vertex Shaders
* Cartoon Shading* Rainbow Rendering*Code your own Shaders* Vector and Matrix Manipulation* Real Time Shadows* True Reflections* Lights (Omni, Spot, Directional)* Matrices and Terrains* Particle System* Extremely fast 2D Sprites* Polygon Collision and Response* Create Multi-player Games (Lan and Internet)* Fully Windows XP compliant* 3D Studio and Direct X Object Support* Sprite support including flipping, scaling and collision* Set and control sounds in 3D space* Load, Play and Loop Music files* Control 3D Fog depth, distance and colour* Full Object Rotation control* Control Object Limbs (direction, angle, rotation, size)* Create and Delete Object Meshes* Global or Object based automatic 3D Collision Detection* Automatic Camera and Camera
to Object Orientation Commands* Create, Position and Colour Lights* Build, Texture and Map Matrix Landscapes* System Test Commands let you check for compatibility
Outubro 2008
20
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
TGC / DARK GDKDARK GDK http://gdk.thegamecreators.com/
11
Outubro 2008
21
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
DARK GDK / DBPro ExemplosMatheus Winter
Outubro 2008
22
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
DARK GDK / DBPro Exemplos
Programas utilizados� DarkBasic Professional 1.057� Terragen 0.9� 3D Canvas 6.5.1.0 (Freeware Edition)� Terranim 2.1.4� MatEdit 1.6b� Wav MP3 Editor 10.1� VirtualDubMod 1.5.10.1� Capture Solution 8.1� Tasker 3.13
12
Outubro 2008
23
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
DARK GDK / DBPro Exemplos Bruno FerreiraNelson Florisbal
Outubro 2008
24
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
DARK GDK - Instalação
http://gdk.thegamecreators.com/?f=downloads
Visual C++ 2008 ExpressDirectX 9.0c SDK August 2007Dark GDK
13
Outubro 2008
25
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
DARK GDK - Instalação
http://gdk.thegamecreators.com/?f=downloads
Dicas... By F.S.O
HOW TO INSTALL...
1) Install Visual C++ Express (execute this once... you should start VC++ one time before to continue)
2) Install DirectX SDK (SDK not only run-time)3) Install GDK from The Game Creators
4) Copy: wizard/Project to My Documents
5) Enter in Visual C++: Tools - OptionsSet Include pathSet Libs path
DONE!
Outubro 2008
26
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
DARK GDK - Instalação
http://gdk.thegamecreators.com/?f=downloads
Dicas... By F.S.O
HOW TO INSTALL...
4) Copy: …\Dark GDK\Wizards\Project To \My Documents
Copy files... …\Dark GDK\Wizards\Project If you are using a Portuguese version of Windows, pleasecreate a My Documents directory!
Example: for the user FOSORIO
C:\Documents and Settings\fosorio\Meus documentos\ andC:\Documents and Settings\fosorio\My Documents\
COPY:C:\Arquivos de programas\The Game Creators\Dark GDK\WizardsTO:C:\Documents and Settings\fosorio\My Documents\Visual Studio 2008\Wizards
14
Outubro 2008
27
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
DARK GDK - Instalação
http://gdk.thegamecreators.com/?f=downloads
Dicas... By F.S.O
HOW TO INSTALL...
5) Enter in Visual C++: Tools - OptionsSet Include pathSet Libs path
To see how to configure the paths,Follow the "instructions.pdf" And see the screen-captures:Add-Include-in-Tools-Option.jpgAdd-Libs-in-Tools-Option.jpg
I also edited this file:C:\Arquivos de programas\The Game Creators\Dark GDK\Wizards\Projects\
\Dark GDK - Game\Dark GDK - Game.vsz
=> Replace in the text Mike by Fosorio :-)
Outubro 2008
28
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
15
Outubro 2008
29
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
Outubro 2008
30
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
DARK GDK - Instalação
http://gdk.thegamecreators.com/?f=downloads
Usando o GDK:
1. Veja o HELPC:\Arquivos de programas\The Game Creators\Dark GDK\Documentation
2. Veja os exemplos...C:\Arquivos de programas\The Game Creators\Dark GDK\TutorialsC:\Arquivos de programas\The Game Creators\Dark GDK\Samples
3. Use os arquivos de mídia... (objetos, audio, etc)C:\Arquivos de programas\The Game Creators\Dark GDK\MediaC:\Arquivos de programas\The Game Creators\DarkMATTER2 [PAGO]Acesse o TurboSquid: http://www.turbosquid.com/ [Modelos Pagos e Gratuitos]
16
Outubro 2008
31
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
DARK GDK – Meu primeiro programa...
Crie um projeto novo no Visual C++ 2008 Express Edition
Outubro 2008
32
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
DARK GDK – Meu primeiro programa...
Crie um projeto tipo: Dark GDK - Game
17
Outubro 2008
33
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
DARK GDK – Meu primeiro programa...
Crie um projeto tipo: Dark GDK - Game
// Dark GDK - The Game Creators - www.thegamecreators.com
// The wizard has created a very simple project that uses Dark GD. It contains the basic code for a GDK application// whenever using Dark GDK you must ensure you include the header file#include "DarkGDK.h"
// the main entry point for the application is this functionvoid DarkGDK ( void ){
// turn on sync rate and set maximum rate to 60 fpsdbSyncOn ( );dbSyncRate ( 60 );
// our main loopwhile ( LoopGDK ( ) ){
// update the screendbSync ( );
}
// return back to windowsreturn;
}
Outubro 2008
34
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
DARK GDK – Meu primeiro programa...
Crie um projeto tipo: Dark GDK - Game
// Esqueleto Dark GDK
#include "DarkGDK.h"
void DarkGDK ( void ){
dbSetWindowOff ();dbHideMouse();
while ( LoopGDK ( ) ){
// Loop do Jogo
}
return; // FIM}
18
Outubro 2008
35
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
DARK GDK – Meus primeiros programas...
Dark GDK – HANDs ON!
Ex1-Cubo1 => Cubo3DEx1-Cubo1 => Cubo3D com CorEx1-Cubo2 => Cubo3D com TexturaEx1-Cubo3 => Cubo3D com Rotação (animação)
Ex2-Esfera => Esfera3D com TexturaEx2-Esfera1 => Esfera3D com Textura adaptada e FundoEx2-Esfera2 => Esfera3D Rotacionando nos 3 eixosEx2-Esfera3 => Controle pelo teclado: wireframe
Ex3-Camera => Esfera + Câmera Virtual / Teclado (shift/control)Ex3-Camera1 => Controle da altura da câmera
Ex4-Plano => Cria um plano de referência (Matrix)Ex4-Plano1 => Reposiciona o MatrixEx4-Plano2 => Aplica uma textura no Matrix
Outubro 2008
36
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK
DARK GDK
DARK GDK – Meus primeiros programas...
Dark GDK – HANDs ON!
Ex5-Obj3D => Troca Esfera por Objeto3D (XWing)Space/Return, Shift/Control
Ex5-Obj3D1 => Ajuste de escala e posiçãoEx5-Obj3D2 => Controle da Nave:
R = RotateQ/W, A/Z = Controle direçãoI,J,K,M = Avanço, Giro
DEMOS:
> ShowObj > Cubo de Cubos> ShowAnim (mummy) > Abertura> ShowXAnim > Planetas> ShowBSP > Terreno> ExploreBSP> Matrix com elevação COMANDOS GDK
19
Outubro 2008
37
JEDIJEDI - JJogos e ogos e EEntretenimento ntretenimento DiDigitalgitalProf. Osório / USP-ICMC / Out. 2008
DarkDarkGDKGDK INFORMAÇÕES SOBRE O MINI-CURSO
USP USP -- Universidade de São Paulo Universidade de São Paulo -- São Carlos, SPSão Carlos, SPICMC ICMC -- Instituto de Ciências MatemInstituto de Ciências Matem ááticas e de Computaticas e de Computa çção ão SSC SSC -- Departamento de Sistemas de ComputaDepartamento de Sistemas de Computa ççãoão
Prof. Fernando Santos OSProf. Fernando Santos OS ÓÓRIO RIO –– ProfaProfa . . KalinkaKalinka Castelo BrancoCastelo BrancoWeb institucional: http://www.icmc.usp.br/ssc/Web institucional: http://www.icmc.usp.br/ssc/PPáágina pessoal: http://www.icmc.usp.br/~fosorio/ gina pessoal: http://www.icmc.usp.br/~fosorio/ EE--mail: mail: fosoriofosorio [at] [at] icmcicmc . usp. . usp. brbr ou ou fosoriofosorio [at] [at] gmailgmail . Com. Com
kalinkakalinka [[atat] ] icmcicmc . . uspusp . . brbr
SEMCOMP 11 SEMCOMP 11 -- Outubro 2008 Outubro 2008 MiniMini --CursoCursoDesenvolvimento RDesenvolvimento R áápido de Jogos em 3D: pido de Jogos em 3D: Usando o GDK com o Microsoft Visual C/C++ (Game RAD )Usando o GDK com o Microsoft Visual C/C++ (Game RAD )