L3DT users' community
Large 3D terrain generator

L3DTio to Atlas2

Correspondence concerning plugins and scripts; development, use, bugs and ideas.

L3DTio to Atlas2

Postby MDynna » Fri Jun 15, 2007 8:05 pm

The first time I used this plugin it asked for the path to my TGEA.exe. That location has since changed but the plugin no longer asks for the location. How can it be changed?
MDynna
Contributing member
 
Posts: 33
Joined: Thu Jun 29, 2006 4:50 am

Postby Aaron » Sat Jun 16, 2007 9:03 am

Hello,

The setting is accessible in the 'Settings->Presets' menu option, under 'L3DTio_Atlas->TgeaPath'. Double-click on it to set the path.

Cheers,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby MDynna » Sat Jun 16, 2007 5:05 pm

Excellent, I knew it had to be somewhere in there. On another note, Aaron, I think this plugin has massive potential and I would be glad to help you develop it. Feel free to drop me an email.
MDynna
Contributing member
 
Posts: 33
Joined: Thu Jun 29, 2006 4:50 am

Postby Aaron » Tue Jun 26, 2007 11:27 am

Hello Mark,

Sorry for the slow reply. I've uploaded the source code for the plugin project to:

http://www.bundysoft.com/L3DT/downloads/plugins/src/L3DTio_Atlas2-src.zip (VC++ 7.0)

This code also requires the plugin API source, which is available over here:

http://www.bundysoft.com/docs/doku.php?id=zeolite

Disclaimer: the plugin code was a real quick-n-dirty job to test whether the concept might work, so it's not decorated with nice things like code comments.

Anyhoo, there were a few reasons I kind of stalled with this plugin. One is that my copy of TGEA doesn't run properly on my dev box, which kind of limits my ability to test whether things work. Also, beyond the script examples I've read from TDN, I don't have a clear idea of exactly what is required or what extra features TGEA users might desire. If you or other members could give some guidance, I'd be more than happy to take up the cudgel again and bash the plugin into shape.

Cheerio,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

I'm on it!

Postby MDynna » Tue Jun 26, 2007 2:40 pm

Thanks a lot Aaron, I'll take a look at the source. I consider myself very familiar with Atlas terrain creation, especially using L3DT. Sparkling and I were probably some of the first to pioneer the use of L3DT to create Atlas terrains.

Anyway, I know exactly what is required from a script perspective to get this going. So the last thing will be asking you how to get certain bits of info out of L3DT. I'll keep you posted.
MDynna
Contributing member
 
Posts: 33
Joined: Thu Jun 29, 2006 4:50 am

Postby MDynna » Tue Jun 26, 2007 3:21 pm

Aaron, which version of that API did you develop this plugin with? It seems to be referencing functions and variables that have either been removed or changed names.

PS Maybe move this thread to the "Plugin Development" forum?
MDynna
Contributing member
 
Posts: 33
Joined: Thu Jun 29, 2006 4:50 am

Postby Aaron » Wed Jun 27, 2007 11:11 am

Oops, I'm very sorry. That was build with zeolite 2.4, which I hadn't released. You can get the updated API from here:

http://www.bundysoft.com/L3DT/downloads/zeolite/zeolite_v2.4.zip

This version has the new VarID_FileSelector class and associated functions (as required by L3DTio_Atlas2), and also some mipmapping functions for the VarID_map class (as now used in Sapphire).

Best regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

More Troubles

Postby MDynna » Tue Jul 10, 2007 9:17 pm

Ok, I'm still getting myself familiar with this API, so it's slow going. I made a few tentative changes but when I loaded up L3DT to give them a try I got these errors:
Code: Select all
CExtManager::GetFuncHandle error:
 - function not found

ExtFunc_GetFuncHandle error:
 - Plugin 'L3DTio_Atlas2' requestied function 'map.GenMipmaps', which was not found

CExtAPI::GetFuncHandle error - Function not found

CExtManager::GetFuncHandle error:
 - function not found

ExtFunc_GetFuncHandle error:
 - Plugin 'L3DTio_Atlas2' requestied function 'map.ClearMipmaps', which was not found

CExtAPI::GetFuncHandle error - Function not found

CExtManager::GetFuncHandle error:
 - function not found

ExtFunc_GetFuncHandle error:
 - Plugin 'L3DTio_Atlas2' requestied function 'map.GetMipmapLevel', which was not found

CExtAPI::GetFuncHandle error - Function not found

CExtManager::GetFuncHandle error:
 - function not found

ExtFunc_GetFuncHandle error:
 - Plugin 'L3DTio_Atlas2' requestied function 'map.GetMipmapResStep', which was not found

CExtAPI::GetFuncHandle error - Function not found

CExtManager::GetFuncHandle error:
 - function not found

ExtFunc_GetFuncHandle error:
 - Plugin 'L3DTio_Atlas2' requestied function 'map.GetMipmapMaxLevel', which was not found

CExtAPI::GetFuncHandle error - Function not found


Also, I couldn't compile the plugin in Debug mode at all as I got some "Unexpected End of File" errors. They didn't show up when compiled for Release.

Generally, Aaron what's your process for developing/debugging these plugins?
MDynna
Contributing member
 
Posts: 33
Joined: Thu Jun 29, 2006 4:50 am

Postby Aaron » Wed Jul 11, 2007 2:48 am

Hi Mark,

The mipmap functions were only added to L3DT quite recently; you will need a more recent dev build of the L3DT Pro exe to be compatible with that version of the API. I'll send you a link by e-mail.

The current release of the plugin API (v2.5) is the one that will be used for the next stable release of L3DT (v2.5b).

Also, I couldn't compile the plugin in Debug mode at all as I got some "Unexpected End of File" errors. They didn't show up when compiled for Release.


The compiler is looking for precompiled header directives, which I neglected to include. Open up the project settings, go to 'C/C++ -> Precompiled headers' and switch the 'Create/Use precompiled headers' option to 'Automatically generate' or 'Not using precompiled headers'. I had done this for the release build, but I had not done so for debug mode.

Generally, Aaron what's your process for developing/debugging these plugins?


I guess this is where I admit that I never use debug mode anymore. I do too much realtime network programming at work, for which step-through debugging is not very useful. Consequently I've become accustomed to developing/debugging only in release mode. As you can see from the 'ExtAtlasExport' function in L3DTio_Atlas2, the method I use is just to check the return values of everything and throw a reasonably verbose error message if not OK.

Cheerio,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby MDynna » Wed Jul 25, 2007 9:47 pm

Ok, I am very slowly getting the hang of this API (custom object for everything!). I know I'm missing something obvious, but here's my problem:

I need to use CString.ReverseFind but it doesn't seem to accept a string literal, like "\\". The compiler tells me it can't convert that to an XCHAR. I looked at all the other functions that accept an XCHAR but none were used in the code so I'm not sure how I can call that function with a string literal?
MDynna
Contributing member
 
Posts: 33
Joined: Thu Jun 29, 2006 4:50 am

Postby Aaron » Sat Jul 28, 2007 8:12 am

Hi Mark,

Hmmm...it is rather strange that CString::ReverseFind doesn't have a string-compatible function overload like CString::Find. I suppose you could create a copy of the string, call MakeReverse, call Find, and then reverse the index.

Cheers,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby MDynna » Wed Aug 01, 2007 9:02 pm

Ok, it's pretty "hockey" looking but that works. I've got the script that is generated cleaned up now (it should be using relative paths from the TGEA.EXE, not absolute paths). The last thing it needs to do is change the save location Texture file(s) to the same place as the Atlas file output path.
MDynna
Contributing member
 
Posts: 33
Joined: Thu Jun 29, 2006 4:50 am

Postby Aaron » Mon Aug 13, 2007 11:23 am

Hi Mark,

How is this going? I was thinking of adding the tiled atlas option to this plugin before I changed the UI for the 'official' atlas plugin, but I'll wait for you to finish your changes before I start making mine.

Hmmm...maybe it would be useful if I set up a SVN repository (e.g. Google Code) so that we - and any other interested developers - could check-in changes without getting in one another's way. It may not be worth the trouble just yet, but if other devs join the party then I think it could really help.

Cheers,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby MDynna » Mon Aug 13, 2007 2:25 pm

Aaron,

I've been on vacation the last couple weeks so I haven't done anything more on this yet. If I'm starting to hold you up, then I can send you what I have done already. All that remains to be done (for now) is to change the save location of the texture files. Maybe you could just point me quickly to where that's done?
MDynna
Contributing member
 
Posts: 33
Joined: Thu Jun 29, 2006 4:50 am

Postby Aaron » Mon Aug 13, 2007 9:34 pm

Hi Mark,

Ah, there's no hurry then. Please enjoy your vacation, and think not of code.

Maybe you could just point me quickly to where that's done?


If the texture is not a mosaic, then it's saved in this bit of code:

Code: Select all
TxName.Format("%s_TX.jpg", (char*)BaseFileName);
TxName.Replace("\\", "/");

CzFormat TxFormat;
TxFormat.GetByExt2((ZMAP)TX, "jpg");

if(!TX.ExportMap(TxName, (ZVAR)TxFormat, nx, ny)) {
   theAPI.ReportError("L3DTio_Atlas2::ExtAtlasExport error:\r\n - texture export failed");
   return false;
}


It the texture is a mosaic, it's not actually exported, because it's already saved to disk somewhere. However, if the paths need to be relative to TGEA, I guess I should make the texture mosaics export to the same place as the heightfield. I'll do that when you check-in your changes, but there's no rush on this.

Cheers,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Next

Return to Plugins and scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron