.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 2: The Ascension Wars (http://forum.shrapnelgames.com/forumdisplay.php?f=55)
-   -   JAVA programmer? (and Win-DomMap, and some GIMP) (http://forum.shrapnelgames.com/showthread.php?t=17585)

Gandalf Parker January 30th, 2004 09:49 PM

JAVA programmer? (and Win-DomMap, and some GIMP)
 
This site has a blur class, and a map render program. It would be great if someone could look at it and see if it will fill our needs to map-making

http://www.jhlabs.com/index.html

Can the blur run stand-alone?
Batch mode?
on linux?
process targa files?
be told to not blur white pixels (255/255/255)?
be told 3 colors to avoid?

[ February 24, 2004, 19:33: Message edited by: Gandalf Parker ]

BugRoger January 31st, 2004 03:17 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
This filter won't run on itself. It's a class that can be used in conjunction with the Java Advanced Imaging API (JAI). It would be quite easy to implement a filter that does the thing's you mentioned though. But it only works with BMP, GIF (decoder only), FlashPix (decoder only), JPEG, PNG, PNM, TIFF, and WBMP.

For running java programs you need to have at least the JRE installed. Set some enviroment variables and you can (almost) use it like a native executable.

Gandalf Parker January 31st, 2004 04:17 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by BugRoger:
This filter won't run on itself. It's a class that can be used in conjunction with the Java Advanced Imaging API (JAI). It would be quite easy to implement a filter that does the thing's you mentioned though. But it only works with BMP, GIF (decoder only), FlashPix (decoder only), JPEG, PNG, PNM, TIFF, and WBMP.

For running java programs you need to have at least the JRE installed. Set some enviroment variables and you can (almost) use it like a native executable.

<font size="2" face="sans-serif, arial, verdana">This sounds like more reading and experimenting into Java than I wanted to do. I would be running on a linux so raw java code should run fine. Could I ask you to whip up something that works on PNM files to blur the entire image except for 255/255/255 44/135/195 195/87/44 ?

Examples of the maps Im working with are at
http://www.techno-mage.com/~dominion...s2/RandomMaps/

And you can email me as gandalf@ that site or community.net (or a dozen others) http://forum.shrapnelgames.com/images/icons/icon7.gif

BugRoger January 31st, 2004 05:53 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Before I spend my day working on Java (again) may I suggest something else? Try ImageMagick. It might be just what you are looking for. If you're running Linux it's probably already installed... I'm not very experienced in using it but it is *very* powerful. I use it for on the fly generation of thumbnails on my webserver.

I browsed the Online docu and there is a blur filter and an option to select a specific set of colors. I haven't tried it but it seems like this should work.

Joe Bedurndurn January 31st, 2004 05:59 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
If you can point me to a site that explains the PNM format and a sample image, I can give it a go.

Gandalf Parker January 31st, 2004 07:21 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Joe Bedurndurn:
If you can point me to a site that explains the PNM format and a sample image, I can give it a go.
<font size="2" face="sans-serif, arial, verdana">Targa is what the game uses (.tga format). The PNM is just a passthru on its way to JPG (I couldnt find a tga2jpg converter so I go tga2ppg then ppg2jpg)

The JPG exists for web viewing and so that WebMagick can make thumbnails (which does use imagemagick to do it). I did see that ImageMagick had a blur switch but didnt see where I could hold 255/255/255 white aside. Maybe something where I could copy the white pixels to another file then merge it back after the blur?

Of course these are also all work-arounds for the old DomMap program which is in C source code if anyone is interested.

[ January 31, 2004, 17:22: Message edited by: Gandalf Parker ]

BugRoger January 31st, 2004 11:48 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
If I'm correct you can use the map switch. Give it a color map file to select specific colors (I'm totally clueless about the file format though). Pass that output to the matte channel. You might have to create a temp file for that.

In the docs there's an example about using a matte channel to filter only certain areas of the image.

gladestrider February 24th, 2004 12:29 AM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Gandalf Parker:
Of course these are also all work-arounds for the old DomMap program which is in C source code if anyone is interested.

<font size="2" face="sans-serif, arial, verdana">Gandalf,

Please send me the source code when you get a chance. I'd like to take a look at it.

I'm a bit late to this party. Why are we looking for a blur filter?

gladestrider

Gandalf Parker February 24th, 2004 01:46 AM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
PhilD is managing the source code now. The Last batch of changes were his. He has pretty much gotten it to create maps which will work for Dom2. His Version is Linux only and there are people who would love to get just a working Windows compile made available.

The blur story is this. Dom1 had a very restricted use of color. The maps made for Dom2 have a much greater range of allowance. There are alot of possible ways to go as far as making the random maps look much better. But the EASIEST thing Ive found is a blur.

In a few steps, using GIMP, I can layer the white capital dots, layer the blue borders in water provinces, layer the brown color used for land borders, blur the rest and then save. I can provide links of the before and after if you wish.

With DomMap I can generate 100 maps a day and make them available on my web site. But they are ugly. Ive tried to find a way to automate blurring them while not touching 3 colors (or even 1, the 255/255/255 white capitals). But a better answer would be the fact that DomMap has all that info in an array at one point. There are alot of ways to go. Blur then insert the capital pixels to the file would be one.

Id also be interested in whether the C code actually generates a more extensive fractal map then "dumbs it down" to the old Dom1 map format. Such as... does it squeeze everything between height 100-150 into the green tree color because the old Dom1 limited the map to a total of 16 colors? Letting it assign each level to a slight color change could result in a great map.

Gandalf Parker February 24th, 2004 01:47 AM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Found PhilD's link to the newer DomMap code.
http://duchon.philippe.free.fr/dom2/index.html

PhilD February 24th, 2004 08:06 AM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Gandalf Parker:
PhilD is managing the source code now. The Last batch of changes were his. He has pretty much gotten it to create maps which will work for Dom2. His Version is Linux only and there are people who would love to get just a working Windows compile made available.

<font size="2" face="sans-serif, arial, verdana">More specifically: I'd say the program is pretty much standard C. Not really my problem if people cannot get it to compile on their system http://forum.shrapnelgames.com/images/icons/icon7.gif

(more truthfully: I don't know what it would take to get it to compile on non-linux machines; it's most likely very little)

Quote:



Id also be interested in whether the C code actually generates a more extensive fractal map then "dumbs it down" to the old Dom1 map format. Such as... does it squeeze everything between height 100-150 into the green tree color because the old Dom1 limited the map to a total of 16 colors? Letting it assign each level to a slight color change could result in a great map.

<font size="2" face="sans-serif, arial, verdana">Yes, it actually generates two full fractal maps (one for altitude, one for "richness"), then sorts it into a few color categories to only include a few colors in the output.

I can easily change it so it outputs more or less the whole range (of one map), or something like that: it's a very minor change. Or to output the province borders and capitals to a different .tga file, if you want to do some automated image treatment. Not that big a deal (will use more memory, though).

Arryn February 24th, 2004 08:42 AM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
I've already mentioned to Gandalf that I'll be looking at porting it to Windows later this week. I grabbed the code earlier tonight. The compiler I'll be using, BTW, is MSVC++ 6.0 Pro.

In case anyone's curious, I'm not a newbie C++ programmer. I cut my teeth in C/C++ on AT&T UNIX systems back in '88. Used Borland compilers (I was one of their beta testers) from '90-'97, and have used MS stuff since then (have to for my employers).

EDIT: oh, and in regards to the thread's title, I also program in Java. http://forum.shrapnelgames.com/images/icons/icon12.gif

[ February 24, 2004, 06:47: Message edited by: Arryn ]

February 24th, 2004 08:58 AM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
I eat toast.

Just in case that is a requirement.

Gandalf Parker February 24th, 2004 05:20 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Its a race. So far I think 3 people have offered to take a stab at a Windows compile.

PhilD: do you want to host the Win Version also. Im thinking its basically your puppy for control purposes. Or at least you get first shot at it if you want it.

On the other notes, YES those would be great.
Doing the 2 tga might make the blur project work.

And Id love to see what we get if each level/richness variation is given a slightly different color. The blur project might not be needed at all. With some tweaking we might get it to smoothly transition appropiately. Maybe even knock the GIMP project out of the running if we can get it close to this....
http://www.techno-mage.com/~dominion...s/rendered.jpg

Leif_- February 24th, 2004 06:39 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by PhilD:
More specifically: I'd say the program is pretty much standard C. Not really my problem if people cannot get it to compile on their system http://forum.shrapnelgames.com/images/icons/icon7.gif
<font size="2" face="sans-serif, arial, verdana">It was pretty much this that was a problem, otherwise it went fine: http://www.meangene.com/notes/putc.html

Leif_- February 24th, 2004 07:02 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Gandalf Parker:
But the EASIEST thing Ive found is a blur.

<font size="2" face="sans-serif, arial, verdana">You might want to look at adding a bump-map to that as well. (To do that manually in Gimp copy the original map to a new layer, and create an additional empty layer. Fill the empty layer with plasma (Filter -> Render -> Clouds -> Plasma), then select the copy of the map, blur it and choose Filter -> Map -> Bump Map and use the plasma layer as the bump map.)

Next, select by colour to select the borders and capital-dots on the original map and cut these parts away from the copy. Delete the plasma map.)

Gandalf Parker February 24th, 2004 07:28 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Leif_-:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">quote:</font><hr /><font size="2" face="sans-serif, arial, verdana">Originally posted by Gandalf Parker:
But the EASIEST thing Ive found is a blur.

<font size="2" face="sans-serif, arial, verdana">You might want to look at adding a bump-map to that as well. (To do that manually in Gimp copy the original map to a new layer, and create an additional empty layer. Fill the empty layer with plasma (Filter -> Render -> Clouds -> Plasma), then select the copy of the map, blur it and choose Filter -> Map -> Bump Map and use the plasma layer as the bump map.)

Next, select by colour to select the borders and capital-dots on the original map and cut these parts away from the copy. Delete the plasma map.)
</font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">WOw I didnt follow that at all. There are some GIMP threads here that you might want to look at. Click on "search" in the upper right of this forum. I think GIMP in the titles of the threads will get you a short list.

I have a few steps that will do it in GIMP quite nicely. And one of the people here even made a scheme script-fu of it for me. But I still havent gotten it to work in a batch mode which is what Im really wanting.

If anyone is REALLY into GIMP Id rather see someone tackle the map generators that are in gimp already.

PhilD February 24th, 2004 09:04 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
[quote]Originally posted by Gandalf Parker:
Its a race. So far I think 3 people have offered to take a stab at a Windows compile.

PhilD: do you want to host the Win Version also. Im thinking its basically your puppy for control purposes. Or at least you get first shot at it if you want it.


I'd rather not have executables on my "site", though I'll gladly link to them. If I understand Leif's comment, it's a very minor change I need to make so it becomes Windows-compatible (provided one knows how to compile).

Actually, there are a few tweaks I'd like to try, and minor features I'd like to add, if I can find the time (who am I kidding? I'm on vacation this week, so I have to choose between PLAYING this game and PROGRAMMING this stupid generator...)

Quote:


On the other notes, YES those would be great.
Doing the 2 tga might make the blur project work.

And Id love to see what we get if each level/richness variation is given a slightly different color. The blur project might not be needed at all. With some tweaking we might get it to smoothly transition appropiately. Maybe even knock the GIMP project out of the running if we can get it close to this....

<font size="2" face="sans-serif, arial, verdana">Most likely, GIMPing the whole thing would be much simpler if somebody knows how to do it, but... I'll add my changes.

(and the picture you linked is nice, but hard on the eyes - it looks like my brand-new 19" LCD monitor is all blurry... http://forum.shrapnelgames.com/images/icons/icon9.gif )

PhilD February 24th, 2004 09:04 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Leif_-:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">quote:</font><hr /><font size="2" face="sans-serif, arial, verdana">Originally posted by PhilD:
More specifically: I'd say the program is pretty much standard C. Not really my problem if people cannot get it to compile on their system http://forum.shrapnelgames.com/images/icons/icon7.gif

<font size="2" face="sans-serif, arial, verdana">It was pretty much this that was a problem, otherwise it went fine: http://www.meangene.com/notes/putc.html </font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">You mean I only have to change the fopen() calls and it will work on Windows?

E. Albright February 24th, 2004 09:05 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Well, as Leif_- stated, it didn't seem too hard to get compiled. There were a few quirks, but nothing drastic. It seems like it's working fine, but then I've no .tga viewer on this machine, so I'm taking on faith that it functions properly. Anyway, if anyone wants to grab it, it is for the moment at:

http://gozips.uakron.edu/~emil/dommap.zip

A sample output is at:

http://gozips.uakron.edu/~emil/dommap.zip

The program is of course provided as-is, no guarentees, use at your own risk, blah, blah, blah. If it's not working, let me know, and I'll try to fix it (within my capabilities). And I'd appreciate if, should it prove to be correct and of use, for someone to find it a more permanent home than where it currently resides...

E. Albright February 24th, 2004 09:08 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

You mean I only have to change the fopen() calls and it will work on Windows?
<font size="2" face="sans-serif, arial, verdana">Well, I had to change random/srandom to rand/srand, and maybe tweak a few other things (and I don't know, and can't currently test, if my port functions correctly, but it seems to do so), but yeah, there wasn't much to change.

[Edit: And per Leif_-'s suggestion, I changed the fopen().]

[ February 24, 2004, 19:10: Message edited by: E. Albright ]

PhilD February 24th, 2004 09:25 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Leif_-:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">quote:</font><hr /><font size="2" face="sans-serif, arial, verdana">Originally posted by Gandalf Parker:
But the EASIEST thing Ive found is a blur.

<font size="2" face="sans-serif, arial, verdana">You might want to look at adding a bump-map to that as well. (To do that manually in Gimp copy the original map to a new layer, and create an additional empty layer. Fill the empty layer with plasma (Filter -> Render -> Clouds -> Plasma), then select the copy of the map, blur it and choose Filter -> Map -> Bump Map and use the plasma layer as the bump map.)

Next, select by colour to select the borders and capital-dots on the original map and cut these parts away from the copy. Delete the plasma map.)
</font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">OK, so now we have someone who really knows what he's talking about... cool http://forum.shrapnelgames.com/images/icons/icon7.gif

I tried to do what you said: if you check the "compensate darkening" on the bump-mapping filter, it looks nice... only, now the sea's all bumpy. I thought I'd select capital dots, plus borders, plus the sea, and invert the selection before blurring and bump-mapping, but then, the problem seems to be that colors from the unselected part still blur (which means the area around capital dots will be lighter); and, if I cut this part away, it will either blur to background, or blur to transparent if I make the background transparent.

I don't know if all this is clear...

OK, now here's what I get, starting with a dommap output with default settings except a 500x500 size...

Original dommap output

(JPG Version)



Same map after blurring and bump-mapping

(JPG Version)

What do you all think?

(The .map file, in case you like it)

PhilD February 24th, 2004 09:28 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by E. Albright:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">quote:</font><hr /><font size="2" face="sans-serif, arial, verdana">You mean I only have to change the fopen() calls and it will work on Windows?
<font size="2" face="sans-serif, arial, verdana">Well, I had to change random/srandom to rand/srand, and maybe tweak a few other things (and I don't know, and can't currently test, if my port functions correctly, but it seems to do so), but yeah, there wasn't much to change.

[Edit: And per Leif_-'s suggestion, I changed the fopen().]
</font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">OK; when someone can confirm that it runs fine, and produces viewable output, could you email me the source at: duchon (dot) philippe (at) free (dot) fr

(I'd like to reconcile the Versions, as much as possible, in case I decide to tweak features...)

Gandalf Parker February 24th, 2004 09:31 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by E. Albright:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">quote:</font><hr /><font size="2" face="sans-serif, arial, verdana">You mean I only have to change the fopen() calls and it will work on Windows?
<font size="2" face="sans-serif, arial, verdana">Well, I had to change random/srandom to rand/srand, and maybe tweak a few other things (and I don't know, and can't currently test, if my port functions correctly, but it seems to do so), but yeah, there wasn't much to change.

[Edit: And per Leif_-'s suggestion, I changed the fopen().]
</font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">OK I have Win compiled copies from both you and Leif. They both seem to work but have one strange quirk. Little loops of water border create un-capitaled water provinces. Not a big problem since the windows Version was mostly desired by people who wanted to edit the maps in paint programs anyway.

Arryn February 24th, 2004 09:31 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by E. Albright:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">quote:</font><hr /><font size="2" face="sans-serif, arial, verdana">You mean I only have to change the fopen() calls and it will work on Windows?
<font size="2" face="sans-serif, arial, verdana">Well, I had to change random/srandom to rand/srand, and maybe tweak a few other things (and I don't know, and can't currently test, if my port functions correctly, but it seems to do so), but yeah, there wasn't much to change.

[Edit: And per Leif_-'s suggestion, I changed the fopen().]
</font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">The variable "near" is also a (obsolete) reserved word and I had to change that (to "nearby" http://forum.shrapnelgames.com/images/icons/tongue.gif ). The only thing blocking my compile at present is a missing def for "M_PI". Of course, I presume this is related to the value of Pi, but I don't know what the "M" is supposed to imply.

Once I have the console port in Windows compiled and working okay, then I can begin the "fun" task of rebuilding the app as a native Windows MFC app, with GUI and all the other niceties. Well, that's the plan, FWIW.

Gandalf Parker February 24th, 2004 09:35 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
OK that makes 3 in the running. http://forum.shrapnelgames.com/images/icons/icon7.gif
Anyone feel like "Source Forge"ing this project? http://forum.shrapnelgames.com/images/icons/shock.gif

Gandalf Parker February 24th, 2004 09:38 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by PhilD:
(JPG Version)

What do you all think?

<font size="2" face="sans-serif, arial, verdana">I like that. The "canvas" thing that Illwinter uses was interesting also (I think Saber Cherry recommended it in another thread) but I think I like this one better.

But I suspect this is farther away from being batch-useable than blur is. Im sure ImageMagick commands can do what I want. I just dont understand enough about masks and such.

[ February 24, 2004, 19:39: Message edited by: Gandalf Parker ]

Taqwus February 24th, 2004 09:45 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
M_PI is normally the value of PI from math.h or a subinclude. For instance, on a Linux box I've nearby, /usr/include/math.h contains
# define M_PI 3.14159265358979323846 /* pi */
(in a block of defines surrounded by an #ifdef relating to BSD).

Arryn February 24th, 2004 09:58 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Taqwus:
M_PI is normally the value of PI from math.h or a subinclude. For instance, on a Linux box I've nearby, /usr/include/math.h contains
# define M_PI 3.14159265358979323846 /* pi */
(in a block of defines surrounded by an #ifdef relating to BSD).

<font size="2" face="sans-serif, arial, verdana">Thanks! My linux box is downstairs collecting (a lot of) dust. Two years worth at least.

I've gotten the code to compile and produce a map & tga. You can get the v1.94a console .exe w/ sample output from my site. If no one finds any other problems (besides the odd water loops that happen with my compile also), then I can begin the conVersion into a real Windows app. That is, assuming anyone is interested in the fancy Windows trappings (GUI, etc.) ...

[ February 24, 2004, 20:00: Message edited by: Arryn ]

Gandalf Parker February 24th, 2004 10:22 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Not to curb your enthusiasm but so far what we have managed to do is get the DomMap from Dominions 1 to work for Dom2. There is a wish-list for this program. Many things that could be upgraded. If we wander into two code-sets it will be hard to keep up. Your choice of course.

There are also other 3rd party program requests where window-dressing (pun intended) is what is being asked for.

Arryn February 24th, 2004 10:48 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Gandalf Parker:
Not to curb your enthusiasm but so far what we have managed to do is get the DomMap from Dominions 1 to work for Dom2. There is a wish-list for this program. Many things that could be upgraded. If we wander into two code-sets it will be hard to keep up. Your choice of course.
<font size="2" face="sans-serif, arial, verdana">First, no one has yet come forward to volunteer for Source Forging. I would if I was familiar with the system. I've never used Source Forge.

Second, and more pointedly, if I apply "window-dressing" to the app, it will be a major (ie: almost complete) rewrite of the code, not just a recompile. This will render moot any source control between a Windows GUI Version and a linux console Version.

The ideal option, of course, is to do any GUI in Java, which, if done properly, will run on all platforms. Doing it in Java will take me longer as the code not only has to be translated from C, but I'm not as swift a Java coder as I am a C coder.

BTW, I haven't been doing this out of any interest I have in the app (I don't plan to use it myself), but just because a need for a Windows Version was expressed. So just point me in the direction you want me to go.
Quote:

There are also other 3rd party program requests where window-dressing (pun intended) is what is being asked for.
<font size="2" face="sans-serif, arial, verdana">Such as? Someone else is doing the game-save app, so I'm not going to parallel that effort. I haven't seen mention of any other projects in progress or desired. Please post a list of what's been asked for, and solicit volunteers ... http://forum.shrapnelgames.com/images/icons/icon12.gif

[ February 24, 2004, 21:54: Message edited by: Arryn ]

Leif_- February 24th, 2004 11:46 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Gandalf Parker:
I like that. The "canvas" thing that Illwinter uses was interesting also (I think Saber Cherry recommended it in another thread) but I think I like this one better.

But I suspect this is farther away from being batch-useable than blur is. Im sure ImageMagick commands can do what I want. I just dont understand enough about masks and such.

<font size="2" face="sans-serif, arial, verdana">I've been messing around with Jeff Kelly's selective blur script, and have added bump-mapping to it. You can find the edited Version here: http://home.Online.no/~rmoldskr/Domi...blur-batch.scm

It _almost_ works in batch mode (with the command-line gimp -b '(selective_blur_batch "/complete/path/to/file/random.tga")(gimp-quit 0)'), but for some reason the gimp-by-color-select calls refuses to work unless there's an open display. I did a quick google on the problem, and it seems other people _are_ able to use the gimp-by-color-select calls in batch mode, so it might perhaps be related to the Version of Gimp I'm using (1.2.3)

Gandalf Parker February 24th, 2004 11:53 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Hmmm the dommap has kindof a UI called run_dommap.sh which I tried to convert to a batch file. Didnt really come out good. All it does is give an easy semi-documented way to edit the many parameters of DomMap and run them with your favorite settings over and over. Doing a GUI front-end to DomMap would probably be a great thing.

On my linux system I made a front-end for me to play with which ran batches of maps thru DomMap while randomizing many of the parameters (within reasonable boundarys) so that I could view the results of 30, 50, 100 at a time. It gave me a feel for the settings I prefered. I can provide the code if you promise not to laught at it (its in Basic)

You could probably do something with those two. A front end that offered help on the variables, let you set them, save them, randomize them, and run a batch for viewing.

I started a list of desired 3rd party apps but it got kindof long. I thought maybe I had better make it another thread.

Arryn February 24th, 2004 11:57 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Gandalf Parker:
You could probably do something with those two. A front end that offered help on the variables, let you set them, save them, randomize them, and run a batch for viewing.
<font size="2" face="sans-serif, arial, verdana">Sounds like something useful, that I can do without the "me-too" issues of the core generator. I'll begin work on the front end. Thanks for the suggestion.

mgarnett February 25th, 2004 12:32 AM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Hi all,

I also have compiled a working windows Version of the DomMap generator. I have also started work on afront end to allow variable changing etc.

I am new to the forum and see that Arryn has also started work on a front end. Let me know if you need any help. I'll keep working on mine just in case you don't get any time to finish.

By the way Arryn, I was finally able to view the TGA files.

Thanks

Mark Garnett
Brisbane Australia

alexti February 25th, 2004 01:38 AM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Arryn:
Second, and more pointedly, if I apply "window-dressing" to the app, it will be a major (ie: almost complete) rewrite of the code, not just a recompile. This will render moot any source control between a Windows GUI Version and a linux console Version.

<font size="2" face="sans-serif, arial, verdana">If you'll do window UI using Qt, you will be able to compile the same code on Linux and Windows (and Mac). And AFAIR, Qt is free for GPL-ed projects.

Arryn February 25th, 2004 01:53 AM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by alexti:
If you'll do window UI using Qt, you will be able to compile the same code on Linux and Windows (and Mac). And AFAIR, Qt is free for GPL-ed projects.
<font size="2" face="sans-serif, arial, verdana">I don't see a Qt/GPL Version for Windows. Also, if I'm going to write cross-platform code, I'd rather do it in Java. The only advantage to writing in C++ would be to use the (obviously non-portable) MFC libraries. http://forum.shrapnelgames.com/images/icons/icon12.gif

But thanks for clueing me in that there is a cross-platform compiler besides those from Borland and IBM.

[ February 24, 2004, 23:53: Message edited by: Arryn ]

Leif_- February 25th, 2004 03:03 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
I've finally managed to get the "blur and bump-map" script to work with Gimp's batch mode - although unfortunately I had to hard-code the color values into the script. (I'm sure it's possible to send them in as parameters, but I don't know enough scheme to get it done.)

I've put the working script up at http://home.Online.no/~rmoldskr/Domi...blur-batch.scm

Place it in Gimp's scripts directory (~/.gimp-1.2/scripts on unix machines) and you can run it from the command line by typing gimp-1.2 -b '(script_fu_blur_random_map_batch "./random.tga")' - Alternatively, just add this as the Last line of run_dommap.sh

alexti February 25th, 2004 03:27 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Arryn:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">quote:</font><hr /><font size="2" face="sans-serif, arial, verdana">Originally posted by alexti:
If you'll do window UI using Qt, you will be able to compile the same code on Linux and Windows (and Mac). And AFAIR, Qt is free for GPL-ed projects.

<font size="2" face="sans-serif, arial, verdana">I don't see a Qt/GPL Version for Windows.</font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">I can't find it on their site either and now their current Version is 3.xx. But if I'm not mistaken, 2.xx Version was GPL-ed, so it can be obtained from somewhere else. and btw, it's not compiler, it's a GUI library (plus few extra libraries and tools)

Quote:

Also, if I'm going to write cross-platform code, I'd rather do it in Java. The only advantage to writing in C++ would be to use the (obviously non-portable) MFC libraries. http://forum.shrapnelgames.com/images/icons/icon12.gif

<font size="2" face="sans-serif, arial, verdana">The use of MFC is only advantageous in commercial projects, where you're getting paid for fixing MFC bugs ;-)

Gandalf Parker February 25th, 2004 05:20 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Leif_-:
I've finally managed to get the "blur and bump-map" script to work with Gimp's batch mode
<font size="2" face="sans-serif, arial, verdana">Looks like you got it to work. And I thank you. Some of the GIMPers will be able to make use of it.

Unfortunately it still wont quite fill my needs because Im hard-headed and dont load GUIs on my servers. Everything I do with the maps so far uses no console display. WHen I run your new script I get much farther than before but I get this...
Gtk-WARNING **: cannot open display:
even though Im not asking for a displayed finish. I even deleted the display line out of the script completely and it gave me that error

[ February 25, 2004, 15:21: Message edited by: Gandalf Parker ]

Leif_- February 25th, 2004 05:57 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Gandalf Parker:
Looks like you got it to work. And I thank you. Some of the GIMPers will be able to make use of it.

Unfortunately it still wont quite fill my needs because Im hard-headed and dont load GUIs on my servers. Everything I do with the maps so far uses no console display. WHen I run your new script I get much farther than before but I get this...
Gtk-WARNING **: cannot open display:
even though Im not asking for a displayed finish. I even deleted the display line out of the script completely and it gave me that error

<font size="2" face="sans-serif, arial, verdana">Yes, I believe that is a flaw with Gimp - it actually needs to open its menu window, even when just doing batch-processing; so it needs an X display just to start. Terribly annoying.

PhilD February 25th, 2004 06:12 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Gandalf Parker:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">quote:</font><hr /><font size="2" face="sans-serif, arial, verdana">Originally posted by Leif_-:
I've finally managed to get the "blur and bump-map" script to work with Gimp's batch mode

<font size="2" face="sans-serif, arial, verdana">Looks like you got it to work. And I thank you. Some of the GIMPers will be able to make use of it.

Unfortunately it still wont quite fill my needs because Im hard-headed and dont load GUIs on my servers. Everything I do with the maps so far uses no console display. WHen I run your new script I get much farther than before but I get this...
Gtk-WARNING **: cannot open display:
even though Im not asking for a displayed finish. I even deleted the display line out of the script completely and it gave me that error
</font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">Have you tried using the -i switch? My gimp (Version 1.2.3) says it will not cause the program to use its graphical interface. I just tried, and it seems to work (it's possible that, even when not launching an interface, gimp still requires an X server or something like that, though).

Leif_- February 25th, 2004 06:25 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by PhilD:
Have you tried using the -i switch? My gimp (Version 1.2.3) says it will not cause the program to use its graphical interface. I just tried, and it seems to work (it's possible that, even when not launching an interface, gimp still requires an X server or something like that, though).
<font size="2" face="sans-serif, arial, verdana">Yes, I looked at that now. Gimp still needs an X server for font rendering (even though we don't do any font rendering in this script.)

Gandalf Parker February 25th, 2004 06:52 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by PhilD:
Have you tried using the -i switch? My gimp (Version 1.2.3) says it will not cause the program to use its graphical interface.
<font size="2" face="sans-serif, arial, verdana">Good shot. Sounded good but it didnt work. Rats, I thought we had it that time.

If I had more willpower I would reload Debian with all the GUI stuff and just force myself not to get addicted to it. But I know Id fail and lessen my abilities as a server admin.

[ February 25, 2004, 16:54: Message edited by: Gandalf Parker ]

PhilD February 25th, 2004 07:02 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Gandalf Parker:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">quote:</font><hr /><font size="2" face="sans-serif, arial, verdana">Originally posted by PhilD:
Have you tried using the -i switch? My gimp (Version 1.2.3) says it will not cause the program to use its graphical interface.

<font size="2" face="sans-serif, arial, verdana">Good shot. Sounded good but it didnt work. Rats, I thought we had it that time.

If I had more willpower I would reload Debian with all the GUI stuff and just force myself not to get addicted to it. But I know Id fail and lessen my abilities as a server admin.
</font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">Too bad, really. Me, I like the result, and I'll probably add a switch to dommap to launch this script on the .tga... ugly kludge, but if the maps look better...

Leif_- February 25th, 2004 07:16 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by PhilD:
Too bad, really. Me, I like the result, and I'll probably add a switch to dommap to launch this script on the .tga... ugly kludge, but if the maps look better...
<font size="2" face="sans-serif, arial, verdana">I'm working on a perl script right now to do batch production of maps processed with this script. I'll put it up somewhere when it's ready.

Leif_- February 25th, 2004 09:28 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Leif_-:
I'm working on a perl script right now to do batch production of maps processed with this script. I'll put it up somewhere when it's ready.
<font size="2" face="sans-serif, arial, verdana">Okay, I'm finished with the perl script now. It basically lets you create a number of maps with dommap, prettifies them with the Gimp script, zips up the maps in individual zip-files, generates thumbnails and builds a (very basic) web-page where the maps can be downloaded from. (The web-page thing can be turned off)

The script can be found at http://home.Online.no/~rmoldskr/dominions.html and an example web-page with a handfull of generated maps on it can be found at http://home.Online.no/~rmoldskr/Domi...nion_maps.html

Torvak February 25th, 2004 09:37 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Magnificent

Gandalf Parker February 25th, 2004 10:01 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Leif_-:
Okay, I'm finished with the perl script now. It basically lets you create a number of maps with dommap, prettifies them with the Gimp script, zips up the maps in individual zip-files, generates thumbnails and builds a (very basic) web-page where the maps can be downloaded from. (The web-page thing can be turned off)

<font size="2" face="sans-serif, arial, verdana">Wow, you are good. Sounds like what I have running (minus the gimp part) but you got there alot faster than I did. I will definetly take a look at it.

Leif_- February 25th, 2004 10:34 PM

Re: JAVA programmer? (and Win-DomMap, and some GIMP)
 
Quote:

Originally posted by Gandalf Parker:
Unfortunately it still wont quite fill my needs because Im hard-headed and dont load GUIs on my servers. Everything I do with the maps so far uses no console display.
<font size="2" face="sans-serif, arial, verdana">I came across something here http://gug.sunsite.dk/tutorials/tomcat17/ about using virtual frame-buffers to allow Gimp to do batch processing from a text console. As far as I understand, you'd have to install X Window on the machine to get the frame-buffer, but you wouldn't have to actually start X Window as such.

Would that help you?


All times are GMT -4. The time now is 12:26 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.