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.

Dark GDK / Terrain question

Author
Message
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 24th Jul 2011 23:04
dbSetTerrainHeightmap(TerrainMap, FilePath);

Why can't I just use an image that I already have in memory? Is there a way or do you have to load the image?

The fastest code is the code never written.
Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 26th Jul 2011 06:12
You can't use an image in memory because this behavior is not supported. Write it to the temp directory, pass it in, and delete it. Even with large textures this should be almost instantaneous.

Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 26th Jul 2011 15:35
That's what I've been using, but now there's another problem. There is no way for me to alter the height map of the terrain. I've tried several ways to change it. I can't find any way to delete an old terrain so I can make a new one, and there's no way to take the actual mesh and alter it. I searched the forrum for ways to do this and none of them gave me any hope. There was one possible (void dbDeleteTerrain(int iID) by putting it in the header file, but that didn't work. Either it's not in the code at all or it's a different phrase like "dbTerrainDelete...." or whatever.

Ultimately, I need to generate a single terrain in-game an infinite number of times. I don't need more than one terrain at any one time, but I need to be able to generate it with a wide variety of elevations (for each landing site on each planet).

The fastest code is the code never written.
Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 26th Jul 2011 20:18 Edited at: 26th Jul 2011 20:19
The deleting terrain crash has been fixed in the most recent DBP release candidate. You can port the changes to DarkGDK by grabbing the code from the SVN and, most likely, just recompiling the terrain library.

http://code.google.com/p/darkbasicpro

I don't know the process for compiling for DarkGDK. Someone else will have to help you with that.

Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 26th Jul 2011 20:32
I have no idea how to compile either. I don't even know where the source code is. Is there a download for the source? I looked at the link and I'm not sure what I am looking for or even what I am looking at.

The fastest code is the code never written.
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 26th Jul 2011 21:05 Edited at: 26th Jul 2011 21:09
dbDeleteTerrain is supposed to be fixed in Dark GDK (EDIT: in the last update, October 2010). It was announced in the update thread. I haven't yet tested it though. If it still doesn't work, the bug report thread should be bumped.

Have you already tried the BlitzTerrain plugin? It might be the answer to your questions. It can build a terrain from image ID instead of file name, and the commercial version allows you to edit terrain real-time. The texture can be changed real-time in the free version too. It's also supposed to be faster than Dark GDK terrains and deletion should work too. You can download the free version from here:

http://forum.thegamecreators.com/?m=forum_view&t=145404&b=8

As I wrote in two other threads recently, maybe you didn't read those, to download Dark GDK source code you need to install a Subversion client (e.g. Tortoise SVN). You can browse the code on the web site as well (click source, browse) but that is slow. (EDIT: I haven't yet tried to recompile it.)
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 26th Jul 2011 23:20
I am only wanting something simple. My game doesn't require huge terrains or even multiple ones at the same time. I just need to either delete an existing one and remake it, or alter it. I will look at my DGDK version and see if I need to update (sounds like I need to). If all else fails, I'll just fork over the $40.99 for Blitz. I was just hoping to be able to make my game without any add-ons.

The fastest code is the code never written.
Mistrel
Retired Moderator
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 26th Jul 2011 23:59 Edited at: 27th Jul 2011 00:01
Quote: "If all else fails, I'll just fork over the $40.99 for Blitz. I was just hoping to be able to make my game without any add-ons."


If all else fails, you might consider looking into PureGDK for C++ if you want to stick with something familiar. It's based on the dynamic linking variant of DarkGDK, also known as DarkBasic Professional. It uses DBP 7.7 libraries so deleting terrain does indeed work.

It's currently free while in beta and is compatible with any standards-compliant C++ compiler:

http://forum.thegamecreators.com/?m=forum_view&t=177817&b=38

C++ Projects supported by PureGDK out of the box:

GNU make/g++ (gcc compiling may require setup)
nmake/vc++ (vcvars32.bat compiling should work out of the box)
Visual Studio 6
Visual Studio .NET
Visual Studio .NET 2003
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010

Don't defect to the Blitz crowd.

Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 27th Jul 2011 00:09
I am neck-deep in my current project. If I change to PureGDK, I would have to start over right?

I have (Dark GDK - Version 14th November 2007). I think I need to upgrade.

The fastest code is the code never written.
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 27th Jul 2011 00:23
Quote: "I just need to either delete an existing one and remake it, or alter it. "


If delete-remake is a viable option instead of modification, then the free version of BlitzTerrain should be enough.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 27th Jul 2011 00:30
I downloaded the Oct2010 version and it does exactly what I need. Thank you all for your help/suggestions. When I am done with this project, I'm going to look into PureGDK and see if I like it. If nothing else, I can give Blitz a try on my next project.

The fastest code is the code never written.

Login to post a reply

Server time is: 2024-11-19 08:23:21
Your offset time is: 2024-11-19 08:23:21