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.

Work in Progress / BlitzTerrain

Author
Message
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 13th Apr 2011 00:03
Hi kaedroho,

Glad to see a new GDK version, sorry I took so long getting around to testing it.

I'm afraid I have a linker error, I updated to latest GDK but some things seemed to stop working(in general, not BT) so I am no longer on the latest version, in case that could cause this issue:


I had to comment out the linking of this lib also:


You might want to put that in an '#ifdef' also.

Thanks.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 13th Apr 2011 00:14
Woops, I missed that, thanks for reporting.

I will look into removing the linker warnings, they are nothing to worry about though.

The linker error is caused by a GDK command not being there. That command was added into GDK 7.4 so make sure that your fully updated.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 13th Apr 2011 00:25
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 23rd Apr 2011 07:36
Hey Kaedroho,

I noticed that an issue with the returning of height of a terrain object that I have had in the beta version, still exists in this version,

The last tile on the X and Z axis of a terrain give no Y data, but the terrain does have data because it creates it right, but my object will go always go through the last X,Z values of a terrain...

So if my height map is 128x128, the corresponding area where pixels on the X axis are 127 with Y=0-127, and the Y axis are 127 with X=0-127, when created as a terrain, the X and Z axis return 0 for the Height of that terrain BUT I can see visual height difference for that location..

I am using the lastest GDK version

My theory is that you have invoked some kind of cap on the X/Z values that is set one less than the tiles that exist so that is why I am not getting anything other than 0 for that position...


Making dreams possible, one line at a time...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 23rd Apr 2011 13:57
The reason why there is no Y coordinates is because those tiles don't exist. The problem is that a heightmap of 128x128 will acctually have 129x129 vertices, this is because each sector must have a power of 2 number of tiles for the LOD to work properly. I did make the system remove these extra tiles for the 2.02 release but I quickly changed it back because the terrain size changed due to the LODLevel.

I do plan on fixing this for 2.03. In 2.03 get ground height will work for these tiles, GetTerrainSize will be slightly higher to include them and "power of two plus one" Heightmap sizes will be allowed (eg. 129, 257, 513, etc).

If you use normal heightmap sizes, the heights will be automatically calculated depending on the gradient of the area around it.


The main aim of 2.03 is to add the ability to stitch terrains together so you can make one huge terrain out of a few smaller ones. This can then be used for adding spherical terrains and streaming.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 23rd Apr 2011 15:15
Well what is a normal size heightmap? Because I used the same heightmap for Advanced Terrains long time ago and didnt have the same issue.


Making dreams possible, one line at a time...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 23rd Apr 2011 15:34
Normal size heightmap is 128x128, 256x256, 512x512, etc.

Advanced terrain removes the extra and stretches the whole terrain a little bit to make it the same size, so tiles are slightly larger than they should be. This can't be done when using LOD because you must be able to halve the detail of each sector but it should still line up. The reason why I left the extra polys there is to keep the terrain the same size for every LOD level.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 23rd Apr 2011 16:49
Ok I am using a 128x128, but in the next update the position will be corrected for those tiles?


Making dreams possible, one line at a time...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 23rd Apr 2011 19:03 Edited at: 23rd Apr 2011 19:06
The positions are already correct. Its just that you can't have a 128x128 vertex terrain, It must be 129x129 vertices in order to have a power of 2 number of tiles.

The next update will calculate the last row and column depending on the gradient so it will look better than it is at the moment. It will also have support for 129x129,etc heightmaps.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Travis Gatlin
15
Years of Service
User Offline
Joined: 14th May 2009
Location: Oxford, Alabama
Posted: 23rd Apr 2011 22:50
Ok, i'll run the code right quick in the step through mode

Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 28th Apr 2011 23:09
@ Kaedroho,

Could you explain what bytes within the ARGB are used to calculate the colour heightmap value - which byte comes first - >? - could you perhaps also give an example ie. green byte = 210, blue byte = 80, therefore height value = x (in decimal). Trying to get my head around it.

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 29th Apr 2011 01:55
The bytes used are the R and G values. Blue and Alpha are not used (the PNG format will chop these off automatically).

The calculation for the height is:


So to get a height into R and G values, first make sure your height is between 0 and 255 then do this calculation.



Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 29th Apr 2011 06:47 Edited at: 29th Apr 2011 11:45
@ Kaedroho,

Sorry to harp on but with that second bit of code, if R =2, R-R = 0 * 255 = 0 .... so it would always be R = 2, G would always be 0 as r-r is always 0?

[edit] it's ok - get it now.

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 1st May 2011 12:41
@kaedroho
Shouldn't it be like this:

and:


If you use 255, you get multiple colours equating to the same height:
R = 1, G = 0 => 1.0
R = 0, G = 255 => 1.0

256 will give you an even distribution of heights.

[b]
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 1st May 2011 13:45
I get what you mean by using 256 instead of 255. I will change that in the code. It won't make much difference though. Just adds one extra step G for every step in R.

Thanks Diggsey



As for the GDK full version. This was sent to TGC 3 weeks ago, they kept telling me that it will be up by the end of the month. I will look into why it still isn't up. I'm hoping they will have it up in the next week though.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 4th May 2011 04:53 Edited at: 4th May 2011 04:53
Any news about shaderless multitexturing?


Making dreams possible, one line at a time...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 4th May 2011 13:16 Edited at: 4th May 2011 13:19
Not yet, 2.03 will be mainly focused on stabilising the system and adding the ability to stitch terrains together for Streaming and Spherical terrains. I will look into it for 2.04.


Recently, I have been rewriting parts of the system to make it more stable. The main parts I've been rewriting is the memory management and Build code.


The memory management now does fewer but bigger allocations. This makes memory leaks less likely and improves the efficiency of loading/building. I have also found a couple of memory leaks as well.

Large parts of the build code has been rewritten to make the system better on memory and more stable. I have also removed some code which was going to be features such as the option to disable mesh optimisation.



Also, the GDK ful version has been released on TGC. Get it here: http://www.thegamecreators.com/?m=view_product&id=2286

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 4th May 2011 17:38
Quote: "Also, the GDK ful version has been released on TGC. Get it here"

Looked at the videos there
Looks really awesome
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 4th May 2011 22:28
Great news for GDK users, I'm almost certain I will be buying this for my next project.

I'm trying to use 2 cameras but find although the terrain seems fine in both cameras my objects dissapear in camera 0. Is there something I'm doing wrong, I have added a few lines of code to your demo:



I also get a crash if I try to use the render() function.

Hopefully these don't cause you too much trouble.

Melancholic
14
Years of Service
User Offline
Joined: 26th Nov 2009
Location:
Posted: 4th May 2011 22:50
Hey Keadroho, is there anyway to find the height of a terrain at a certain co ordinate?


I can count to banana...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 4th May 2011 23:14 Edited at: 4th May 2011 23:17
Melancholic,
Yep, just use BT GetGroundHeight.



matty halewood,

As you have auto render on, you should not call the render function manually. This shouldn't cause a crash though, I will look into that.

I'm not sure why the objects are disappearing, does it do this when a terrain is not rendered?


EDIT: Just found the cause of the crash, you must add BTMain.SetCurrentCamera(0); before calling the render function.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 5th May 2011 00:15
Quote: "I'm not sure why the objects are disappearing, does it do this when a terrain is not rendered?"


No, if the terrain is not rendered I see the box in both cameras.

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 5th May 2011 01:46
@Kaedroho, bought Blitz just waiting on the approval


Making dreams possible, one line at a time...
Melancholic
14
Years of Service
User Offline
Joined: 26th Nov 2009
Location:
Posted: 6th May 2011 22:07
Is anyone else having a problem with BT GETGROUNDHEIGHT returning a 0 constantly? im looking directly down at the terrain and using the x and z co ord of the camera, yet still 0


I can count to banana...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 6th May 2011 22:21 Edited at: 6th May 2011 22:26
Melancholic,

BT GetGroundHeight will return 0 for areas with no data. Make sure that the point is not excluded and is on the terrain. If you've repositioned your terrain, you need to use coordinates which point to the terrains original position.

If none of the above solve the problem, then please post:

Weather your using the DBPro or DarkGDK version.

What version you are using (Get this with BT GetVersion or right click the dll -> Properties -> Version).

Any code that might help find the problem.


Oneka,

Thanks for purchasing! Let me know if you have any problems or need any help.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Melancholic
14
Years of Service
User Offline
Joined: 26th Nov 2009
Location:
Posted: 7th May 2011 12:10
Sorry for being a bother Keadroho, but i cant seem to get it to work. The code is simple:



The terrain is visible, it has not been repositioned and is in the default location, but no x,z value seem to return anything. BTW is using version 2.02


I can count to banana...
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 7th May 2011 15:06
@kaedroho,

Have you put in any thought of adding the ability to carve out maybe caves or tunnels of a terrain?


Making dreams possible, one line at a time...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 7th May 2011 15:37
Melancholic,

Are you using the TerrainID returned by BT MakeTerrain or the terrains object number? BT GetGroundHeight uses the Terrains ID.

Oneka, that would be difficult to add because of the way the LOD system works. It is possible to add caves in but It would be very difficult to put LOD on them.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 7th May 2011 15:43
Hmmm interesting though, it would be a nice option to have though, I would definitely make use of it, LOD wouldn't be so much of an issue as long as I could hide bits when not in view


Making dreams possible, one line at a time...
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 7th May 2011 22:00
Oneka, I would just model the cave in pieces if you are wanting something longer than 50 scale yards or so. Done right you could angle the pieces in any direction, create T, or 4 way intersections in the same way FPSC does, but with more control over the end result.

You could exclude the tiles from BT at the entrance, and model your cave opening to merge into the surrounding tiles.

Melancholic, what Kaedroho said. It's probably that you're using the Terrain Object ID and not the terrain ID.

Melancholic
14
Years of Service
User Offline
Joined: 26th Nov 2009
Location:
Posted: 8th May 2011 20:41
@Keadroho, ah i feel like an idiot for not noticing that thanks for the help though!


I can count to banana...
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 8th May 2011 22:33
@KISTech that is a great idea, have a modular system of pieces that I can use to build caves with would prove to be a useful asset!


Making dreams possible, one line at a time...
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 9th May 2011 05:25
Making the areas where the pieces join look right will be the tricky part.

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 9th May 2011 18:01 Edited at: 9th May 2011 22:09
@Kaedroho, sorry to be a bother but

I am having issues with BT, it is creating my terrains fine and all but it is apparently not giving me correct heights for some portions of the map, basically the majority of the map is correct but it seems at some curves on the hill that the height data and mesh data are not lining up as the mesh will be either above or below what the height reports back as a number which is causing invisible terrain points in which sometimes I will either go under the terrain or fly above it

My code that I am using is provided



NOTE: I am not gathering height data for the other terrains as I am only using the uiMain_Terrain one (which is positioned at 0,0) but they are all the same

EDIT: I have supplied the heightmap I am using that I encounter this problem with, even when I randomly place objects on the map just using position coords I still see objects floating on areas that I get the same issue with..


Making dreams possible, one line at a time...

Attachments

Login to view attachments
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 10th May 2011 20:51
@ kaedroho,

just checking - how is it going with next version? what's your next move with additions to this plugin?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 11th May 2011 00:58
..hoping Terrain Streaming is coming soon.

Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 16th May 2011 22:59
Hi kaedroho,

At last I had some time to try out the latest BlitzTerrain Dark GDK free version. I started with the first example and I noticed something funny. The terrain is mirrored in relation to the height map. Have a look at the attached picture which shows the heightmap and its appearance in the program, side by side.

I tested a heightmap with the built-in terrain commands of Dark GDK and that is not mirrored.

Attachments

Login to view attachments
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 16th May 2011 23:16
Quote: "I tested a heightmap with the built-in terrain commands of Dark GDK and that is not mirrored. "


That explains why I had to alter my terrain light mapping commands. Is there a standard for this, does it matter?

Also, kaedroho, can you confirm the multiple camera issue I brought up or do you think it might be specific to my machine?

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 17th May 2011 00:45 Edited at: 17th May 2011 00:46
In the DBPro version it's BT SetATMode 1. Which will flip the heightmap around to line up with the other textures and stuff.

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 17th May 2011 02:26
Wondering if I can get a response on my issue...


Making dreams possible, one line at a time...
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 17th May 2011 08:23
Thanks KISTech! If I use BT_SetATMode(true); before building the terrain, then it looks good. According to the help, this mirror feature is for compatibility with Advanced Terrain because "Advanced Terrain rotates and mirrors the terrain but Blitzwerks Terrain doesn't". Maybe this AT mode switch behaves the other way around, I would think that it should be set to false to prevent rotation, but the important thing is that it works. I should have read the help a little further.
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 17th May 2011 11:21 Edited at: 17th May 2011 11:25
Oneka, I will look into that issue when I get back to my home pc (should be later today). Not sure whats happening there. Try doing this without quad rotation.

Mireben, I thought that I mirrored the terrain the BlitzTerrain way. I'll look into that. Thanks.

matty halewood, I will look into that aswell when I get back.

Advanced Terrain takes a heightmap in one way but flips and rotates the texture before applying it on to the heightmap (I don't know the reason for this). BlitzTerrain applies the texture straight to the heightmap without flipping or rotating which gives it better compatibility with many terrain editors.


Sorry everyone for being away without notice. I'm doing lots of exams at the moment so I can't focus that much on programming . I will be fully back to work on this next month though.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 17th May 2011 20:47
Yes it looks like quad rotation was the culprit!


Making dreams possible, one line at a time...
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 20th May 2011 13:56
Regarding the objects dissapearing with multiple cameras, I have just noticed that this can happen in my plugin(DI) too. I can fix it by rendering at a different priority on my plugin. It looks like it does draw the objects but to the the wrong camera view.

I still need to investigate this more. I will let you know if I find out exactly what causes it and any fixes.

A r e n a s
16
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 6th Jun 2011 19:08 Edited at: 6th Jun 2011 19:09
For some reason, once I've installed the plugin and compile one of the examples, I get the following error;



And then;



Can any one help me with this? It looks like such an incredible plugin and I'd love to include it with the RTS game I'm working on.


EDIT

I found this has happened before and I'm installing what I now need. Cant wait to use this plugin!

A

Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 8th Jun 2011 09:53
@ Kaedroho,

Hoping the exams are over...

What next for BlitzTerrain?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 15th Jun 2011 13:42
Sorry for the lack of updates, still doing exams until the 27th of June.


A r e n a s,

You just need to download and install this:
http://www.microsoft.com/downloads/en/details.aspx?familyid=a7b7a05e-6de6-4d3a-a423-37bf0912db84


Duffer,

Exams will be done by the end of the month (last month was the last month of school, this month is home study and exams month). I start full time work on 4th of July. Full time work will give me less time to work on BT during the week than I had while I was at school.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 6th Jul 2011 01:01
@ Kaedroho,

Good to hear you got a job.

Selfishly though, really hope you find some time at some point to take this plugin further...

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 6th Jul 2011 17:41
If you don't mind me asking, how much have you made from Blitzterrain?

JackDawson
13
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 13th Jul 2011 08:59
Hey there. Ok, I downloaded the Demo Blitzwerks. 2.02.1. Now I got this source code from this link to an infinite Terrain demo he made.

http://forum.thegamecreators.com/?m=forum_view&t=183409&b=1

Now the EXE he has works just fine. In fact it worked BEFORE I even had the DLL from this thread. Now the problem is, I am trying to compile his code. I went through the Matrix DLLs that I was informed off and all of that is fine. But what I found in the Blitzwerks INI file is two references to the same function. Which happens to be the EXACT error i'm having. Its the BT BuildTerrain function. And the code gives me a successful compile, it then goes black and its running the program with text.. but when it gets to that command to BT BuildTerrain, it crashes with the error saying "Its already running that function".

So after hours of searching, I found that there is two instances of that same command in the INI.

One is : BT BUILDTERRAIN==int TerrainID, int ObjectID

The Second is : BT BUILDTERRAIN==int TerrainID, int ObjectID, bool Build Fully

The second one with the 3rd Option is the one I see being called in the demo called.. because its passing 3 perimeters. But as you can see above, there is two instances and the upper one is missing the 3rd perimeter it needs anyhow.

Now I have taken it out, I have taken both out, I have even taken out the INI completely.. but I left the DLL in there the whole time where it should be. And I get the SAME results every time.

It crashes with the message saying there is already a second function.

I have supplied a picture to show you the popup error message.

Keep in mind, I am testing this before I buy this plugin.. Hopefully you can get this demo to work. I downloaded it from this thread.

Thanks for all your help and its a great plugin from the looks of it. I just have not ever gotten it to compile.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-23 13:47:14
Your offset time is: 2024-11-23 13:47:14