Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Minecraft-esque Mine Engine

Author
Message
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 31st Mar 2011 15:51
OFFTOP@

Why did you start to learn java ? Because of Minecraft ?

Satchmo
18
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 2nd Apr 2011 01:19
Lol, minecraft is what let me know that java wasn't this slow useless language like I previously thought, but not exactly. Dbp is nice and I'll always use it for some stuff but I'd really like to learn something more cross platform and even more similar to C/C++, and java seems perfect for that. So in a way, yes, but not entirely.

kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 2nd Apr 2011 09:24
Well, java looks not that powerful to me as it seems . But still i like the option of implementing your game/program into web browser ! Still, if notch would make it in C/C++ it would be alot faster, since now it's laggy when generating world.

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 2nd Apr 2011 12:48 Edited at: 2nd Apr 2011 12:49
Java is extremely powerful! Its used alot commercially and is only slow when compared with C which is extremely fast. I think these days its fairly common practice to use java for the front end and C++ for the back end.

Quote: "if notch would make it in C/C++ it would be alot faster, since now it's laggy when generating world."

Not so, the reason its laggy will be to do with the graphics engine and/or the culling algorithms he's using. Its possible to implement algorithms fast enough such that even DBP can cull quickly enough.

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 3rd Apr 2011 13:41
My suggestions for improving speeds are as follows:

Notch doesn't use cubes to create his world (as many think), but he uses a deformable terrain mesh. Every time you remove a block, or add a block to the world, the terrain "inverts" it's sides. Here is a screenshot of a MineCraft level. The left side is what you see outside, the right side is what's inside the terrain:



As you can see, there are no cubes, it's a terrain. This makes it much faster to render, and you don't need to write a complex culling system.

The way Notch kept the RAM usage down is by only loading the chunks the player is near into memory. The rest he dumped onto the hard disk.

My second observation is the way minerals are calculated. This is just my theory, but I think the minerals that are inside the terrain aren't defined yet. They are calculated once reached. This means that a chunk doesn't store every cube in memory, but calculates it when the player reaches it. That's probably another huge memory saver right there.

I hope I didn't confuse you, keep up the good work

TheComet

C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 3rd Apr 2011 16:47
Quote: "I think the minerals that are inside the terrain aren't defined yet"

Well that's definitely wrong for gold and diamond - because if you get Mineviewer, you can see the veins of gold and diamond in mine-mode in the newer versions.

I'd assume it was the same for coal and iron but there's no way to view them in Mineviewer at the moment.

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 3rd Apr 2011 17:03
I'm not familiar with Mineviewer, but I use Minecraft X-ray, and I'm pretty sure the diamonds it highlights are calculated according to the seed value (they don't show up unless you highlight them). Is that the case in Mineviewer?

TheComet

C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 3rd Apr 2011 17:08
I'm not sure. :S

I just know that in Mineviewer you can turn on "mine mode" and fly down to the bottom of the map n see all the diamond and gold seams.

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 3rd Apr 2011 18:34
Oh well, I guess we'll never know In the end it was just a guess.

TheComet

Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Apr 2011 22:16
Can you make prettier graphics? I think a big reason I never wasted time with mindcraft is because everything looks so pixelated like an old Dos game.

The Internet: Where men are men, women are men, and children are federal agents
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 4th Apr 2011 23:04
@ Phaelax

I find it fitting that the graphics are poor, after all, you are shifting around pixels I checked out FortressCraft (basically the same, just with high graphics), and I think the graphics just don't fit the game mechanics... :/

TheComet

thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 4th Apr 2011 23:33
Quote: "Can you make prettier graphics? I think a big reason I never wasted time with mindcraft is because everything looks so pixelated like an old Dos game.
"

There is no better way to troll people who play Minecraft then to criticize the graphics...

Quel
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 4th Apr 2011 23:36
A game like this is one of the most exciting game engineering practice i have ever seen.

Actually playing it is the stupidest, lowest waste of time... ever.


At least in this "let's imitate the 8bit era" form. And overall it's free-roaming nature, you are so free to do anything, that you immediately bounce into its limits.

I would rather make something in real life, not some virtual pixeldoo-doo what i can have a biiiig look at, and then i close it and there, i did nothing really with my life that day.
thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 4th Apr 2011 23:42 Edited at: 4th Apr 2011 23:44
Quote: "Actually playing it is the stupidest, lowest waste of time... ever."
Have you ever even played it?

Just my opinion, but I find the style very appealing and simple. Graphics aren't everything. I do agree though, it is a waste of time. But it's a fun waste of time.

kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 5th Apr 2011 00:05
I would rather store informations about what block is where for every island and load them when block is destroyed to check, what do display

Threeworlds manager
13
Years of Service
User Offline
Joined: 10th Mar 2011
Location: UK
Posted: 8th Apr 2011 00:19
I tried making one of these myself but needed someone else that had done it before. I have played the demo and found it amazing! I made a castle and a giant creeper! I even reahed bedrock (after about 20mins of mining!)

I was wondering if i could help you build on to this amazing game by giving you points for improvements and if possible learn a bit more myself!

-TWgames-
'happy gaming'

looking for free models
(zombies, dirt block entities...)
Threeworlds manager
13
Years of Service
User Offline
Joined: 10th Mar 2011
Location: UK
Posted: 8th Apr 2011 00:27
The world was alot better cubed and maybe add water blocks that you can swim in and some way to save what youve done... Also mine crashed a few times

(im on about the demo)

-TWgames-
'happy gaming'

looking for free models
(zombies, dirt block entities...)
Threeworlds manager
13
Years of Service
User Offline
Joined: 10th Mar 2011
Location: UK
Posted: 8th Apr 2011 00:33
Can i have the scripting for the minecraft game? So i can test out my skills and upgrade your game (i will give you a free copy of the upgraded version when its done).

-TWgames-
'happy gaming'

looking for free models
(zombies, dirt block entities...)
Threeworlds manager
13
Years of Service
User Offline
Joined: 10th Mar 2011
Location: UK
Posted: 8th Apr 2011 09:25
You should eedit the lighting and add a light source

looking for free models
(zombies, dirt block entities...)
Threeworlds manager
13
Years of Service
User Offline
Joined: 10th Mar 2011
Location: UK
Posted: 8th Apr 2011 09:51
Is there a way to print screen? Cause i wanted to show you my builds...



looking for free models
(zombies, dirt block entities...)
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Apr 2011 16:37
Stop posting, please

I don't think he is going to give you the code, and it's obvious that he can add water blocks, and make a lighting system. But that all takes time to do, and believe me, it's not a simple task. Especially now that he's really busy in real life.

As to the print screen, press "print screen" and then paste the image into paint or something.

TheComet

Threeworlds manager
13
Years of Service
User Offline
Joined: 10th Mar 2011
Location: UK
Posted: 8th Apr 2011 17:37
When i tried print svreening with this game an pasting it on paint it just came up blank with no picture

looking for free models
(zombies, dirt block entities...)
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Apr 2011 17:51
What about alt+print screen?

TheComet

Threeworlds manager
13
Years of Service
User Offline
Joined: 10th Mar 2011
Location: UK
Posted: 8th Apr 2011 23:33
I tried it but it did the same

looking for free models
(zombies, dirt block entities...)
Satchmo
18
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 10th Apr 2011 02:51
No code at this point, I'm afraid. And there won't be for a while.

It'll come though you just need to be patient.

Threeworlds manager
13
Years of Service
User Offline
Joined: 10th Mar 2011
Location: UK
Posted: 10th Apr 2011 21:49
Hey satchmo, i can make some texture packs for the game quite easily for you if you want (for free)

looking for free models
(zombies, dirt block entities...)
Threeworlds manager
13
Years of Service
User Offline
Joined: 10th Mar 2011
Location: UK
Posted: 17th Apr 2011 21:19
I am currently working on texture packs for this game! The halloween one is complete

looking for free models
(zombies, dirt block entities...)
Threeworlds manager
13
Years of Service
User Offline
Joined: 10th Mar 2011
Location: UK
Posted: 18th Apr 2011 12:37
texture pack 1 (halloween)

heres a sneak peek

looking for free models
(zombies, dirt block entities...)

Attachments

Login to view attachments
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 18th Apr 2011 16:26
Erm, maybe you will edit your posts instead of posting new ones? That's just a hint

GlutenFree
13
Years of Service
User Offline
Joined: 23rd Jun 2010
Location:
Posted: 18th Apr 2011 20:18
I am trying to make a program for fun similar to this but I can't figure out how you did the chunks. Can you give out some code?
Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 27th Jun 2011 17:32
How's this project going? It'd be a shame if it died.

Satchmo
18
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 27th Jun 2011 21:25
Well to be honest it's not really going at all lol. Part of the reason I stopped was because I found out someone had made my idea already (a war game in a minecraft style builder). As well, all sorts of logistical problems with DBPro would make finishing that game at the quality I want too hard. I'll post the code up later for public use.

kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 27th Jun 2011 21:53
Quote: "I'll post the code up later for public use."


Yay

Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 28th Jun 2011 01:00
Aww, I'm sorry to hear that. It's great that you're posting the source though, I could learn a lot from it. Thanks!

Threeworlds manager
13
Years of Service
User Offline
Joined: 10th Mar 2011
Location: UK
Posted: 28th Jun 2011 17:53
Can we have what you made so far cause it is soooooooo awsome!!!!!

The big building pack
COMING 2012
(feel free to email building designs)
Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 7th Jul 2011 21:05
Hi again, I hate to bug you about this, but I'm working on a minecraft-like game myself, and I can't see to get performance anywhere near as good as yours is, could you shed some light on how you made it run so fast?

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 7th Jul 2011 21:47
I was thinking about that the other day so here's my guess.. Its slow when you apply the culling algorithm to each cube individually, but you don't need to do that, you can use a quad tree to instantly knock out large chunks of the map with one check, and then increase in detail where necessary.

Satchmo
18
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 7th Jul 2011 22:00
Yeah don't worry about it, I've finished cleaning up the code. Here's the project folder. If you have any questions just ask.

Attachments

Login to view attachments
Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 8th Jul 2011 03:21
You are a saint, thank you so much.

I had been thinking about QuadTrees, but I didn't know how to implement it, this will no doubt be amazingly useful.

Satchmo
18
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 8th Jul 2011 20:28
I don't know what quad trees are lol, I'm not sure if I used them.

Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 9th Jul 2011 18:46
From what I can tell, you did. Basically checking if an entire area is visible before checking if each individual block is visible. But your code is complex, so I can't tell for sure.

Satchmo
18
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 9th Jul 2011 21:56 Edited at: 9th Jul 2011 22:01
What I did is split the map into chunks (I think 6 by 6 blocks). However I don't check for their visibility, only their position in relation to the player. If the player is close enough I swap out the chunks with the actual blocks and turn collision back on (I only do checks on the blocks that are close to the player, a 18 by 18 square which moves as the player goes from chunk to chunk).



This picture was on the previous page.

One more thing, when generating the map I go through each block and check if there are any "air" blocks next it it on any side, if there is I set the blocks visibility to 1, and it is shown when the blocks are generated. Digging and building makes that same check be run again for every block surrounding the block that was built or destroyed.

One last thing, I forgot to mention compiling the code requires sparky's collision dll and the matrix functions dll (for the high res timer).

RedFlames
16
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 9th Jul 2011 22:49 Edited at: 9th Jul 2011 22:52
Your approach is very interesting, I had started something like this some time ago as well, but with some differences:

- when blocks changed they were checked against their surrounding and faces/vertices were generated or removed on the fly, so that only the "shell" of the terrain is in the objects. The chunks were similar to yours, i guess
- collision checks were done by checking the player position against the existing blocks at that position, using some trigonometry, but independent from rendering/vertices etc.
- i already had a basic lighting engine which would use lightsources to update the UV colors of the faces, but it was very slow & buggy
- it parsed the original block-texture-image from minecraft, and all blocks could be used (even transparent ones would work, without being able to "look through" the terrain)
- I added some basic diamond square generator thingy looking similar to yours (haven't really looked at all of your code yet)
- I had ported it to OpenGL and a basic version on the PSP
- oh and it was using arrays & linear search, looking back that is quite horrible
- another thing I just remembered is that the actual gameplay and the "vertex updating" were seperate, so you could start playing immediatly, but the blocks were still being generated around you...

So yeah, sorry for hijacking your thread, just wanted to share some info about how things could be achieved differently...

Unfortunately my code is VERY chaotic and weird, so I don't think it'd be of any use in it's current state... Maybe I'll find some time to pick it up again in the future, it was really interesting to mess with the vertices and rendering on this basic level.
Satchmo
18
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 10th Jul 2011 01:47 Edited at: 10th Jul 2011 01:48
Quote: "I had ported it to OpenGL and a basic version on the PSP"


Cool!

What language did you use? I've only ever used basic and turing and tbh have had a hard time getting into java or c++. Any tips? You sound like you know what you're doing compared to me

RedFlames
16
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 10th Jul 2011 03:25
Nah I just know some basic C, but I don't know much about how C++ and Object-Oriented programming work, so my code was mostly working like the DBP code, consisting of lots of functions with "global" and "local" variables... I guess the main difference would be how OpenGL renders the vertices.
And i also used simple C code, because AFAIK there's only a C compiler for the PSP. So the code in VC++ and for the pspsdk was 90% the same.

About really getting into C++, it'd probably be easier to start with some kind of engine or SDK like DarkGDK or Ogre3D or something else. But I'll stay with DBP for now.
Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 10th Jul 2011 19:41
Well, I've been working with DarkGDK for a while( I haven't got anything to show for it though ) and I've been trying to make this work. My chunks are 16x16x128 ( Same as minecraft ) and at any one time you can see 3 chunks. DarkGDK doesn't like that at all. I've switched to Ogre3D and the performance is amazing. I'm still learning how to use it though.

2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 12th Jul 2011 19:57
I thought of this as more of a Fortresscraft rather than Minecraft.


Cheers.

God help me, Please.

Come on down to my site at Unleashed FPSCreators
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 23rd Jul 2011 19:27
I'll be watching this. I love the IDEA of minecraft.. I just hate the JAVA version Notch is "constantly fixing". ** Rolls Eyes **

Did I say I hated JAVA ? oh right.. let me rephrase that.. I FRIKKIN HATE JAVA... Just my opinion.. so yea.. uhmm... please.. I hope to see this working..

"If you can sing that high, you must have been kicked in the crotch a little too hard."
Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 23rd Jul 2011 22:16
Why do you hate Java?

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 24th Jul 2011 00:09
Yeah why such hate? Java has alot of beautiful object orientated design and good documentation

Login to post a reply

Server time is: 2024-03-28 19:49:39
Your offset time is: 2024-03-28 19:49:39