Video (will probably download rather than play)
g3a download

I'm working on this Minecraft clone game for the CG50 calculator. I got quite far but it's not really a full game yet. I've locked it to 20fps but it there is some headroom most of the time and I can probably optimise it more as well for further render distances/framerates in the future. The 3D is done using small3dlib, and also the Azur engine which can do triangle rendering using the calculator's fast on-chip memory.

Features:
- Renders a 16x32x16 flat-shaded world at a mostly consistent 20fps
- Physics that mostly match actual Minecraft
- Block placing (only wood planks) and breaking
- Crosshair, block selection indicator and toggleable F3 screen
Missing features (may come in the future):
- World saving
- Multiple chunks
- Placing anything but planks
- Inventory
- Textures
- Health
- Flying
- Mobs
- Most other things

Controls:
Forward: OPTN
Back: log
Left: ALPHA
Right: ^
Jump: SHIFT
Camera: Up/Down/Left/Right
Break: F1
Place: F2
Toggle debug overlay: F3

Source code (won't work as-is because it needs a patch to a library, I'll explain if anyone wants to build it)
I'm trying this on my fx-CG10 and it works pretty well (although slower if the calculator isn't overclocked, but still playable. I get between 8 and 15 FPS). Nice work on this so far. I was curious if this line of calculator could support Minecraft and I'm glad it does. I also like the dual d-pad controls.
That's impressive!!! I'm using the same calculator so it runs pretty smoothly for me like in the video. Did you record that using your emulator?
Wow that's impressive I've seen worse, it looks amazing for a calculator. What kind of rendering are you using.
QuietRiot wrote:
That's impressive!!! I'm using the same calculator so it runs pretty smoothly for me like in the video. Did you record that using your emulator?


Thanks, yes, it’s a screen recording using the emulator
Invalid_Jake wrote:
Wow that's impressive I've seen worse, it looks amazing for a calculator. What kind of rendering are you using.


Thanks! The rendering is done in the normal way, using rasterisation. It goes over each block in the world, works out which faces are visible and makes a mesh out of it, and this is redone whenever the world is changed. Then to render it I pass that data into a version of the small3dlib library I linked to above but with some changes to replace its built in triangle rendering function with the one from the Azur library, which was made by Lephe (a member on this forum who also has helped me a lot in my Discord server). Azur does a clever trick where it renders the screen in segments small enough that they can fit into the fast on chip memory in the calculator which is faster than main RAM because it’s on the CPU itself instead of a separate chip. I’m not using a depth buffer, instead small3dlib sorts all the triangles from back to front before it renders them. That works particularly well here because the triangles don’t overlap in strange ways, it’s all on a block grid. I’m not really doing many tricks to take advantage of the fact that it’s all voxels at right angles on a grid yet, but I have some ideas I’m going to try to speed it up more! For example it can simply the backface culling calculations and maybe I can loop over the blocks in the world from back to front to avoid the sorting step. Another idea I could potentially tey to get really high render distances is using the algorithm described at https://github.com/s-macke/VoxelSpace but that will have artifacts so it will only work for things that are far away and I don’t know if I can free up enough frame time to run both that and the main renderer

(sorry for the long wall of text)
Thanks for the reply, that's interesting on how you break it up into portions I would have never of thought of that. That's very cool I'll take a look at the libraries you linked. Very Happy
Here's a build running at full resolution rather than half:

Minecraft.g3a



I did some optimisation which gave me some extra headroom, I could use it to increase the framerate or render distance instead, but the physics are currently tied to the framerate so they would be too fast and increasing the render distance would need me to implement multiple chunks, so I did this instead
Awesome! I get 12-15 FPS now and when I'm at the top of a block tower looking down I still manage to get 9 FPS.
DJ Omnimaga wrote:
Awesome! I get 12-15 FPS now and when I'm at the top of a block tower looking down I still manage to get 9 FPS.


I could post a build for the CG10 that has the optimisations without the high resolution if you want. Is that framerate with or without an overclock?

Edit: Here, you can try this if you want, it might help a bit: Minecraft.g3a


Here's a demo of the Minecraft game with affine texture mapping, which is an approximate but fast way to map textures onto triangles. It's mostly just a demo for now because quite a lot is missing:

- You can't place or destroy any more because I need to redo how the block selection highlight works first
- There's no lighting variation so it all looks quite flat
- The affine texture mapping means things warp when you get close, I can make this better in the future by splitting nearby faces up
- The performance sometimes drops to 14fps in the worst case
- Some blocks (on the tree) are still untextured

However it does still often reach 20fps at full resolution which is better than I thought it would be

g3a file
This looks absolutely crazy! I thought that minecraft on a calculator was long gone after the ndless version ceased development
Thanks, I’m hoping to make it into a more full game and maybe I could port it to some other calculators eventually if I can?
This is really impressive, you made a really good job.

I guess the usual tricks such as fixed point arithmetics, precalculated tables and stuff like this have been already used to achieve 20FPS (is that really the max, cause it seems to be artificially capped ?).
Amazing work adding the textures. Hopefully you can fix a portion of the warping in future versions. Regardless I'm still amazed even when I don't overclock my fx-CG10 as it remains playable.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement