Author Topic: nCraft (3D minecraft-like game for the nspire)  (Read 101127 times)

0 Members and 1 Guest are viewing this topic.

Offline Chockosta

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 447
  • Rating: +169/-6
    • View Profile
nCraft (3D minecraft-like game for the nspire)
« on: February 28, 2012, 02:43:10 pm »
Hello,

Since I like 3D, I wanted to try it with ndless.
After a couple experiments, I got spinning cubes... Yeah :P

At first, I wanted to try a minecraft-like game, but it's waaay too slow.
I'll try to do some optimizations, but I don't hope too much. Sorry.

The source is attached with a screenie.
« Last Edit: September 20, 2012, 02:04:30 pm by Chockosta »

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Some 3D with Ndless...
« Reply #1 on: February 28, 2012, 02:44:25 pm »
That looks really nice ! :D

Trying on nspire_emu :P
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Chockosta

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 447
  • Rating: +169/-6
    • View Profile
Re: Some 3D with Ndless...
« Reply #2 on: February 29, 2012, 07:41:32 am »
I just modified main.c, because I realised that I changed some values for testing purposes.
(I updated the first post)
If you downloaded it, you should do it again...
« Last Edit: February 29, 2012, 07:41:48 am by Chockosta »

Offline Jonius7

  • python! Lua!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1918
  • Rating: +82/-18
  • Still bringing new dimensions to the TI-nspire...
    • View Profile
    • TI Stadium
Re: Some 3D with Ndless...
« Reply #3 on: February 29, 2012, 07:45:26 am »
Wow, looks nice.
I haven't downloaded Ndless 3.1 yet (what was I doing?), I just have 2.1, so I'll try it now.
Programmed some CASIO Basic in the past
DJ Omnimaga Music Discographist ;)
DJ Omnimaga Discography
My Own Music!
My Released Projects (Updated 2015/05/08)
TI-nspire BASIC
TI-nspire Hold 'em
Health Bar
Scissors Paper Rock
TI-nspire Lua
Numstrat
TI-nspire Hold 'em Lua
Transport Chooser
Secret Project (at v0.08.2 - 2015/05/08)
Spoiler For Extra To-Be-Sorted Clutter:

Spoiler For Relegated Projects:
TI-nspire BASIC
Battle of 16s (stalled) | sTIck RPG (stalled) | Monopoly (stalled) | Cosmic Legions (stalled)
Axe Parser
Doodle God (stalled while I go and learn some Axe)

Offline Chockosta

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 447
  • Rating: +169/-6
    • View Profile
Re: Some 3D with Ndless...
« Reply #4 on: February 29, 2012, 08:04:51 am »
Oh, you might want the executable file...

The attached one should give you 100 cubes (like in the screenshot). You can turn them with the arrow keys.

WARNING : This has never been ran on a real calculator. I am not responsible if it causes any damages to your Nspire.
This executable only works with grayscale Nspires (It won't cause anything bad on a CX, but it will display random pixels...)
« Last Edit: February 29, 2012, 08:08:36 am by Chockosta »

Offline Jonius7

  • python! Lua!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1918
  • Rating: +82/-18
  • Still bringing new dimensions to the TI-nspire...
    • View Profile
    • TI Stadium
Re: Some 3D with Ndless...
« Reply #5 on: February 29, 2012, 08:16:45 am »
Ah thanks. I was just about to say if I would have to compile it lol.
Now those cubes look very s**y...
EDIT: If you rotate it right you can get them to look like minecraft blocks perspectively, which is what you're aiming for, I guess.
« Last Edit: February 29, 2012, 08:21:30 am by Jonius7 »
Programmed some CASIO Basic in the past
DJ Omnimaga Music Discographist ;)
DJ Omnimaga Discography
My Own Music!
My Released Projects (Updated 2015/05/08)
TI-nspire BASIC
TI-nspire Hold 'em
Health Bar
Scissors Paper Rock
TI-nspire Lua
Numstrat
TI-nspire Hold 'em Lua
Transport Chooser
Secret Project (at v0.08.2 - 2015/05/08)
Spoiler For Extra To-Be-Sorted Clutter:

Spoiler For Relegated Projects:
TI-nspire BASIC
Battle of 16s (stalled) | sTIck RPG (stalled) | Monopoly (stalled) | Cosmic Legions (stalled)
Axe Parser
Doodle God (stalled while I go and learn some Axe)

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Some 3D with Ndless...
« Reply #6 on: February 29, 2012, 08:20:01 am »
Looks nice. Although this may be slow I'm pretty much convinced that something like minecraft should be possible on an nspire. ;)


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Some 3D with Ndless...
« Reply #7 on: February 29, 2012, 08:20:26 am »
Wouldn't a call to lcd_ingray() be enough for Nspire CX compatibility?
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Chockosta

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 447
  • Rating: +169/-6
    • View Profile
Re: Some 3D with Ndless...
« Reply #8 on: February 29, 2012, 08:36:11 am »
@calc84maniac :
Sure, I will do that if I manage to create a game.
This program is just a proof of concept.


I just made some tests...
It starts to be too slow if I draw more than 500 cubes.
A minecraft might be possible if I managed to determine which cubes have to be drawn and which ones are hidden.
But I really don't know how to do that.

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Some 3D with Ndless...
« Reply #9 on: February 29, 2012, 12:50:38 pm »
Nice work :D

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: Some 3D with Ndless...
« Reply #10 on: February 29, 2012, 03:12:30 pm »
Looks nice. How fast does it run approximately? It's hard to tell on a grayscale calc because the LCD is so blurry. X.x

EDIT: Seems to run at good speed considering the large amount of cubes displayed. I guess maybe with too much stuff it might be a bit too slow but a bunch of games like Star Fox would most likely be doable.
« Last Edit: February 29, 2012, 03:25:25 pm by DJ_O »

Offline Jonius7

  • python! Lua!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1918
  • Rating: +82/-18
  • Still bringing new dimensions to the TI-nspire...
    • View Profile
    • TI Stadium
Re: Some 3D with Ndless...
« Reply #11 on: February 29, 2012, 11:54:50 pm »
The cubes do rotate a bit slowly, but that could be speeded up somehow I guess.
Potentially good enough for great games to be ported.
Minecraft could work, but only in a partial form, because it even freezes on my computer (with the Minecraft logo changing to a Java logo), sometime regularly.
Programmed some CASIO Basic in the past
DJ Omnimaga Music Discographist ;)
DJ Omnimaga Discography
My Own Music!
My Released Projects (Updated 2015/05/08)
TI-nspire BASIC
TI-nspire Hold 'em
Health Bar
Scissors Paper Rock
TI-nspire Lua
Numstrat
TI-nspire Hold 'em Lua
Transport Chooser
Secret Project (at v0.08.2 - 2015/05/08)
Spoiler For Extra To-Be-Sorted Clutter:

Spoiler For Relegated Projects:
TI-nspire BASIC
Battle of 16s (stalled) | sTIck RPG (stalled) | Monopoly (stalled) | Cosmic Legions (stalled)
Axe Parser
Doodle God (stalled while I go and learn some Axe)

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Some 3D with Ndless...
« Reply #12 on: March 02, 2012, 05:26:36 am »
You can't call rewriting a program really porting.
And normally if you do this you can optimize it how you want.

One of the problems of Minecraft is that it's written in Java, and Java is full of problems itself (no offense Java programmers).

Offline Jonius7

  • python! Lua!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1918
  • Rating: +82/-18
  • Still bringing new dimensions to the TI-nspire...
    • View Profile
    • TI Stadium
Re: Some 3D with Ndless...
« Reply #13 on: March 02, 2012, 05:35:57 am »
Minecraft being written in Java cannot escape the fact that it cannot be independent of it. And therefore sometimes, the minecraft logo in the taskbar disappears and gets replaced with a Java icon (when it is frustratingly not responding), which IMHO, seems to 'cheapen' or make it look less polished as a game. But it's not like it's a big game release from a big company either.
« Last Edit: March 02, 2012, 05:36:17 am by Jonius7 »
Programmed some CASIO Basic in the past
DJ Omnimaga Music Discographist ;)
DJ Omnimaga Discography
My Own Music!
My Released Projects (Updated 2015/05/08)
TI-nspire BASIC
TI-nspire Hold 'em
Health Bar
Scissors Paper Rock
TI-nspire Lua
Numstrat
TI-nspire Hold 'em Lua
Transport Chooser
Secret Project (at v0.08.2 - 2015/05/08)
Spoiler For Extra To-Be-Sorted Clutter:

Spoiler For Relegated Projects:
TI-nspire BASIC
Battle of 16s (stalled) | sTIck RPG (stalled) | Monopoly (stalled) | Cosmic Legions (stalled)
Axe Parser
Doodle God (stalled while I go and learn some Axe)

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Some 3D with Ndless...
« Reply #14 on: March 02, 2012, 06:21:23 am »
A minecraft might be possible if I managed to determine which cubes have to be drawn and which ones are hidden.
But I really don't know how to do that.
I guess (I said "I guess", not "I know") it would be like raycasting. You must determine which cubes are hidden by others (not to draw) and which cubes are too far (not to draw) with imaginary rays you project everywhere, then you draw the remaining cubes, only the ones the character can see.
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s