User avatar
spsn
Posts: 72
Joined: Wed Nov 07, 2012 6:33 pm

Not Minecraft, but Blocky

Wed Nov 07, 2012 6:58 pm

My 10 yr old loves Minecraft because it lets him express his creativity by building all kinds of things and trying out mods etc. But what he really wishes to do is to make his own mods. Since that is a bit difficult to do right now, the two of us have embarked on an adventure to write our own little blocky world game where we can put in the things we like and change things to see what happens. Like using a FOV of 180 and ending up with an upside down world, or reversing gravity and flying up into the sky instead of falling to the ground. Many a laugh have been had by us both.

And he is learning how to program in JAVA. And I am learning about 3D graphics which I have never done before.

We have a version of it that runs on the RasPi if you would like to see. This is more a demonstration that this kind of game can be made to work inside the constraints of the RasPi, than anything else. I think there is hope for Minecraft proper yet. So far we have some basic gameplay elements in place; you can walk around, jump, place and remove blocks, and the torches sort of work when you place them inside a dark area you have dug out. Apart from the normal keys, keys 1 and 2 cycle through the list of blocks to place.

Get it here: http://www.4shared.com/file/ttQBdcb3/blocky.html

User avatar
spsn
Posts: 72
Joined: Wed Nov 07, 2012 6:33 pm

Re: Not Minecraft, but Blocky

Wed Nov 07, 2012 7:40 pm

In my excitement I left out some important info.

Blocky uses armhf LWJGL libraries so you will need an armhf distro like Raspbian to run it on. It also needs JAVA OpenJDK installed. Zero will do fine but jamvm is a bit faster, so you may prefer that. There are 2 scripts to run Blocky; ./blocky for Zero and ./blocky-jamvm for jamvm.

The GPU needs 128MB ram and you need to start X first for Blocky to run. I have not yet been able to make a version of LWJGL that runs without X.

The default world size is 128x128 block horizontally but you may try out a 256x256 world too by specifying 256 as the first command line argument.

Extract the downloaded blocky.tgz with the command: tar -xzvf blocky.tgz. This creates a blocky directory, you will find the start scripts and the other files inside.

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: Not Minecraft, but Blocky

Wed Nov 07, 2012 8:31 pm

Giving it a try.

Got java errors so I ran

sudo apt-get install openjdk-7-jre

I can only ssh in right now and when I run either code all I get is a blue screen I can exit out but nothing else. Am I missing something or do you think it will work once I get directly connected to the Pi.

running wheezy - 128mb split not overclocked on a 256mb board.

I am getting a few errors in the background:

Code: Select all

getTexture(res/bar.png) = 38
glGetError 0x500
getTexture(res/terrain.png) = 3268
glGetError 0x500
getTexture(res/border.png) = 43
getTexture(res/spiral3.png) = 202
glGetError 0x500
getTexture(res/numbers1.png) = 203
glGetError 0x500
getTexture(res/b.png) = 887
generateTerrain = 2234
glGetError 0x500
getTexture(res/c.png) = 563
setLighting = 1332
glGetError 0x500
getTexture(res/d.png) = 623
generateMeshes = 14940
CLEAR_BUFFER          = 0.40912762 % [2194]
UPDATE_MATRIX         = 1.3650019 % [7320]
CALCULATE_FRUSTUM     = 1.1496224 % [6165]
BIND_TEXTURE          = 0.35430378 % [1900]
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

User avatar
spsn
Posts: 72
Joined: Wed Nov 07, 2012 6:33 pm

Re: Not Minecraft, but Blocky

Wed Nov 07, 2012 9:18 pm

The LWJGL library that Blocky uses is compiled for hardfloat, so it needs Raspbian or another hardfloat image to run correctly.

My other RasPi is still on wheezy so I will upgrade it and see if I can get a version of Blocky built for softfloat. Will likely take a few days. I will post back here when done.

User avatar
spsn
Posts: 72
Joined: Wed Nov 07, 2012 6:33 pm

Re: Not Minecraft, but Blocky

Wed Nov 07, 2012 9:37 pm

Here is a picture.
Image
Last edited by spsn on Wed Nov 07, 2012 9:47 pm, edited 1 time in total.

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: Not Minecraft, but Blocky

Wed Nov 07, 2012 9:40 pm

That is sweet looking.

Sorry about the confusion I am on the Hard Float image Raspbian “wheezy” I forgot they didn't name the soft and hard differently. (they really should have :) )
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

User avatar
spsn
Posts: 72
Joined: Wed Nov 07, 2012 6:33 pm

Re: Not Minecraft, but Blocky

Wed Nov 07, 2012 9:50 pm

The blue screen you see, is it on the display that is connected to the HDMI of the RasPi?

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: Not Minecraft, but Blocky

Wed Nov 07, 2012 10:03 pm

Ok so I got home the issue is ssh and x it runs looks fantastic.

Are there more commands? This could easily be the answer to everyone who wants a minecraft if it gets more development.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

User avatar
spsn
Posts: 72
Joined: Wed Nov 07, 2012 6:33 pm

Re: Not Minecraft, but Blocky

Wed Nov 07, 2012 11:06 pm

We work on Blocky a bit most every day, so it keeps on growing. Like just last week we still had the leaf code for the trees putting leaf blocks where the tree trunks are supposed to be, so some of the trees looked all funny.

Here is the source code for Blocky as it is now: http://www.4shared.com/zip/5YkuUM9b/blocky-src.html

The source is for the game, the rendering framework and the support libraries, with LWJGL of course. In the form of Eclipse projects so it is easy to work with on PC (where we do our dev, we just compile and test on the RasPi).

The texture atlas that Blocky uses (res/terrain.png) is a 3rd party texture atlas that is compatible with Minecraft and there are still lots of blocks we have not yet added to Blocky, so a fun exercise to start with is maybe to add some more block types and see them actually work in Blocky. Or you can create a whole new texture atlas of your own with your own layout (that's how we started).

If others play around with the code, improve it, have fun and maybe learn something in the process, that would be great. We ourselves will off course keep working on it.

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: Not Minecraft, but Blocky

Thu Nov 08, 2012 10:13 pm

This looks really neat. I don't suppose you've considered putting it on github, and hopefully choosing a Free Software license so others can freely make and share modifications? Personally I'm a fan of the MIT license http://en.wikipedia.org/wiki/MIT_License

User avatar
spsn
Posts: 72
Joined: Wed Nov 07, 2012 6:33 pm

Re: Not Minecraft, but Blocky

Thu Nov 08, 2012 11:29 pm

I have not used git before, so I have to learn first. I will post here when the repository is ready.

mongrol
Posts: 76
Joined: Wed Aug 01, 2012 2:43 am

Re: Not Minecraft, but Blocky

Thu Nov 08, 2012 11:55 pm

Can I suggest the GPL3 license instead. This ensures the code will always remain free for others to study and learn from. MIT allows closed distribution I believe.

User avatar
spsn
Posts: 72
Joined: Wed Nov 07, 2012 6:33 pm

Re: Not Minecraft, but Blocky

Fri Nov 09, 2012 1:29 am

Ok. Here is the git repository:

Code: Select all

https://github.com/spsn/blocky

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: Not Minecraft, but Blocky

Fri Nov 09, 2012 2:57 am

spsn wrote:We work on Blocky a bit most every day, so it keeps on growing. Like just last week we still had the leaf code for the trees putting leaf blocks where the tree trunks are supposed to be, so some of the trees looked all funny.

Here is the source code for Blocky as it is now: http://www.4shared.com/zip/5YkuUM9b/blocky-src.html

The source is for the game, the rendering framework and the support libraries, with LWJGL of course. In the form of Eclipse projects so it is easy to work with on PC (where we do our dev, we just compile and test on the RasPi).

The texture atlas that Blocky uses (res/terrain.png) is a 3rd party texture atlas that is compatible with Minecraft and there are still lots of blocks we have not yet added to Blocky, so a fun exercise to start with is maybe to add some more block types and see them actually work in Blocky. Or you can create a whole new texture atlas of your own with your own layout (that's how we started).

If others play around with the code, improve it, have fun and maybe learn something in the process, that would be great. We ourselves will off course keep working on it.
Any chance you can post how to get the source code going on say a Windows 7 setup.

I have downloaded Eclipse and tried to import the project but it complains of JREs

Code: Select all

Build path specifies execution environment JavaSe-x.x. There are no JREs installed in the workspace that are strictly compatible with this environment.
I have tried 1.6, 1.7, etc.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

User avatar
spsn
Posts: 72
Joined: Wed Nov 07, 2012 6:33 pm

Re: Not Minecraft, but Blocky

Fri Nov 09, 2012 3:46 am

In Eclipse, right-click on each project, select Properties, then Java Compiler and disable project specific settings. Does that help?

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: Not Minecraft, but Blocky

Fri Nov 09, 2012 4:07 am

Unfortunately no. And I am going crazy I have deleted my workspace folder 50 times.

I think the whole problem is how to even start.

Open eclipse (first time)
Set workspace folder
File - New - Java Project
name: blocky (use default JRE) <Finish>
File - Import - General - Archive File (Git repo zip) into blocky project

Then errors cannot find test.opengles.util.Shader, etc.. (Fix the build path then try building)

Everything I have read is it isn't putting the correct files into the correct places and building dependencies off that. Have tried adding libraries everything I can think of but properties of the project just seem wrong no java in the build path source.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

User avatar
spsn
Posts: 72
Joined: Wed Nov 07, 2012 6:33 pm

Re: Not Minecraft, but Blocky

Fri Nov 09, 2012 4:33 am

I am sorry. My git GUI ignored all the .project and .classpath files that are needed for the Eclipse projects. Please refresh from github. They are there now.

I have not tried to populate a project from an archive file before. What I know to work is to extract the contents of the archive file into a folder and then to use the Eclipse import function to import existing projects into the workspace.

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: Not Minecraft, but Blocky

Fri Nov 09, 2012 4:55 am

I think that may be it. How do you develop it what OS and system are you running I think I read you develop it on one machine then you port it over to the Pi or are you doing all your coding directly on the Pi itself. My options for my kid is either Windows then port over or directly on the Pi itself. VM running on Windows won't work out for our setup for him.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

User avatar
spsn
Posts: 72
Joined: Wed Nov 07, 2012 6:33 pm

Re: Not Minecraft, but Blocky

Fri Nov 09, 2012 5:17 am

We develop on Windows with a Desktop OpenGL 2.0 version of Blocky so that we can run it directly from inside Eclipse on Windows. We tend to make lots of little changes, so it works faster this way. Then afterwards I merge all the changes into the OpenGL ES 2.0 version and test on the RasPi. GL 2.0 and GL ES 2.0 are very similar, at least the parts we are using, so both versions of Blocky are almost identical and the merge is not difficult.

I can put the GL version of Blocky in github too if anyone would like.

I have just added a development starter kit for RasPi to the github repository. Look for blocky-dev-pi-starter.tgz

It contains all the source code, a build script to compile and of course the scripts to run Blocky. Just extract the contents to the RasPi and you can start coding right away. If you develop on Windows, then just copy the ge.framework/src and ge.demo/src folders with your changes over to the RasPi, build and run.

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: Not Minecraft, but Blocky

Fri Nov 09, 2012 5:24 am

Please help me get this going on Windows any sort of Minecraft is all I needed to get a kid lost in a world of coding :lol:
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

User avatar
spsn
Posts: 72
Joined: Wed Nov 07, 2012 6:33 pm

Re: Not Minecraft, but Blocky

Fri Nov 09, 2012 6:01 am

Ok. Here is the github repository for Blocky for Windows:

https://github.com/spsn/blocky-pc

Place the content of the repository in a folder on Windows, then use the import functionality in Eclipse to import the existing projects into the workspace. Run the ge.demo.game.Blocky.java file as a Java Application to make Blocky go.

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: Not Minecraft, but Blocky

Fri Nov 09, 2012 9:42 am

spsn wrote:Ok. Here is the git repository:

Code: Select all

https://github.com/spsn/blocky
You are a star, thank you!

User avatar
spsn
Posts: 72
Joined: Wed Nov 07, 2012 6:33 pm

Re: Not Minecraft, but Blocky

Fri Nov 09, 2012 10:33 am

Some more eye candy. Larger images here: http://www.flickr.com/photos/[email protected] ... hotostream

ImageImageImageImageImageImageImageImage

User avatar
Forrrge
Posts: 120
Joined: Fri Apr 27, 2012 6:07 am
Location: Gateshead, UK.

Re: Not Minecraft, but Blocky

Fri Nov 09, 2012 6:50 pm

Those screenshots look great, any chance of a vid :)

cdjaco
Posts: 18
Joined: Tue Aug 28, 2012 6:53 pm
Location: Colorado, United States

Re: Not Minecraft, but Blocky

Fri Nov 09, 2012 7:45 pm

Wow spsn, that looks pretty good! Thanks for opening up the code; I've got two boys who are Minecraft fanatics and think that knocking out a mod is a piece of cake. I think I'll show them what you've accomplished so far along with the source. Worst case scenario will be that they simply have a better appreciation for the work that goes into it.... best case scenario is that they'll want to learn Java! ;)

Return to “Gaming”