Die Präsentation wird geladen. Bitte warten

Die Präsentation wird geladen. Bitte warten

1/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Projektgruppe KIMAS Half-Life 18.06.2003 Lars Tegeler.

Ähnliche Präsentationen


Präsentation zum Thema: "1/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Projektgruppe KIMAS Half-Life 18.06.2003 Lars Tegeler."—  Präsentation transkript:

1 1/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Projektgruppe KIMAS Half-Life 18.06.2003 Lars Tegeler

2 2/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Überblick Half-Life Die Half-Life Welt Programmstruktur Modifikationen Bot´s

3 3/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Half-Life 1997 von Valve Software entwickelt von Sierra On-Line vertrieben Modifikation der Quake Engine basiert auf Quake 1 mit Teile von Quake 2 und eigenen Erweiterungen Einige der Verantwortlichen z.B. Gabe Newell kamen von Microsoft ;-)

4 4/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Half-Life Skeletal Animation System Rendering (16-bit color, colored lighting) Monster AI Decal System Real-Time DSP DLL´s Direct X Single/Multiplayer-Sourcen frei verfügbar Binaries der Engine nur unter Microsoft Windows

5 5/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Überblick Half-Life Die Half-Life Welt Programmstruktur Modifikationen Bot´s

6 6/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Half-Life Welt Die Half-Life Welt besteht aus zwei Arten von Objekten: 1. Solids (Wände, Decken,..., ohne Funktion) 2. Entities Point-based ( statisch, aber auch Monster ) Brush-based ( dynamisch )

7 7/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Half-Life Welt Gleicher Aufbau wie in Quake: Vektoren (für Richtungen, etc.) Maps (Positionierung der Solids und Entities, werden im Editor erzeugt und nach.bsp kompiliert) Binary Space Partitioning (schnelle Datenstruktur für Echtzeitrender- systeme) Kolisionserkennung (über Bounding-Boxes, an Achsen ausgerichtet, werden nicht gedreht)

8 8/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Half-Life Welt Skeletal Animation System Knochen werden bewegt Polygon-Netze um die Knochen werden durch die Bewegung verformt Berechung der Modelle zur Laufzeit Größere Flexibilität wesentlich höhere Anzahl von Polygonen (6000+)

9 9/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Überblick Half-Life Die Half-Life Welt Programmstruktur Modifikationen Bot´s

10 10/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Programmstruktur Code in C++ Server - hl.dll (bzw. mp.dll) Steuern der Entities (Monster, Waffen,...) Client - cl_dll.dll Enthält das gesamte UserInterface DLL (Dynamic Link Library) E rmöglicht einem Prozess eine Funktion zu benutzen die nicht zu seinem Ausführbaren Code gehört

11 11/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Programmstruktur Engine (Half-Life Game Executable) Server (hl.dll /mp.dll) Client-UI (cl_dll.dll) GiveFnptrsToDll() GetEntityAPI() GameDLLInit() Interaktionschema:

12 12/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Programmstruktur Klassendiagramme Server: http://www-math.upb.de/~tegeler/kimas/server_class_diagram.png Client: http://www-math.upb.de/~tegeler/kimas/client_class_diagram.png Vererbung Alle Objekte stammen von CBaseEntity ab (zu finden in cbase.cpp)

13 13/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Überblick Half-Life Die Half-Life Welt Programmstruktur Modifikationen Bot´s

14 14/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Modifikationen Modifikationen (Mod´s) sind Änderungen am Spielablauf, z.B. an: Waffen, Monstern, GUI, Regeln,... Der wohl bekannteste Half-Life Mod´s: Counter-Strike

15 15/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Modifikationen Was benötigt man um aktuelle Half-Life Mod´s zu erstellen? C++ Compiler (der DLL´s erstellen kann die mit den von Microsoft Visual C++ kompatibel sind, z.B. MingW32, MSVC++ 6.0,...) SDK 2.3 (Standart oder Full) Half-Life 1.1.1.0

16 16/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Modifikationen Geschwindigkeit der RPG: DropXP: Rpg.cpp (in FollowThink):... pev->velocity=pev->velocity*10;... Player.cpp (in DropPlayerItem):... CWeaponBox *pWeaponBox = (CWeaponBox *)CBaseEntity::Create(..., Koordinaten,...);...

17 17/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Überblick Half-Life Die Half-Life Welt Programmstruktur Modifikationen Bot´s

18 18/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Bot´s Half-Life bietet keine Schnittstelle für Bot´s Deshalb Implementierung durch: Einbettung des Bot´s in ein Mod DLL´s ausnutzen, und eine Bot.dll zwischen die Engine und dem Server (hl.dll) zu mogeln

19 19/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Bot´s Engine (Half-Life Game Executable) Server (hl.dll /mp.dll) Client-UI (cl_dll.dll) GiveFnptrsToDll() GetEntityAPI() GameDLLInit() Bot (bot.dll) Interaktionschema:

20 20/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Bot´s Der Bot wird mit FakeClient als virtueller Spieler erzeugt, zählt also als Spieler: Bot erzeugen Bot steuern BotEnt=g_engfuncs.pfnCreateFakeClient(Bot);... ClientConnect( BotEnt, BotName, 127.0.0.1, ptr); ClientPutInServer( BotEnt);... pfnRunPlayerMove( BotEnt, BlickRichtung, VorG, RechtsG, HochG, Taste, Impuls, Dauer);...

21 21/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Bot´s Sicht des Bot´s am Beispiel-Code for (i =1; i maxClients; i++) { edict_t *pPlayer = INDEXENT(i); vec2LOS = ( pPlayer->v.origin – pEdict->v.origin).Make2D();... flDot = Dotproduct ( vec2LOS, gpGlobals->v.forward.Make2D() ); if ( flDot > 0.50 ) { //im Sichtfeld UTIL_TraceLine{...}//Line zum Ziel } else {...}//ausserhalb des Sichtfelds }

22 22/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Bot´s aus den Engine-Headerdatein (common\com_model.h): es können also nur 32 Bots erzeugt werden! (bei Quake gab es keine genaue aussage) und 900 Entities insgesamt (ca. genau soviele wie in Quake) #define MAX_CLIENTS 32 #define MAX_EDICTS 900

23 23/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Bot´s Und wenn 32 Agenten nicht genug sind? Bot als eignende Entity programmieren Keine weitern Einschränkungen größer Programmieraufwand Bot als Monster programmieren evtl. Einschränkung durch das erben von CMonster ca. genau so viel wie bei üblichen Bot implementationen

24 24/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Bot´s Unserer KimasBot:

25 25/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Gegenüberstellung FunktionQuakeHalf-Life Bot´s (max)???32 Entities (max)1024900 OpenGL** Direct X* Skeletal Animation System* Rendering8-bit16-bit Colored lighting* Decal System* Real-Time DSP* Maps als BSP** Datenstruktur (Bewegung, Richtung,...) Vektor Ausführbare DateienQuakeVMDLL KollisionserkennungBounding-Boxes

26 26/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Weitere Informationen Half-Life FAQ von Steve Cook: http://www.planethalflife.com/hlsdk2/sdk2_articles.htm Half-Life programming: http://www.planethalflife.com/hlprogramming/tutorials.asp Gamedesign and programming resources: http://www.resourcecode.de Botman´s Homepage: http://www.planethalflife.com/botman/

27 27/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Kommentare im Source Code ;-) TOP3 3: // this is the most hacked, evil, bastardized thing I've ever seen. 2: // this is not a hack or temporary fix, this is how things should be. 1: // Huh?


Herunterladen ppt "1/26 UNIVERSITY OF PADERBORN Projektgruppe KIMAS – Half-Life Projektgruppe KIMAS Half-Life 18.06.2003 Lars Tegeler."

Ähnliche Präsentationen


Google-Anzeigen