Upload
lenguyet
View
223
Download
0
Embed Size (px)
Citation preview
slide 1gaius
Coursework 2 support
you can either modify quake 1 or quake 3 for the coursework. I’dadvice modifying quake3.
you can download the quake 1 engine and extract it from the commandline using the following commands:
$ cd Desktop
$ wget http://floppsie.comp.glam.ac.uk/download/c/darkplaces-20090128-gore.tar.gz
$ tar zxf darkplaces-20090128-gore.tar.gz
or you could download the quake 3 engine using these commands:
$ cd Desktop
$ wget http://floppsie.comp.glam.ac.uk/download/c/ioquake-20141114.tar.gz
$ tar zxf ioquake-20141114.tar.gz
slide 2gaius
Coursework 2 support
note that the data sets are not included, see later on for how the data isintroduced
slide 3gaius
Coursework Quake 1 texture modifications
if you want to run quake 1 you will need to create the data files. This isbest performed on the server, so:
$ ssh mcgreg.comp.glam.ac.uk
Password: yourpassword
$ initbaseq1
$ exit
from the command line
slide 4gaius
Coursework Quake 1 texture modifications
we will now download the improved textures for the darkplaces (quake1) engine and extract them so we can edit them later
again this is best done on the server, so
open up a command terminal and type the following:
$ ssh mcgreg.comp.glam.ac.uk
Password: secret
$ cd $HOME/.darkplaces/id1
$ wget http://floppsie.comp.glam.ac.uk/download/c/textures.tar.gz
$ tar zxf textures.tar.gz
$ exit
these image files can be edited usinggimp or equivalent tools
now we need to build the darkplaces engine (quake 1)
this must be done on the client not the server
slide 6gaius
Coursework Quake 1 texture modifications
open up a command line terminal and type:
$ cd Desktop
$ cd darkplaces-20090128
$ make sdl-debug
slide 7gaius
Run the quake 1 engine
open up a terminal and type:
$ cd Desktop
$ cd darkplaces-20090128
$ ./darkplaces-sdl
slide 8gaius
Modifying the Darkplaces game engine
extensive modifications have been made to the original Quake gameengine - the result is darkplaces
we will try and change engine in a trivial way:
navigate to the file:Desktop/darkplaces-20090128/cl_particles.c and open itup in an editor
slide 9gaius
Modifying the Darkplaces game engine
move to line170 and here you will see some configuration valueswhich control the particles in darkplaces
enable some of boolean values by changing0’s to 1’s and now bytrial and error try adjusting some of the values of particle variablessee if you can introduce your owngore variable and make itincrease various particle effects, more blood, more smoke, greaterlength of time before bullet holes disappear etcfeel free to modifydarkplaces in any other way
slide 10gaius
Some previous modifications to original Quake (notdarkplaces)
these notes might be useful to gain a flavour of how to modifify quakenote they do not directly apply to darkplaces
slide 11gaius
Introducing gore into the original quake engine (notdarkplaces)
firstly add a console function: in the filer_main.c
void R_Gore_f (void)
{
if (gore) {
gore = false;
Con_Printf("gore off\n");
} else {
gore = true;
Con_Printf("gore on\n");
}
}
slide 12gaius
Introducing gore into the original quake engine (notdarkplaces)
add new command to the filer_main.c inside the function:R_Init
Cmd_AddCommand ("gore", R_Gore_f);
add a boolean variable (external declaration) tocommon.h
extern qboolean gore;
slide 13gaius
Introducing gore into the original quake engine (notdarkplaces)
declare and initialise the variable insidecommon.c
qboolean gore = false;
slide 14gaius
Introducing gore into the original quake engine (notdarkplaces)
inside the function
void COM_InitArgv (int argc, char **argv)
add a test for the presence of the command line option-gore
...
if (COM_CheckParm ("-gore")) {
gore = true;
}
...
slide 15gaius
Now for the fun... modify R_ParticleExplosion2 (notdarkplaces)
void R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength)
{
int i, j;
particle_t *p;
int colorMod = 0;
int multiplier=1;
if (gore)
multiplier = 2;
for (i=0; i<512*multiplier; i++) {
if (!free_particles)
return;
p = free_particles;
free_particles = p->next;
p->next = active_particles;
active_particles = p;
p->die = cl.time + 0.3;
p->color = colorStart + (colorMod % colorLength);
colorMod++;
...
slide 16gaius
Now for the fun... modify R_ParticleExplosion2 (notdarkplaces)
p->type = pt_blob;
for (j=0 ; j<3 ; j++) {
p->org[j] = org[j] + ((rand()%32)-16);
if (gore)
p->vel[j] = (rand()%512)-256;
else
p->vel[j] = (rand()%1024)-512;
}
}
}
}
slide 17gaius
Quake II
Quake II takes place in a science fiction environment
in the single-player game, the player is a human soldierknown only by his alias, ’Bitterman’ taking part in ’OperationAlien Overlord’a desperate attempt to protect Earth from alien invasion bylaunching a counter-attack on the home planet of the hostilecybernetic Strogg civilisationmost of the other soldiers are captured or killed almost as soon asthey enter the planet’s atmosphere, so it falls upon the player topenetrate the Strogg capital city alone and ultimately to assassinatethe Strogg leader, the Makronfurther reading⟨http://en.wikipedia.org/wiki/Quake_II⟩
slide 18gaius
Technical aspects of Quake II
unlike Quake, where hardware accelerated graphics controllers weresupported only with later patches, Quake II came with OpenGL supportout of the box
the latest version is 3.21contains numerous bug fixes and new maps designed for multipleplayers death-match
Quake II uses an improved client server network model introduced inQuake
the game code of Quake II, which defines all the functionality forweapons, entities and game mechanics, can be changed in any waybecause id Software published the source code of their ownimplementation that shipped with the game
slide 19gaius
Technical aspects of Quake II
Quake II uses the shared library functionality of the operating system toload the game library at run-time - this is how mod authors are able toalter the game and provide different gameplay mechanics, newweapons and much more
originally just the shared library source code was released,ev entually the code which loads the shared library game wasreleased
technically Quake II is harder to modify than Quake as you have to beextremely careful where to add new variables
are they declared in the shared library?or in the parent loader?or both?
slide 20gaius
Technical aspects of Quake II
full source code to Quake II version 3.19 was released under the termsof the GPL on December 21, 2001. Version 3.21 followed later.
since then several Third-party update projects to the game engine havebeen created
the most prominent of these are projects focused on graphicalenhancements to the game such as Quake2maX, EGL and Quake IIEvolved
slide 21gaius
Technical aspects of Quake II
source release also revealed numerous critical security flaws which canresult in remote compromise of both the Quake II client and server
most 3rd party engines include fixes for these bugs
the most popular server-side engine modification, R1Q2, is generallyrecommended as a replacement for the 3.20 release for both clients andservers
the most widely used engine modifications as of 2006 appear to beR1Q2, AprQ2 and EGL, with a large majority of users still usingthe original 3.20 release
slide 22gaius
Technical aspects of Quake II
in July, 2003, Vertigo Software released a port of Quake II for theMicrosoft .NET platform, using Managed C++
it became a poster application for the language, showcasing thepowerful interoperability between .NET and unmanaged C++ code
slide 23gaius
Ports
ports of Quake II were released in 1999 on the Nintendo 64 (ported byRaster Productions L.L.C. ) and PlayStation (ported by HammerHeadLtd.) console platforms
in both cases, the core gameplay was largely identical;however, changes were made to the game sequence,split-screen multiplayer replaced network or Internet play
SGI port was made in 1999 by Philip Nemecin 2002, the game was ported to the Amiga PowerPC platform byHyperion Entertainment
there was also an unofficial port for the Sega Dreamcast,another port to Xbox, named Quake2X, and an unfinished port toPlaystation 2 via homebrew coders
slide 25gaius
Nintendo 64 port of Quake II
the Nintendo 64 version, unlike the PlayStation version, had completelydifferent levels and multiplayer maps which had never been seen before
this version also had new lighting effects, mostly seen on gun fire, andalso used the expansion pack to offer extra graphical detail
slide 26gaius
Xbox 360 port of Quake II
ported version of Quake II was included in the box of Quake 4 for theXbox 360 on a bonus disc
a direct port of the original game, and does not feature any graphicalimprovements, other than it may render in 480p and 720p
it does allow for System Link play for up to 16 players,split-screen for 4co-operative play in single player for up to 16 players or 4 withsplit-screen alone
slide 27gaius
Quake 2
has some of same weapons as Quake 1, and some new onespistol, shotgun, super shotgun, Machine gun, Chaingun, HandGrenade, Grenade Launcher, Rocket Launcher, Hyper Blaster,Railgun, BFG10Kplayers can also throw grenades
recall that Quake hadaxe, shotgun, double-barreled shotgun, nailgun, supernailgun,grenade launcher, rocket launcher, thunderbolt
generally accepted that the multiplayer component of Quake 2 is muchbetter than the single player game
slide 28gaius
Quake 2 Mods
there are so many, capture the flag, new skins, maps, deathmatch mapsetc
slide 29gaius
Question
which of the three quake game engines begat this game engine?screencapture⟨http://floppsie.comp.glam.ac.uk/avi/nexuiz_promo_video.h264.avi⟩