Thursday, December 3, 2009

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


(custom quake maps in flash)
1. Get the source code at
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.
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
make -f makeswc

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, you will get the file “”, 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

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!


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 (, powerful for making total conversions, can create & modify maps, models, textures and sounds…), bspquakeeditor ( and quakeED ( 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 
to make your mods and TCs. There are docs and video tutorials online ( 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).

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:, 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 “” embed the “PAK0.PAK” file to get a standalone swf, modify, 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.)

A free (GPL) game data (PAK file) for quake1 is here:
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:


1. quake1 mods and tools:

2. free web client version of Quake:

4. Flash quake/descent style renderer:

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


Friday, September 18, 2009

Build your doom in flash step by step - Instructions for compile alchemy doom

It is when I found this game I began to believe how useful adobe alchemy will be.

Finally, the classical doom was ported into flash player as an playable game!

Thanks to adobe alchemy and Mike(, who made it and shared the source!

I am not an expert on doom , alchemy or even flash but I feel glad to share what I know about this project with those who like doom and flash.

This simple tutorial is the first step to build your doom in flash using Mike’s source, hope it can help. 


1.  get the souce code

(1) simplely download this packge:

(include Mike’s source(mybe outdated, try (2) to get the latest source) and my flashdevelop project file,

just open "my doom project.as3proj"(alchemy_linuxdoom-1.10\my doom project\.) and build it you will get the "doom.swf"(\bin\.).

no pre-loader in this package, if you want that, go to the project home or make your own.) this sofeware Git-1.6.4-preview20090730.exe from

install and run "Git bash":

git clone git://


when done go to

"C:\Documents and Settings\user\flash-doom" and find your source.

 you can also download raw file directly one by one

-click raw on the right of the title)

2. install alchemy

follow the instructions:

P.S. you should install "make(Devel ) packages" when installing Cygwin.

3. compile the source code

Download the source files and copy them to D:\alchemy\(supposed you install alchemy into this folder)

Run Cygwin go to the alchemy_linuxdoom-1.10 folder and compile the source:

cd D:

cd alchemy/alchemy_linuxdoom-1.10)

source /cygdrive/d/alchemy/alchemy-setup




It will take some time to finish compiling all c source files into a swc.

When you see this:


You can find lots of .o file in your swc folder, compilation is almost done,

it will now pause for a while, and then build all .o file into a swc:


When it is done, go to "swc" folder and copy the generated "doom.swc" to your project folder.

4.create your flashdevelop project

Create an flashdevelop project:


Copy "" into "D:\alchemy\alchemy_linuxdoom-1.10\my build\src"

and "doom1.wad" into "D:\alchemy\alchemy_linuxdoom-1.10\my build\lib"

add the swc asset:

addswc - (right click) always compile

Properties - Output - platform target - flash player 10


Build your project now!

Finally find your "doom.swf" in bin folder

and Run it, Press space key - new game...


1.create/add new levels – doom builder

Doom Builder.exe-file-open map/new map-"doom1.wad"

Game Configuration-Doom

Add resourc-From WAD File-doom1.wad–ok



Now you need to learn how to use this software to make new levels by yourself.

When done:File-save map into-choose your wad.

2.make total conversations - XWE

Xwe.exe-file open-"doom1.wad"


Play with this powerful editor, you can create a totally different  game!

Don't forget to replace the original "doom1.wad" with the new edited one when rebuilt your game!


1.some doom ports:

2.the doom game:

3.doomonline-A port of Doom for Flash by Max Herkender:

4.Ryan A. Chilton’s Flash doom & quake:

5.doom 2d flash: Triple Pack (Doom, Heretic, and Hexen):

7.doom in java applet:

Any question or problem please feel free to drop your comment!

Tuesday, August 18, 2009

Adobe Alchemy Ray Caster Port

======== UPDATE 2010, April 5========
Source Code Released:
======== UPDATE 2010, April 5========

Interested in ray casting, I once wanted to port this C++ code to as3.

Don't have much time for that and have little faith in as3's speed, I haven't done that yet.

Then I knew adobe alchemy, played Mike's Doom port and decided to have a try using Alchemy.

A Wolfenstein 3D is to complicated for me but this simple code is just fine. Not used to C/C++ programing any more, I got lots and lots of
warnings when compiling my swc. Luckily, it works in the end.

I first tried no textures, then one texture and finally full textures.

The swf looks all right but it is a mess behind what you see. Lots of work need to be done with the source code.


Besides this simple test, I also played with a voxel terrain engine (as3 port by me available here) and other old school effects using Alchemy.

Monday, July 6, 2009

Ray casting in Flash

Ray casting is a technology used in many old ‘3D’ games such as Wolfenstein 3DDOOM. Game engine use ray casting is also called a 2.5 D engine. The limitation of a simple ray casting engine in Wolfenstein 3D is that you can't look up or down – you can’t rotate X axis. Ray casting is fast and simple so before flash 10 which supports 3d, many people used this technology to make some 3D effect. Ray casting can easily create a maze-like world of walls. You can render terrains, too. Terrain rendering is much different from walls, it is also called voxel rendering.

Here are some information about voxel terrains and volume rendering:

Ray casting is different from mode7, mode7 is much more simple, good at rendering floors or grounds, but can’t do with walls.

I collected some good examples of flash based ray casting:

1.Wolfenstein 3D flash ported by Glen Rhodes

Flash ray engine

2. Andre Michelle’s ray caster(source available)

(1)AS3 version

(2)old as2 version

You can find the source in ‘fla/examples/pro/raycasting’ ray casting engine(source available);a=summary

4. half baked ray casting (source available)

very powerful but use c processor.

5.Pixel raycasting engine (source available)

7. Strille’s ray caster(flash5)(source available) (source available at flashkit)

8.Frédéric Heintz, aka FredH’s flash maze(source available)

Find the flash8 source at

This one also has a simple editor.

9. doomedonline(source available)

10. Ryan A. Chilton’s Flash doom & quake(source available)

11.Another simple as3 raycaster

13.ericlin’s 3d maze(source available)

This one is not ray casting. It skews movieclips to create a perspective wall effect which is similar to raycasting.



1. F. Permadi’s Ray-Casting Tutorial

2. Lode's Computer Graphics Tutorial-Raycasting (c++ source available)

3. Another Raycasting Engine Tutorial

4. Advanced raycasting techniques (Line based raycasting/Doom style, instead of cell based/Wolf style)



1. id Software’s Wolfenstein3D source code

2. A fast java raycaster like doom or wolfenstein 3D (source available)

3. Wolfenstein 3D in 20 lines of JavaScript by Mathieu 'p01' Henri (source available)

4. JavaScript ray caster by Ben Joffe(source available)

5.Flash AS3 Ray Casting Tutorial with example and source

6. UPDATE(2013-11-3)
Bresenham magic: raycasting, line of sight, pathfinding:



rayfaster 2 test: