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 / matedit

Author
Message
why789
14
Years of Service
User Offline
Joined: 17th Feb 2010
Location:
Posted: 18th Feb 2010 21:53
hello

im absolutly new to DGDK so im probably gonna need a step by step... anywho ive made a matrix and i built it with all of the files my question is how im going to put in my program in DGDK

thank you,
why789
bloodmage2
15
Years of Service
User Offline
Joined: 14th Jun 2009
Location:
Posted: 23rd Feb 2010 17:55
hmm, im not quite sure what you are asking. are you trying to load an object? use dbLoadObject. are you trying to put code in darkGDK? just #include "DarkGDK.h", and use the functions as listed in C:\Program Files\The Game Creators\DarkGDK\Documentation\Help

-to the optimist, the glass is half full. to the pessimist, it is half empty, to the engineer, it is twice as big as it needs to be.
why789
14
Years of Service
User Offline
Joined: 17th Feb 2010
Location:
Posted: 23rd Feb 2010 18:36
ive made a matrix and i need to know how to load it into dark GDK so i can use it in my game
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 23rd Feb 2010 23:16 Edited at: 23rd Feb 2010 23:45
Well I made a search on this forum for matedit and it seems to be a matrix editor which was made for DB Classic and/or DB Pro and it is rather old. (References from 2001-2005 mostly.) Even its web site seems to contain something else now.

Since the program uses its own file format to store the matrix, you would need:
- either to know the file format, so that you can write your own loader,
- or a DB Pro code to load the matrix, which you can, with some effort, convert to Dark GDK code,
- or a converter that can convert the files into another format that can be loaded into Dark GDK more easily.

Have a look at this thread.

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

Here, "Lost in Thought" wrote a program to convert matedit files to X objects, as far as I understood the posts in quick reading. He also posted the source code to his converter (including the loading part) and there is a mention of it that the loader code is "already included in the package", so possibly you also have it in your matedit installation. Note, however, that the loader code is DB Pro and you need to know both that language and Dark GDK pretty well to make a conversion.

Maybe your best bet is to try if that converter, in its executable form, works for you, because X objects can be loaded into Dark GDK.
why789
14
Years of Service
User Offline
Joined: 17th Feb 2010
Location:
Posted: 24th Feb 2010 00:41
that sounds mighty confusing lmfao... is there a way to turn the matrix files into a height map... cuz i kno whow to use that
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 24th Feb 2010 22:09 Edited at: 24th Feb 2010 22:11
Regarding that the matedit files contain height values as numeric data and the heightmap, to my best knowledge, is a bitmap - sure there is a way to convert one into the other but again, you will have to write your own program for it.

If you have a look at the file format and the DB Pro loader in the above-mentioned thread: I saw them yesterday for the first time in my life, but they are so straightforward that it should be easy to write a Dark GDK loader.

You know what, if this seems above your current capabilities, then post your matrix files (zip them together and attach to the post) and I may have a go at writing a loader for you. (Supposing that the file format is really so simple as can be seen in the other thread, but why should your version be different.) It will be an interesting coding exercise. Alternatively, I can try to give guidance for you how to write a loader yourself, if you want to try, but I need to see the files.
why789
14
Years of Service
User Offline
Joined: 17th Feb 2010
Location:
Posted: 25th Feb 2010 04:35
I won´t even try to attempt that lol the only coding experience i have is in GML anyway if you would like to try your hand at your own program than ill attach a zip file of all files i get when i build it. if you could make a .exe of the converter and would like to share it could you please send it to me so i dont have to ask you everytime i need a terrain done... I have a few textures in there... i hope that doesnt complicate anything... all i have is a mountain in the middle lol

thank you for your help,
why789

Attachments

Login to view attachments
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 25th Feb 2010 19:01
OK, that certainly looks feasible, but will take some time. I will write again in a few days.
why789
14
Years of Service
User Offline
Joined: 17th Feb 2010
Location:
Posted: 25th Feb 2010 19:06
THank you very much...

take your time

why789
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 28th Feb 2010 10:34
I have written a matrix file loader for you. It is attached, but let me tell you first what I deduced from your posted files and from the file format published in the other thread. It seems that matedit can create two types of builds: single-matrix file with one texture file attached, and multi-matrix with multiple texture files. Your matrix is a single matrix, which makes it much easier. I am not going to write a loader for multi-matrix, since it is more complicated and you don't need it anyway.

From the files you posted, only the MATRIX.MDF and the _MATRIX.BMP files are needed for loading. The first contains the matrix data (size, various settings, then texture tile indexes for each tile, then height values for each tile, then - it seems - a few additional meaningless lines at the end). It is human-readable text format, you can check what's inside. The BMP file is the texture with all tiles. The two smaller bmp files (grass, gravel) are the separate tiles of the big image, so they are not needed for loading. And the MA0 file - I don't know why it's there because it is only meaningful in a multi-matrix format, so that is not needed either.

The source code I attached has many comments, you can study how it works. It's a complete project, so you can use it this way: Unzip the files, making sure to unzip with subdirectories, and put them into the directory where you usually put your Visual Studio projects. Double-click the file with the sln extension to open the project in Visual Studio. (You can also open it from the Visual Studio menu.) In the beginning of the program, locate the lines where it contains the names of the two matrix files to be loaded. Write in the directory path where your files are. If you leave it like this (file name only), then the files will only be found if they are in the correct working directory, but if you write out the path, then they will be found anywhere on disk. (The program will give an error message if the files are not found.) Then compile and run the program and it should display your matrix.

I must mention that I had to scale down the size of the matrix because it's huge (hundred thousand units). It was so large that it simply did not appear on the screen even if I loaded it correctly. So I introduced a Divider variable in the beginning to scale it down by 100. If you make other terrains with smaller size, you might want to change that Divider.

I had a slight surprise: you said that there is one mountain in the middle, but actually there is a mountain on the left side, and a smaller one on the right side. I hope that's how it's supposed to look like. I double-checked the code but it's fine.

Attachments

Login to view attachments
why789
14
Years of Service
User Offline
Joined: 17th Feb 2010
Location:
Posted: 28th Feb 2010 16:33
thank you very much! at the moment im on my laptop cuz my comp is in the shop so i wont be able to test this until i get my computer back.

this program is just a loader am i right?
either way

thank you very much!

Login to post a reply

Server time is: 2024-11-19 15:23:30
Your offset time is: 2024-11-19 15:23:30