Game Development Community

dev|Pro Game Development Curriculum

Released GTK+ Map2Dif User Interface for Windows/Linux

by Jeffrey Bakker · 12/18/2005 (4:11 pm) · 21 comments

Since my video game plan is going to have to be put on hold, due to time and money constraints, I figured I can still make myself useful by starting other projects in the meantime.

I don't know how many people will find it useful, but I designed a user interface for map2dif that works on Linux and on Windows. It requires python, GTK+ 2.6, pyGTK 2.6 and libglade, which are all available on any Linux distro and can easily be installed on Windows** in minutes.

Most people either know how to use map2dif from the command line, and others may use BSP programs that have map2dif already integrated. But for those in between, or those who'd like to do batch converting, m2dui is the ting for you! Below are some screenshots:

Windows
evil.damnclan.com/torque/m2dui_01.jpg
Linux
evil.damnclan.com/torque/m2dui_02.png
I hope that at least a small handful of people may find this useful. Here's the download link:

Linux/Windows python script release:
damnclan.com/evil/torque/m2dui-1.0.2.zip

"Standalone" Windows .exe release (only basic GTK+ runtime is required):
damnclan.com/evil/torque/m2dui_exe-1.0.2.zip

Enjoy!


*Note: first time running, you will have to locate the map2dif executeable and your paths, then you can click on save settings which will create an m2duirc file in your home folder.

**The "standalone" .exe version is recommended on Windows, as it has less requirements (only GTK+ runtime). The non-exe version still works fine in Windows, however. If you want to use the non-exe, you will need the following...

GTK+ for windows, GTK+ devel for Windows, libglade for windows are all available in one package, found here:
gladewin32.sourceforge.net/modules/wfdownloads/viewcat.php?cid=1

Then install python:
www.python.org/download

Then install pygtk (make sure to download the version the corresponding version of python and GTK+ you downloaded):
www.pcpm.ucl.ac.be/~gustin/win32_ports/pygtk.html


Update:
New feature, plus minor changes in v1.0.2, as well as another Windows .exe release (requires GTK+ runtime, but nothing more :). The non-exe release still works in Windows, given all requirements are met.

m2dui changes

v 1.0.2 (21/12/2005)

- Added more tooltips to the GUI.
- Added the ability to write batch/shell scripts for later/repeated use.
- Fixed for output and textures directory paths containing spaces.
- Fixed adding a whole directory to only add .map files inside.
- Maps directory chooser will now only show .map files.


v 1.0.1 (20/12/2005)

- Added a separate Windows .exe version (regular version still works too).
- Code cleanup/organization.
- Fixed GTK+ 2.8 FileChooser warnings.
- Fixed AboutBox bug if License file is not found.
- Updated toolbar with text labels.


v 1.0.0 (18/12/2005)

- Initial release.
Page «Previous 1 2
#1
12/18/2005 (4:52 pm)
Cool stuff, I know some people who would gladly make use of this.

Have you looked at py2exe before? It'll let you build the Python interpreter and all the dependencies into a native executable (and data package) for people who don't want to install/manage Python on their machines.
#2
12/18/2005 (5:13 pm)
Wow, thanks for the py2exe info. I'll have to look a lot more into it, as I still don't know how to use it (looking at the sample files just confused me even more, lol). I definately would like to start porting Linux apps to Windows this way because I understand that most Windows users don't really have much reason for installing python and gtk+, etc. I used to port GUI programs by having to rewrite them from scratch to keep the dependencies to a minimum.
#3
12/18/2005 (10:06 pm)
Minions of Mirth is packaged on Windows with Py2Exe and on OSX with Py2App :)
#4
12/19/2005 (12:22 pm)
I don't think I'll be getting it running with py2exe anytime soon, so Windows users will have to install the dependencies if they want to use m2dui right now.

The problem I'm having with py2exe is that the built program will execute with python errors I haven't seen in m2dui before. The build window says it's missing the modules 'gdk' and 'ltihooks'. That and the fact that it's rather large in filesize for such a small application (10MB+), even a compiled C/C++ program like this statically built with libraries would be only a few megs at most.
#5
12/19/2005 (2:21 pm)
Hey, umm I'm using widnows, I downloaded the GTK+ and I don't know how to run your program. I tried using glade to open the m2dui.py file but that doesnt work. I opened the .glade file but I didn't understand what to do.

Edit: got it lol i feel noobish. you open up the .glade file and then double click the m2dui
Edit2: even more noobish, this opens the thing up so that u can edit hte actual interface.
#6
12/19/2005 (3:02 pm)
I'm sorry if it isn't very clear. With all these dependencies on Windows is the best I could do at the time, but I hope to take care of that in the near future.

Well, having GTK+ installed is a good start. I am guessing that you may not have python and pygtk for Windows installed.

First install python:
www.python.org/download

Then install pygtk (make sure to download the version the corresponding version of python you downloaded):
www.pcpm.ucl.ac.be/~gustin/win32_ports/pygtk.html

When python is installed, the m2dui.py file should look like a green snake in your Windows explorer. Just double-click on it to launch the program.
#7
12/19/2005 (6:48 pm)
Ok i downloaded and installed those programs. I can now open up the program and load up .map files. But, I can't convert them. it says:

'C:\Documents' is not recognized as an internal or external command,
operable program or batch file.

So... what do I do now?
#8
12/19/2005 (7:15 pm)
Looks like you found a bug, and I think I know what it is: command line programs and environments (like calling map2dif) don't like spaces in filenames because spaces are treated as separators. For "Map2Dif Location" choose a map2dif.exe file that is not contained in paths that have spaces. eg:

DON'T
C:\Program Files\Somewhere\map2dif.exe
C:\Documents and Settings\user\Desktop\map2dif.exe

DO
C:\Torque\map2dif.exe
C:\my_folder\map2dif_plus.exe


Edit:
At first I thought it was spaces in the input filenames, but it turns out that is already taken care of by m2dui by placing quotes around them before calling map2dif. The only explaination left is that map2dif.exe is in a path with spaces (which putting quotes around doesn't simply fix). Most people will have map2dif.exe located under "C:\Torque\SDK\tools\", which doesn't have any spaces therfore isn't an issue.

If you certainly must use a copy of the map2dif.exe program located somewhere in "Program Files" or your desktop (or any path with spaces), there is a workaround. You can use a text editor to edit the m2dui config file (located in HOMEDRIVE:\Documents and settings\your username\m2duirc) and manually change the path to map2dif.exe in the old DOS style file name convention. eg. "C:\PROGRA~1\MAP2DIF\map2dif.exe"
#9
12/19/2005 (10:18 pm)
Just released v1.0.1 with minor changes, plus a Windows .exe release (no python or pyGTK required). See above in .plan for more info.
#10
12/20/2005 (12:30 pm)
Thanks Jeff, I'll test this out and get back to you.
#11
12/21/2005 (2:46 am)
Added yet another release 1.0.2 with imporvements (that I didn't think of when I released 1.0.1 monday night). The new key feature is the ability to create batch/shell scripts for ease of reuse once you have all your options set. See above for details.
#12
12/21/2005 (9:28 am)
So with 1.0.2 can i uninstall python, GTK+ 2.6, pyGTK 2.6 and libglade?
#13
12/21/2005 (12:33 pm)
If you download the .exe release, you will not need python, pygtk, or libglade. You will still need the basic GTK+ runtime installed.
#14
12/26/2005 (9:25 pm)
Umm ive been getting these wierd errors ever since I uninstalled python, pygtk, and libglade. My computer gets this blue screen with some white code on it for a second and then my computer restarts. do you know whats wrong? does it have to do with those? because thats the only thing i really changed before it started happening. well i did change to the Omega driver like 2 weeks ago, but i htink i would have experienced errors before now.

This is where i get sent when i send my error to microsoft.
http://oca.microsoft.com/en/response.aspx?SGD=af7c0f4a-d761-4cc8-bb73-b667d9de418c&SID=10
#15
12/27/2005 (11:18 pm)
Ben, that page is referring to a device driver problem. Installing/removing gtk+, libglade, python, pygtk does not affect your operating system on a driver level, nor have I ever heard of them causing BSOD errors.
#16
12/28/2005 (9:32 am)
alright, im not much of a hardware guy, probbly easy to see that. I'll keep looking for a way to fix it. thanks. :)
#17
12/30/2005 (4:38 pm)
Thanks for checking out the program, I hope you will find it useful. I also hope you get your problem solved soon.
#18
01/17/2006 (3:53 pm)
Quote - "You will still need the basic GTK+ runtime installed."

Do you have a link to the basic GTK+ runtime?
Without it being in a package as you mentioned top of post?

Thanks,

JG
#19
01/31/2006 (5:06 pm)
J.G. - Sorry for the late reply (haven't been very active on the GG site lately), but if you still need the link or if anyone else does for future reference here it is:

gladewin32.sourceforge.net/modules/wfdownloads/viewcat.php?cid=12
#20
06/21/2006 (12:25 pm)
I am trying to get this to work with
the map files created with 3d World Studio 5.47
but it is not working.
3d World Studio 5.47 doesn't make the dif file
even though the guy states that it will.
The textures are Microsoft Set Up files .stf
could that be the issue.
Either there is nothing in the output folder
or I am getting an error.
Page «Previous 1 2