Wow...this is a wonderul WIP demo...well done!
Printable View
Wow...this is a wonderul WIP demo...well done!
Wow, thats good work! I love how you recursively call the raycaster to make many sectors, really good idea. You realize you could use it to make mirrors, right?
This is a good show of what the flash engine is capable of. And its fast enough to actually run a game engine, which is great. I haven't seen a 3D game in flash since the mode7 days.
I remember thinking that after posting about the similarities to the Build engine earlier. If I remember correctly, they created reflective floors by mirroring the above part in the sector below then making the floor slightly transparent. Pretty simple really, but it was a powerful effect, especially back in those days. I'll try and dig up a screenshot...Quote:
Originally Posted by ihoss.com
And that's an interesting point you make about 3d games in flash recently. Despite the huge increases in speed with recent flash versions and the number of tech demos showing off new techniques, we haven't really seen many actual games make use of it yet. The same applies to things like the various physics engines, or some of the bitmapdata demos showing thousands of particles at once. There may have been a handful of examples but it seems the majority of flash developers are sticking with what's tried and tested.
EDIT: Screenshots!
http://www.jonof.id.au/modsuppt/buil...tfloorlame.png
http://www.jonof.id.au/modsuppt/buil...ctfloorken.png
Looks like they may be from tech demos, but I know the effect was used actual games based on build engine. The water one is particularly interesting. If you could switch out sectors easily, you could make it reflect the water with a nice refraction effect when looking from above, then swap it out to the underwater part while you in the water.
What is the use of this engine going to be? Is it going to be an in-browser webgame?
It is very impressive coding by the way. I don't even know enough to be properly impressed I am sure, but I am impressed anyway. Better than any other 3d I have seen in flash and you are doing more with it than making a single room to walk around in. *thumbs up*
DancingOctopus, those are great ideas & screenshots. I had given some thought to making reflective surfaces but didn't try to implement it yet....
1. The raycaster is 2D, so reflective walls are straightforward to do because the problem is already cast in the correct plane (the 2D ray, reflecting off of the vertical wall, still lies in the 2D plane again). You don't even need to worry about the inversion of the ray/orthoray coordinate system that happens upon reflection, because the whole map is only drawn one column at a time anyway. What I think could be a problem is a hall of mirrors effect, which could happen if you have multiple mirrors and look at them from just the right angles. Performance could totally tank as the ray bounces back and forth a very large number of times.
2. Reflective floors I hadn't given any thought to, but now that I bounce (pun intended) it around in my head, it's doable just like wall case. Whenever you have a patch of reflective floor, you start drawing the _ceiling_ of the same z-layer, by spawning a new ray from a deeper (futher-from-camera) range. It's just some trig to figure out how far the ray should skip down the ceiling. And it avoids the hall of mirrors effect that causes problems with reflective walls, because the view is restricted such that you cannot ever look down normal to the floor.
3. Reflective slopes are completely intractable IMO, it's a 3D problem and it would just be a mess I think. I mean it's doable, but i don't think it would perform nearly fast enough.
Your screenshots gave me another idea that is totally doable - translucent but colorized glass surfaces. The engine is palettized, so any _real_ alpha-blending effects, like partial transparency, are intractable to implement. But the pic gave me a good idea of how to fake it. When you look through a transparent colored (blue, for instance) surface, set some special flag indicating that all pixels from here until the expiration of the ray should be blue somehow.
To fake that in a paletted image, just before you're about to write the palette index into the ByteArray, compute the average intensity of all three channels of that palette color (thats a grayscale intensity, 0-255). In the palette I use, all my blue shades are together (theres sixteen of em), and they're in a linear gradient from intense blue all the way to black - so you can easily scale a 0-255 grayscale index into a 0-15 index that represents which blue you should pick & place as the final color.
It's sort of like you're grayscaling everything behind that blue plane, and then dropping the red and green channels. So bright colors behind the glass are now bright blue, and dim colors behind the glass are now dim blue. I think this will look pretty sharp. I have similar gradients in the palette for red, green, yellow, and purple... so you could implement glass layers in any of those colors. The nice thing is that this will take very little code to implement, just a little bit of bit twiddling right before the palette write occurs.
Alluvian, I doubt this will be an in-browser webgame. (Although I think it would be fun to do an online multiplayer version of the game, where this code is basically the rendering client). My ultimate plans are just to make a 2 to 4player split screen version for a stand-up arcade machine, sorta like Goldeneye. This arcade machine is already set up with a bunch of games on it, and all the key mapping is pretty much hard coded for that platform. This will be just another "rom" that you can pick out of it's list of games to play. (Currently all the games on it are stuff like tic-tac-toe and run-the-maze, this game will set the bar pretty high from now on!).
This is all going to be much easier to code soon. The new flash has a C++ to AS convertor thingy with it, they even demo'd a C version of doom in flash.
You got some things wrong there. First of all they demoed quake running in flash,not doom (of which a pretty well made flash port is already available since flash 8 days), next up they didnīt say the c/c++ to AS converter would be included with flash 10, it was just one of the things they were working on but it wasnīt specified whether itīd be included with the next flash ide.
from what it looked to me it was some flash written tool where a flash movie converted string from a textfield to to optimized as3 code- not something i think wich will be in flash itself.
Anyone know when Flash 10 is due? And what are the new things in flash CS3 (9). It seems like everyone is using Flex now instead of Flash.
Sorry to go offtopic :p
I must have missed this, do you have a link to the project site? I was under the impression that Max's port was the first doom-2-flash success.Quote:
Originally Posted by tomsamson
Limit number of reflections, obviously? Perhaps with simultaneous fading out.Quote:
Originally Posted by rachil0