Crafti (Minecraft clone) for the Dreamcast !

This forum is for discussion pertaining to homebrew and indie 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
User avatar
gameblabla
DCEmu Freak
DCEmu Freak
Posts: 51
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Tue Jul 14, 2015 8:32 pm
Has thanked: 0
Been thanked: 36 times

Crafti (Minecraft clone) for the Dreamcast !

Post by gameblabla »

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 !

Version 1.2

Dreamcast:
https://bafybeickzfjuzs4g6xvq2yms7cn47l ... ast_v11.7z

Naomi (untested on real hardware, needs DC controller adapter) :
https://bafybeickzfjuzs4g6xvq2yms7cn47l ... I_TEST.zip

Github repo:
https://github.com/gameblabla/crafti

Older version
Spoiler!


Changelog :
Spoiler!

Version 1.2
- Performance improvements
- Keyboard & mouse support. Any game controller port should also work, even for the keyboard and mouse. (doesn't matter the order as long as you plug them before start-up)

Version 1.1
- CDDA music
- Speed improvements (faster block copies, backported improvements from upstream)
- Dropped SD card version (you can still run it through other ways but you won't get any music, just like previous version)

Version 1.0
- Initial release


Burn the MDS/MDF file and you're good to go !
If you own a GDEMU, you can place it in its own folder (01, 02, 03...) and rename the MDS/MDF files to disc.mds and disc.mdf respectively.
It should then appear in your frontend.
Last edited by gameblabla on Wed Feb 14, 2024 4:07 pm, edited 7 times in total.
These users thanked the author gameblabla for the post:
Ian Robinson
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by bogglez »

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
User avatar
gameblabla
DCEmu Freak
DCEmu Freak
Posts: 51
Joined: Tue Jul 14, 2015 8:32 pm
Has thanked: 0
Been thanked: 36 times

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by gameblabla »

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: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by bogglez »

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
Has thanked: 0
Been thanked: 0

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by roflmao »

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
Has thanked: 0
Been thanked: 0

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by brmanuk »

Awesome! Always hungry for more DC homebrew. Any chance of plain files so I can make an SD Iso?
User avatar
gameblabla
DCEmu Freak
DCEmu Freak
Posts: 51
Joined: Tue Jul 14, 2015 8:32 pm
Has thanked: 0
Been thanked: 36 times

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by gameblabla »

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: 161
Joined: Wed Sep 03, 2003 6:37 pm
Has thanked: 2 times
Been thanked: 4 times

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by DARKHALO2K »

Excellent work! Thanks for sharing.
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by bogglez »

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
Has thanked: 0
Been thanked: 0

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by brmanuk »

User avatar
gameblabla
DCEmu Freak
DCEmu Freak
Posts: 51
Joined: Tue Jul 14, 2015 8:32 pm
Has thanked: 0
Been thanked: 36 times

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by gameblabla »

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.
User avatar
gameblabla
DCEmu Freak
DCEmu Freak
Posts: 51
Joined: Tue Jul 14, 2015 8:32 pm
Has thanked: 0
Been thanked: 36 times

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by gameblabla »

Too late for xmas unfortunately but i still decided to release an improved version of Crafti with some nice changes.
Music was added thanks to CDDA (as i said before, this game is quite tight on memory) and it should run a bit faster as well. Give it a try
Link is in the first post
These users thanked the author gameblabla for the post:
Ian Robinson
User avatar
gameblabla
DCEmu Freak
DCEmu Freak
Posts: 51
Joined: Tue Jul 14, 2015 8:32 pm
Has thanked: 0
Been thanked: 36 times

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by gameblabla »

I've also posted a link to a test naomi version but this will require the adapter for connecting DC controllers to the NAOMI. And for some reasons, all NAOMI emulators will ignore this kind of input so while the game will run, you can't control it...
I will look into implementing JVS controls at some point.
These users thanked the author gameblabla for the post (total 2):
JuanIan Robinson
User avatar
gameblabla
DCEmu Freak
DCEmu Freak
Posts: 51
Joined: Tue Jul 14, 2015 8:32 pm
Has thanked: 0
Been thanked: 36 times

Re: Crafti (Minecraft clone) for the Dreamcast !

Post by gameblabla »

Updated crafti again with some better performance improvements yet again (i should have used DMA :P) and also added
keyboard and mouse support for the game.

Any game controller port should also work as long as you plug them before startup.
I've also made an updated binary for NAOMI with those changes as well and i believe the DC controller adapter on that expects the controller to be in port 2 and 3 so it should fix controls there as well.
These users thanked the author gameblabla for the post (total 4):
JuanIan RobinsonBasil|darc|
Post Reply