View Full Version : Some Exciting Developments...
Well, I have come up with some new processes to greatly speed up the creations of large maps, using the "import objects" function.
Here's a brief description of them:
Importing Buildings
- I take a point data file in Globe Mapper, export it as a CSV, run it through a Excel VBA macro, and then import instantly into Visitor.
Imported Vegetation
- I took vegetation data in Globe Mapper, exported as a BMP, imported into the BMP to Text program. This gave me a vegetation mask. I then wrote a VBA macro in Excel to read through the file, and randomly place a number of objects based on the brightness of the mask. This macro then exports a list of items to a text file. Then import the text file into Visitor and the objects are all placed!
- I have just tested this process out, and it works.
Just to reitterate, I've now made a way that you can import hundreds of thousands if vegetation items within minutes :) All you do is paint a mask of the area that you want to deploy vegetation, go through some (reasonably complex) export steps, and they're in visitor. No mucking around individually placing them.
I will post some screenshots later today, I'm working with Soul_Assassin for him to develop the tools. In the meantime, I have it all working using Excel 2007 macros if anyone is interested :D
Snake Man
Nov 13 2009, 04:59
I would be interested.
Could you tutorialize the gathering of this data, what site, what to download and so on?
So, this is how visitor looks before:
http://i511.photobucket.com/albums/s354/icemotoboy/visitor_before.jpg
Then what we do, is create a mask (I used LINZ real world data for vegetation) as below:
http://i511.photobucket.com/albums/s354/icemotoboy/mask_bmp.jpg
This is a greyscale map, the value of the brightness decides how many objects get placed inside it. In this case, white means 2 (2 objects per 7.5 meters).
I convert this to a text image (as per below);
http://i511.photobucket.com/albums/s354/icemotoboy/mask_text.jpg
And then convert this in Excel using a macro I will post shortly. This generated over 200,000 objects. I imported these into visitor below:
http://i511.photobucket.com/albums/s354/icemotoboy/visitor_after.jpg
Closeup of the results:
http://i511.photobucket.com/albums/s354/icemotoboy/visitor_close.jpg
And in buldozer:
http://i511.photobucket.com/albums/s354/icemotoboy/bulldozer.jpg
The whole process took 12 minutes. Not bad, for 204300 objects :)
---------- Post added at 07:08 PM ---------- Previous post was at 07:04 PM ----------
This is the macro I used to populate the data, and I used ImageJ to convert the greyscale map to a text file. I placed // at the bottom of the text file to ensure all data was made.
I'll post up a tutorial and download links soon. Hopefully Soul_Assassin will be able to create a command line tool that does it all automagically.
mikebart
Nov 13 2009, 05:10
Nice work, looks interesting, are you guys planning to create the tools as an addition to the 3dsmax Arma2 toolset?
Bushlurker
Nov 13 2009, 05:53
this is Deeply Impressive!!!
DTED lvl 0 data is available for most countries and usually includes a "nature" or vegetation shapefile... this could be totally invaluable for anyone using real world data! - especially if the vegetation placed could be a random selection similar to the random object placer script!
I'll be watching this with interest!
B
.kju [PvPscene]
Nov 13 2009, 06:43
You can use roller to create a dummy mask based on the terrain height.
Might be useful in some cases here too.
Soul_Assassin
Nov 14 2009, 00:29
Nice work, looks interesting, are you guys planning to create the tools as an addition to the 3dsmax Arma2 toolset?
nope just a seperate comandline tool with a few inputs to turn the text image into a object placement file that can be directly imported into Visitor. written in C++.
phaeden
Nov 14 2009, 15:25
I am very interested in this process. Please let me know of any developments.
Snake Man
Nov 14 2009, 15:34
comandline tool with a few inputs to turn the text image into a object placement file that can be directly imported into Visitor. written in C++.
Please make it open source so we all can learn :)
Soul_Assassin
Nov 15 2009, 02:20
Im still very new to c++ and this would be the first prog that saw the light of day so I'm positive there are even better ways to do this, so don't laugh :)
#include <fstream>
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
int main()
{
char fileName[64];
char fileNameOut[64];
char objectType[64];
float squareSize;
float density;
int maskSize;
int ender;
int num = 0;
char * cstr, *p;
cout << " "<< endl;
cout << " "<< endl;
cout << " @<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden> "<< endl;
cout << " @<hidden>@<hidden>@<hidden>@<hidden>@<hidden> "<< endl;
cout << " @<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden> "<< endl;
cout << " @<hidden>@<hidden> @<hidden>@<hidden> "<< endl;
cout << " ********* @<hidden>@<hidden> @<hidden>@<hidden> ********** "<< endl;
cout << " *0000000* @<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden> @<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden> *000000000* "<< endl;
cout << " *0000000************** ******* @<hidden>******000000000* "<< endl;
cout << " *000000000000000000000***000000* *000000000000000* "<< endl;
cout << " *00000000000000***000000**0000000* *0000000000000000* "<< endl;
cout << " *00000000000000* *000000**0000000* *0000000000000000* "<< endl;
cout << " *00000000000000***000000**00000000* *000000000000000000* "<< endl;
cout << " *00000*00000000000000000***000000000*00000000000000*0000* "<< endl;
cout << " *00000**00000000000000** *000000000000000000000000**000* "<< endl;
cout << " *00000**000000000000** *000000000000000000000000**000* "<< endl;
cout << " *00000* *0000000000000** *000000000000000000000000* *000* "<< endl;
cout << " *00000****00000000*000000* *00000**000000**00000000****000* "<< endl;
cout << " *0000000000000000**000000* *00000* **00** *000000000000000* "<< endl;
cout << " *0000000000000000* *00000* *00000* ** *00000000****000* "<< endl;
cout << " ***00000****0000000* *00000***00000* *00000000* *000***"<< endl;
cout << " ***00000* *0000000* *0000000000000* *00000000* *00000*"<< endl;
cout << " ********* ********* *********@<hidden>*@<hidden>*** ********** *******"<< endl;
cout << " * @<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden> @<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden> "<< endl;
cout << " @<hidden>@<hidden>@<hidden>@<hidden> "<< endl;
cout << " @<hidden>@<hidden>@<hidden>@<hidden>@<hidden> "<< endl;
cout << " @<hidden>@<hidden>@<hidden>@<hidden>@<hidden> "<< endl;
cout << " @<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden>@<hidden> "<< endl;
cout << " "<< endl;
cout << "maskMapper v1. Object pacement for ArmA2.\nCoded by Soul_Assassin; concept by Rocket.\n2009 (c) Soul_Assassin\n-------------------------------------------------\n";
cout << "Source File Name (e.g. input.txt):\n";
cin >> fileName ;
cout << "Output File Name (e.g. output.txt):\n";
cin >> fileNameOut ;
cout << "Mask Size (pixels):\n";
cin >> maskSize ;
cout << "Object Type:\n";
cin >> objectType ;
cout << "Square Size:\n";
cin >> squareSize ;
cout << "Density:\n";
cin >> density ;
cout << "------------------------------------------------\n";
int x = 0;
int y = maskSize-1;
float yPos;
float xPos;
float xPosObj;
float yPosObj;
float angObj;
float numObjectsFloat;
float randX;
int numObjectsInt;
ifstream fin(fileName);
ofstream fout(fileNameOut,ios::app);
if (!fin)
cout << "File Does Not Exist!\n";
while (y>=0)
{
yPos = y * squareSize;
string tmp;
getline(fin,tmp);
if (tmp != "")
{
cstr = new char [tmp.size()+1];
strcpy (cstr, tmp.c_str());
p = strtok (cstr," \n\t");
while (p != NULL)
{
xPos = x * squareSize;
int data;
data = atoi(p);
numObjectsFloat = (float)data/255 * density;
numObjectsInt = (int)numObjectsFloat;
for (int j = 1 ; j <= numObjectsInt; j++)
{
randX = (float)rand()/(float)RAND_MAX;
xPosObj = xPos + ( rand() % (int)squareSize) + randX;
yPosObj = yPos + ( rand() % (int)squareSize) + randX;
angObj = randX*360 - 180;
fout << "\"" << objectType << "\";" << xPosObj << ";" << yPosObj << ";0;" << angObj << ";" << endl;
num++;
}
p= strtok(NULL," \n\t");
x++;
}
delete[] cstr;
}
y--;
x = 0;
}
fin.close();
fout.close();
cout << "Finished! Created "<< num << " objects successfully.\n";
cin >> ender;
return 0;
}
Snake Man
Nov 15 2009, 04:24
Open source way to go. Wow, this is excellent, thanks man, appreciated.
rstratton
Nov 15 2009, 04:50
f**king genious
I'll have the tutorial up in a few hours.
I've also written a VB program to create "lines" of objects. For example, for powerlines. You just write the co-ords in a text file, run the script, and it writes the stuff for input.
I'll see if I can get soul_assassin to turn this into a C++ program also.
Snake Man
Nov 15 2009, 09:37
Can we use the lines for roads too... hmm not really asking, just thinking out loud. I mean it does straight objects? Can it do curves like in roads?
RE: MaskMapper
I have written up the tool download page on the wiki at:
http://community.bistudio.com/wiki/MaskMapper
Download link is there.
I have also put up a detailed tutorial at:
http://community.bistudio.com/wiki/MaskMapper_Tutorial_for_Visitor_3
RE: LineMapper
This is still being tweaked, it MIGHT be possible to use it for roads, not sure how to create them yet. I only have it written in VB so its a bit of a pain, but should be easy enough to convert. I use trigonometry to work out direction and angles, will post some more info when I have refined it somewhat. I just placed 10km of powerlines with ease... :)
phaeden
Nov 15 2009, 15:30
This is truly fantastic! It should increase the rate at which maps are created.
Thanks gents!
.kju [PvPscene]
Nov 15 2009, 19:20
Well done.
Roller from Spooner has a command line tool called Split.exe.
It splits a text file to 200 KB files each. That was our max for importing objects.
It splits a text file to 200 KB files each. That was our max for importing objects.
Really? I've been able to import 1.2 million objects as my maximum in a single import before visitor crashed - with the file size about 32mb. Mind you, Visitor ballooned to nearly 4GB in ram used... I'm running Vista 64bit here, with 6GB of ram. I'm able to import more than that, if I import five hundred thousand at a time. Perhaps the limit is RAM related.
.kju [PvPscene]
Nov 15 2009, 21:52
Sorry I meant 200k objects. Not sure how big of a file that is.
Actually Spooner made it possibly to specify the amount of lines/objects you want
per file:
http://dev-heaven.net/wiki/23/Split
Sorry I meant 200k objects. Not sure how big of a file that is.
Actually Spooner made it possibly to specify the amount of lines/objects you want
per file:
http://dev-heaven.net/wiki/23/Split
I think 200k is a good limit of objects to import per time. On that note, does the overall amount of objects affect map performance, or is it the amount streamed in at that time that does (ie, the density)?
On my 30km x 30km map, I'm trying to decide on a sensible tree budget. Any thoughts or experiences?
Bushlurker
Nov 15 2009, 22:10
Just gave this a try... works perfectly!
shapefile > mask in Global Mapper, followed by the tutorial procedure and into visitor...
http://i21.photobucket.com/albums/b272/Bushlurker/VegPlacer.jpg
And in bulldozer...
http://i21.photobucket.com/albums/b272/Bushlurker/twees.jpg
No problems whatsoever!
Thanks a million guys!! This is really going to help a lot of people!
Well done!!
B
ebanks129
Nov 15 2009, 22:25
hey rocket how did you get vegetation data in global mapper!?
You can get a shapefile, then open it in Global Mapper. A shapefile will have an extension *.shp typically. Then you go 'Export Raster > BMP" and you have your image :)
OChristie
Nov 16 2009, 10:42
Where did you get your Shapefile from, please post data sources :)
Where did you get your Shapefile from, please post data sources :)
http://www.linz.govt.nz/
Land Information New Zealand holds vast quantities of GIS data for New Zealand and it is all freely available.
Oh wait, you probably meant bushlurker... my bad... but LINZ is great for those making NZ maps. Or maybe, that's just me LOL
Bushlurker
Nov 16 2009, 15:11
@<hidden>
Try here for starters - though you can also make your own shapefiles by clicking around areas on your basemap and saving as .shp in Global Mapper, Microdem, ArcGIS, etc... (and thats the best way probably, if you're looking for high resolution)...
Select and download free geographic (GIS) data for any country in the world
(http://www.diva-gis.org/gData)
or here...
Digital Chart of the World (http://www.maproom.psu.edu/dcw/)
or here...
Geocomm (http://data.geocomm.com/catalog/index.html)
(.E00 format loads in most GIS programs too)
Not nearly as good quality as the NZ or USA stuff though...
Digimap and Edina have good quality UK data, but you need to be a "member of an academic institution" to access it... (ie: a student or teacher), or you pay... (typical UK)!
USGS has quality data freely available for the US...
@<hidden>
I've noticed a slight issue...
When you run the script several times, as you suggest, say with different trees for a more varied forest, the script seems to dump all three runs at pretty much the same point...
Like, one run each with 3 different types of tree at a density of 1 tree per 10m ideally should produce 3 randomly placed trees per 10m square, what it actually does is this...
http://i21.photobucket.com/albums/b272/Bushlurker/too_close.jpg
Three trees pretty much on top of each other, then - 10m away, another 3 trees on top of each other, etc etc..
It might be better if there was a slightly bigger "scatter" in the placement - so when the script is told to place one tree in that 10m square, it picks a random place within the square - on the next run, the script does the exact same thing, but maybe uses a randomiser routine or something, so it's likely to pick a slightly different location within that 10m square each time...
Is that possible??
B
Soul_Assassin
Nov 16 2009, 16:43
computers sadly cannot produce truly random numbers, especialy floating point numbers.
There was this random object placer in Visitor2
http://cross.kellys-heroes.eu/public/RandomObjectPlacer_V1.1.1.txt
perhaps it helps...
Rename ext to .vis to use with visitor.
great job on this... I've always dreamed of something like this...vegetation by colored mask file. Black & white should do just as fine too since I guess it is not possible to do it in color.
Cross
binkster
Nov 17 2009, 20:06
Ive been playing around with this and its a very nice tool. Saves a ton of time especially in my case. I would say 35 % of my map is trees at 10240. So what I did was split the the mask into 4 pieces and imported 1 corner at a time. Visitor still fills the memory up. Does visitor reset memory after exiting and saving? So im assuming I would have to save and exit after every import?
ebanks129
Nov 17 2009, 20:13
Ive been playing around with this and its a very nice tool. Saves a ton of time especially in my case. I would say 35 % of my map is trees at 10240. So what I did was split the the mask into 4 pieces and imported 1 corner at a time. Visitor still fills the memory up. Does visitor reset memory after exiting and saving? So im assuming I would have to save and exit after every import?
Interesting. I've done the exact same thing:cool: but I'm not to sure about the memory reset.
binkster
Nov 17 2009, 20:56
Interesting. I've done the exact same thing:cool: but I'm not to sure about the memory reset.
I just tried it. After importing 70k objects my memory stayed at 1.37g and after I saved then exited then I reopened the memory was at 1.08. So it seems after every import I would exit and reopen.
I have a question.... What is the best way in making a tree mask. Im not talking about getting the trees on a mask. Thats the easy part. Whats the best way about making the different whites?
Ive been only able to use density 1 cause I have too much white. Ive played around with tons of different ways to make it spotty and less white but whats the best way?
Soul_Assassin
Nov 17 2009, 21:14
one thing u should keep in mind when using the maskmapper is u should always choose a new output file. If the output file u specify already exists it just appends it rather then overwriting it. May cause super large files to strangely appear.
binkster
Nov 18 2009, 19:14
If I have the preferences set for the tree for different options for Randoms size, angle ect..... Will the maskmapper placethem random as well?
If I have the preferences set for the tree for different options for Randoms size, angle ect..... Will the maskmapper placethem random as well?
Yes, it will.
rstratton
Nov 22 2009, 19:35
what about random size?
phaeden
Nov 22 2009, 20:06
It does.
Soul_Assassin
Nov 22 2009, 22:19
Presenting MaskMapper2 for the first time:
http://img205.imageshack.us/img205/2289/descx.jpg
Whats new:
- Obviously a complete GUI which makes working with it a whole lot easier. No need to retype countless times and everything is just much more visual.
- No need to use imageJ to convert to text images. Just load black/white or colour BMPs straight away.
- Less prone to square size errors since now u enter the physical size of your terrain as reference.
- Possibility to export up to 3 seperate vegetation masks in one go. With each of the channels in the BMP (Red, Green, Blue) containing independent masks.
An example:
Here's the image in Photoshop. Each channel hold a seperate mask (in the form of some text). The intensity of the white of course determines the final density of the vegetation.
http://img69.imageshack.us/img69/658/psdemo.jpg
Saved as a normal BMP (24bit). Loaded into MaskMapper2:
http://img38.imageshack.us/img38/6960/mm2demo.jpg
Information is enteres into the multi-channel boxes. And the "Generate multi channel object lists" button is pressed. Three files with the type names are saved to the indicated folder. Here is the Visitor preview after a few minutes importing:
http://img692.imageshack.us/img692/8531/visdemo.jpg
NOTE: visitor object preview colours have nothing to do with the channels.
Expect to be out later today :)
ebanks129
Nov 22 2009, 22:52
Soul Assasin..... You are amazing man! geez with all these things coming out from you and Rocket we all can be pumping out island in flippin days with this:yay::yay::yay:
You guys are bad ass for this!:cool:
phaeden
Nov 23 2009, 02:13
Soul and Rocket, do you guys have PayPal accounts set up? I would like to donate a little $ to show my appreciation of your work.
Snake Man
Nov 23 2009, 07:01
Presenting MaskMapper2 for the first time
Looks very good, nice job!
Still Open Source so others can study the code?
Soul_Assassin
Nov 23 2009, 07:10
Looks very good, nice job!
Still Open Source so others can study the code?
The principle is still the same as the first code. There is just no point posting this one cuz now its a few files mainly because of the GUI. Also the GUI is wxWidgets which will not apply for people who dont use them in their coding. The core algorithm though is still this way:
if (WxSaveObjList->ShowModal() == wxID_OK)
{
WxProgressDialog->Show(true);
ofstream fout(WxSaveObjList->GetPath(),ios::trunc);
int imageWidth = maskImage->GetWidth();
int landWidth = landMassWidth->GetValue();
float square = (float)landWidth/(float)imageWidth;
unsigned char* imageData = maskImage->GetData();
int x = 0;
int y = imageWidth - 1;
int densityVal = density->GetValue();
float yPos;
float xPos;
float xPosObj;
float yPosObj;
float angObj;
float numObjectsFloat;
float randX;
int numObjectsInt;
int pixCount = 0;
int num = 0;
while (y>=0)
{
yPos = y * square;
while (x<imageWidth)
{
xPos = x * square;
int data = imageData[pixCount];
numObjectsFloat = (float)data/255 * densityVal;
numObjectsInt = (int)numObjectsFloat;
for (int j = 1 ; j <= numObjectsInt; j++)
{
num++;
}
x += 1;
pixCount += 3;
}
y -= 1;
x = 0;
}
y = imageWidth - 1;
x = 0;
int num1 = 0;
pixCount = 0;
while (y>=0)
{
yPos = y * square;
while (x<imageWidth)
{
xPos = x * square;
int data = imageData[pixCount];
numObjectsFloat = (float)data/255 * densityVal;
numObjectsInt = (int)numObjectsFloat;
for (int j = 1 ; j <= numObjectsInt; j++)
{
num1++;
randX = (float)rand()/(float)RAND_MAX;
xPosObj = xPos + ( rand() % (int)square) + randX;
yPosObj = yPos + ( rand() % (int)square) + randX;
angObj = randX*360 - 180;
fout << "\"" << objectType->GetLineText(0) << "\";" << xPosObj << ";" << yPosObj << ";0;" << angObj << ";" << endl;
wxString progressString;
float percent = (float)num1/(float)num*100;
progressString << "Generating object " << num1 << "/" << num;
WxProgressDialog->Update((int)percent,progressString,NULL);
}
x += 1;
pixCount += 3;
}
y -= 1;
x = 0;
}
fout.close();
WxProgressDialog->Show(false);
wxString finalString;
finalString << "Saved " << num1 << " object(s) \"" << objectType->GetLineText(0) << "\" successfully.";
WxStatusBar1->SetStatusText(finalString,1);
}
multi-channel export:
int imageWidth, landWidth, x, y, densityVal, numObjectsInt, pixCount, num, num1;
float square, xPos, yPos, xPosObj, yPosObj, angObj, numObjectsFloat, randX, percent;
wxString folderPath, filePathR, filePathG, filePathB, objType;
wxString filePathArray[3];
if (getSaveDir->ShowModal() == wxID_OK)
{
folderPath = getSaveDir->GetPath();
filePathR = rChannelType->GetLineText(0);
filePathG = gChannelType->GetLineText(0);
filePathB = bChannelType->GetLineText(0);
filePathArray[0] = folderPath+"\\"+filePathR+".txt";
filePathArray[1] = folderPath+"\\"+filePathG+".txt";
filePathArray[2] = folderPath+"\\"+filePathB+".txt";
for (int a = 0; a <= 2; a++)
{
WxProgressDialog->Show(true);
ofstream fout(filePathArray[a],ios::trunc);
imageWidth = maskImage->GetWidth();
landWidth = landMassWidth->GetValue();
square = (float)landWidth/(float)imageWidth;
unsigned char* imageData = maskImage->GetData();
x = 0;
y = imageWidth - 1;
densityVal = density->GetValue();
pixCount = a;
num = 0;
while (y>=0)
{
yPos = y * square;
while (x<imageWidth)
{
xPos = x * square;
int data = imageData[pixCount];
numObjectsFloat = (float)data/255 * densityVal;
numObjectsInt = (int)numObjectsFloat;
for (int j = 1 ; j <= numObjectsInt; j++)
{
num++;
}
x += 1;
pixCount += 3;
}
y -= 1;
x = 0;
}
y = imageWidth - 1;
x = 0;
num1 = 0;
pixCount = a;
switch (a)
{
case 0:
objType = rChannelType->GetLineText(0);
break;
case 1:
objType = gChannelType->GetLineText(0);
break;
case 2:
objType = bChannelType->GetLineText(0);
break;
default:
objType = rChannelType->GetLineText(0);
break;
}
while (y>=0)
{
yPos = y * square;
while (x<imageWidth)
{
xPos = x * square;
int data = imageData[pixCount];
numObjectsFloat = (float)data/255 * densityVal;
numObjectsInt = (int)numObjectsFloat;
for (int j = 1 ; j <= numObjectsInt; j++)
{
num1++;
randX = (float)rand()/(float)RAND_MAX;
xPosObj = xPos + ( rand() % (int)square) + randX;
yPosObj = yPos + ( rand() % (int)square) + randX;
angObj = randX*360 - 180;
fout << "\"" << objType << "\";" << xPosObj << ";" << yPosObj << ";0;" << angObj << ";" << endl;
wxString progressString;
percent = (float)num1/(float)num*100;
progressString << "File " << (a+1) << " of 3. Generating object " << num1 << "/" << num;
WxProgressDialog->Update((int)percent,progressString,NULL);
}
x += 1;
pixCount += 3;
}
y -= 1;
x = 0;
}
fout.close();
WxProgressDialog->Show(false);
wxString finalString;
finalString << "Saved " << num1 << " object(s) \"" << objType << "\" successfully.";
WxStatusBar1->SetStatusText(finalString,1);
}
}
beyond that Im afraid the rest of the code doesnt make any sence :P
[APS]Gnat
Nov 23 2009, 11:02
Mate!! ..... thats just Awesome !
With GUI tools like this the whole Terrain making exercise could become a breeze!
I dream of making tools like this ... except I'm crap with the 2d and 3d maths lol.
Old Bear
Nov 23 2009, 15:43
Well, the prospect is entrancing but as I am still an old dumb noob, I am unable to get any vegetation from my outputfile.txt, I am generating extrahuge files from my .bmp pics and importing the stuff in Visitor ends every times with an out of memory error message.
Could you explain me some points :
- what is density?
- what is the relation between the grey level and the density ?
- is the .exe populating white or black areas ?
- is density = 1 a valid value ?
Soul_Assassin
Nov 23 2009, 16:10
Here's a quick and dirty explanation:
imagine you have a 25x25 km area (25000m). The mask BMP that you are making will be pulled over it. Each pixel in that bmp defines what is happening in that square. If your bmp texture is 2500x2500 pixels then the square size we are talking about is 25000/2500 = 10 m. So each pixel in the bmp defines a 10x10 m physical square on your map.
Now the bmp can contain pixels from pure black to pure white (all shades of grey). Black = no vegetation, white = as much vegetation as defined by the density amount. Shades of grey are in between respectively. So for example:
Mask Size:
2500
Square Size:
10
Density:
7
Would mean, where in the mask bmp you have a white pixel the corresponding land square will have 7 trees. If the pixel you have is 50% grey then you will have 3 trees there.
Thats it :)
The extra huge files are probably explained by u outputting to the same file every time you try. Try saving to another file or reducing density.
The GUI should make things abit more intuitive.
Old Bear
Nov 23 2009, 18:49
So the "density" parameter you are typing in the tool is not the final density value, this final density is a combination between "density" from the pic and this "density" param, so if the pixel is 97% and density is 1, there will be no object on map ?
Soul_Assassin
Nov 23 2009, 18:58
most likely yes as 1*0.97 = 0.97 and in C++ when this gets converted into an integer it is 0. So when using density 1 better only use straight black/white.
mikebart
Nov 23 2009, 20:47
Amazing work guys!
Soul_Assassin
Nov 26 2009, 08:48
Hello all,
the original plan was to get Rocket to release it but he's now been AWOL a few days so I decided to release myself:
http://sparrowstudio.net/armavdv/software/maskMapper2.rar
Features:
- no need to convert to text images anymore. Just load in the BMP masks.
- now comes with an intuitive GUI interface. No need to retype everything many times.
- a little better optimized and organized. Now you use terrain size to calculate square sizes so its less error prone.
- preview maps
- estimate number of objects
- option to generate 3 object files at a time using the separate channels.
The tutorial will be updated once i hear from Rocket.
Enjoy.
Uziyahu--IDF
Nov 26 2009, 21:05
computers sadly cannot produce truly random numbers, especialy floating point numbers.
You can't seed the randomizer with user-generated input that would be different on a daily basis? "What day is it?" Seed Number then generated from adding up the numerological value of text entered?
File name, for example. Version #.
Bushlurker
Nov 27 2009, 16:59
Hi again guys!
OK - I've given the new version a try... MUCH easier to use! Everything seems to be working as it should...
I tried a single monochrome mask like with v1.0 - worked fine and much less fuss than before... Then I tried another black 'n white mask, but treated it as an RGB, just with the same areas for each colour, and assigned a different tree for each of the 3 colours... That also worked nicely, output 3 files which when imported gave a nice mix of pines for forest areas...
Here's a quick pic...
http://i21.photobucket.com/albums/b272/Bushlurker/BenNevis.jpg
That's Leanachan Forest, near Ben Nevis, one of about 30 forests (for a total of about 300,000 trees!) I was able to place exactly to their real-world locations and extents with about half-a-dozen clicks!
Seriously well done guys! What a time-saver! I may yet finish my island before next Xmas thanks to this!
Now if you could come up with an equally impressive way to shortcut the 140km of roads I've still to lay.....;)
B
Soul_Assassin
Nov 27 2009, 17:34
Roads are next on the list ;)
Gunny1987
Nov 27 2009, 22:13
Roads are next on the list ;)
Awesome :inlove::inlove::cc::pray:
rstratton
Nov 28 2009, 04:33
Roads are next on the list ;)
wow thats fucking awesome
prowler.wolf
Nov 29 2009, 04:48
This tool has saved me a LOT of time on my islands, thank you so much. Any chance on being able to enhance it for support of multiple objects?
:icon_w00t:
http://farm3.static.flickr.com/2711/4145643800_88557fb7af.jpg (http://farm3.static.flickr.com/2711/4145643800_88557fb7af_b.jpg)
Commander1985
Dec 28 2009, 16:50
Hey there, will there be an Update to for the Tutorial?
If tried to use this Program to make new Vegetation for my Map, was to much in Forest. So i made a Greyscale (monochrom?) image and used the maskmapper. When i make Density 1 it tells me there will be about 366 Objects, when i make Density 2 it wants to make about 3 million objects!!!
Well that would be far more Objects then i got there (ca. 300000)
I hope someone can help me would save a lot of time :P
Dont know what im doing wrong :/
Mfg
Commander
SaBrE_UK
Dec 28 2009, 17:18
Jesus! I'm not island maker, but I can see the huge advantage this offers modders. Bravo! Hopefully we'll be seeing some truly inspired locations!
Commander1985
Dec 29 2009, 15:53
Found the Error, Mask was just to Big. Great Tool!
Kremator
Dec 30 2009, 17:02
This is amazing .... i may even take up map making becuase of this! THANKYOU !
What an awesome tool! Thumbs up!
DMarkwick
Jan 23 2010, 14:14
Holy crap, I just found this thread. What an achievement(s) :) This would definitely increase my interest in mapmaking for sure.
ebanks129
Feb 19 2010, 02:41
@<hidden> or someone using the new version of the program.
Can someone give me a quick run down on how to do the process with the new program I need a refresher as its been months now since i've used the program and finding a need in it again. thanks :)
Bushlurker
Feb 19 2010, 03:01
Dead easy...
Prep the mask... you can use monochrome to place a single item at the stated density, or use an RGB image with either the same mask on all 3 channels (place 3 different items at 3 different densities in the SAME areas), or with different areas on each channel (place the same, or different, items in different, possibly overlapping areas)...
Mask should be a .BMP file - same res as your HEIGHTMAP - NOT your sat_lco...
Load up the mask... top section on right handles a single item output file - the section below is for RGB 24bit bmp masks... you can define items and densities for each channel...
Names of items need to be the same as the name of the item in your objects list in Visitor... eg: "b_betulahumilis"...
Thats about it... import objects list via Visitor "import objects" script - then curse when you STILL get trees on the road :)
B
ebanks129
Feb 21 2010, 16:47
Dead easy...
Prep the mask... you can use monochrome to place a single item at the stated density, or use an RGB image with either the same mask on all 3 channels (place 3 different items at 3 different densities in the SAME areas), or with different areas on each channel (place the same, or different, items in different, possibly overlapping areas)...
Mask should be a .BMP file - same res as your HEIGHTMAP - NOT your sat_lco...
Load up the mask... top section on right handles a single item output file - the section below is for RGB 24bit bmp masks... you can define items and densities for each channel...
Names of items need to be the same as the name of the item in your objects list in Visitor... eg: "b_betulahumilis"...
Thats about it... import objects list via Visitor "import objects" script - then curse when you STILL get trees on the road :)
B
Thanks man :) time is saved once again!!:yay:
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.