Crafti (Minecraft clone) for the Dreamcast !

This forum is for discussion pertaining to homebrew software for the Dreamcast, such as homebrew games, emulators/interpreters, and other homebrew software/applications. Porting requests and developmental ideas are not to be made here; you can make those here. If you need any help burning discs for homebrew software, this is the place to ask as well.
Post Reply
gameblabla
DCEmu Junior
DCEmu Junior
Posts: 38
Joined: Tue Jul 14, 2015 8:32 pm

Crafti (Minecraft clone) for the Dreamcast !

Post by gameblabla » Wed Jan 18, 2017 2:51 am

Image
I looked around at porting Vogtinator's nCrafti to the Sega Dreamcast and here it is !
It's a Minecraft clone programmed by Vogtinator for the Ti Nspire CX : a very limited calculator with a weak ARM cpu. (clocked at 132 Mhz !)
It is entirely software renderered : No OpenGL, only a framebuffer.

The Dreamcast port runs okay and does not make use of the PowerVR GPU.

No enemies are available but you do get Redstone and TNT blocks !

Grab it while it's hot :
CDI file
https://gameblabla.nl/files/crafti-dreamcast.zip
Plain files (for SD cards)
https://gameblabla.nl/files/crafti-dc-sd.zip

Burn the CDI file and you're good to go !
There's no music, since it was slowing down the game (it requires a lot of RAM as well) but there are some sound effects.
Last edited by gameblabla on Wed Jan 18, 2017 10:04 pm, edited 1 time in total.
User avatar
bogglez
Moderator
Moderator
Posts: 567
Joined: Sun Apr 20, 2014 9:45 am

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by bogglez » Wed Jan 18, 2017 5:07 am

Nice project!

I had a quick look at the code. Some suggestions, if you want to speed things up

1. You can use the fast math routines of the SH4 (fsincos) instead of the sinus table to implement fast_sin and fast_cos. Your code also always computes both sine and cosine, so I suggest you add a call fast_sincos(degree, &sin, &cos) anyway.

http://gamedev.allusion.net/docs/kos-cu ... 87868239ca

2. Another easy change with huge performance benefits would be reimplementing nglDisplay. Instead of memcpy in ngl/gl.cpp on line 245 you should perform an asynchronous copy using a store queue or dma. This has increased performance a lot in other software rendered titles as well.

3. It would be much faster if you used kos gl and made use of the hardware. Since you only use a small subset of OpenGL, the port should be relatively straight forward.

4. You should draw arrays of triangles, instead of calling a function for every vertex (glBegin vs. glDrawArrays)
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
gameblabla
DCEmu Junior
DCEmu Junior
Posts: 38
Joined: Tue Jul 14, 2015 8:32 pm

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by gameblabla » Wed Jan 18, 2017 11:07 am

1. This is going to be very tricky : it uses fixed point (on an int) rather than floats for math...
So far my attempts to switch to fast_cos and fast_sin has failed.

2. Hmm... Using DMA might do it. Any examples or open source games that uses it ?

3 and 4. I know but i admit i'm not really familiar with even OpenGL :p
I might attempt a gl port for the pc version first, then the dc

Thanks for the quick look booglez !
User avatar
bogglez
Moderator
Moderator
Posts: 567
Joined: Sun Apr 20, 2014 9:45 am

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by bogglez » Wed Jan 18, 2017 3:20 pm

1. Yeah you'd have to switch to float. If you want to support both platforms and that other platform doesn't have floats you'll have to introduce some global typedef depending on the platform you're on.

2. Check the first bullet point viewtopic.php?f=29&t=104104&p=1051279#p1051279
I've also tried this myself in a raytracer I wrote.
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
roflmao
DCEmu Newbie
DCEmu Newbie
Posts: 1
Joined: Wed Jan 18, 2017 8:13 pm

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by roflmao » Wed Jan 18, 2017 8:15 pm

This looks amazing! I'm downloading it now.
brmanuk
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 33
Joined: Thu Dec 04, 2003 11:54 am

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by brmanuk » Wed Jan 18, 2017 9:40 pm

Awesome! Always hungry for more DC homebrew. Any chance of plain files so I can make an SD Iso?
gameblabla
DCEmu Junior
DCEmu Junior
Posts: 38
Joined: Tue Jul 14, 2015 8:32 pm

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by gameblabla » Wed Jan 18, 2017 10:09 pm

bogglez wrote:1. Yeah you'd have to switch to float. If you want to support both platforms and that other platform doesn't have floats you'll have to introduce some global typedef depending on the platform you're on.
It's going to be a little more tricky than a couple of idefs, i'm afraid...
I will talk with Vogtinator about this at some point, if he's still interested lol. (floats should squash those graphical bugs as well)

I actually tried to disable rendering, to see if using store queues on a texture would improve things
and rendering is not the bottleneck, especially at the low resolution of 320x240.
Best case, i would only gain 1~3 FPS.
I will look at this at some point tho.
brmanuk wrote:Awesome! Always hungry for more DC homebrew. Any chance of plain files so I can make an SD Iso?
Here are the plain files :
https://gameblabla.nl/files/crafti-dc-sd.zip

Thanks for the comments, i'm amazed by the reception !
DARKHALO2K
Insane DCEmu
Insane DCEmu
Posts: 160
Joined: Wed Sep 03, 2003 6:37 pm

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by DARKHALO2K » Thu Jan 19, 2017 2:48 am

Excellent work! Thanks for sharing.
User avatar
bogglez
Moderator
Moderator
Posts: 567
Joined: Sun Apr 20, 2014 9:45 am

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by bogglez » Thu Jan 19, 2017 9:39 pm

gameblabla wrote:
bogglez wrote: I actually tried to disable rendering, to see if using store queues on a texture would improve things
and rendering is not the bottleneck, especially at the low resolution of 320x240.
Best case, i would only gain 1~3 FPS.
I will look at this at some point tho.
I assumed the renderer is the bottle neck because you're not running at 640x480.

BTW I shared this with the dcjunkyard on Twitter and you seem to be pretty popular there, if that motivates you to work on this :)
https://twitter.com/TheDCJunkyard/statu ... 3260538880
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
brmanuk
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 33
Joined: Thu Dec 04, 2003 11:54 am

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by brmanuk » Sat Jan 21, 2017 1:47 am

gameblabla
DCEmu Junior
DCEmu Junior
Posts: 38
Joined: Tue Jul 14, 2015 8:32 pm

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by gameblabla » Sat Jan 21, 2017 9:22 am

Crafti is catching fire it seems... I guess people really wanted to have minecraft (a clone of it) on the Dremcast !
Hopefully it should ease of pain of In the Line of Fire being canceled.

I won't work more on this though... maybe at a later point once i have ported my own games (KillMinds & Rubby Bird 100) to the DC.
Post Reply