Jump to content
Sign in to follow this  
Leopotam

Arma road generator

Recommended Posts

Arma road generator - "result of one day" tool for easy road-network creation.

Steps:

1. Create in visitor fake objects (of any type) - it's will be waypoints for road. Distance between WP must be more than 10-12m (or you will see funny road circles :) ).

2. Select all this WP-objects (order is important) and export to txt-file.

Example content:

"ca\buildings2\ind_tank\ind_tanksmall";16295;3249.88;0;166.219;
"ca\buildings2\ind_tank\ind_tanksmall";16216.7;3582.62;0;177.238;
"ca\buildings2\ind_tank\ind_tanksmall";16206.3;3642.82;0;178.176;

3. Run ArmaRoadGenerator.exe with some params (run without params for usage).

4. Import created output file to visitor in new road-network.

5. That's all.

Link:

v1.0.0.3

v1.0.0.2

v1.0.0.1

v1.0.0.0

Requirements: .Net Framework 3.5 SP1.

Example picts (progress from fussy-logic to following WP):



0

road1.th.jpg

1

road2.th.jpg

2

road5.th.jpg

...

last

road6.th.jpg

Edited by Leopotam
v1.0.0.3

Share this post


Link to post
Share on other sites

What is going on!!?? Tools by tools are coming out from everywhere...wow!

Share this post


Link to post
Share on other sites

ZeroG: yes, and it's about damn time! :p

Good to see someone else working on road-placement, and with a different approach than mine too :) I hope this works out well! Going to try it when I get home from work tonight...

Share this post


Link to post
Share on other sites

i've created a path with Fence Generator and imported with the tool.

20 points separated by 20 meters one each other but the program goes in deadlock.

I'll try tomorrow with more time available :)

nice work, spring is bringing out a lot of new opportunities and tool ;)

Share this post


Link to post
Share on other sites

shezan74,

1. You can tune some params into config-file.

2. You can place objects with more distance between them.

3. Check curvature of potential way - "deadlock" means, that generator turn and turn again to your WP-object.

P.S. First post updated with picts.

Edited by Leopotam

Share this post


Link to post
Share on other sites

It ain't available anymore...maybe host it on filefront instead?!

Share this post


Link to post
Share on other sites

v1.0.0.1 released (First post). One bugfix (detect angle distortion between current direction and direction to WP).

Edited by Leopotam

Share this post


Link to post
Share on other sites

Is it just me or is filefront unavailable atm? :)

Still won't work :-(

Edited by ZeroG

Share this post


Link to post
Share on other sites

I've been sidetracked enormously in the last week by RL stuff, plus trying to come to grips with O2 (which I gotta say makes Visitor look easy! - maan, the whole 3D thing is black magic!! I'm gonna have to go to the O2 section and ask some seriously noob questions!)

Anyway... I did manage to have a go with the first version of this... just gonna try the update now... but here's a couple of initial impressions.....

This worked pretty well for me!

Firstly I placed a T-junction as a keypoint... then I used an armchair as my "object" for easy removal of strays afterwards - looked quite surreal laying out the road path :p - exported all armchairs - ran that file thru the tool - then import...

Success first time!

I had a couple of goes - managed to get the occasional wild loop where the guide objects were obviously too close together... but, in general - it worked pretty well...

Here's a couple of basic pics...

roadtool02small.jpg

roadtool01_small.jpg

Not bad... and VERY quick and easy...

I'm not sure about the selection of road pieces though - the tool seems to almost exclusively use the 12.5m straight bit and the tight 25 degree turn and nothing else - which makes the turns kind of abrupt, and the intervening sections dead straight.... maybe this is all down to more careful armchair placement required... I dunno as yet...

Just d/l'd the new version... I'll try to give it a go later tonight... Well done so far anyway Lepotam!

B

Edited by Bushlurker

Share this post


Link to post
Share on other sites

Yep, tool uses turning 10_25 road parts only. Why? Because there is no simple method to detect road network difficulty in automatic mode. May be, make params in config file for describing turns?

Share this post


Link to post
Share on other sites

How good are you at math & trigonometry? If you want, I can explain how I automatically select road radius in my "painter" tool... are you familiar with the equation for a circle?

Share this post


Link to post
Share on other sites

I compute dot between current dir vector and vector to WP-object. If dot product < (dot between not turned vector and turned on "AngleDistortion" degrees vector) then - turn. I can make additional param in config for tune radius of turn curve.

Share this post


Link to post
Share on other sites

We have 3 points: A, B and C

There is a road between A and B, facing north (0°)

Determine the angle betweeb A-B-C.

For example the vector from B to C is going to 20° (right turn)

Distance between B and C is 170 meters

Now:

Calculate (once a time) what is the length of each road piece (with 25-50-75-100 meters radius)

Divide the angle by the default road turn (10°).

This means you have to make 2 turns

divide the distance between B and C by the number of turn required

Select the longest piece of road that will fit in the distance and remove this distance from the grand total (from 170).

Then select again the longest piece of road that will fit the remaining distance.

We have ended turns (we have had 2 turns available -> 20 degrees)

now retrieve the residual distance and fill in this way:

if > 75 set a straight piece before the first turn, a straight piece between turns and a straight piece after second turn.

Then fill the residual distance with road pieces

if <75 and > 50 place a 25 meters piece before first turn and a 25 meters piece after second turn then fit one or more 6,25-12 pieces in the middle

if <50 and >25 and so on is up to you.

Beware, 25, 50 and those numbers are strictly related to the effective road turn length.

Hope this brainstorming will help :)

Share this post


Link to post
Share on other sites

I don't know whether you could apply this logic to your algorithm or not, but feel free to look at the math behind my radius-selection... drawing from origin, to the big X. It's pretty simple... all based on the equation of a circle.

http://img.waffleimages.com/bf69ef121ad6dbeeca8442cec51ed204707205dd/Circles.JPG

it's a little more complicated that that, because you have to do a coordinate-transformation to get the destination X,Y coordinates relative to the first point... but if you know how to do dot products, then you're probably able to do a little trigonometry? :p

Edited by Homer Johnston

Share this post


Link to post
Share on other sites

Yep, I use this algo in new version (in testing now), turn radius selected from [25, 50, 75, 100] by distance to WP.

Share this post


Link to post
Share on other sites

I think that for using other kind of roar turnes it would be helpful for program to create another kind of waypoint (something like "just before curve WP") and then program will know when the turn is beggining and how big the angle will be and will decide what kind of curve to use. It's just an idea, suggestion, what do you think about it ?

Share this post


Link to post
Share on other sites

v1.0.0.2 released (First post). Now turn radius auto detected from [25, 50, 75, 100] by distance to WP-object.

road6.th.jpg

Share this post


Link to post
Share on other sites

By the way Leopotam - just a thought: it would be possible some day to "combine" your algorithm into something like the painter tool I'm making; that is, to be able to place down points and draw a preview of the road in real-time, and shift points to make changes ;) If you can develop an algorithm which predicts roads in a good enough manner, this might be the "ultimate" solution to road-building...

Share this post


Link to post
Share on other sites

It works brilliantly! Thank you so much for saving my lifetime and nerves!

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  

×