Thursday, December 3, 2009

A simple tutorial for using Alchemy Quake Engine to create your own FPS game!

a-custom-quake-map-in-flasha-custom-quake-map-in-flash 

(custom quake maps in flash)
  
PART 1 COMPILE THE SOURCE
  
1. Get the source code at http://github.com/mkr3142/QuakeFlash
using git and

2. Install alchemy.
If you don't know how to do that (step 1&2) check this tutorial (I wrote for alchemy doom).

3. Compile the source to a swc
Copy the source folder to “F:\alchemy\” (suppose you install alchemy into this folder)
First you need a simple modification of the C source of wiquak in the source folder “D:\alchemy\QuakeFlash\WinQuake”:
Open the file “common.c” by any text editor, find this line (by searching key words such as “use modified games”)
” Sys_Error ("You must have the registered version to use modified games");”
Just remove or add”//” before (commentize) that line.
registered_remove
This is important if you want to use the engine to run your mods or total conversions, that line will check if the game data “PAK0.pak” is original (not modified), and won’t let the game run if not.
Now let’s build the C source to a swc: (you may want to read "readme_QuakeFlash.txt" in your downloaded source folder first)
Run Cygwin go to the “F:\alchemy\QuakeFlash\quakeswf” folder and compile the source:

cd F:
cd alchemy/QuakeFlash/quakeswf
source /cygdrive/f/alchemy/alchemy-setup
alc-on
make -f makeswc
 flashquake1
quakeflash

When it's done, check that "quake.swc” was created in “F:\alchemy\QuakeFlash\lib
(if not, go to “F:\alchemy\QuakeFlash\quakeswf\Release”, copy "quake.swc " to “F:\alchemy\QuakeFlash\lib”)

4. get the game data PAK0.pak
Download the original quake game demo(DOS) from  http://www.idsoftware.com/games/quake/quake/, you will get the file “quake106.zip”, unzip it and run “install.bat”,
go to the folder you installed your game such as "C:\QUAKE_SW",
copy the "PAK0.PAK" form "C:\QUAKE_SW\ID1" to
F:\alchemy\QuakeFlash\quakeswf\embed

5. compile the swf
Open the FlashDevelop project file “QuakeFlash.as3proj” in"F:\alchemy\QuakeFlash\quakeswf",
build the project you will get the “QuakeFlash.swf” in “F:\alchemy\QuakeFlash\quakeswf\bin”.
Run it, it will play the demos, press space key->NEW GAME, you can play the game now!


PART 2 MODS and TOTAL CONVERSIONS

1. choose one of your favorite quake editors
There’re lots of free & open source game editors for quake1.
Some of which I know are quark (quark.sourceforge.net, powerful for making total conversions, can create & modify maps, models, textures and sounds…), bspquakeeditor (http://www.bspquakeeditor.com/) and quakeED (http://www.celephais.net/board/view_thread.php?id=60225&end=25unzip and put it in “C:\games\quake\tools”, you need to create that folder by yourself.) for levels (new maps), a light and useful tool PakExplorer(for creating & modifying PAK0.PAK, quark has a build in Pak Explorer too.).

2. I prefer quark, just learn how to use it to create & modify PAK0.Pak 
 quark_pak
quark_map
qurk_model
to make your mods and TCs. There are docs and video tutorials online (quark.sourceforge.net) to help you.

P.S.For bspquakeeditor quakeED, the default quake level format is *.map, you need to compile the *.map to *.bsp (both editor can do that).
 quakeedbsp

3. A quick start – test your first quake mod level in flash:
You created/downloaded a level and want to test it in the flash.
Use PakExplorer open PAK0.PAK, import (drag and drop) *.bsp into maps folder of PAK0.Pak, delete e1m1.bsp, rename your *.bsp to e1m1.bsp, save and recompile the flashproject. The first level of the game will be yours.

If you download a mod’s PAK0.PAK (here are some:http://www.quaketerminus.com), just open it and the original PAK0.PAK by PakExplorer, right click and copy any *.bsp from MOD.PAK’s map folder and paste it in the original one’s map folder, delete or rename “e1m1.bsp”, rename the mod’s .bsp to “e1m1.bsp”, save the PAK file, rebuilt the swf and the first level will be changed.

P.S. a tip for moders: compile the swf everytime when you want to test your level is time consuming, because the “Main.as” embed the “PAK0.PAK” file to get a standalone swf, modify Main.as, use Loader, let it load the "PAK0.PAK", so you won’t need to recompile the swf any more whenever you change the “PAK0.PAK”, (if you’re not clear of what I mean or how to do that, email me or leave a comment.)
copy
deletee1m1

A free (GPL) game data (PAK file) for quake1 is here: http://openquartz.sourceforge.net/index.html
download Game data in binary format, use PakExplorer open pak0~3.pak, copy all files in pak1~3.pak into pak0.pak, repalce what's in F:\alchemy\QuakeFlash\quakeswf\embed with"config.cfg" of openquartz and the newly created pak0.pak, compile the project, you will get something like this:

LINKS:

1. quake1 mods and tools: http://www.quaketerminus.com

2. free web client version of Quake: http://www.blogger.com/www.quakelive.com


4. Flash quake/descent style renderer: http://board.flashkit.com/board/showthread.php?t=749263
source: http://esl.eng.ohio-state.edu/~rac/hobby.html



7. Quake2-based 3D renderer for flash using HaXe:

8. http://www.celephais.net/board/view_thread.php?id=60393
9. http://forums.inside3d.com/viewtopic.php?f=3&t=1835#p19371

Sponsors