Author Topic: Nspire Raycaster  (Read 104990 times)

0 Members and 1 Guest are viewing this topic.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Nspire Raycaster
« Reply #300 on: May 03, 2010, 11:59:34 pm »
Here's an avi of the emulator, for those who don't have Nspires.
For some reason, if I convert the avi to a gif, it grows to ~20 MB, so I can't upload a gif.
The engine on real hardware is smoother than what you see in the video (its 60 Mhz faster, and Wine makes the emulator a bit choppy).
« Last Edit: May 04, 2010, 12:01:41 am by bwang »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Nspire Raycaster
« Reply #301 on: May 04, 2010, 12:08:40 am »
wow that's great! :O

And yeah I hate how gifs gets pretty huge sometimes, especially with Nspire stuff x.x

AVIs can be compressed easier and still look decent. Nice job on the raycaster :)

Offline tensuke

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 16
  • Rating: +0/-0
  • Crab Nicholson
    • View Profile
Re: Nspire Raycaster
« Reply #302 on: May 04, 2010, 10:02:23 pm »
Sweet, downloading the new version now!

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: Nspire Raycaster
« Reply #303 on: May 05, 2010, 03:52:21 pm »
Every time a new video is posted, I want to try this more and more, but I have OS 2.0 and I need the programming tools in 2.0 for Chemistry programs I use in school.  I wish this would work on 2.0. :(  I hope Ndless 2 comes out soon.


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Nspire Raycaster
« Reply #304 on: May 05, 2010, 03:55:03 pm »
Me too. I hope once school ends, that there will be some progress. Else after June there's no sign of life, I'll get worried x.x

(End of school == busy with exams. Once exams and school is over == more free time. However, if no progress despite increased free time, it means the author lost interest or got in serious trouble with TI)
« Last Edit: May 05, 2010, 03:59:28 pm by DJ Omnimaga »

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Nspire Raycaster
« Reply #305 on: May 05, 2010, 07:44:22 pm »
New demo!
This one adds support for different textures and sprites.
I think the engine is nearly ready for a real release. I've split all the rendering code out of the main program, so essentially the engine consists of one render() function that takes map data, sprite data, texture data, camera position, and a screen buffer as parameters and draws the rendered image to the buffer.
I'm worried about the speed now, though. It becomes a bit choppy when you're looking at a complex scene :(

Offline AaroneusTheGreat

  • Moderator
  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 287
  • Rating: +26/-1
    • View Profile
Re: Nspire Raycaster
« Reply #306 on: May 06, 2010, 02:34:50 pm »
I really like the way you've handled that, it makes it much easier to use the same screen buffer to put stats and such on the screen as well as the rendered scene. If you want to I could try to help you optimize the code to make it faster. Also are you going to keep the variable viewing screen size in the finished program? If you are, the client code could adjust the viewing area to meet it's own processing needs. That way, games with more complicated AI and such would be able to make up for the processing time for that by decreasing the screen size. It would make your engine extremely flexible.

Offline JoeyBelgier

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 545
  • Rating: +25/-21
  • Joey
    • View Profile
Re: Nspire Raycaster
« Reply #307 on: May 06, 2010, 05:00:00 pm »
Holy fuck, Doom-era games on an Nspire, nice job

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Nspire Raycaster
« Reply #308 on: May 06, 2010, 05:06:58 pm »
This looks incredible!  As always, nice job bwang! ;D

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Nspire Raycaster
« Reply #309 on: May 06, 2010, 06:31:35 pm »
I really like the way you've handled that, it makes it much easier to use the same screen buffer to put stats and such on the screen as well as the rendered scene. If you want to I could try to help you optimize the code to make it faster. Also are you going to keep the variable viewing screen size in the finished program? If you are, the client code could adjust the viewing area to meet it's own processing needs. That way, games with more complicated AI and such would be able to make up for the processing time for that by decreasing the screen size. It would make your engine extremely flexible.
I'll make a release with source in a bit, once I extract all my stuff from the Ndless folder I've been coding this in.
The adjustable screen size is part of the engine right now; render() takes the width and height of the screen as two of its parameters.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Nspire Raycaster
« Reply #310 on: May 06, 2010, 07:41:31 pm »
Nice to see it's getting close to engine release! Also with the source some other people might be able to help in the community, especially if on ticalc.org. Just make sure that instructions on how to use it won't be too cryptic, though, for the average C programmer/Windows user.

Offline AaroneusTheGreat

  • Moderator
  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 287
  • Rating: +26/-1
    • View Profile
Re: Nspire Raycaster
« Reply #311 on: May 07, 2010, 11:28:54 am »
Quote
render() takes the width and height of the screen as two of its parameters.

Are you also able to set where on the screen buffer the viewing area is rendered? Also if you make a structure out of your parameters for the rendering engine, it could speed up the engine a bit, because you'd be actually passing one void pointer to the function, like so:

Code: [Select]
typedef struct
{
 int screen_width,
 int screen_height,
 //pointer to sprite array, however that's defined//
 // same for texture array//
int screen_position_x,
int screen_position_y
// etc//
}
render_structure;

render_structure rend_struct;

render(rend_struct);

This way when you pass rend_struct, C actually sees rend_struct as a pointer to a place in memory, and you're actually only passing one void pointer through the stack, which if I'm not mistaken is only one char.
« Last Edit: May 07, 2010, 11:34:58 am by AaroneusTheGreat »

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Nspire Raycaster
« Reply #312 on: May 07, 2010, 01:29:10 pm »
Quote
Are you also able to set where on the screen buffer the viewing area is rendered?
I'll add that feature.
The structure for the parameters sounds like a good idea, especially since it makes render() a bit easier to use (no need to remember what order the parameters come in).

Offline theUnnamed

  • LV3 Member (Next: 100)
  • ***
  • Posts: 63
  • Rating: +3/-3
    • View Profile
Re: Nspire Raycaster
« Reply #313 on: May 07, 2010, 08:25:13 pm »
how much does this strain the cpu?

Offline Ancient Power

  • LV3 Member (Next: 100)
  • ***
  • Posts: 45
  • Rating: +0/-0
    • View Profile
Re: Nspire Raycaster
« Reply #314 on: May 07, 2010, 08:31:30 pm »
This looks amazing. I want to learn C just to try out the engine  :)