Skip to content

mibi88/MibiCraft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

                                    MIBICRAFT
                                    by Mibi88

A small game in a world of cubes

-------------------------------------------------------------------------------

                                    TODO

[ ] Fix the sluggishness caused by warping the pointer.

[ ] Use mutexes and/or barriers for safer threading
[ ] Use config file to generate C code with tool/dataconv, to make block
    definition easier and add other block shapes easily
[x] Add support for multiple textures per block
[ ] Allow for block rotation
[ ] Optimize the culled mesher
[ ] Add lighting
[ ] Add water movement
[ ] Add world saving

-------------------------------------------------------------------------------

                            COMPILING ON LINUX

MibiCraft is straightforward to compile on linux: in the project folder run

$ meson setup build

and run

$ meson compile -C build

to compile it. You may need to run it multiple times before it succeeds.

-------------------------------------------------------------------------------

                            COMPILING ON WINDOWS

I can't test it on modern windows versions. I'm only testing it on Windows XP

-------------------------------------------------------------------------------

                    COMPILING MIBICRAFT ON WINDOWS XP

MibiCraft works correctly with zlib 1.3 and libpng 1.6.40 (at the time I'm
writing this, the 20/06/2025, with the latest commit being commit d88a2be "Add
Win32 support" from the 20/06/2025). Previously, freeglut was required but it
isn't anymore.

Compiling MibiCraft is quite difficult on Windows XP. I recommend you to
compile it with OpenWatcom 1.6 (OpenWatcom 1.9 was quite buggy for me, so I
downgraded to OpenWatcom 1.6 which worked slightly better). MibiCraft can also
be built with gcc, but I wasn't able to compile my image conversion tool,
imgconv, with it.

First, you'll need to compile the imgconv tool.

    COMPILING IMGCONV

imgconv uses libpng to read the assets, which was quite challenging to build.

    Compiling libpng on Windows XP

libpng provides files to compile it with the OpenWatcom IDE, but they require a
build of zlib which I wasn't able to build correcly.

That's why I created a static library project. I Added the following source
files to it :

- lpng1640\png.c
- lpng1640\pngerror.c
- lpng1640\pngget.c
- lpng1640\pngmem.c
- lpng1640\pngpread.c
- lpng1640\pngread.c
- lpng1640\pngrio.c
- lpng1640\pngrtran.c
- lpng1640\pngrutil.c
- lpng1640\pngset.c
- lpng1640\pngtrans.c
- lpng1640\pngwio.c
- lpng1640\pngwrite.c
- lpng1640\pngwtran.c
- lpng1640\pngwutil.c
- zlib-1.3\adler32.c
- zlib-1.3\compress.c
- zlib-1.3\crc32.c
- zlib-1.3\deflate.c
- zlib-1.3\gzclose.c
- zlib-1.3\gzlib.c
- zlib-1.3\gzread.c
- zlib-1.3\gzwrite.c
- zlib-1.3\infback.c
- zlib-1.3\inffast.c
- zlib-1.3\inflate.c
- zlib-1.3\inftrees.c
- zlib-1.3\trees.c
- zlib-1.3\uncompr.c
- zlib-1.3\zutil.c

After building the library by pressing F5, copy the generated .lib file to
C:\WATCOM\lib386\nt and the libpng and zlib (I don't know if they are required,
but I also copied them) header files to C:\WATCOM\h\nt (if you installed the
OpenWatcom C compiler at  C:\WATCOM).

    Compiling the imgconv executable

Now just build imgconv. The compilation should succeed. Check that you've
followed the previous steps properly if it fails.

    COMPILING MIBICRAFT

Now you should be able to compile MibiCraft easily using the build files, by
opening the project file in the OpenWatcom IDE, marking the target for remake
and pressing F5.

Now you should be able to run MibiCraft, it is a standalone executable :D
(previously freeglut.dll was required, but it isn't anymore, because I got rid
of freeglut, and replaced it with custom code :D).

-------------------------------------------------------------------------------

                        A SMALL NOTE TO ME

The command to open everything in GNU nano:

$ nano $(find . -path ./.git -prune -o -path ./bin -prune -o -path ./img \
    -prune -o -path ./win32 -prune -o -name COPYING -prune -o -type f \
    -print | sort)

About

A small game in a world of cubes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages