Jump to content
Sign in to follow this  
Homer Johnston

Road Painter tool (development thread)

Recommended Posts

Summary:

-This tool is intended to aid the process of road creation in Visitor. It allows you to easily "paint" long sections of road in between key-parts from within the ArmA mission editor. You can then generate a text file to import into a Visitor road-network.

-The tool is not intended to export/import key-parts (yet). Key-parts must be placed using Visitor, importing road sections as you go.

Current version:

0.1 - BETA

Download:

http://dl.dropbox.com/u/4621600/HOMJ_Road_Painter_v0-1.zip (Added April 29th 2010) You are welcome to host this file on your own site!

ArmaHolic Mirror:

DOWNLOAD - Road Painter tool (v0.1beta) from ArmaHolic

ArmedAssault.info Mirror:

DOWNLOAD - Road Painter tool (v0.1beta) - [131 KB] from ArmedAssault.info

Usage instructions:

Please read the Readme.txt and watch this video. Higher-resolution is available if you watch it at Youtube instead of embedded:

aEsTyUgUE1I

Things I need assistance with:

- A way to inject road sections and key parts into a PEW file using this information. I am not a coder, and this level of hex editing/binary editing is currently beyond my understanding.

:627:

Edited by Homer Johnston

Share this post


Link to post
Share on other sites

Homer that looks really promising.

If someone could tell me what exactly the numbers in the curves stand for i would try to modify some of the roads..for testing

Share this post


Link to post
Share on other sites

if a road has one number it is straight, with the "approximate length". If it has two numbers it is a curve with angle + radius.

asf 6 = straight 6.25m

asf 12 = straight 12.5m

asf 25 = straight 25m

asf 10 25 = 10 deg. turn with 25m radius

asf 10 50 = 10 deg. turn with 50m radius

asf 0 1000 = 0.5 deg. turn with 1000m radius (unusable?)

Currently I believe the only curves we can use in visitor are 25, 50, 75, and 100m radius (since these are the only options in the dialog), and these all turn 10 degrees. Visitor does not specify degrees. I am expecting that 10-degree turns will be a hardcoded feature of Visitor 3 and not read from the road model, but it might be worth checking to find out anyway. If Visitor would use other degree turns, it would make this tool 10x more awesome :icon_neutral: sometimes it's difficult to match a SatMap with 10 degrees as your minimum turn amount...

It's interesting to note that ArmA2 uses some odd curve shapes: 0.? degrees with 2000m radius, 1 degree with 1000m radius, 7 degree with 100m radius, 60 degree with 10m radius ... BIS gave us the MLODs to use these roads, but not a tool capable of placing them :(

If you want to try this, you'll need some basic knowledge of O2. Maybe edit asf_1 10 100 ... delete half of its faces (on the "far" side, not the ones near XYZ origin), and then somehow move the memory points for the corners of the road back to the new corners... then save as asf_1 5 100, and try using it in visitor. Place some of the 10 100 curves and 5 100 curves in a row and see if there's any difference between them. I'm hoping that Visitor uses the Memory points to snap roads together. I'd REALLY appreciate it if you (or anyone) tried this for me...

[EDIT] Don't bother trying the model mod ... I tried loading the 15-deg 75 meter curve in and it treated it like it was 10-degrees :(

Edited by Homer Johnston

Share this post


Link to post
Share on other sites
I think the last numbers are meters? 25,50,75,100?

compared to the different length of the road pieces....you are right. The numbers indeed are describing the length of respective roadpieces.

Share this post


Link to post
Share on other sites

Memphis, please note that my post above correctly describes what the numbers mean :) for curved pieces, the 25/50/75/100 is not the "length" of the curve. It is the radius.

I managed to get mouse-movement working using camera/buldozer controls. It still needs keyboard buttons for commands - I am not sure yet if I will be able to use mouse movement and mouse buttons together... if anyone has seen anything which does this, please let me know so I can learn from it!

Edited by Homer Johnston

Share this post


Link to post
Share on other sites

I added a video to the first post which sort of shows how the whole system works right now... Some random thoughts on how I think I will eventually set this up:

- it will have a basic dialog on-screen (like 3DE did, but many less options)

- moving your mouse will move the camera

- your mouse pointer will be visible and 'locked' somewheres on screen, probably near the bottom edge in the middle (this is an unfortunate side effect of dialogs, and displaying a dialog is the only way I can detect mouse-clicks)

- holding spacebar (?) will unlock mouse and allow you to use the GUI

Tentative controls:

Mouse:

motion: move brush

left click: place all pieces

shift + left click: place one piece

right click: erase one piece

wheel forwards: increase turn radius

wheel back: decrease turn radius

middle click: ???

Keyboard:

spacebar (hold): interact with GUI instead of brush

A/D: camera rotation around brush

W/S: camera distance from brush

Q/Z: camera elevation above brush

Tab: copy road info to clipboard

GUI buttons:

... still thinking about this

Share this post


Link to post
Share on other sites

No download yet; (well, there's a half-working concept version in the other thread) I'm hoping to advance this to a "beta-release" within a couple of weeks :) Cheers.

Share this post


Link to post
Share on other sites

Looking awesomely easy!

One question: Have u pressed the "test direction" button for the road yet? I experienced some RED dots on a 20km road I once placed, because of some slope angles or sth..THAT was annoying, cause replacing the not working parts on a 20km road is...ARGH.

Wonder if your road tool does correct slope angles automatically? would certainly be great!!!

Regards

Share this post


Link to post
Share on other sites

Ah! I didn't even know about that button. I actually haven't laid many roads in Visitor.

Can anyone tell me more about this - does this button check if the slope of the road is within limits? i.e. how steep it is to gain altitude; 5 degrees by default. What is the difference between "Max Bank" and "Max Angle" in the road settings?

Ignoring all coding issues for a second, what could be done to fix or help this?

- changing terrain properties? (this is what the SmoothRoads script is for, right??)

- alerting the user that the road will be out of limits?

- anything else??

Share this post


Link to post
Share on other sites

I think this button will give u the information if ai can use it...I noticed some red parts once i placed an invisible road over a bridge, since AI has problems finding its way over...still they had problems...and later I found out that those red parts were causing the AI problems...is THAT the purpose of the "test direction" button..testing it ONLY for AI?

Share this post


Link to post
Share on other sites

If anyone would have some time to experiment with that option and with what ZeroG said, it could benefit us all very greatly...

For now, a simple picture to show where this is going. The cursor is now always visible on-screen (but not in screenshot - just imagine the ArmA cursor showing at the last blue dot :p). The preview-line follows the cursor... left clicking places the road, and you can pan the view by holding right-click & dragging, and zoom with mousewheel (just like in the editor).

RoadPainter_preview2.jpg

Share this post


Link to post
Share on other sites

Homer Johnston good work :D

Edited by SenChi

Share this post


Link to post
Share on other sites

Looking amazingly promising so far Homer!!

I had a quick check over some roads I've already placed with the "test direction" button... (I'm following a lot of tight RL coastal and hill roads in a VERY hilly landscape, so theres little room for manoeuvre as to where the roads have to go)...

Several of my carefully hand-laid roads show red and orange sections - not many, but a few bits here and there... I looked more closely at the landscape - and the sections... it didn't seem to be a "slope" factor - sometimes the "warning sections" were on relatively flat areas...

One thing I DID notice was the choice of roadparts seemed to often be responsible for the "warnings"... these crazy scottish roads twist and turn a lot - and where I've used a sequence like ... "75 left turn, 75 right turn, 75 left turn" - one after the other - that tends to show red with the "test direction" button...

I'll have to check further to see if there's any other obvious combinations that seem dodgy...

In-game - the AI seem to follow these roads with "dodgy warning" sections about as well as any other so far... they hesitate a little generally on my roads - they don't confidently belt along (this could be because theres rarely even a 25m straight section), except when crossing the big bridges - the only real long continuous straight roads on my map, really - they seem to put the foot down there no problema - and confidently zoom across them... then they hit the next road section, and slow down to "tourist pace" again... ;)

Anyway.... looking forward enormously to trying this tool! keep up the good work!

B

Share this post


Link to post
Share on other sites
In-game - the AI seem to follow these roads with "dodgy warning" sections about as well as any other so far...

F***ing marvelous - this is what I was really worried about. If you go into the edit-road dialog (Options>Roads) then you can alter the "max angle" and "max bank" settings, which are somehow related to the "Test Direction" button and its warnings.

If the AI are OK with it, then I am going to guess that these warnings are just to let you know that your road is "unrealistic" (steeper than you said it should be), because you can increase the previously mentioned "max" settings and the warnings go away.

Thanks Bushlurker!

Should be able to get a beta of this released sometime on the weekend, need to add a few more things to the GUI :) initial beta will require some copy/paste/Notepad++ find-replace labor. Next week, if everything else is going okay, I might look into using Nutty's addon to write to file automatically and remove the Notepad++ requirement.

Share this post


Link to post
Share on other sites
If the AI are OK with it, then I am going to guess that these warnings are just to let you know that your road is "unrealistic"

Thats my conclusion so far too... hard "left-right-left" turns aren't a feature of many RL roads (except maybe scottish ones), so it could be more an "asthetics" than a "AI practicality" button...

In my experience the AI will attempt some fairly scary slopes if they decide thats the way they want to go

B

Share this post


Link to post
Share on other sites

One more thing guys that we shouldn't forget: road smoothing script (aka terrain leveler). Does it work with these external tools? Since we can only move terrain +-1meter we pretty much depend on it.

Share this post


Link to post
Share on other sites

About the road warnings... i think they are a remains of the former autoroadtool which does not work anymore. Accordings to the road´s settings this tool would have avoided big bank and angle values. As far as i know is only the ai taking unwanted shortcuts sometime but thats not really related to the roads.

The road smoothing tool should "work" as always more or less because the roads are imported into visitor and handeled like any other road.

I´m really happy that some dedicated guys are working on these tools... thank you

Share this post


Link to post
Share on other sites

the generated road is no different than a road drawn in visitor, so the road smoothing script works no different either on an imported road section. Have I read that sometimes, the smooth roads script doesn't work? Maybe later this summer I (or someone) could write a new script... we'll see how things turn out.

After I have this tool working "as-is", I intend to try and expand it by allowing you to place T's and crossroads... you won't be able to import them into Visitor, but HOPEfully you'll be able to draw full road networks and import it section by section into Visitor (you will still have to place T's and crossroads manually in Visitor at the end/start of each section)

[edit] Beton posted first :P

Edited by Homer Johnston

Share this post


Link to post
Share on other sites

wasting more time photoshopping up preview pics...

Preview #3

GUI is mostly in-place, still a few placeholder-buttons. Still hoping I will release something usable by the end of next weekend.

All for now!

Share this post


Link to post
Share on other sites

Outstanding preview, you're doing more for the community than BIS right now, kudos for that! :)

Share this post


Link to post
Share on other sites

Another preview... should be releasing something that looks this in the next day or two. It will feel a little bit "rough" and I'm expecting some bug reports, but that's what betas are for right? :D

A big thanks will go to Leopotam for allowing me to use & supply his "ArmA Offline Storage Monitor" tool to enable file exports from ArmA. :)

The first page of this thread will be updated with all important information when this is released, but for now I will mention using the beta tool will require:

- using Leopotam's "ArmA Offline Storage Monitor" (a simple console window which is left to run in the background), with an export script slightly modified by me

- using Lester's (MapFact) Editor Update addon

VhFCPnvbL_4

Again, high-res video is available if you watch it at Youtube.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×