ID:4794
 
Keywords: demos
Some of you know that I released a small raycasting demo a few months ago. It was fairly quick because it only drew the bottom and top parts of the walls. Well yesterday I decided to toy around with raycasting.. except with textures. If I used my previous engine, it'd lag so badly, BYOND would think it were an infinite loop. Well, I optimized the engine, and did some textures.

The way the engine works is that it draws 512 double sized pixels in every tile. Say I wanted the resolution to be 5x5, it would draw 25x512 pixels on the screen before doing any raycasting. It isn't as slow as most people would think, since I don't create it on the map, and just put it on the screen.



Well, that was a mighty fine attempt. Textures work by reading a multi-dimensional array, so I can quickly reference the colours of a texture datum.

Since I could do that, I added more colours, and made more textures with different colours!



Also, I could add letters to the texture walls. Very fun. =P



Fun, fun. There's only one problem which I can't pick down. When I move (not turn the direction), a majority of the pixels flick black for a few seconds, making this wavy pattern in every tile.

Anyway, this was a fun day. =D

[edit]

After a while of work, I put in floor casting. Now the ground has textures!

very Very VEry VERy VERY cool.
Does it draw the map based from a dmp? If it's so fast as you say, you could build a proper game.
Just a suggestion for your current problem, couldn't you add all the 'new' pixels to a list, then set client.screen to the new list? If this is what you're doing, or you don't use a client.screen based system (though it sounds like you do), please ignore me. Don't worry, I'm used to it :-P.
Thanks. The dmp map file is the 2d representation to the raycasting map, so you could plug this a game, and it would work semi-well, assuming you programmed their textures. (It does not support mobs and objects)

For the reponse to my problem, my engine doesn't work that way. When the program raycasts, it tells the pixels on the screen to change colours, so it has to be another factor.
Hmmm.

You could build it into a Myst style game. Have you built a texture editor? You could have one whereby you build a 'map' in DM which shows the texture, i.e. using the map editor as a paint program.
*Cough*Onep srouec htat borhtre*Cough*
MystMaze.
Man, I've been playing Uru too much recently :-).
I don't know about your problem, it may just be a limitation of your system or of BYOND. Since I can't see your code (and I wouldn't really know what to do with it, having about zero experiance with 3D programming) I can't really suggest a solution.
Purdy.
So the engine only does wall and floor raycasting, any plans for obj and mobs too?

In regards to my previous comment, any plans for open sourcing or releasing this as a library?

P.S. I like your CSS.

P.P.S Are you just living in Toronto, or are you Canadian. Either is cool!
Sprites in raycasting are generally tricky, but I will try anyway. I'm going to be trying to put as much as I can to the raycasting engine.

At this moment, releasing the source as a demo or a library isn't on my mind right now, since it's fairly buggy (the wavy blackness while moving), and how slow it is. I will definitly put it up for download to run, when I fix up the speed issues a bit.

I like my CSS too. =P

I live in Toronto, and I'm Canadian.
I live in Nova Scotia, and I'm Canadian.

Anyway, if you can finish this it could be a great benefit to some BYOND games, because there are a few that I know that could use Raycasting 3D to make the game better.
If someone wanted to make a 3d-esque game, BYOND wouldn't be the place to do it. It'd be nice if BYOND had a faster image rendering which was usable in DM (since I know the graphics utility BYOND uses is fast enough for ray-tracers, even). This was simply a tech demo on what BYOND can do, since if this were put in a real-game scenario, it wouldn't be fast enough to do something mildy interesting other than it's first person. =P

Best someone can do of this is a maze-ish game, or something which doesn't bog resources. Multiplayer is barely an option.
I live in Michigan, and I'm Cana--- oh wait.

Anyways, very nice.
dang- that is *sweet!* nice job there! i agree that using this as a fullblown 3D gaming engine might overpower BYOND (especially in a multiplayer setting) but one thing you might want to consider, is to develop this with more of an Ultima/DungeonMaster/PoolsOfRadiance-style gaming system.

screenshots of possible implementation ideas:
http://www.scottmac.clara.co.uk/images/DungeonMaster.jpg
http://www.scottmac.clara.co.uk/images/LastNinja.jpg
http://www.gb64.com/Screenshots/A/ Alternate_Reality_-_The_Dungeon.gif

good job none-the-less! keep it up!
My system is by no means the best out there, but the game is unplayable for me even at the most minimum of game settings. Well, it runs really fast when I set the screen size to 1. :p Shadowdarke's ray cast demo runs really well and it has a default view bigger than your's and Gaku's also runs nicely.
Yesums, buts hisis hasest themostest beautifuls textures.
I'm so stupid compared to you people >_<!!!!! *Worships*
How did I miss this?

I drool.
I live in the frozen wastelands, and I'm a polar bear.

Anyways, great job with the raycasting, I've been studying it lately (from what I can find online), the trig is killing me.