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

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(http://mike.newgrounds.com/), 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. 



 PART 1 - COMPILE THE SOURCE



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.)


1.download this sofeware Git-1.6.4-preview20090730.exe from


install and run "Git bash":


git clone git://github.com/Herschel/flash-doom.git

 git0

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

alc-on

make

cygwin_setup_make

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

When you see this:


make_incomplete

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:

make_done

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:


flashdevelop_project

Copy "DoomGame.as" 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

DoomGame.as - (right click) always compile

Properties - Output - platform target - flash player 10

project

Build your project now!


Finally find your "doom.swf" in bin folder

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



PART 2 - CREATE YOUR FLASH FPS GAME POWERED BY ALCHEMY DOOM ENGINE



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

db0

db1

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"

 xwe0

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!

Links:

1.some doom ports:
http://www.doomworld.com/classicdoom/ports/

2.the doom game:
http://www.idsoftware.com/games/doom/doom-final/

3.doomonline-A port of Doom for Flash by Max Herkender:
http://code.google.com/p/doomedonline/
http://blog.brokenfunction.com/2007/07/20/flash-plays-doom/

4.Ryan A. Chilton’s Flash doom & quake:
http://esl.eng.ohio-state.edu/~rac/hobby.html

5.doom 2d flash:
http://www.codinsoft.de/doom2d.html

6.game-Doom Triple Pack (Doom, Heretic, and Hexen):
http://www.newgrounds.com/portal/view/470460

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:
http://bruce-lab.blogspot.com/2010/04/alchemy-ray-casting-engine-source-code.html
======== 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.


DEMO:http://flaswf.googlecode.com/files/Alchemy_RayCaster_DEMO.swf




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:

http://bruce-lab.blogspot.com/2009/01/terrain-rendering-in-flash.html

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

http://www.glenrhodes.com/wolf/



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


(1)AS3 version




(2)old as2 version

http://recycle.andre-michelle.com/as2/packages.zip

You can find the source in ‘fla/examples/pro/raycasting’



3.fast ray casting engine(source available)
http://git.runtimeterror.com/?p=rayfaster1.git;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)


http://www.strille.net/works/raycasting.swf (source available at flashkit)




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


Find the flash8 source at http://www.fredheintz.com


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.

====================

TUTORIALS

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)


====================

LINKS


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)http://www.p01.org/releases/20_lines_Castle_Wolfenstein/




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

http://www.benjoffe.com/code/demos/canvascape/textures

5.Flash AS3 Ray Casting Tutorial with example and source

http://www.rustyarcade.com/blog/read/33/Ray-Casting-Tutorial

6. UPDATE(2013-11-3)
Bresenham magic: raycasting, line of sight, pathfinding:
http://deepnight.net/bresenham-magic-raycasting-line-of-sight-pathfinding/

=============================================

UPDATE(2009-12-4)


rayfaster 2 test:
http://www.badsectoracula.com/peponi/rayfaster2/

Sponsors