Jump to content
Sign in to follow this  
ZeroG

ZGM Roadpainting source files for Global Mapper

Recommended Posts

Hello folks!

As this took me a whole Sunday to figure out, I thought I'd release it so that you guys save some time. First of all: credits to Atsche and M1lkm8n who were my precedessors in this case. Now, lets start:

Global Mapper was used with these sourcefiles! The whole road creation process is possible with the free QGis as well, yet these files are meant to be used with GM

1. Open up ZGM_A3Roadpainting.gmw with GM. You will see:

?di=5136419730910

It is a 20480 x 20480m and a 32768m x 32678m template map, georectified to the coordinates A3A is using atm (I haven't figured out a way to do it with other (my original project for example) coordinates - yet. But for the game, it doesnt matter - its just more work and time I try to save you here :j:)

So, to use your own map or reference image, simply open up 20480x20480RECTIFIED.png and paste your own image on top of it.

If you have a smaller map (10240x10240 or 5120x5120 etc.), just make sure it still fits into the initial measurements, while the origin gotta be in the left bottom corner. Simply leave the unused part of the map blank white:

?di=5136420040914

If you change the name of the reference file, the GM project will ask your for the file's whereabouts.

What also is enabled in my project is the geogrid which helps to orientate. If you keep it enabled, A3 - funnily - will paint dirt roads along it (as it identifies the grid as an undefined line/road). You might not want this in game but for georectifying an image, it is (was, because you can use my file now) very helpful!

2. You can immediately start with painting your own roads. You will see one example road named 1, spanning over the whole map (yeah, it is one of the famous Autobahns with no speed limit which all of you guys except Germans are jealous about ;))

I created it by clicking on the DIGITIZER and then CREATE NEW LINE FEATURE (VERTEX MODE). When completed, after the rightclick, GM will ask for the attributes, while you have to enter the following 4:

?di=013641978540

__LAYER : Haven't seen the influcence for now, can be Roads, City Roads, Path (or something else?). Seems to be a Visitor 4 shape layer description

ID : The type of the road, 1:1 of what is defined in roadslib.cfg:

class RoadTypesLibrary
{
   class Road0001
   {
    width = 30;
    mainStrTex      = "a3\roads_f\roads_ae\data\surf_roadtarmac_highway_ca.paa";  // lowercase!
    mainTerTex      = "a3\roads_f\roads_ae\data\surf_roadtarmac_highway_end_ca.paa";
    mainMat         = "a3\roads_f\roads_ae\data\surf_roadtarmac_highway.rvmat";
    map             = "main road";
    AIpathOffset = 3;
   };
   class Road0002
   { 
 width = 15;
    mainStrTex      = "a3\roads_f\roads_ae\data\surf_roadtarmac_main_road_ca.paa";  // lowercase!
    mainTerTex      = "a3\roads_f\roads_ae\data\surf_roadtarmac_main_road_end_ca.paa";
    mainMat         = "a3\roads_f\roads_ae\data\surf_roadtarmac_main_road.rvmat";
    map             = "road";
    AIpathOffset = 2.5;
   };
   class Road0003
   {
 width = 7.5;
    mainStrTex      = "a3\roads_f\roads_ae\data\surf_roaddirt_road_ca.paa";  // lowercase!
    mainTerTex      = "a3\roads_f\roads_ae\data\surf_roaddirt_road_end_ca.paa";
    mainMat         = "a3\roads_f\roads_ae\data\surf_roaddirt_road.rvmat";
    map             = "track";
    AIpathOffset = 2.5;
   };	
class Road0004
   {
 width = 10;
    mainStrTex      = "a3\roads_f\roads_ae\data\surf_roadconcrete_city_road_ca.paa";  // lowercase!
    mainTerTex      = "a3\roads_f\roads_ae\data\surf_roadconcrete_city_road_end_ca.paa";
    mainMat         = "a3\roads_f\roads_ae\data\surf_roadconcrete_city_road.rvmat";
    map             = "track";
    AIpathOffset = 2.5;
   };
class Road0005
   {
 width = 5;
    mainStrTex      = "a3\roads_f\roads_ae\data\surf_roaddirt_path_ca.paa";  // lowercase!
    mainTerTex      = "a3\roads_f\roads_ae\data\surf_roaddirt_path_end_ca.paa";
    mainMat         = "a3\roads_f\roads_ae\data\surf_roaddirt_path.rvmat";
    map             = "track";
    AIpathOffset = 2;	 
   };
};

So, currently possible are values from 1 to 5, the first giving you a Highway, the latter a Path.

If you want to change the width, you can! As the config seems to be something like a road painting instruction for A3, you can easily play around with the width value and create new types of roads, like I for myself created a bike lane with the Highway texture :cool::

?di=813641986018

ORDER : Thanks to Milkman, we now know this value determines which road gets laid on top at crossroads. A smart idea would be to give the biggest roads the highest numbers, like: Highway > City road > Path (1 > 2 > 3 > ...)

__ID : Enter a number here that allows you to identify the road and separate it from the others, especially later when there are lots of them. You may also enter that value at the NAME spot on top.

3. Now, when you are done with road painting, you gotta export them to your A3 map. Simply click FILE > EXPORT VECTOR FORMAT > SHAPEFILE > EXPORT LINES and then select a filename which has to have the same name and path as in your map config line you have to add/modify:

newRoadsShape = "\YOURMAP\data\roads\roads.shp";

After selecting file and path, you can just press OK. Don't worry about the other checkboxes yet, I have played around with them and for the method we are using here, you can use the default setting.

4. You are almost done - just pack the island now. You can also use cpbo for that instead of BinPbo, as I found out. That is especially great if you want to change only small things regarding the roads, thus it packs the map in seconds.

5. Enjoy your roads ingame. I posted some example pictures of how exact road placement is (don't wonder about the odd texture colors: I use a topography map for object placement):

GLOBAL MAPPER:

?di=5136420175214

A3 EDITOR SCREEN, TEXTURES ON:

?di=413642006437

INGAME:

?di=513642006759

DOWNLOAD ZGM Roadpainting source files V2 for Global Mapper

Edited by ZeroG
UPDATE: added 32768x32768m template

Share this post


Link to post
Share on other sites

This is great! Hopefully GM isn't forced on us with the new toolset though, as I find it very confusing and do not want to purchase it =P

Share this post


Link to post
Share on other sites

Well, QGIS is free but imho even more confusing...best thing would be Visitor 4...

Share this post


Link to post
Share on other sites

Ya that would be great, but sadly wont happen lol. You have got an island in game already for test purposes right?

Share this post


Link to post
Share on other sites

You guys are so much better at wording things :)

Good work!

Share this post


Link to post
Share on other sites

Zero have you gone larger with the roads? im wondering if the texture gets stretched to fit?

Share this post


Link to post
Share on other sites

@B: Thank you, perfect! Still I wonder if there is a way to do it with Photoshop....

@M1lkm8n: I have tried both widing and narrowing, both work like a charm..dont look strange at all.

Edited by ZeroG

Share this post


Link to post
Share on other sites

hey zero I updated my road guide with this which I though Id stick in here for you so you can see what I did

also adding in your own road sizes is as simple as adding another road class into the roadslib.cfg

you can also actually add your own road as well which works pretty good but its an extra step.

first what I did was create my road texture and I called it mainhighway_ca.paa

then I created a _nohq.paa for the mainhighway texture.

I threw my files in to a data folder in my roads folder (so my directory looks like this gm\grandmanan\data\roads\data) then copied a rvmat from a3's road folder over into my roads\data directory

inside the rvmat I pointed it towards my nohq texture.

I added a class into the roadslib.cgf and pointed them towards my paa files. I didn't add a end section to the road at this time as it was only for testing.

now the tricky part. after binarization i noticed the rvmat inside the roads\data folder isn't there (not sure if its something I did wrong or just because we have old tools and are just trying work-arounds) so what I did was unpack the pbo moved the rvmat back inside where it should be and just repacked. and my roads in game. now the road was just for testing so its ridiculously huge and not very nice looking but this was just to show how to go about getting a new roads in.

edit- its so big because I didn't realize I had the width set at 30! doh

http://i.imgur.com/jSY8Urm.jpg

just one more edit - I bit the bullet and subscribed to cgtextures (figured if im gonna do it might as well do it right!)

much better now

http://i.imgur.com/Kcvpu48.jpg

Edited by M1lkm8n

Share this post


Link to post
Share on other sites

Hey, thats really looking nice! Which programs and which tutorial did you use ? Is it just the three files? Maybe you could upload them as a template?

Not that I'd need zillions of new roads, but as my map will be in a temperate zone, I'd like to have some muddy forest road, a muddy path and maybe some German road markings :)

Share this post


Link to post
Share on other sites
Hey, thats really looking nice! Which programs and which tutorial did you use ? Not that I'd need zillions of new roads, but as it seems to be easy and as my map will be in a temperate zone, I'd like to have some muddy forest road, a muddy path and maybe some German road markings :)

cgtextures.com is where I got the images. the tutorial on how to make the texture for the game came from bushlurkers site...betons groundtexture tut.

Share this post


Link to post
Share on other sites

Nice Jakerod, The more sources the better! Also I found to make selection and editing road networks easier you can open the .dbf file with a spreadsheet program (I use Kingsoft Spreadsheet it's free) and do you unique id's and all that in there. Well the hard part of it anyway imo.

Share this post


Link to post
Share on other sites

Especially important when you use a topographic map as a blueprint - like me - or if shapefiles arent available: look for topographic maps stored on "WMS" servers which you can use with GM. After downloading the area of interest, you can export "1 pixel:1 meter" size map (Raster) images and extract the features you want with the magic wand tool, using GIMP/Photoshop.

I for myself downloaded several mapsets for my map and compared the detail and accuracy...

Share this post


Link to post
Share on other sites

I still haven't been able to get roads on my Hawaii island, probably because it's incredibly large 41kx41k. Tried like 20 times today with rectifying and all sorts of stuff. Also spent about 4 hours trying to get my cfgsurface and clutters working but then just deleted them so my map actually worked again so I could continue testing the roads =P

Share this post


Link to post
Share on other sites
I still haven't been able to get roads on my Hawaii island, probably because it's incredibly large 41kx41k. Tried like 20 times today with rectifying and all sorts of stuff. Also spent about 4 hours trying to get my cfgsurface and clutters working but then just deleted them so my map actually worked again so I could continue testing the roads =P

Are you adding the .shp,.dbf and whatever (I can't recall right now) the other 2 files are to the list of files to be copied directly in binpbo?

Share this post


Link to post
Share on other sites
Are you adding the .shp,.dbf and whatever (I can't recall right now) the other 2 files are to the list of files to be copied directly in binpbo?

Ya I added all the file types .shp, .dbf, .shx, and .prj . Still no dice =/

Share this post


Link to post
Share on other sites
Ya I added all the file types .shp, .dbf, .shx, and .prj . Still no dice =/

Remember ".cfg"

Share this post


Link to post
Share on other sites

Did you use my files? I.e. you did open 20480x20480Rectified.png and enlarged it to 40960x40960, so that the Origin is still at 0° N, 18? 6° 18' E ?

Share this post


Link to post
Share on other sites

Zero the topographical map that you are using, do you have that set as you sat map while place objects?

Share this post


Link to post
Share on other sites
Zero the topographical map that you are using, do you have that set as you sat map while place objects?

Indeed..as I use 3D-Editor...advantage is that you even see building contours - try World Topograhic Map, its quite accurate!

Share this post


Link to post
Share on other sites
Indeed..as I use 3D-Editor...advantage is that you even see building contours - try World Topograhic Map, its quite accurate!

Cool. I'll check it out. I'm trying to figure out the best way to go about smoothing my roads and adding the buildings. Some streets just had to be removed as I took the entire island and shrunk it by a proximity 10 km or so. I was thinking I can use that exported overlay and put it into l3dt as another mask so u can smooth my roads there then in the editor or visitor place the objects

Share this post


Link to post
Share on other sites

Let me explain it like this. I have no idea how to use Global Mapper....Took me 2 hours of dicking around to figure out how to remove your geogrid. I have recified my roads, turns out that looks like hell because I used that damn point system, ya, don't do that... I have no idea how to check the coordinates or how to get them to be where I want them to be. I used the command center or whater it's called to select the layer with digitalizer and then right click on my map and click move and drag and dropped it on it...still not exact coords... I'm basically an idiot with GM and any help would be nice...like knowing how to resize things...that's a start.

Share this post


Link to post
Share on other sites

@Milk: Exactly thats what the tutorial B posted says. Simply put in the road overlay as texture and then use the Smoother or Buldozer tool to clear the roads from bumpiness.

@Twin: Do the map exchange not with GM but use a photo editing tool. Open um 20480x20480rectified and place your map on top of it - dont change the name of the file and make sure your map is aligned to the Origin of my map, then save.

When you now open up the A3roads.gmw project in GM and you have done it right, your map will appear instead of mine, aligned to the grid. Now you can start painting roads as described.

For more info on GM or basics on realword recreation, check out my tutorial from Arma 2 or VBS 2 developer reference on terrain. And the rest is learning by doing....

As a recommendation: I wouldnt necessarily start terrain editing with a 40x40km island - it takes ages to accomplish and is very resource intensive in the process. I do have lots of fast RAM and use a SSD scratchdisk, yet it takes some time even to load in the layer maps for my 20x20km island...so double that for your island. Now, if you change stuff like road width in PS or whatever, it always takes a loooong time until you can see the results in game - that is annoying. For learning how things work, use a 1x1km map.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×