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 / Giles Importer for DarkBASIC Professional !!!

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Jan 2006 15:26 Edited at: 12th Jul 2006 17:25
Giles Importer now available, Updated for U6.2 (see posts around 12 July 2006)

Attached to this post is the source code for the Gile[s] importer for DarkBASIC Professional. This is almost complete, but requires someone to pick up the baton and run the final stretch.

I quote, due to my lack of knowledge of C++ :

Quote: "there really isnt much to finish, the converting side is done but a problem remains in the loader part...

...some models load fine while others dont but I'm sure someone will spot what I have done wrong

the source is for a DLL to DB Pro based on the advanced terrain project, wont take much to sort it out
"


So if anyone is prepared to take the challenge, the community will be eternally grateful. This will be a fantastic tool to add, just take a look at Megaton's level building tutorial and see what future projects could look like. We need 5.9 compatibility for all the new commands, Unity, TextureMax and any future plug-ins.

Our thanks go to Mike, who has developed this source so far, and to Rich for his persuasive powers and influence.



Attachments

Login to view attachments
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 9th Jan 2006 15:38
BTW this is a Visual Studio 7 project. If you want it in another format, convert it yourself. It will create a DLL for DBPro that will be able to load in GLS files. To see the file in DBPro you need to call 'build terrain'. If you look at the BuildTerrain function you will see the code required to set things up (it's basically the terrain DLL with all the terrain stuff ripped out).

The issue is the map loading. If the map loads correctly it will be converted to a DBO just fine. But it's the GLS loader that needs tweaking.

So, eat your heart out!

Exit Planet Dust
x1bwork
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 9th Jan 2006 15:54
Quote: "BTW this is a Visual Studio 7 project."


Awsome!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Jan 2006 22:11 Edited at: 9th Jan 2006 22:57
If someone can compile this and provide the commands and the dll, I'd be happy to run different scenarios through to see what causes the problems.

French gui
20
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 9th Jan 2006 22:13
Yeah, I'm eating my mouse ,waiting...

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Jan 2006 10:36
Has anyone downloaded this and started looking yet?

Chenak
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 10th Jan 2006 13:47
I've started looking but can't compile it without some dx9c sdk files, and I can't be asked to download those
Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 10th Jan 2006 13:53
I'm starting to go crazy about this! There are so many people that are really good with C++ but noone can help us? We are not asking that much!

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 10th Jan 2006 13:59 Edited at: 10th Jan 2006 14:03
I have started taking a look at this. Since I have no real way to test this out, can someone test the compiled dll's? Or provide me with some sort of test project that I could use with my debugger to pin point the problem (prefered method)?

Also I had to comment out the included file cTerrain.h because it wasn't included in the source code. It did compile fine without it though.

[edit]

Never mind about the test project, I found stuff in the other directory.

Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 10th Jan 2006 14:22
I can test it... just post it here! I need this Dll so much I can even eat my hearth out!!

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 10th Jan 2006 14:31
None of the .gls files included with this had any problems converting to .dbo format. Hmmm...

Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 10th Jan 2006 14:47
Post it, post it, post it... Sorry for n00bing though! You better download the latest Demo Scene GLS files from Fredborgs Gile[s] site. I had problem with loading old GLS files into the latest version of Gile[s]. Better test it!

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 10th Jan 2006 15:11 Edited at: 10th Jan 2006 15:24
Test this until you get a failed load, then zip up the needed gile[s] files that failed and upload them here so I can test.

The command to build the terrain is:

BUILD TERRAIN .gls filename, .dbo filename, id number

Example:

build terrain "RomanBath.gls","RomanBath.dbo",1

[edit]

I noticed a bug already, working on it...

Attachments

Login to view attachments
Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 10th Jan 2006 15:21
Ok in an hour I will post a GLS if it will not be loaded, great job!

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 10th Jan 2006 15:30
Newer dll upload. Try it out. The previous one had a bug.

Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Jan 2006 15:46 Edited at: 10th Jan 2006 15:48
OK, I'm sat 20 miles from my Gile[s] installation. However, the mssus is out tonight, i will have peace and quiet to create all sorts of different scenarios in Gile[s], I'll post any results, good or bad.

I guess the plan of action would be to isolate various components, and report back on each one:

1. Gile[s] primitives
2. Imported objects
3. Single light map
4. Multiple light maps
5. Vertex maps
etc...

Thanks for putting the time in Torrey, it's appreciated!

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 10th Jan 2006 16:00
No problem! I've been digger deeper and deeper at this. Currently I'm checking out the file format specs and comparing it to the way the file is loaded to see if I noticed any out of the ordinary. It seems like in some models like the RomanBath that it's skiping data for whatever reason.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Jan 2006 16:12 Edited at: 10th Jan 2006 16:13
Which file format specs? DBO or GLS? As far as I know there are no specs for DBO at 5.9, only the source code to unravel. I'm just a little concerned that you are working to the old 5.8 information.

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 10th Jan 2006 16:25
GLS, Davey pointed out that if the gile[s] file loads correctly the dbo file will be created.

Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 10th Jan 2006 17:21 Edited at: 10th Jan 2006 20:07
Here are my tests:







+ The sample lightmapping scene that came with Gile[s] version 1.31 does not load at all.

Looks a bit dark though and neither the SET AMBIENT LIGHT 100 or SET OBJECT LIGHT onoff helped.

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 10th Jan 2006 20:18
I also manually edited the Parking Lot Scene. Added second layer with detail texture and moved the lightmapping layer to the 3rd layer. And this is what I get:



As you can see the texture mapping is incorrect + the detail texture layer is not visible\loaded!

Cheers,

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 10th Jan 2006 20:42
I'm sorry I can't help with the C++ side of things, but I can test the DLL once it's released.

I'm also struggling to see specifically how this DLL will work. Torrey posted a function call example which specified a giles object filename, a dbo filename and an id. If the DLL converts the GLS object to a DBO object and writes it to disk, what's the point in the id number? If the DLL loads the GLS Object straight into the DBP engine (and is assigned the id number) what's the point of the DBO filename?

[center]
iv tryed everything!!!!!!!!!! could u please just add The gun and shooting Code thats All!!!!!!!!!
Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 10th Jan 2006 20:49
It does not load straight to the DBP (yes it does but it seems that it doesn't work), you rather should load the saved DBO file into DBP using load object command, tho

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Jan 2006 21:55 Edited at: 10th Jan 2006 21:58
Not having much luck. Firstly, I have downloaded D3DX9_25.dll in order to make it work. Not the best scenario for deploying.

Secondly, every test I make results in a silent crash. It crashes immediately just by the command being included. I have placed messages prior to the command, and it crashes even before those. As soon as I comment out the line, it works fine. For example, the following would not reach line 2:



But this will run (albeit it uselss!)



This is the same for both versions of the Dll. Simple test with one Gile[s] primitive (cube) and no lights attached.

Attachments

Login to view attachments
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 10th Jan 2006 22:14
Great to see people far cleverer than me are working on this. Good work Torrey - keep at it!

Vector ScOpE
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: middle world UK
Posted: 11th Jan 2006 00:55 Edited at: 11th Jan 2006 02:49
@Torrey

imported x file into Giles saved as giles tried conversion did not convert giles scene attached.

[edit]forgot to add the textures to the zip[/edit]


Nothing is foolproof to a sufficiently talented fool

Attachments

Login to view attachments
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 11th Jan 2006 02:26
During my testing I already noticed that straight loading of the gls never worked, but the dbo was created correctly so I loaded that instead. The dbo loaded fine each time except for the roman bath.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Jan 2006 09:56
I wonder why mine does nothing at all? Does anyone have a sample project and GLS model that I can test with, one that at least creates the dbo?

Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 11th Jan 2006 13:35
As you can see that almost every GLS file I load does this incorrectly... (except for the Ruin.gls)

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 11th Jan 2006 13:43 Edited at: 11th Jan 2006 14:12
Here's the .dbo's created for ruin and the parking lot.

Attachments

Login to view attachments
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 11th Jan 2006 14:33 Edited at: 11th Jan 2006 14:33
And I decided to post up the screen shots from those scenes as well.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 11th Jan 2006 15:17
Torrey - those scenes are lightmapped correctly when I tried it out. Have you changed much in the code?
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 11th Jan 2006 15:20
2 screenshots showing what I get when loading the DBOs that the DLL creates -




For some reason the roman bath scene does not all load. Never got round to looking at why that is. If I get chance will finish this myself over weekend.
Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 11th Jan 2006 15:42
Mike has same problem as me & Torrey your screens show incorrect texture mapping tho

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 11th Jan 2006 18:54
The only changes I've made so far are to the command BuildTerrain. I added the infile and outfile parameters. There was an accidental change to the lightmap portion of code that I just noticed now. Once I change that back the objects I load should have the proper lightmap.

For whatever reason the terrain once loaded in memory doesn't apply the texture or light map to itself, but it does convert to the dbo properly (except for the roman bath). In the tests above I deleted the terrain object created and then loaded the dbo file.

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 13th Jan 2006 14:50 Edited at: 13th Jan 2006 14:50
Quote: "Secondly, every test I make results in a silent crash. It crashes immediately just by the command being included."


You need at least one object command in your source for dbpro to include the object commands, which the dll uses.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 13th Jan 2006 15:41
Ah, thank you Mr Sparky!

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 15th Jan 2006 18:54 Edited at: 29th Jan 2006 12:01
Updated version

- the command is LOAD GLS <Filename>, <ObjNum>
- loads meshes directly into the object number, doesn't save a .dbo
- meshes now loaded correctly
- textures now loaded correctly
- lightmaps are now at full brightness when 'full bright' option is selected in giles
- alpha transparency loads when 'alpha' option is checked in the texture properties
- culling is applied when 'two sided' option is checked in the material properties
- vertex lighting is supported

Known issues

- texture masking (making black invisible) is not supported, use the alpha channel for now
- material color/alpha is currently not supported
- saving to .dbo and then loading causes lightmaps to darken
- two or more overlapping transparent meshes can make meshes invisible

If any .gls files fail to load or don't look as they should then post them here and I'll take a look.

[edit] (Newer version in later post)

Attachments

Login to view attachments
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 15th Jan 2006 20:12
Genius! Nice one Sparky.

Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 15th Jan 2006 21:54 Edited at: 15th Jan 2006 22:12
Hey Sparky, I tried your version and it does not load a gls file if it is not in the same folder as the loader app.

If I try to load: "E:\Programs\DarkBASIC Professional\Projects\gls\ParkingLot.gls" it wont load, but if I try: "ParkingLot.gls" then it loads ok!

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Jan 2006 21:59
Sweet If you're ever in my local, I'll buy you several of the Landlord's best.

Now all I need is time...

Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 15th Jan 2006 22:02 Edited at: 15th Jan 2006 22:13
<edit>

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 15th Jan 2006 22:09
@Olby - I can't view your image, the site just loads forever.

Is it an error message? If it's runtime error 68 then it can't find the gls file you specified, it must be in the same directory as your source file.
Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 15th Jan 2006 22:13
Sorry I'm a bit sleepy, I edited the post read it again!!

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 15th Jan 2006 22:27 Edited at: 29th Jan 2006 12:02
Using absolute path names works here, as long as you have write access to the folder where the .gls file is located.

Does it just not load the model or does it display an error/crash silently?

[EDIT]

Nevermind, fixed a bug with relative texture paths.

New version attached, let me know if you still experience problems.

[EDIT] (Newer version in later post)

Attachments

Login to view attachments
Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 16th Jan 2006 12:10
Ok, I will try it later at home. Thanks!

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Jan 2006 18:02
Fantastic Work!

I just given myself a crash course in Cshop, exported to Gile[s], add my lights, saved and then dropped it into my project in place of the rather drab looking grey box. It worked perfectly!

I had to install D3DX9_25.dll to make it work. Is this essential, or can it be made 100% compatible?

Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 16th Jan 2006 19:04 Edited at: 16th Jan 2006 19:06
Sparky your version of the loader does not support multitexture functions. I set an additional layer of a texture but instead it showed only one layer DBP though!

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 16th Jan 2006 19:07
Nice mike

http://www.users.zetnet.co.uk/csimon/spain03/days2_3.htm << where i went for my holiday or www.portaventura.es
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 16th Jan 2006 21:44
I'll try compiling with an older version of the DirectX SDK, once it finishes downloading

True multi-texturing is not supported, only base texture and lightmap. If you want to post a .gls that has multiple textures I'll see if it would be possible, as the file format doesn't clearly state how multiple textures per material are handled.

Login to post a reply

Server time is: 2024-11-24 07:34:14
Your offset time is: 2024-11-24 07:34:14