Forum Archive

Go Back   3D Realms Forums > General Topics > Programming Forum
Blogs FAQ Members List Social Groups Calendar Mark Forums Read

Notices

 
 
Thread Tools
Old 08-27-2008, 03:08 AM   #1
Bad Sector

Bad Sector's Avatar
3D Raycasting in Flash9
Here is a small raycaster i did in Flash9/haXe over night. Nothing really mindblowing, or never-seen-before (i've actually seen better stuff done using Flash). However i think its one of the few raycasting engines in Flash that doesn't have horrible artifacts or accuracy issues with distant walls. Also most people just render walls, i also render sprites :-P. And its 9kb including textures :-).

Anyway, tell me your average/worst FPS (see at the top-right corner) and your system specs :-).

http://gimme.badsectoracula.com/rayfaster/
Bad Sector is offline  
Old 08-27-2008, 05:10 AM   #2
Samji

Samji's Avatar
Re: 3D Raycasting in Flash9
Looks pretty cool. Reminds me of Wolf 3D. That would pretty cool in Flash actually.
__________________
Sam's Py
Samji is offline  
Old 08-27-2008, 06:32 AM   #3
Mr.Fibbles

Mr.Fibbles's Avatar
Re: 3D Raycasting in Flash9
If I get close to the sprite I drop down to like 170~180 but otherwise I am up around/above 200.

This is on my work computer:
Dell Optiplex 745

Core 2 Duo (2.13)
2GB RAM
ATI Radeon X1300PRO (256mb)
__________________
http://thaunandshad.com
Mr.Fibbles is offline  
Old 08-27-2008, 07:25 AM   #4
Crosma

Crosma's Avatar
Exclamation Re: 3D Raycasting in Flash9
I haven't messed around with Flash 10 stuff yet, but it's got rudimentary 3D acceleration support, to compete with Silverlight. Should be pretty cool.

This raycaster thing is pretty cool. Kudos.

Got 60 FPS on my 1.2GHz Linux laptop in Firefox. The low-ish FPS is probably down to the Linux version of Flash being slow as hell at writing the graphics buffer to the screen. Although X11 is probably partially to blame. Flash 10 is going to use 3D acceleration to write to the screen, so it should be hella faster.
__________________
(define love (lambda () (map conquer all)))
Crosma is offline  
Old 08-27-2008, 08:12 AM   #5
ADM

ADM's Avatar
Re: 3D Raycasting in Flash9
I get around 200 with the lowest dip of 198 or so. But it's very constant with a couple of peaks above 220. It's on my laptop which is a Core 2 Duo 2.4ghz running Vista.

Either way this is very cool. Any chance of releasing the source code/fla? Would love to see how it's done.
ADM is offline  
Old 08-27-2008, 02:21 PM   #6
Bad Sector

Bad Sector's Avatar
Re: 3D Raycasting in Flash9
@Crosma:
Maybe your video drivers? My EeePC (which runs Linux and has an Intel Celeron -officially- underclocked at 600Mhz with some intel GMA card) gets around 30fps. I will look intro Flash 10's 3D stuff once haXe (the language i use to produce SWF files) supports Flash 10 :-). But even when it comes out, i'm not sure if i'll use it immediatelly since it will take a while to be widespread (even Flash Player 9 which is available for years isn't the majority).

@Samji:
http://www.glenrhodes.com/wolf/myRay.html. This one is playable (not mine) but it has a very low resolution and its kinda blurry.

@ADM:
Its your pretty standard raycaster. This tutorial is probably the best on the net about making a raycaster. I didn't made this in Flash, but in haXe an AS3/Java-like language which supports generation for Flash 6 to 9, PHP, JavaScript and its own server-side VM module for Apache (basically its an all-in-one web language :-P). So there isn't any .FLA available (i don't even have the Flash IDE).

Also the textures are embedded in the source code (in a class) using a small tool i wrote that reads PNG files, converts them to a 8bit bitmap and stores that bitmap in an array (which is then written in a generated haXe source code file). Since the texture data is "packed" in a single array, the pixels are 8bit (one byte per pixel) and the whole SWF is solidly compressed, this produces smaller files than if i was using a separate file per image/texture.
Bad Sector is offline  
Old 08-27-2008, 04:49 PM   #7
Yatta

Yatta's Avatar
Re: 3D Raycasting in Flash9
~150 FPS

Win XP
Athlon X2 4200+
GeForce 7800 GT 256MB
2 GB RAM
Yatta is offline  
Old 08-27-2008, 05:05 PM   #8
Mr.Fibbles

Mr.Fibbles's Avatar
Re: 3D Raycasting in Flash9
~110

Pentium D 805 Dual Core (2.6)
GeForce 7600 GT (256 MB)
2 GB RAM

I'm actually surprised I am getting lower specs considering that something like Spore Creature Creator won't even install on that work machine (video card not supported)
__________________
http://thaunandshad.com
Mr.Fibbles is offline  
Old 08-27-2008, 06:03 PM   #9
Bad Sector

Bad Sector's Avatar
Re: 3D Raycasting in Flash9
@Mr.Fibbles:
It uses only the CPU.

I added floor casting (textures in floor). It might go a little slower now.
Bad Sector is offline  
Old 08-27-2008, 06:20 PM   #10
Yatta

Yatta's Avatar
Re: 3D Raycasting in Flash9
~130 with the floor textures.
Yatta is offline  
Old 08-28-2008, 04:30 AM   #11
Crosma

Crosma's Avatar
Exclamation Re: 3D Raycasting in Flash9
Quote:
Originally Posted by Bad Sector View Post
@Crosma:
Maybe your video drivers? My EeePC (which runs Linux and has an Intel Celeron -officially- underclocked at 600Mhz with some intel GMA card) gets around 30fps.
Nah, the Linux version is just crap and has serious syncing issues on a lot of systems. I managed to fix mine by forcing OSS.
__________________
(define love (lambda () (map conquer all)))
Crosma is offline  
Old 08-28-2008, 05:19 AM   #12
Bad Sector

Bad Sector's Avatar
Re: 3D Raycasting in Flash9
I've added a bunch of new stuff in the engine:
  • Floor/ceiling textures (they use the same code now) with textures taken from the tilemap (basically three tile maps are defined - one for ceiling, one for walls/entities and one for floor).
  • Multiple sprites (using fast but inaccurate sorting based on the rays being cast)
  • Map data loaded from special resources (generated using a plugin i wrote for a tilemap editor i'm making - check here for more info)
  • Collision detection with sliding response
  • WASD keys as an alternative to arrow keys

Obviously the rendering slowed down a bit (from ~200 fps in my machine to ~160fps, although it fluctuates between this and 200 depending on what is in view)
Bad Sector is offline  
Old 08-28-2008, 09:56 AM   #13
Mr.Fibbles

Mr.Fibbles's Avatar
Re: 3D Raycasting in Flash9
Quote:
Originally Posted by Bad Sector View Post
@Mr.Fibbles:
It uses only the CPU.
I guess that means the Core2Duo is better than the Pentium D despite the processor speed.

Averages between 100~120 FPS on the Core2Duo now.
__________________
http://thaunandshad.com
Mr.Fibbles is offline  
Old 08-28-2008, 03:06 PM   #14
Yatta

Yatta's Avatar
Re: 3D Raycasting in Flash9
Quote:
Originally Posted by Bad Sector View Post
I've added a bunch of new stuff in the engine:
  • Floor/ceiling textures (they use the same code now) with textures taken from the tilemap (basically three tile maps are defined - one for ceiling, one for walls/entities and one for floor).
  • Multiple sprites (using fast but inaccurate sorting based on the rays being cast)
  • Map data loaded from special resources (generated using a plugin i wrote for a tilemap editor i'm making - check here for more info)
  • Collision detection with sliding response
  • WASD keys as an alternative to arrow keys

Obviously the rendering slowed down a bit (from ~200 fps in my machine to ~160fps, although it fluctuates between this and 200 depending on what is in view)
I get around 100-110 FPS now.
Yatta is offline  
Old 08-28-2008, 11:00 PM   #15
LeadBullet

LeadBullet's Avatar
Re: 3D Raycasting in Flash9
I get between 75-120 in normal use with my usual programs running.

Athlon XP 4000+
__________________
"The" "DNF release date" "is" "next" "month" - George Broussard
"Anyway, it's close to being ready." - Joe Siegler
Friend Code -oSSBB: 1160o9449o5021
LeadBullet is offline  
Old 08-29-2008, 01:37 AM   #16
Bad Sector

Bad Sector's Avatar
Re: 3D Raycasting in Flash9
New version, i added doors (togglable - like in Duke, not timed like in Wolf), and "thinkers". These are objects that are attached to entities in map load time and provide the logic part (the bouncing balls are provided by a thinker test). Also did proper sorting for entities.
Bad Sector is offline  
Old 08-29-2008, 08:39 AM   #17
Samji

Samji's Avatar
Re: 3D Raycasting in Flash9
Quote:
Originally Posted by Bad Sector View Post
@Samji:
http://www.glenrhodes.com/wolf/myRay.html. This one is playable (not mine) but it has a very low resolution and its kinda blurry.
Thanks. A good find!
__________________
Sam's Py
Samji is offline  
Old 08-29-2008, 10:19 PM   #18
LeadBullet

LeadBullet's Avatar
Re: 3D Raycasting in Flash9
On the updated one my FPS went from 75-120 to 100-150ish. I watched carefully and it never went under 100.
__________________
"The" "DNF release date" "is" "next" "month" - George Broussard
"Anyway, it's close to being ready." - Joe Siegler
Friend Code -oSSBB: 1160o9449o5021
LeadBullet is offline  
Old 08-29-2008, 11:21 PM   #19
Bad Sector

Bad Sector's Avatar
Re: 3D Raycasting in Flash9
Hmm, i did changed some parts which should speed up things but on the other hand i added lots of others which i expected to slow down things too (like proper entity sorting). It could be the more "cramped" nature of the new map (less spacy rooms which leave less floor and ceiling to be rendered - these are the slowest parts of the raycaster), but then again i added much more entities which should provide a bit of balance.

Of course hearing that the rendering is faster now is only a good thing :-). But i've uploaded a new version with a wider room with more entities to check.
Bad Sector is offline  
Old 08-30-2008, 09:09 AM   #20
Mr.Fibbles

Mr.Fibbles's Avatar
Re: 3D Raycasting in Flash9
Current FPS on Pentium D 805: 75~100
__________________
http://thaunandshad.com
Mr.Fibbles is offline  
Old 08-30-2008, 10:21 PM   #21
LeadBullet

LeadBullet's Avatar
Re: 3D Raycasting in Flash9
I get 96-102 sitting at the start point.

In that room with all the statues and tons of bouncing balls I'm around 86-92
__________________
"The" "DNF release date" "is" "next" "month" - George Broussard
"Anyway, it's close to being ready." - Joe Siegler
Friend Code -oSSBB: 1160o9449o5021
LeadBullet is offline  
Old 08-30-2008, 10:29 PM   #22
Superczar

Superczar's Avatar
Re: 3D Raycasting in Flash9
Pretty cool man, lowest drop for me was down to between 110-160 in the room with the balls.
__________________
'F*** Fresch!!!'.
Superczar is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 08:07 PM.

Page generated in 0.17404890 seconds (100.00% PHP - 0% MySQL) with 16 queries

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.

Website is 1987-2014 Apogee Software, Ltd.
Ideas and messages posted here become property of Apogee Software Ltd.