a tool for automatic placement of objects?
#1

Such tool would have as input map_t.tga and a couple of village/town object templates (these have to be produced manually first by us). Then it will place the objects from the templates wherever on map where the corresponding texture is present on map_T (using the periodicity of the village and town textures). I think it would be an awesome help for everybody doing new maps, especially with lots of villages and towns. Any programmer willing to try?
Reply
#2

http://www.mission4today.com/index.php? ... ls&id=3183

http://www.mission4today.com/index.php? ... ils&id=314

http://www.mission4today.com/index.php? ... ls&id=2636

You could try and ask these guys who have done some fmb utilities before.
Reply
#3

Hehe, there's already quite a bunch of programmers frequenting this forum:
Flying Nutcase,FC, MiWA, CrazySchmidt, ...and Maraz which provided the tool from your first link Big Grin Let's hope Big Grin
Reply
#4

The village/town template could be made up quite quickly.
I am in the process of doing this for Northeast France, based on the following textures:

sk_DownCity.tga
sk_MidCity.tga
sk_Factory.tga
sk_country_mount.tga

I have split down the actors.static for Slovakia and now have access via FMB Map Editor to three separate 50x50km areas which I can use to cut and paste existing scenery from.
Reply
#5

Thinking about this a bit more. It should be quite simple --- for a programmer.
Huge understatement I expect.

Each map T pixel has a unique coordinate x,y for the bottom left corner.
Each pixel is 200x200m
The standard village/town textures cover 800x800m, a total of 16 pixels

So we need to create 16 versions of an inBuildings.txt
Each of these will have coordinates 0,0 for the bottom left corner

The programme needs to add the pixel coordinates to the chosen inBuildings.txt coordinates and merge all of the inBuilding.txt files together.

The output can be in the form of a large inBuildings.txt file which we then process with existing Actors Tools to create the actors.static

Thats it!

=======

In addition -- the perimeter of a village area fades into the surrounding texture, so it would be nice to exclude building objects from the faded area. Perhaps that could be in version 2?
Reply
#6

Asheshouse I think your 16 pixel approach is cool, I was thinking a bit differently. Either way though I believe too it's not really difficult to write such a program. Then about templates, maybe in the future, having such a prog, people will be more motivated to build such templates so maybe we'll even have databases of such village/town/industry templates. Then process of map building would be much faster.
Reply
#7

Forgive me Ashes, the old brain has shifted to first gear, but are you refering to auto-gen based on the textures (kinda like the random tree thing)...?
Reply
#8

RAF_Magpie Wrote:Forgive me Ashes, the old brain has shifted to first gear, but are you refering to auto-gen based on the textures (kinda like the random tree thing)...?

I am referring to the ground textures defined by the "Fields" section of load.ini and edited using the "Tile" function in Map Editor. All the textures can be viewed using the vpmedia texture library.

The buildings created would not be random but would be created in the inBuildings.txt files.

To cover a texture area we need to create 16 blocks each 200x200m. that will cover the whole of the repeating pattern. We can do this by copying parts of towns from the Slovakia map.
These will be saved as inBuildings.txt files --- say inBuildings-a.txt to inBuildings-p.txt
The coordinates of the objects on these files will be in the range 0,0 to 8000,8000

When map_T is processed if say a town texture is detected at coords 80000, 80000 then then the pixel coords are added to the basic inBuildings-*.txt coords to create part of the final inBuildings.txt file

The programme would have to be able to process a *.tga file and identify specific pixel RGB values and their bottom left coordinates.

Assuming the programme, the map_T file and the basic inBuildings.txt files are all put together in one folder then the only input the programme would require would be the RGB value of the texture for which you wanted to create a merged inBuildings.txt file, and perhaps the image size of the map_T, but maybe the programme could get that info from the file.

I wish I had the knowledge to programme this but I dont.
Reply
#9

As you stated before the perimeter pixels have to be specifically analyzed in order to correctly populate those fading textures. This is a major problem, imho
Reply
#10

LSA and Asheshouse, I would just ignore this problem. If you ignore it, after the prog places the objects you just have to manually delete the objects placed at the border. If you work deleting in 3d mode in FMB I estimate maybe 10 seconds for a village and maybe 1-2 minutes for a big town. So I think deleting doesn't take that much time. BTW, if you look at standard il2 maps you'll see sometimes the map builders didn't correct exactly the thing we are talking about ( we know there is an official Oleg "autofill tool" and it's plain enough that it was used for most maps)

One more thought, no need to divide the "village" template into sections, all needed is the periodicity in meters of the "village" texture... maybe more later...


LSA Wrote:As you stated before the perimeter pixels have to be specifically analyzed in order to correctly populate those fading textures. This is a major problem, imho
Reply
#11

I agree with Lowfighter. For the 1st Edition of the programme it would not be a problem to have to edit around the edges of towns, but this may not be necessary.

I made an image to show what we are dealing with. The map extract shows each pixel (200x200) indicated by the white grid lines. The lower left corner shows a single town pixel at coords 0,0 surrounded by Lowland0. Above this is a two pixel pattern. at pixel 800,800 and 1000,800

If map_T has a single pixel with town texture this produces a full 200x200 block on the map centred on the lower left corner of the pixel. So this can be allowed for in setting the initial coords of the basic inBuildings.txt. A final process can crop out any objects with -ve coord values.

[Image: Untitled-1copy-1.jpg]
Reply
#12

It sounds interesting, but the stack of TODOs following me around extends to the horizon. I hope some adventurous soul will pick this one up.
Reply
#13

No prob FN, I knew you were very busy. Let's hope somebody will take it...
Reply
#14

Its a little more complicated.
Not all the town/village centres have the same repeat interval

Example:

sk_DownCity.tga repeats at 800m intervals
sk_country_mount.tga (village texture) repeats at 1600m interval

So perhaps you would have to work on the basis of the largest interval used?
Reply
#15

Ashes, it's not a problem. Just each time you run the prog you would have to specify the periodicity of the texture in case.
Yesterday I spent some 1 hour or so and wrote a matlab script doing it. Since matlab doesn't know tga's I converted map_T to jpeg. Still have some problems of scale but it works in principle. However that's useless for community because you can run such script only if you have matlab on your PC. Still hoping someone will do it. This map making is so time consuming :mrgreen:
Reply


Forum Jump:


Users browsing this thread: 9 Guest(s)