Connect-Lines

Post Reply
User avatar
22sec
Posts: 1186
Joined: Sat Dec 11, 2004 4:09 pm
Location: Jackson, MS
Contact:

Connect-Lines

Post by 22sec »

A few years ago, when Armored Brigade was freeware and custom maps were first added, Veitikka wrote a neat little program called Command-Lines to fill in the missing pixels that resulted from exporting spatial data sets, such as the data from OSM in to a bmp file. It also works to remove blobs that are formed. Veitikka has agreed to let me share here for those that are interested. Please remember this is a program written three plus years ago, well before the commercial version, and as such it is not officially supported by Veitikka Studios or Matrix Games. Also note, you use it at your own risk.

1. To run you need to first enter Window's Command Prompt.
2. You then need to change the directory to whichever folder you have saved Connect-Lines to.
3. To use you simply type connect-lines file1.bmp file2.bmp, where file1 is your raw exported data and file2 will be the end result. So for example, connect-lines hwys.bmp abhwys.bmp. When it runs, the resulting abhwys.bmp is the file you would use going forward.

**There have been some changes to the RGB of roads used since Connect-Lines was originally written. The three colors currently used for autobahns does not work in CL. I change my autobahns to a different color, run CL, and then change them back to the current autobahn color I need them to be.

A few other pointers:
I prefer to run CL for separate types of roads, i.e. one file for dirt tracks, one for residential roads, one for highways, one for autobahns and one for water, and then use GIMP to place each layer in the order I want. I would recommend using the in-game editor from there to make any other necessary edits to tidying up roads and water.

There are some parameters that can be added to the end of the command prompt, but I don't remember what they are. If and when I remember I will update this post. Please let me know if you have any quesitons.

https://drive.google.com/open?id=1PyqPFbybdU8w6bTXbLExj31dnscZ8TMk

Image
Attachments
Connectlines.jpg
Connectlines.jpg (1.79 KiB) Viewed 611 times
Flashpoint Campaigns Contributor
https://twitter.com/22sec2
User avatar
storm rider
Posts: 40
Joined: Wed Mar 13, 2013 6:19 pm

RE: Connect-Lines

Post by storm rider »

Thank you very much! Works great!
exsonic01
Posts: 1133
Joined: Tue Jul 26, 2016 6:45 pm
Location: Somewhere deep in appalachian valley in PA

RE: Connect-Lines

Post by exsonic01 »

Hey, do you remember any parameters for this script? Also, are there any other scripts?
User avatar
Veitikka
Posts: 1335
Joined: Sun Jun 24, 2007 10:11 pm
Location: Finland
Contact:

RE: Connect-Lines

Post by Veitikka »

ORIGINAL: exsonic01

Hey, do you remember any parameters for this script? Also, are there any other scripts?

Tell me the parameters you fancy, and I can code them in.
Know thyself!
exsonic01
Posts: 1133
Joined: Tue Jul 26, 2016 6:45 pm
Location: Somewhere deep in appalachian valley in PA

RE: Connect-Lines

Post by exsonic01 »

ORIGINAL: Veitikka
Tell me the parameters you fancy, and I can code them in.
Regarding parameters, I was wondering the parameters for this connect-lines script which 22sec mentioned:
There are some parameters that can be added to the end of the command prompt, but I don't remember what they are. If and when I remember I will update this post. Please let me know if you have any questions.

Regarding 'any other scripts', is this possible to make a road/stream/river smoothing script, which makes
Image
This 'step-like' road / water network to

Image
like this combination of linear line + 45 degree diag line + linear line.

Current 'connect-lines' script makes so many step-like features from freshly-exported-png-file from QGIS process. Such script will require a logic to modify/import slightly-inclined lines to a line with two or more steps and a linear line. But I guess logic for this script wouldn't be an easy one to write in code...

This is my personal thinking, but step-like feature looks unrealistic, and also might influence on the maneuverability of units, like momentarily exposing side armor more and reduce speed during 90 degree turn in such step-like features.

But if this takes too long time, just forget about it. But if there are any other script to automate or help map cleaning process, let's share. I think 22sec or CCIP could comment more things on such automated script.
User avatar
Veitikka
Posts: 1335
Joined: Sun Jun 24, 2007 10:11 pm
Location: Finland
Contact:

RE: Connect-Lines

Post by Veitikka »

ORIGINAL: exsonic01
ORIGINAL: Veitikka
Tell me the parameters you fancy, and I can code them in.
Regarding parameters, I was wondering the parameters for this connect-lines script which 22sec mentioned:
There are some parameters that can be added to the end of the command prompt, but I don't remember what they are. If and when I remember I will update this post. Please let me know if you have any questions.

Regarding 'any other scripts', is this possible to make a road/stream/river smoothing script, which makes
Image
This 'step-like' road / water network to

Image
like this combination of linear line + 45 degree diag line + linear line.

Current 'connect-lines' script makes so many step-like features from freshly-exported-png-file from QGIS process. Such script will require a logic to modify/import slightly-inclined lines to a line with two or more steps and a linear line. But I guess logic for this script wouldn't be an easy one to write in code...

This is my personal thinking, but step-like feature looks unrealistic, and also might influence on the maneuverability of units, like momentarily exposing side armor more and reduce speed during 90 degree turn in such step-like features.

But if this takes too long time, just forget about it. But if there are any other script to automate or help map cleaning process, let's share. I think 22sec or CCIP could comment more things on such automated script.

What is the ConnectLines version you have?
Know thyself!
exsonic01
Posts: 1133
Joined: Tue Jul 26, 2016 6:45 pm
Location: Somewhere deep in appalachian valley in PA

RE: Connect-Lines

Post by exsonic01 »

ORIGINAL: Veitikka
What is the ConnectLines version you have?
I only have the version uploaded in this post by 22sec.
User avatar
Veitikka
Posts: 1335
Joined: Sun Jun 24, 2007 10:11 pm
Location: Finland
Contact:

RE: Connect-Lines

Post by Veitikka »

ORIGINAL: exsonic01

ORIGINAL: Veitikka
What is the ConnectLines version you have?
I only have the version uploaded in this post by 22sec.

The version number and the options should be visible when you run connect-lines.exe. We were experimenting with many different features in this console application, but many of them are currently disabled. As I replied in the other thread, we had similar ideas about the roads, but our map designer wanted to draw them by hand, so the road algorithm was not improved from what it is. If somebody can represent how the algorithm should work step by step, then I can write it to the code.
Know thyself!
exsonic01
Posts: 1133
Joined: Tue Jul 26, 2016 6:45 pm
Location: Somewhere deep in appalachian valley in PA

RE: Connect-Lines

Post by exsonic01 »

ORIGINAL: Veitikka
The version number and the options should be visible when you run connect-lines.exe. We were experimenting with many different features in this console application, but many of them are currently disabled. As I replied in the other thread, we had similar ideas about the roads, but our map designer wanted to draw them by hand, so the road algorithm was not improved from what it is. If somebody can represent how the algorithm should work step by step, then I can write it to the code.

It is version 1.15.

This is copy & paste from my Windows 10 command prompt

>connect-lines terrain.bmp terraint.bmp
ConnectLines v1.15
Hit Ctrl+C to exit
Reading input header...
Initializing temp array...
Reading input terrain...
Reading fields.bmp... Not found
Reading urban1.bmp... Not found
Reading urban2.bmp... Not found
Reading urban3.bmp... Not found
Reading urban4.bmp... Not found
Adding missing pixels #1...
Tidying up the blobs........
..
Streams to water...
Adding missing pixels #2...
Adding bridges...
Removing orphan pixels...
Writing output header...
Writing output terrain...
Finishing output...
Deleting temp array...
Done!



Like I mentioned, I wish if there is a script which makes a road and water less step-like feature, and make more smooth lines combination of perpendicular lines + 45 degree diag lines. This will require for script to create 2 steps instead of one step when depict angled road / water, as 2 or more steps will make 45 degree line on the map.

Plus, features like connecting disconnected road / water tiles to become a linear one might be a good one IMO, but I guess this would be dangerous to create unwanted strange features...

But I wish to listen what 22sec or CCIP or any other map editors would comments about this idea and other ideas...


Post Reply

Return to “MODS and Scenarios”