Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Chockosta

Pages: 1 2 3 [4] 5 6 ... 31
46
TI-Nspire / Re: nCraft (3D minecraft-like game for the nspire)
« on: September 30, 2012, 02:05:30 pm »
I finally found 1 hour or 2 to code :)

I obviously didn't have time to add saving, but I changed two things :
-Now the full render should not crash anything : it uses 25 times less RAM. I also added a progress bar.
-I finally fixed the sorting bug !

The new version is attached...

47
TI-Nspire / Re: nCraft (3D minecraft-like game for the nspire)
« on: September 29, 2012, 01:17:37 pm »
Quote
Also, is an inventory being planned?

Like this?(I made this in 1 minute)


Yes, maybe :)
But it will be smaller, due to the size of the Nspire screen

Thanks for the epic video, DJ !
Seems like you've already build more things than me :P I didn't spend much time playing yet...

Sorry, but I don't have time to work on it this week-end, because of my math club :/
But I will try to add saving for wednesday...

48
TI-Nspire / Re: nCraft (3D minecraft-like game for the nspire)
« on: September 28, 2012, 12:29:30 pm »
Is there a reason you use double instead of float? If you don't really need the extra precision, you can go with float and use half the space (and probably less processing time too)
Yes, I changed to floats yesterday, like 30 minutes after posting my code :P

49
TI-Nspire / Re: nCraft (3D minecraft-like game for the nspire)
« on: September 28, 2012, 11:46:10 am »
hm I get a crash when I press F sadly
ti-nspire CX OS 3.1.0
Yes, if there is no much free RAM, it crashes.
That's because the algorithm that I used is totally stupid... I render all the blocks in once. I am working to use a chunk-based render, that should divide the used RAM by 25 :) .

Is there a jump key?
No, but that's planned. By the way, which keys should I use ? Because Augs said that the current ones are inconvenient...

This is great.
Also seconded on the saving. Even if it's just a savestate or something, it'd be worth it :D
Saving is indeed the next big step.

50
TI-Nspire / Re: nCraft (3D minecraft-like game for the nspire)
« on: September 27, 2012, 03:24:06 pm »
Yes, same for me...

51
TI-Nspire / Re: nCraft (3D minecraft-like game for the nspire)
« on: September 27, 2012, 02:32:42 pm »
Thanks for the help !

First off, it is important to note that whenever the camera is within a voxel, the voxels that are rendered are sorted relative to the distance they are to that voxel.  Consequently no matter what voxel the camera is in, the order of the rendered voxels is always the same relative to the center camera voxel.  What this means is that you can presort a large number of voxel positions into an array based on how far they are from a center voxel, and simply use those positions relative to the camera to render.
Seems interesting. Could you give an exemple ? Because of my poor English skills, I'm not sure that I've got it very well...

This works, but it can take up a large amount of memory.  If that is a problem, there is another solution that I discovered when working on my Castle Storm game, which uses a similar rendering method.  The way it would work is by drawing the voxels (still relative to the camera position) in shells, and it is painfully difficult to explain, so if you are interested, I can whip up some sort of gif or example and we can talk from there
Memory isn't a big problem on the TI-Nspire. i can achieve full world renders, which means that I use an array containing more than 30,000 floats...

Now, this would speed up the sorting of cubes, but it would not actually speed up the drawing, which is probably another main bottleneck.  First off, since you are only rendering cubes, you can always discard the faces that are facing away from you.  This is a rendering trick you can use on convex objects, that any faces that are facing away from you cannot actually be seen.  Additionally, you can use a simply dot product to detect whether or not a face is facing away from you, so it is super speedy and results in half of your faces being discarded!
I already do that :)

Another method would be to look at the cubes surrounding a cube to be rendered.  When you go to render a cube, you can look at neighboring cubes to see if they are solid, if not, you do not have to render the connecting face!  This should result in significant speedups hopefully, since using these methods would drastically cut down on the number of polygons you need to render in any given frame. 
This could improve my drawing function indeed, since I draw every cube that "touches" an empty block...




By the way, I added a function to render full world with F.
You now can see your creations properly :)
Full renders take about 5 secs to generate...
But as I said, I use more than 30,000 floats, so I'm afraid that it might crash grayscale Nspires, which don't have so much RAM. (it doesn't crash the grayscale emulator, though)

52
TI-Nspire / Re: nCraft (3D minecraft-like game for the nspire)
« 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...

53
TI-Nspire / Re: nCraft (3D minecraft-like game for the nspire)
« 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

54
TI-Nspire / Re: nCraft (3D minecraft-like game for the nspire)
« on: September 26, 2012, 09:25:37 am »
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...

55
Miscellaneous / Re: Post your desktop
« on: September 26, 2012, 08:05:44 am »
Whoa, that wallpaper is awesome! Can you post the wallpaper itself, Chockosta?
Sure ! Here you are
Spoiler For Spoiler:

56
TI-Nspire / Re: nTris - Tetris for nSpire -
« on: September 26, 2012, 08:02:49 am »
Yes, I know this one, I even have it on my calculator.
The graphics are awesome too, but there are several problems :
-sometimes you loose without any reason
-the feature to "hold" blocks is really buggy.

(maybe there is a new version whith bugfixes, I would be happy to download it)

57
TI-Nspire / Re: nTris - Tetris for nSpire -
« on: September 26, 2012, 07:44:09 am »
Awesome work !
The graphics are really beautiful, I think this is the best tetris for the Nspire yet...

58
TI-Nspire / Re: nCraft (3D minecraft-like game for the nspire)
« on: September 25, 2012, 01:15:20 pm »
Progresses for today :
-Added straffing with 4 and 6
-Added 5 to go backward
-Implemented the checkboard effect to all the map, not only the grass layer (this part was MUCH harder than I thought, took me more than an hour)

So I'm sorry, I can't add the possibility to place blocks today, so no download :P
Maybe tomorrow :)
Here is a screenie to wait...

59
TI-Nspire / Re: nCraft (3D minecraft-like game for the nspire)
« on: September 25, 2012, 11:39:01 am »
Is it okay to also add in 4 and 6 to strafe? And I'm not sure, but I think that 5 would be better for backwards movement, since it is more like a keyboard of a computer, and you dont have to reach as far for the button. It's just right underneath (just slide your thumb down :D)
Yes, those are nice ideas. I'll add them as soon as possible.

:D I NEED DOWNLOAD!

and when you destroy a block do you get it in your inventory?
Well, since I didn't create the inventory yet, you don't get the blocks that you destroy :p
But when I'll have a working inventory, this will require like 2 or 3 lines of code.

and trees should be added too
Indeed, this should not be complicated. But I'll work on the world generator later. (and I'll add biomes too !)

Thanks everybody for your support !

60
TI-Nspire / Re: nCraft (3D minecraft-like game for the nspire)
« on: September 24, 2012, 02:39:07 pm »
Also nice chockosta. Any possibility to have the checkerboard work vertically as well, not just horizontally?
Yeah, I will add a vertical checkboard too.

Pages: 1 2 3 [4] 5 6 ... 31