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.

Newcomers DBPro Corner / Re-Hello all..

Author
Message
Linehan
15
Years of Service
User Offline
Joined: 13th Oct 2009
Location: Salem, MA
Posted: 11th Mar 2011 11:42
Greetings again to everyone. I started using the forums quite a while ago, but experienced a very serious and disabling health problem and between hospitalization, physical therapy and everything else I was not going any coding or much else for a very long time. As much as I argued they would not let me bring my computer with me even when I was in-patient for almost month long stretches of time. Jerks.. Anyways.. I have returned to the forums and am trying to re-learn what little I had learned of my DBPRO. I grabbed that new source code package for some help. I have chosen a new project and barely even gotten started and am already stuck. (big surprise there I am sure).

Any-Who..

My son showed me this game called Minecraft and it looked sort of fun in some ways. We got to talking about it, and I had said that this game could be made with DarkBasic and he said it was written in Java because "Java is great for games" which I do not agree with completely. I think any language with enough toil and trouble can be great for games (with some exceptions from older mathematic focused languages maybe) and he said I would not be able to make a game like that in DBP without using external add-ons/DLL's/etc because it would be too slow.

Of course, I have to try and prove him wrong now. I have only created several rather easy and small programs with DBP so far but being laid up so badly I have a lot of time on my hands and want to be as productive as I can. Medication is not making this any easier I'll have you know.

Minecraft is a game where a random world is generated and it is comprised of these large rudimentary blocks. Umm.. Picture yourself standing in a world made of big blocks that would be like 3'x3'x3' cubes. Grass, sand, stone, diamond, coal, tree, water, lava and the list goes on. They are all made of these 3' cubes. You can shovel/chop/dig up these cubes and then place them in other spots. You can manipulate the blocks into other materials. You can use the cubes to build structures and what not.

Overall I don't anticipate there being too much in the way of intense coding for most of what I will be doing. Although, I have to be honest and say that I have not even begun any real coding on this yet, and one of if not THE main section of the program has me stumped on how to approach it.

So.. Who wants to help me prove to my son that DBPRO is far superior to JAVA for 3D game development? If that is you, then just help me figure out the best approach for the terrain generation algorithym please!

Initially, I wrote a very short and easy routine that generated a world that was consists of what I am goingt to call Quads. Each quad will be 150(L)x150(W)x10(H) cubes. This was easy enough to generate each section and throw in different sized pockets of the different material types. I will eventually allow the users to pre-select ratios of block types. All in all. This went smoothly. As long as I have a world that is completely flat terrain.

I need, in addition to random sections of water, trees, grass, desert sand, beach sand, stone, etc, rolling hills, mountainous hills, valleys, different sized caves with and without tunnels of various sizes and depths.

I had no idea how incredibly complicated the routines would have to be for generating useable terrain of varying geography.

Here are ideas I have come up with but not crazy about..

1. Have pre-designed quadrants and then just choose from them.
2. Have semi-pre-designed quadrants that just have points selected and generate off of those.
3. Have pre-designed hills, mountains, caves, etc and just randomly slap them down on the flat map.

I don't like any of those really. I jsut can not figure out how to do this while retaining an almost entirely random approach to terrain generation.

I tried doing a % approach, for example, having an x% chance that the terrain would change in some way, then randomly deciding how it would change. like 10% chance of change. 1-go up one 2-go down one 3-change to water 4-change to lava 5-tree 6-grass etc etc..

As you can imagine this sort of approach was resulting in sporadic twitchy terrain that looked insanely unrealistic. Plus when your world consists of 3' cubes it is hard enough to obtain a realistic terrain to begin with. When you add on areas of blocks spiking, and dropping from one block to the next with no rhyme or reason it gets ugly fast.

So.. I need ideas for how to handle the random terrain generation.

I am going to stick with QUADS because that way I can have 9 quads loaded at a time and not the whole world conserving a LOT of ram. This will include the QUAD you are on plus the ones next to you. I will generate each quad as they come into view for the first time.

Also it might be worth noting that I am not intending to release this game to the public if I even create a complete playable game versus just a proof of concept for my boy and his delusions of Java game coding.

So.. Any-Who.. Can anyone give me some guidance on this part of the project?

[-=-=-=-=-=-=-=-=-=-=-=-=]
[Http://DIFS.Forumer.com ]
[-=-=-=-=-=-=-=-=-=-=-=-=]

Login to post a reply

Server time is: 2024-11-24 06:55:26
Your offset time is: 2024-11-24 06:55:26