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 / Terrain w/out editor.

Author
Message
Sk8ing Link08
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location:
Posted: 27th Mar 2006 00:17
Hi everyone!
Im new to DarkBasic, I've read some tutorials and gone trough some post, but I have a question..
Terrain is like a level right (like a floor), anyways if it is how do I make one? I found this Command "MAKE TERRAIN Terrain Number, Heightmap Filename" BUT whats the Heightmap Filename.
I know you can make levels with editors but is there anyway to make them without an editor?

Um...
driftman
19
Years of Service
User Offline
Joined: 7th Aug 2005
Location: Somewhere Outside of Sanity
Posted: 27th Mar 2006 04:33
a heightmap is a bitmap that is a gray scle representation of the terrain, with black being the lowest point and white being the highest point.
you make the heightmap for yourself, then you use make terrain command like this:

just remember that the heightmap can have any name you want.

I have a lil' white jacket that lets me hug myself forever.
Sk8ing Link08
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location:
Posted: 27th Mar 2006 04:42
Um... So if I make a bitman(sp?) thats all black I'll have a flat surface, but if I make a line of black then a line of gray then a line of black then a line of gray and so on... I'll have speed bumps?
Anyways THANKS!! really helpfull.

Um...
Sk8ing Link08
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location:
Posted: 27th Mar 2006 04:58
Um... "Runtime Error 7126 - Could not create terrain at line 1"
I made a .bmp and just colored it all black, I also tried it with other gray colors but I got the same message.
This is my code: (How do you make Code Snippet?)
MAKE TERRAIN 1, "LINK.bmp"
WAIT KEY
One more thing.. is there any way to get more shades of gray in MicrosoftPaint?

Um...
Sk8ing Link08
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location:
Posted: 27th Mar 2006 05:24
Its me again!(Sorry but DarkBasic gets me all hiped up!)
I got it to work (I forgot to save the DarkBasic file)
BUT I don\'t see anything, there is no \"show terrain\" command and I also tried loading a .bmp and using the TEXTURE TERRAIN command, and its not working either. Um... how can I see my terrain?
Am I missing any other commands?

Um...
Twu Kai
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location:
Posted: 27th Mar 2006 20:09
The camera might be beneath the terrain, try positioning the camera a bit higher maybe? The terrain is one-sided I think...

I came, I saw, I programmed!
Okashira
18
Years of Service
User Offline
Joined: 8th Feb 2006
Location: Right here.
Posted: 27th Mar 2006 22:07
Is the make terrain function DarkBasicPro? I have Classic and have never heard of it.

Let the games begin!
Twu Kai
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location:
Posted: 27th Mar 2006 22:22
Well I'm using DBPro, so I guess so!

I came, I saw, I programmed!
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 28th Mar 2006 11:41 Edited at: 28th Mar 2006 15:01
look for the example code for the terrain commands, you need more than just make terrain, you need to load the heightmap, a texture, a detail texture, THEN build the terrain, then update it, and you might need to scale and position it depending on the size of your bitmap, plus IIRC you need your maps to be multiple power of 2 sizes, and make sure you have the 5.9 update since the "correct" terrain commands are not in the earlier versions of Pro (it had a simplified terrain functionality that was not very useful)

edit: heres a function to create a terrain, you just to load the three bitmaps at the start (could be any name actualy)



[edit-edit] heres a whole program I found lurking on my hd, the detail texture has been altered to give a chequred pattern since Pro no longer has the ability to draw circles that go off the edge of the bitmap without crashing, as it could when the code was originaly written, and I can`t be bothered to sort it, it also crashes when you try to create a new heightmap, all these problems are actualy down to changes made in the upgrades, it used to compile and work as intended, but now its broken and needs sorting, feel free to do as you please with it.



I have included the exe compiled under patch 6 pre-release, feedback on any problems would be cool (note sexy 1.5mb file size..new files are much smaller, only 7mb uncompressed).



Windows system error, an unknown error in DLL >Unknown< has caused an unknown fault, keyboard not detected, press any key to continue or hard reset to erase C:.

Attachments

Login to view attachments
roswell
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location: United States
Posted: 28th Mar 2006 22:41
One thing you could use to create some random/realistic heightmaps is to use a program called TerraGen with the "For Export Only" plugin to export the file to a BMP. I just tried this, and the results weren't too bad at all. TerraGen might be a bit high-end for DBPro heightmaps, but the test I ran with some simple settings seemed to work fine.

'Just one game,' they said, and started to play. That was yesterday.

Dual Athlon 2.0/1GB RAM/GeForce Ti4200-128/WinXP Pro

Login to post a reply

Server time is: 2024-09-24 19:25:28
Your offset time is: 2024-09-24 19:25:28