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 / Minecraft-esque Engine Problems

Author
Message
Coldfire
17
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 28th Feb 2011 18:16 Edited at: 28th Feb 2011 18:27
Hello, I got bored and while I've tried to avoid it(like many others ) I started working on an experimental Minecraft-type engine.

At this stage, I am just messing around with a single 8x8x8 chunk. I start by making an empty object, then I make a cube mesh. After that, I add a limb of the cube mesh to the previously empty model for each x, y, and x element for a total of 512 cubes.

I am using the DKSHOP plugin for picking limbs at the center of the screen. Right now, I got cube removal done with the right mouse button.

Now for the questions:

1) For some reason, the "dk pick limb" function doesn't seem to pick up a collision unless i am around 0.1 units away from said object or inside of it. Is there anyway to remedy this? I'd like to be able to delete the limb from any distance instead of having to be practically inside of them.

2) I've started working on cube creation but have removed it for now due to problems(EDIT: actually, I noticed the code I uploaded does include the broken "add cube" functionality). For the life of me, I can't add a limb to an existing model without it throwing an error saying that limbs have to be linked sequentially. I have tried to use the link limb function before and after the limb. If I use it before, I get an error that the limb doesn't exist. If I use it after, I get the linked limbs error again. So my second question is, how do you go about properly linking a new limb to an existing object?

And the source code so far:



And since everyone likes screenies:



Thanks in advance for any and all help

Randy
kamac
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 1st Mar 2011 11:41 Edited at: 1st Mar 2011 11:42
Im not really in the topic, but logically this




Looks wrong. You should only increase totalBlocks count, because you add a limb. So like:




Maybe it's tottaly wrong. That's just a logic guess.

Limit's of this sig are really low o_o 200 characters and i can have only 2 carriage-returns ..:..:..
Coldfire
17
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 1st Mar 2011 13:00
Yup that fixed the add cube functionality... Well, aside from aligning it properly. That was just a copy paste error, but thanks for clearing that one up for me! Now I have to figure out how to add the limbs pick normal to the coordinates so I can build outward from things.

Still having troubles with the 'dk limb pick' not extending further than 0.1 units, though.
kamac
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 1st Mar 2011 16:27
I don't know if that is the cause, but look


set camera range 0.1,100

Maybe set it to more or something


Limit's of this sig are really low o_o 200 characters and i can have only 2 carriage-returns ..:..:..
Coldfire
17
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 1st Mar 2011 18:50 Edited at: 1st Mar 2011 18:55
Hmm... I wouldn't think that would be a problem since that is the near camera range, but perhaps its a bug under those conditions with DKSHOP. I'll have to try it when I get off work. Hmm... I'm not at my comp right now, but I wonder if the set camera range command does actually take an integer instead of a float. If it does, which I dont think it should. That would make my near camera 0 instead of 0.1 which could also possibly cause some problems. Thanks for the idea. I'll let you know if it works.

Edit: Actually I noticed there are MANY different releases of the DKSHOP plugin and the one I'm using isn't even supposed to be for my version of DBP. I'd bet its a good possibility that is the culprit. Once again, I'll let you know if I get it resolved.
kamac
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 1st Mar 2011 19:03
Quote: "I'll let you know if I get it resolved."


Okay!

Im curious about DBPro'ing Minecraft, so i'll try to keep updated , and eventually help!

Limit's of this sig are really low o_o 200 characters and i can have only 2 carriage-returns ..:..:..
Coldfire
17
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 2nd Mar 2011 20:07
Well, I still haven't had a chance to try either of the two possible fixes because I've been kinda busy at work. It has given me plenty of time to think though, and I think I am going to try a completely different method. I am going to wrap up a simple dll to help me with drawing object-less planes. I have D3DFunc and know it has a function for displaying primitives using UDT's but I think I'm going to make a more specific version for my needs. After all, I only need to render planes-at least at this stage.

It will still use chunks, but only for LOD and not for minimizing objects drawn on screen. Without the overhead of drawing 'objects', and only drawing the 3 planes that are visible at any one time of the cubes, I think I may be able to display the current chunk as well as another layer of chunks surrounding the player with little performance impact. That would be the minimal detail, and later can expand to increase the view distance by adding more drawn layers.

This route would yield better performance and wouldn't take a lot of DBP "wrapping" as it would only have a handful of commands, but I'm sure it'll take a while to get a prototype down. I know a bit of C++ and OpenGL but when it comes to DirectX, I'm a total noob, lol. I'm sure it won't be too difficult. I've already read a little on it and it seems pretty easy. Wish me luck With that being said, I make no promises of getting this to a working state, lol. I would say theres a very good possibility though.

Login to post a reply

Server time is: 2026-07-16 01:43:50
Your offset time is: 2026-07-16 01:43:50