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 / Problems With Terrain Statements

Author
Message
Avoth
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location:
Posted: 23rd Mar 2011 16:52
Ive been spending to many hours now trying to work out where ive gone wrong. Basicly i tried making a height map using 3d World Studio and loading that into DBPro but the map is inacurate. To get round this i decided to use the

Load Terrain "mapname*", objno*

Command. This works perfectly and also alows me to have multiple textures on my map which i cant seem to work out how to apply using a height map.

Upon doing this though, when trying to use the

Get Terrain Ground Height(1, xpos, ypos)

command but this refuses to return the ground height. I know the Load command alows you to effectively import objects and set them as a terrain, but the get terrain command doesnt seem to recognise the object as a terrain there for not returning the ground height.

Can anyone tell me where i have gone wrong?

I am trying to return the ground height so i can set basic logic stating that "if player < ground height then player = ground height". As far as im aware this is the best way to do this, and i was going to use the ODE to check collisions between the player and world objects after. This is because i notice there are alot of problems with the ODE where as the dynamic object occassionaly (quit commonly in my case) falls through the object, so i didnt want to have the ground level as part of this engine.

Any advice is welcome!

Ive also just discovered commands such as "Get Terrain Size x(#)" do not exist... yet they are documented in books such as "Hands On DarkBasic Pro Vol2"
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 23rd Mar 2011 17:12
It would be nice to see your terrain code to see where you went wrong.
Also, if you use the 'LOAD TERRAIN Filename, Terrain ID' command, you should keep in mind that it expects a .DBT file for the terrain model. I dont know which file extensions 3D World Studio exports to.
This code works for me, but it doesnt use the 'LOAD TERRAIN Filename, Terrain ID', but rather the 'MAKE OBJECT TERRAIN Terrain ID' command to make a terrain from a heightmap.



Did this help?

Cheers

SLAYER RULES! YEAH, MAN!!
Avoth
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location:
Posted: 23rd Mar 2011 17:33
That is pretty much what i have coded. For some reason everything works perfectly, but the program see's the Load Terrain .dbo file as an object and not a terrain. For this reason it doesnt return a ground height because as far as its concerned there is no terrain. I know this because terrains are positioned at 0, 0, 0 world position using the far corner of the terrain as its focal point... where as object use their dead center position as their focal point.

The only way around this is to create a terrain from a height map which is inaccurate.

This could possibly be a bugg? I unfortunatly dont have the code with me on this computer.

Basicly it goes as follows

The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 23rd Mar 2011 17:54
Quote: "Load Terrain "maps\terrain.dbo", 1"

As I mentioned before, the 'LOAD TERRAIN Filename, Terrain ID' command only works with .DBT files, and not with others. It is a command from the advanced terrain addon.

Quote: "The only way around this is to create a terrain from a height map which is inaccurate."

Why would this be inaccurate?

Quote: "This could possibly be a bugg?"

No, its not a bug. The command only works with .DBT files, that's all.

Cheers

SLAYER RULES! YEAH, MAN!!
Avoth
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location:
Posted: 23rd Mar 2011 17:57 Edited at: 23rd Mar 2011 18:02
Appologies i miss read your post. Your information is perfect!
Thanks!

Ive just checked 3D World Studio but unfortunatly doesnt export as DBT. Only B3D/txt/dbo/x/wmp/map/gmf/fy

Do you know of any DBT exporting real time terrain creators? (minus the expence)

Login to post a reply

Server time is: 2026-07-17 02:54:48
Your offset time is: 2026-07-17 02:54:48