AFS2 Cultivation/Scenery editor

  • I've been working on a small side project this week as I've had some spare time and my goal was to create a scenery/cultivation editor for AFS2 with emphasis on easy to use (as I know it can be very difficult modifying/adding cultivation in the right places).

    This does require you to have some knowledge on how to load cultivation (you'll need to have an airport .tsc file that refers to the cultivation file).

    Here are the current features:

    • Add, edit or delete buildings, plants and lights,
    • Create multiple plants at once (1 to 2500)
    • Create multiple lights at once using a line draw tool
    • Colors and icons for both buildings, plants and lights (color scales for building usage, direct color mapping for lights and icons for plant groups).
    • 3D mode which allows you to see the building and give an indication of the # of floors (can be toggled off).
    • Set default properties via the settings cogwheel, these are used when you create new objects.
    • Modify or delete existing objects by right clicking on them.
    • Mass select objects, drag them, duplicate them or delete them
    • Toggle layer visibility, anything you delete will not count against hidden layers.
    • Tooltip information with the object properties (can be toggled off).
    • Multiple layer of tile sources (Google, Bing, OSM, CartoDB)
    • Load 1 or more existing .TOC files (they must be plaintext)
    • Save the output as .TOC (hidden layers are not included)
    • Unless otherwise stated, assume everything is in meters and uses longitude/latitude.

    Hotkeys:

    • Q for creating a building,
    • W for creating a plant
    • E for creating a light
    • R for creating multiple plants
    • Backspace for deleting selected objects
    • CTRL+V for duplicating selected objects
    • Hotkeys for setting the default type (when drawing) for plant or building:
      • 1 - Broadleaf - ALT residential/gable - SHIFT residential/flat
      • 2 - Shrub - ALT commercial/gable - SHIFT commercial/flat
      • 3 - Conifer - ALT industrial/gable - SHIFT residential/flat
      • 4 - Palm
    • Numpad 1 to 5 can be used to change floors on the selection area if they contain buildings
    • F or D for zooming in and out (as it's broken in Firefox)
    • ESC to cancel all drawing or editing action
    • CTRL + Mouse to select objects (they are highlighted as blue after selection)

    When in draw mode:

    • Plant and Light objects are created by just double clicking anywhere
    • Building is created by clicking once to start the rectangle and then clicking again to finish
    • Mass plants are created in the shape of a polygon, keep clicking on your polygon boundaries and double click to finish.
    • Mass lights are created in the shape of a line, click on your line boundaries and double click to finish
    • If you made a mistake you can right click delete or mass select delete
    • AFS2 only supports rectangular buildings, so make sure they look somewhat rectangular, (they'll end up being rectangular anyhow).
    • Hold right mouse to shift your view at an angle

    Every time you load the editor you'll be placed near London (loading a .toc file will take the center of the cultivation data present and put you there). I plan on adding a local state to save your location/settings (but not data as that wouldn't be possible through browser's limited local storage).

    You are able to load any .toc file or alternatively just add buildings, plants and lights and save from scratch. If you want to give it a test run, I suggest loading the scenery by drassaud (such as Autogen Switzerland South Beta 0.1.0 and opening ch/places/Autogen ch South/fl_8-8 46-1_00.toc) or you can use my example.toc and load that (just a few buildings, plants and lights).

    Anyhow, without further ado, here's the link: AFS2 Cultivation Editor. The editor itself runs locally so it will depend on your resources (CPU/GPU) to process and render. Moreover I've only tested this on the latest Google Chrome (Firefox was a bit sluggish and I had issues zooming, other browsers untested).

    Looking forward to feedback! I can extend this to parse and work with .tsc files as well and add support for other things such as airports, xrefs, parking positions, runways, helipads, etc.

    Edited 9 times, last by Nabeel (January 14, 2019 at 6:18 AM).

  • Great programme.

    Tests showed me that it cannot read compiled toc files (e.g. the ORBX files). TOC files can be compiled with the contentconverter from Aerofly FS2. They are much smaller afterwards.

    Regards,

    Thomas

    i7-14700KF @ 5.6 GHz, Geforce RTX 4090, 32MB RAM, 1TB SSD M.2, 1TB SSD M.2, 2TB SSD M.2, 32" Monitor 4K, Pimax Crystal

  • I'll see what I can do about the zooming thing, I can do a potential fix at least via a zoom slider. As far as compiled .TOCs go, I don't think I'm able to read or decode them, only plaintext. I assume they're compressed and encrypted versions.

    The technology to render everything is WebGL (using deck.gl) which is somewhat new and may have problems on some machines.

    I've added a band-aid fix for zooming in Firefox, you can now use D and F to zoom out and in respectively as well as use the zoom slider (if it doesn't appear you may need to do a hard refresh using CTRL+F5).

    I plan on putting the code on Github sometime next week, just need to get some refactoring done first. This will be something people can run off their machines (rather than needing a website), that will also help with any potential legalities of using Google tile sources.

  • Really a great tool, congratulations. Good to see such talented people on board.

    It reminds me of the autogen annotator for fs9/fsx. I would love to see mass selection/deletion option and a copy paste option.

    Regards,

    Thomas

    i7-14700KF @ 5.6 GHz, Geforce RTX 4090, 32MB RAM, 1TB SSD M.2, 1TB SSD M.2, 2TB SSD M.2, 32" Monitor 4K, Pimax Crystal

  • Really a great tool, congratulations. Good to see such talented people on board.

    It reminds me of the autogen annotator for fs9/fsx. I would love to see mass selection/deletion option and a copy paste option.

    I've gone and added a mass selection option to delete for now, I'm not sure about copy and paste yet as that will need thinking on UI/UX side of things. It might easier having an option to create multiple plants (something like a spread/amount slider) so you can cluster them quickly in a location.

    As for mass selection, hold down CTRL and select your area, then hit backspace to remove. There's no undo right now so be careful!

  • After several hours of work I have a nice combination of drassaud's Berne and ORBXs Bern. I guess I removed several houndred houses from drassaud's file and now the ORBX Berne (town_old_red) fits into it. I prefer drassaud's cultivation because the height of the houses, especially of the small one family houses are more realistic (2 floors) than in the ORBX file. I have also changed the height and kind of many houses from drassaud. It looks much more like Berne now which is my home town btw. There are in fact very few higher houses with more than 6 floors and usually more outside than in the center. They also do not have a gable and are flat. If you know Berne then you know that there are a couple of buildings one can see from almost everywhere: e.g. the university hospital (inselspital) or three high houses close to the approach point whiskey. With the tool from Nabeel I was able to add all these as cultivation.

    A final point: fly once with the R22 to the nearby hill south-west of Berne called Gurten. Every year in Juli there is a famous music festival over four days on top of that mountain. Coincidentally the satellite texture pictures have been taken during that festival. You can see the crowd listening to the bands and a region with thousands of tents.

    Regards,

    Thomas

    i7-14700KF @ 5.6 GHz, Geforce RTX 4090, 32MB RAM, 1TB SSD M.2, 1TB SSD M.2, 2TB SSD M.2, 32" Monitor 4K, Pimax Crystal

    Edited once, last by TomB (January 6, 2019 at 5:39 PM).

  • I've been working on a small side project this week as I've had some spare time and my goal was to create a scenery/cultivation editor for AFS2 with emphasis on easy to use (as I know it can be very difficult modifying/adding cultivation in the right places).

    Thank you so much for this excellent tool. For me who is not a programmer - it is very user-friendly. :thumbup:


    I've gone and added a mass selection option to delete for now, .....

    Exactly what I need to clear forest that (because of inaccuracy) is planted in the water. :)

    Is it possible to create a function that can move a tree - instead of deleting and creating a new one?

    Is it possible to create a function that can create a forest: Choose an area, and a forest is automatically created within the area?

    Thanks again for a wonderful tool. A great contribution to the AFS2-community. :thumbup:

  • I've gone and added a mass selection option to delete for now, I'm not sure about copy and paste yet as that will need thinking on UI/UX side of things. It might easier having an option to create multiple plants (something like a spread/amount slider) so you can cluster them quickly in a location.

    As for mass selection, hold down CTRL and select your area, then hit backspace to remove. There's no undo right now so be careful!

    Would it be possible to use 'Ctrl + right mouse' to select objects and then delete all selected with e.g. backspace. I would like to remove lights as there are too many. Outside of inhabited areas there are usually no lights. However ScenProc adds lights according the street classification.

    Regards,

    Thomas

    i7-14700KF @ 5.6 GHz, Geforce RTX 4090, 32MB RAM, 1TB SSD M.2, 1TB SSD M.2, 2TB SSD M.2, 32" Monitor 4K, Pimax Crystal

  • Would it be possible to use 'Ctrl + right mouse' to select objects and then delete all selected with e.g. backspace. I would like to remove lights as there are too many. Outside of inhabited areas there are usually no lights. However ScenProc adds lights according the street classification.

    Not sure if I understood correctly, but selecting manual objects one by one rather than a huge selection? I plan on adding a visibility layer where you can toggle on and off models (such as buildings, plants and lights), which will ensure that objects selected are only applicable to the visible layer(s).

    Is it possible to create a function that can move a tree - instead of deleting and creating a new one?

    Is it possible to create a function that can create a forest: Choose an area, and a forest is automatically created within the area?

    The first one should be fairly simple. As far as the area selection goes, that could be a bit more difficult UI wise so I'll have a thought on how to do that nicely (as I need to think about creating a single plant vs multiple, plants respecting the area boundaries, the spread/size of plants, etc).

  • I'm always amazed when people say 'I've just been working on a little something' and then present a tool which does much of what we've been wishing for! And it looks great, giving a really good idea of my city as I build it.

    Just a bit of feedback, after all, you did ask...

    I'm mainly interested in adding individual fill-in trees to cultivations I've created using data, in Scenproc. I've used MS's Annotator for years, and was involved in the initial beta, so I know that if you don't ask, you don't get!

    It would be good if the tool selection was retained, so I could select the tree tool, and just keep clicking to plant trees rather than select the tool each time. And to further reduce the number of clicks, a single click to plant a tree, so I could plant 100 trees with 100 clicks, rather than 300 at the moment.

    Really appreciate your work!

  • I've made a few additions/changes:

    • You can move both plants and lights (the marker changes to an X just to make it more clearer where it will "land"), you can end editing/moving by double clicking on it.
    • Visible layers have been introduced, you can toggle them on or off on the top right.
    • Deleting will not count against layers that are not visible (drawing still counts).
    • Draw mode will persist until you hit cancel, so you can spam multiple plants, lights, buildings.
    • A message is shown to notify if you're in draw or edit mode (hard to miss!).

    One thing I still need to do is the ability to create mass plants in a given area.

  • Do you plan on supporting additional browsers.? I do not use Chrome, I use Microsoft Edge, the default browser for Win10. Absolutely nothing shows up at the url when using Edge.

    Regards,

    Ray

  • Do you plan on supporting additional browsers.? I do not use Chrome, I use Microsoft Edge, the default browser for Win10. Absolutely nothing shows up at the url when using Edge.

    Regards,

    Ray

    I've updated it, the issue is that Edge doesn't support the new proposals for Javascript yet (which the other browsers do), so it required a polyfill to work.