Author Topic: Floorcaster  (Read 19030 times)

0 Members and 1 Guest are viewing this topic.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Floorcaster
« Reply #30 on: July 26, 2010, 08:32:07 pm »
OK, I got tilemapping working. I also replaced a bunch of subtractions and a division in the loop with a table lookup, so its even faster now.
The tile map is rather boring at the moment, since I don't have any good tiles to work with :( So I just stole a wall texture from Ncaster.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Floorcaster
« Reply #31 on: July 26, 2010, 11:04:33 pm »
Wow! So...can ncaster and this run in tandem very well? also, how hard would it be to adapt it for the ceiling as well?

I hope I don't ask too much. I just had a crazy idea for a game used with this, and Ceilings would make it even better.

It's nice how much easier and faster greyscale is on the nspire....

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Floorcaster
« Reply #32 on: July 26, 2010, 11:46:10 pm »
In theory, yes. In reality, due to speed concerns, Ncaster would definitely have to be converted to fixed-point in order to get enough FPS.
This is more useful for stuff like racing games. It basically does the same thing a Mode 7 engine would, only using a different method.

Offline AaroneusTheGreat

  • Moderator
  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 287
  • Rating: +26/-1
    • View Profile
Re: Floorcaster
« Reply #33 on: July 27, 2010, 12:03:18 am »
This would only add a floor to the very most bottom level of the Ncaster level though, wouldn't it? Due to the fact that the floor casting is set to only do one level of height. It would definitely improve the visual aesthetics of the Ncaster, but on raised  up platforms and on stairs the floor would still be light gray correct? Or could you modify the engine to treat raised sections differently? Either way, if you can convert Ncaster to fixed point and get enough speed, I say go for the merging of this one with Ncaster because it will give the engine a feature that has never been done on a calculator before!

Oh also an optimization you could implement in the engine would be to only calculate and draw to pixels that don't have walls drawn there, therefore decreasing the amount of pixels that need to be calculated and drawn. There's no reason you would need to draw the floor there anyways, so it makes sense to avoid overdraw.
« Last Edit: July 27, 2010, 12:05:09 am by AaroneusTheGreat »

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: Floorcaster
« Reply #34 on: July 27, 2010, 12:04:36 am »
bwang, this looks great!  It works very nicely on calc! :)


Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Floorcaster
« Reply #35 on: July 27, 2010, 12:08:56 am »
This would only to the bottom layer, but I agree it would still be nice.
I think I really will convert Ncaster to fixed point as soon as I find the time to do so. It'll be a bit tricky, but 2x speed increase with no algorithmic changes is well worth the work.

Offline AaroneusTheGreat

  • Moderator
  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 287
  • Rating: +26/-1
    • View Profile
Re: Floorcaster
« Reply #36 on: July 27, 2010, 12:20:45 am »
Yeah I think so too. I didn't mention in my above post how awesome I think this is btw. It's epic. I really like how the perspective is so correct, that's often hard to do when texturing a floor real time. I don't know why but most of the time it looks as if the floor is warped on a ball or a curve of some kind, but yours is spot on. Well done.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Floorcaster
« Reply #37 on: July 27, 2010, 12:33:31 am »
Yep, ray-tracing has its advantages :)

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Floorcaster
« Reply #38 on: July 27, 2010, 10:21:43 am »
Tilemaps and a fps increase? You've got to be kidding. :)

Are you going to release the source code for this version?
« Last Edit: July 27, 2010, 03:03:44 pm by fb39ca4 »

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Floorcaster
« Reply #39 on: July 27, 2010, 04:30:49 pm »
Here you go.

Offline Silver Shadow

  • Beta Tester
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +27/-7
    • View Profile
Re: Floorcaster
« Reply #40 on: July 27, 2010, 04:49:27 pm »
Woohoo! Looks awesome!
Maybe once I finish my other Nspire project, I'll start messing around with this engine...

And yeah, merging the two engines together would be epic!
Former Coder of Tomorrow


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Floorcaster
« Reply #41 on: July 29, 2010, 02:47:19 am »
WOAH!

I just saw the video on the other page and this BLEW my mind. :O

Is the version with textures that fast? I wonder if a Mario Kart game could be possible? Or maybe combining both raycasting with floorcasting?

Darn I hope you finish this. You should make a demo with some sort of map like in F-Zero or Final Fantasy VI :)

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Floorcaster
« Reply #42 on: July 29, 2010, 02:53:10 am »
The version with textures is even faster, thanks to a change in the code :)
Combining floorcasting with ray casting is certainly possible; however, much of the Ncaster code needs to be altered to support that (namely, the entire thing has to be converted to integer arithmetic). I originally intended for this to be part of a racing game engine (in the style of F-Zero).
I really need to go find some tiles and a map to render. That would make the demo look so much better.
The current map is 64x64 tiles. How big do you guys think a racing game's map should be? The map size is hard-coded for efficiency, so I need to know it if/when I make a release.
« Last Edit: July 29, 2010, 03:10:47 am by bwang »

Offline Silver Shadow

  • Beta Tester
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +27/-7
    • View Profile
Re: Floorcaster
« Reply #43 on: July 29, 2010, 03:25:46 am »
The bigger the better, I guess. :P
Former Coder of Tomorrow


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Floorcaster
« Reply #44 on: July 29, 2010, 04:10:43 am »
I would really love a F-Zero or MK game. Also since you appear to use hi-res tiles, this would mean even better graphics than F-Zero :P

As for map size, I'm not too sure. Usually 64x64 is enough, but for a F-Zero game, it might need 128x128 since game usually goes pretty fast. I didn't like how a lap only lasted 8 seconds in some F-Zero 68K tracks.