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

0 Members and 1 Guest are viewing this topic.

Offline annoyingcalc

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1953
  • Rating: +140/-72
  • Found in Eclipse.exe
    • View Profile
Re: nCraft (3D minecraft-like game for the nspire)
« Reply #165 on: September 26, 2012, 08:58:02 pm »
Played a bit with my raycasting function and I am now able to add cubes !
I am proud to show you the very first dirt house in the history of nCraft :P (see attached screenie)

Unfortunately, this helped me dicovering a graphical glitch : sometimes, a cube doesn't seem to be sorted properly.
Not very annoying, but I still have to repair this.
I hope I will fix it soon...
im tired of no download D: can you release this even with the bug?
This used to contain a signature.

Offline blfngl

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 121
  • Rating: +3/-4
  • No worry, I'll surpass Calc84 in greatness...never
    • View Profile
Re: nCraft (3D minecraft-like game for the nspire)
« Reply #166 on: September 26, 2012, 09:29:18 pm »
^indeed! Patience isn't what most of us have ;)
GAMEGAMEGAMEGAMEGAMEGAMEGAMEGAMEGAMEGAME
My blog:

TiLibs
My Projects:
Minecraft Library

Offline AzNg0d1030

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 522
  • Rating: +45/-4
  • Hardcore anime watcher.
    • View Profile
Re: nCraft (3D minecraft-like game for the nspire)
« Reply #167 on: September 26, 2012, 10:37:10 pm »
Annoyingcalc, I can see you are fairly obsessed... With your avatar and all.... LOL XD
You just lost the game.



Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: nCraft (3D minecraft-like game for the nspire)
« Reply #168 on: September 27, 2012, 01:10:32 am »
im tired of no download D: can you release this even with the bug?
^indeed! Patience isn't what most of us have ;)
I agree with them, the bug is only a displaying bug, not an irrevocable crash so a demo of this with the bug would already be awesome.

Also, I thought about something that may be a faster way to draw the cubes but I am not sure if that will work so I first need to know some things:
-can you draw arbitrary sizes of sprites with Ndless C ?
-can those sprites support transparency ?
« Last Edit: September 27, 2012, 01:11:10 am by Hayleia »
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

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: nCraft (3D minecraft-like game for the nspire)
« Reply #169 on: September 27, 2012, 02:27:34 am »
I have a question of my own, how exactly are you 'sorting' the cubes to draw?  Are you actually putting their distances in a list and sorting them?

Offline annoyingcalc

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1953
  • Rating: +140/-72
  • Found in Eclipse.exe
    • View Profile
Re: nCraft (3D minecraft-like game for the nspire)
« Reply #170 on: September 27, 2012, 10:23:33 am »
Annoyingcalc, I can see you are fairly obsessed... With your avatar and all.... LOL XD
Yep and so are pretty much all my friends
This used to contain a signature.

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: nCraft (3D minecraft-like game for the nspire)
« Reply #171 on: September 27, 2012, 10:52:40 am »
We don't care about the graphical glitch :), this is one really awesome program :D ! You sir have my full support on this :)

Some people need a high five in the face... with a chair.
~EC

Offline Chockosta

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 447
  • Rating: +169/-6
    • View Profile
Re: nCraft (3D minecraft-like game for the nspire)
« Reply #172 on: September 27, 2012, 11:39:15 am »
I have a question of my own, how exactly are you 'sorting' the cubes to draw?  Are you actually putting their distances in a list and sorting them?
Yes indeed. I pretty much optimized the sorting algorithm, but if you know a better way, I would like to know it

Also, I thought about something that may be a faster way to draw the cubes but I am not sure if that will work so I first need to know some things:
-can you draw arbitrary sizes of sprites with Ndless C ?
-can those sprites support transparency ?
I don't think that ndless does that, but it's quite easy to code.
Why ?

im tired of no download D: can you release this even with the bug?
^indeed! Patience isn't what most of us have ;)
I agree with them, the bug is only a displaying bug, not an irrevocable crash so a demo of this with the bug would already be awesome.
Ok, ok, here is the current version :) (I also can post the source code, if you want)
It won't crash, but there are 2 known "bugs" :
-Sometimes a cube isn't sorted correctly so its display looks weird
-When you are too close to a cube, it isn't displayed

And you will notice quickly that the render distance is really short :/
I will add an option to render the full world to see your creations.

Controls :
-8 to go forward
-5 or 2 to go backward
-6 and 4 to strafe
-Arrows to turn the camera
-Tab to remove a block
-Ctrl to add a block
-+ and - to select a block (the type is shown in a little triangle in the top right corner)
-Esc to quit
« Last Edit: September 27, 2012, 11:43:20 am by Chockosta »

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: nCraft (3D minecraft-like game for the nspire)
« Reply #173 on: September 27, 2012, 12:55:17 pm »
Also, I thought about something that may be a faster way to draw the cubes but I am not sure if that will work so I first need to know some things:
-can you draw arbitrary sizes of sprites with Ndless C ?
-can those sprites support transparency ?
I don't think that ndless does that, but it's quite easy to code.
Why ?

Well I thought about a 3d drawing method that could speed up the game, but I am not really sure.
Basically, it is based on the isometric 3d idea.

In isometric 3d, all the cubes are the same, so you only need to draw one in 3d, then use the image of this cube as a masked sprite to draw all the other ones.

In non isometric 3d, one cube is not enough since not all the cubes are seen from the same angle, but one cube per line is enough. If you have n aligned cubes you draw one of them using your current 3d engine, then use the image of this cube as a masked sprite to draw the other ones, using some sprite scaling.

So basically, if you have n lines of m cubes each, you don't need to draw n*m cubes in 3d but only n cubes and n*m sprites.

Do you get what I mean (or is my English really bad :P) ?
« Last Edit: September 27, 2012, 12:57:28 pm by Hayleia »
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

Offline hoffa

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nCraft (3D minecraft-like game for the nspire)
« Reply #174 on: September 27, 2012, 01:05:57 pm »
Isometric 3D would look extremely weird and is not at all suitable for first person games.

Offline lkj

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 485
  • Rating: +58/-1
    • View Profile
Re: nCraft (3D minecraft-like game for the nspire)
« Reply #175 on: September 27, 2012, 01:06:50 pm »
Wow, this is comming along quite nicely!
I'm glad you've come back :)

Ok, ok, here is the current version :) (I also can post the source code, if you want)
The source code would be interesting ;)

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: nCraft (3D minecraft-like game for the nspire)
« Reply #176 on: September 27, 2012, 01:08:32 pm »
Isometric 3D would look extremely weird and is not at all suitable for first person games.
Yes, but read my post again, there is the adaptation of the method for non-isometric 3d ("real" 3d).
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

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: nCraft (3D minecraft-like game for the nspire)
« Reply #177 on: September 27, 2012, 01:19:51 pm »
Sprite scaling is more costly than just drawing a cube.
"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: nCraft (3D minecraft-like game for the nspire)
« Reply #178 on: September 27, 2012, 01:27:47 pm »
Also, I thought about something that may be a faster way to draw the cubes but I am not sure if that will work so I first need to know some things:
-can you draw arbitrary sizes of sprites with Ndless C ?
-can those sprites support transparency ?
I don't think that ndless does that, but it's quite easy to code.
Why ?

Well I thought about a 3d drawing method that could speed up the game, but I am not really sure.
Basically, it is based on the isometric 3d idea.

In isometric 3d, all the cubes are the same, so you only need to draw one in 3d, then use the image of this cube as a masked sprite to draw all the other ones.

In non isometric 3d, one cube is not enough since not all the cubes are seen from the same angle, but one cube per line is enough. If you have n aligned cubes you draw one of them using your current 3d engine, then use the image of this cube as a masked sprite to draw the other ones, using some sprite scaling.

So basically, if you have n lines of m cubes each, you don't need to draw n*m cubes in 3d but only n cubes and n*m sprites.

Do you get what I mean (or is my English really bad :P) ?
No, this wouldn't work (if I got it correctly)
Here is a screenie to explain why :

Your method would be to store a the cube A's projection then scale it and paste it on all the cubes in the blue row, right ?
This would only work if the red lines were parallel, since an homothety keeps the angles, but they aren't...
Moreover, calc84maniac is right, scaling is very costly


The source code would be interesting ;)
Here you are :)
Sorry, my comments are too rare...
« Last Edit: September 27, 2012, 01:34:00 pm by Chockosta »

Offline hoffa

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nCraft (3D minecraft-like game for the nspire)
« Reply #179 on: September 27, 2012, 01:29:52 pm »
Oh, true, my bad. Well, even if in theory everything did scale well and there would be no visual issues, I think it would complexify the code quite a bunch as the maths behind your technique might be difficult (mixing 2D and 3D maths is not easy) and I'm not sure if it's guaranteed it will handle all situations perfectly without some dirty hacks. Furthermore, I don't know if the eventual speed gain is enough to compensate for the pain of implementing the technique. But I might be wrong, if it is a (variation) of a proven rendering technique why not. However I believe there are simpler and faster alternatives (I'm not sure what those alternatives are, but looking at the Yeti3D demo on GBA makes me think they exist).
« Last Edit: September 27, 2012, 01:33:38 pm by hoffa »