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.

DarkBASIC Professional Discussion / Open Source Minecraft Engine

Author
Message
Jimpo
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location:
Posted: 22nd Jul 2011 10:43 Edited at: 28th Jul 2011 05:04
Hey guys, I've seen a lot of folks interested in making a Minecraft-like game. So I've spent the last few hours making an engine, and I'm giving out all the code!



It's a pretty small, finite world. But the engine does what's most important, rendering the terrain and placing/destroying blocks while keeping a decent fps.

Updated 7/27
https://forumfiles.thegamecreators.com/download/2234159

Controls
-Left click - remove block
-Right click - place block
-Space - jump
-Hold 1 - free camera

Some things to note:
-The terrain generation algorithm was thrown together for testing. Try putting your own algorithms in!
-The movement code, especially the part that selects which block to destroy, was also quickly put in for testing. There's probably a much better way to do that.
-It's possible to run out of polygons if you expand the world size. You'd have to use multiple objects to expand the world.

If you use the code, please give some credit! Speaking of credit, the terrain.png was made by JohnSmith.

That's all I can think of for now. If you want something explained/better commented just ask.

Christoffer
13
Years of Service
User Offline
Joined: 8th Feb 2011
Location: Sweden
Posted: 22nd Jul 2011 14:56
Looks great! Downloading and testing now!
Christoffer
13
Years of Service
User Offline
Joined: 8th Feb 2011
Location: Sweden
Posted: 22nd Jul 2011 15:11
Since they take so long to "Verify" my post, i have to write a new one..
When i try to run it i get a few errors.

First


Second


So what are
find free object()
find free mesh()
find free ticker()
Are they built in function in db?
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 22nd Jul 2011 16:39 Edited at: 22nd Jul 2011 16:40
I think they are custom functions. Off the top of my head, they look something like this:



Oh, it could be that he used a plugin, possibly Matrix1Utils. That's quite possible considering the functions have spaces.

TheComet

Jimpo
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location:
Posted: 22nd Jul 2011 17:40
Yeah sorry I forgot to mention you need the Matrix1Utils plugin to compile the code. There are way too many helpful functions to not use them!

Here is the plugin link: http://forum.thegamecreators.com/?m=forum_view&t=85209&b=18

Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 22nd Jul 2011 23:49
Ah awesome man. I love you! This should be really helpful for me. :3

Christoffer
13
Years of Service
User Offline
Joined: 8th Feb 2011
Location: Sweden
Posted: 23rd Jul 2011 01:07
Works now!, Very nice!
SH4773R
14
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 23rd Jul 2011 05:23 Edited at: 23rd Jul 2011 05:26
Was'nt there another minecraft engine floating around these fourms? Yours looks great tho

Edit;
yup, here's the link to it http://forum.thegamecreators.com/?m=forum_view&t=181984&b=8

Jimpo
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location:
Posted: 28th Jul 2011 05:03
I've seen other Minecraft type engines on the forum, but they either use individual objects for each cube or a limb for each. Both methods are much slower than using a single object with a single limb. It's just not as intuitive, so I wanted to make an example of how it can be done.

I forgot to add normals in the original code, so I've attached an updated version to this post. It gives the terrain proper lighting.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-24 20:45:16
Your offset time is: 2024-04-24 20:45:16