Trick to batch-place features with Photoshop

Trick to batch-place features with Photoshop

Tutorials & Resources For Mappers

Moderator: Moderators

User avatar
Jools
XTA Developer
Posts: 2768
Joined: 23 Feb 2009, 16:29

Trick to batch-place features with Photoshop

Post by Jools » 18 Sep 2011, 23:29

I used this trick to place trees, but I guess it applies to most features that you want randomly placed and mixed between types. For example, I had 10 trees in the fs.txt file that I wanted randomly mixed on the map.

1) First define a new scattering brush pattern. Press Ctrl-N for new document, select 30 * 30 pixels. Select pencil tool, brush size 1 px, slect black as colour (0,0,0) and paint two dots like this:

Image

Then select Edit -> save brush pattern. Then close this new document and save it if you want (I didn't).

2) In your feature map document, select the pencil tool and then select the brush you just defined (it will be last in the list). Make sure anti-aliasing is off, and that you did indeed select the pencil tool and not the brush tool (the brush tool doesn't work because it blends foreground colour with background), like this:

Image

Then, select as foreground colour the colour matching the first feature in fs.txt, normally red 255. Then select as background colour the colour matching the last feature in fs.txt, for me it was red 244.

3) Customise brush options

Press F5 to open the brush options, it should look like this:

Image


Select Scattering and set a value to about 500% (or experiment yourself). Then select colour dynamics and set foreground/background jitter to 100%. The close the window.

4) Paint the trees. Just spray the dots to where you want the trees. This is the fun part. (I have the texture map superimposed on the featuremap so I can see where I want to paint them).

If you select channels/red you and then histogram up in the info menu, you can see and check that only the relevant red colours are used. It should look like in the picture, lots of red 0 (= black) and then some of the colours matching the feature used.

Hope this is of use to someone/not common knowledge.
0 x

User avatar
smoth
Posts: 22271
Joined: 13 Jan 2005, 00:46

Re: Trick to batch-place features with Photoshop

Post by smoth » 18 Sep 2011, 23:45

Not sure if you are aware but I have this sort of thing available in featureplacer... not on that large an area but hey:
http://www.youtube.com/user/smoth7?feat ... Zqyz7woPaY
0 x

User avatar
Jools
XTA Developer
Posts: 2768
Joined: 23 Feb 2009, 16:29

Re: Trick to batch-place features with Photoshop

Post by Jools » 19 Sep 2011, 00:24

I read posts mentioning featureplacer but it was unclear to me as to where I can get this app.
0 x

User avatar
smoth
Posts: 22271
Joined: 13 Jan 2005, 00:46

Re: Trick to batch-place features with Photoshop

Post by smoth » 19 Sep 2011, 00:30

I made it built into grts so I could have an easier time working on it/updating it.

I really need to make a thread on it but I honestly felt you guys didn't want it so I just let it languish. A while back I made a standalone version but the mapper who requested it stoppped mapping so I stopped working on it. :P.
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 9896
Joined: 24 Jan 2006, 21:12

Re: Trick to batch-place features with Photoshop

Post by PicassoCT » 19 Sep 2011, 00:38

nobody know how to get it or how to use it..

Hidden feature is well hidden.
0 x

User avatar
smoth
Posts: 22271
Joined: 13 Jan 2005, 00:46

Re: Trick to batch-place features with Photoshop

Post by smoth » 19 Sep 2011, 00:42

not too terribly hidden.. but no one asked either, so unless someone goes "hey, how do I use that feature placer thing" I assume you guys are electing to not use it. Not that you cannot find it.
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Trick to batch-place features with Photoshop

Post by knorke » 19 Sep 2011, 01:11

Then, select as foreground colour the colour matching the first feature in fs.txt, normally red 255. Then select as background colour the colour matching the last feature in fs.txt, for me it was red 244.
imo this system using shades of red for different features is much too cumbersome to use. You end up with lots of red pixels that almost look all the same and I imagine it just gets super confusing.
Also fs.txt, i dont even know?

So I'd rather use some quick lua to put the features (ie featureplacer)
0 x

User avatar
Jools
XTA Developer
Posts: 2768
Joined: 23 Feb 2009, 16:29

Re: Trick to batch-place features with Photoshop

Post by Jools » 19 Sep 2011, 01:22

I'd have to agree to that, but does featureplace place the features when you compile that map or when loading it?

Well, fs.txt isn't too bad, but the stupid thing is that if you screw up with photoshop and put the wrong colour of red, then it's a pain in the flower [moderation] to find wrong spots.

You can do a lot by just showing the red channel, or by trying to use photoshops Select -> Colour range. And to use the histogram to see that the colour ranges look okay.

It's not an optimum process for humans, but on the other hand I think computers find it quite handy instead :wink:
0 x

User avatar
smoth
Posts: 22271
Joined: 13 Jan 2005, 00:46

Re: Trick to batch-place features with Photoshop

Post by smoth » 19 Sep 2011, 01:29

it is done on map load.

Here is the short of it:

You will need to know a bit of lua in order to understand the process.. but lets just focus on what yo need to do..

First, load gundam in mode sandbox.

ok.

place features.

f11, tehre should be a feature dumper lua file
start it or stop it and start it. This will dump a feature defs file into your base spring dir. That file is loaded by feature placer at map start. You can get really creative with how it is used if you want.

simple example to look at: gunmetal harbor.

That was done in featureplacer, it would be impossibly painful otherwise.

unrelated, why did no one give 2 fucks about that map? it is really something that still has no equal in spring.
0 x

User avatar
Jools
XTA Developer
Posts: 2768
Joined: 23 Feb 2009, 16:29

Re: Trick to batch-place features with Photoshop

Post by Jools » 19 Sep 2011, 01:39

smoth wrote:unrelated, why did no one give 2 fucks about that map? it is really something that still has no equal in spring.
I'm not a gynecologist, bit I tried to have a look at it.It crashed with the following info for me:

Code: Select all

Caught content exception: Could not load texture from file bitmaps/projectiletextures/flashside1.tga
[f=0000000] Content error Could not load texture from file bitmaps/projectiletextures/flashside1.tga
The map I used was "Grts_Gunmetal_Harbor_009"
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 9896
Joined: 24 Jan 2006, 21:12

Re: Trick to batch-place features with Photoshop

Post by PicassoCT » 19 Sep 2011, 01:44

smoth wrote:quote all the smoth!
stop bitchin, i use your maps and behes regularly for testing. For the DownSyndromDummies i cannot speak.

But i can guess:
Maybee should have made that harbour longer. And leave all those features and water out of it. And make it brown. And make startposition for 12 people on each side.
Last edited by knorke on 19 Sep 2011, 01:47, edited 1 time in total.
Reason: cut quote
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Trick to batch-place features with Photoshop

Post by knorke » 19 Sep 2011, 01:46

I'd have to agree to that, but does featureplace place the features when you compile that map or when loading it?
There is some config file like
Tree (300,1000)
Tree (80,800)
...
and then some gadget reads the config and places features accordingly.
unrelated, why did no one give 2 fucks about that map?
which one, gunmetal harbor?
There was a thread but you didnt post in it so yeah.
offtopic in 3,2, - oh picasso is already there :shock:

-----------------------
Jools:
Anyway, it would be good you put the guide on the wiki instead.
There others can also update it or fix errors. Probally good to host images on wiki so they do not go offline at some point.
Also instead of the custom brush option, isnt there a spray can function? (like in paint)
0 x

User avatar
Beherith
Moderator
Posts: 4925
Joined: 26 Oct 2007, 16:21

Re: Trick to batch-place features with Photoshop

Post by Beherith » 19 Sep 2011, 01:54

knorke wrote:
I'd have to agree to that, but does featureplace place the features when you compile that map or when loading it?
There is some config file like
Tree (300,1000)
Tree (80,800)
...
and then some gadget reads the config and places features accordingly.
OR you can take that config file and pass it to mapconv with "-k myfeaturedumpfile.lua "

Mapconv will then add those features just right :D No additional lua needed in map.
0 x

User avatar
Jools
XTA Developer
Posts: 2768
Joined: 23 Feb 2009, 16:29

Re: Trick to batch-place features with Photoshop

Post by Jools » 19 Sep 2011, 02:11

knorke wrote: Jools:
Anyway, it would be good you put the guide on the wiki instead.
There others can also update it or fix errors. Probally good to host images on wiki so they do not go offline at some point.
Also instead of the custom brush option, isnt there a spray can function? (like in paint)
I'll wikify the code, I wasn't sure it was needed or maybe everybody already knew...

The thing is, no, there is no spray function (that I know of) in Photoshop. And besides, if you want a mix of features you need to have random colours too (within the range specified by the feature file: fs.txt).

Behe: I have 768 trees that I laid out, wouldn't it me more cumbersome to place them textwise in a lua file?
0 x

User avatar
Beherith
Moderator
Posts: 4925
Joined: 26 Oct 2007, 16:21

Re: Trick to batch-place features with Photoshop

Post by Beherith » 19 Sep 2011, 02:21

That config file is generated by featureplacer. You can launch featureplacer by launching a game of Gundam in lobby and setting the sandbox/featureplacer mod option.

On the other hand, I use vegetation density maps and a script to place non unique features.
0 x

User avatar
smoth
Posts: 22271
Joined: 13 Jan 2005, 00:46

Re: Trick to batch-place features with Photoshop

Post by smoth » 19 Sep 2011, 02:29

Jools wrote:

Code: Select all

Caught content exception: Could not load texture from file bitmaps/projectiletextures/flashside1.tga
[f=0000000] Content error Could not load texture from file bitmaps/projectiletextures/flashside1.tga
what mod?
Last edited by smoth on 19 Sep 2011, 02:34, edited 1 time in total.
0 x

User avatar
smoth
Posts: 22271
Joined: 13 Jan 2005, 00:46

Re: Trick to batch-place features with Photoshop

Post by smoth » 19 Sep 2011, 02:34

Jools wrote: Behe: I have 768 trees that I laid out, wouldn't it me more cumbersome to place them textwise in a lua file?
Beherith wrote:That config file is generated by featureplacer. You can launch featureplacer by launching a game of Gundam in lobby and setting the sandbox/featureplacer mod option.
which is why say it is easier to use featureplacer for placement. Afterwards you can use the lua or behe's mapconv. Whatever way works.
0 x

User avatar
Jools
XTA Developer
Posts: 2768
Joined: 23 Feb 2009, 16:29

Re: Trick to batch-place features with Photoshop

Post by Jools » 19 Sep 2011, 02:39

smoth wrote:
Jools wrote:

Code: Select all

Caught content exception: Could not load texture from file bitmaps/projectiletextures/flashside1.tga
[f=0000000] Content error Could not load texture from file bitmaps/projectiletextures/flashside1.tga
what mod?
XTA 9.665 beta
0 x

User avatar
smoth
Posts: 22271
Joined: 13 Jan 2005, 00:46

Re: Trick to batch-place features with Photoshop

Post by smoth » 19 Sep 2011, 02:42

I'll give it a whirl, I suspect I know what it is.
0 x

User avatar
smoth
Posts: 22271
Joined: 13 Jan 2005, 00:46

Re: Trick to batch-place features with Photoshop

Post by smoth » 19 Sep 2011, 02:49

Yep. their resource.tdf is conflicting with my mapresources file. Either they need to update their resource.tdf or there is an engine bug. try loading it in something actually worked on. wow, there are so many issues here..(made new thread in xta forum for that)

..

interesting even ba loads it fine. I never tested in xta, I figured they were all equally as dated.

...


I think that actually is my fault as I assumed both ba/xta used the same base files. I see what the issue is. Somehow all other mods have my flashside1 tga.. interesting..

..


Ok, issue fixed, archive zipping and will do a re-re-release JUST FOR XTA pEEPS.

..

they still need to look at those def issues though.

Fix uploaded. Feel free to see what I was talking about now
0 x

Post Reply

Return to “Map Tutorials & Resources”