[WIP v0.409] FAF Map Editor

Interesting mapping tools and mapping help.

Moderator: Morax

[WIP v0.409] FAF Map Editor

Postby ozonex » 09 Dec 2014, 22:43

Today I started to work on app, that will help with some things that official map editor can't do, and will help a lot.Im using Unity3d 5 Personal

Basic features will be:
- Mirror Markers
- Changing file names, folders, names in scenario.lua to work with FAF's version control
- Connecting markers to army
- Configuring player spawn points
- Generate script.lua and tags in save.lua, that will support different mexes for differend player ammount
- Group markers
- Terrain texture presets
- Lighting presets
- Water and waves presets

https://github.com/ozonexo3/FAForeverMapEditor

Screens:
Image

Image

Image

Image

Image



TODO:
https://docs.google.com/document/d/1EXt ... FcLEM/edit

Changelog:
v0.409
- Added Slope tool, that colors terain depending on how much terrain is slope (Green flat, orange not-flat, red - high angle, blue - water low angle, pink water high angle)
- Added tool that allows to change "default" area size or turn it off
- Added tool that allows to change where each army will spawn, and preview it with auto-team
- "Search map" now works. It shows folders inside "Map path" and then *.lua files in selected folder

v0.408
- Deleting markers now work (also delete symmetrical markers)
- Added Delete/Create markers to Undo History
- Fixed bug in Path to map files
- Changed path to "Structure" folder
- Fixed bugs with exporting wrong coordinates of markers
- Fixed bug when exporting for marker that has no "spawnwitharmy" tag
- Fixed bug with loading map area of size 0,0,0,0 (all terrain was black)
- Some more temp textures now saves in "temfiles" folder

v0.407
- Rebuilded markers storage - Now is much easier to add/remove markers from code and store their Undo data
- Fixes of selection box
- Camera now zooms better on smaller maps
- Added "change marker selection" to Undo History
- "Create marker" function now work. Its connected with symmetry.
- Cleanup in "EditMap" scripts

v0.406
- Added Undo/Redo commands

v0.405
- Diagonal and Rotation symmetry are now working
- Changed Horizontal and Vertical names of symmetry to X and Z
- Added XZ symmetry (now there are 4 of that kind: X, Z, XZ, X + Z + XZ)
- Water parrameters now scale with map size
- Fixed grid offset for different map size
- Added "Map" folder path in editor settings
- When saving, old scenario, save and script files are moved to "backup" folder. This allow to restore previous files when there will be bug in saved files
- Changed MapInfo UI page to work with smaller resolutions.

v0.404
- Improved selection that much better works with symmetry
- Horizontal, Vertical and Horizontal+Vertical symmetry options now also move mirrored markers
- Fixed Starting UI for smaller window resolutions
- Added AppIcon
- Pressing "G" button now trigger grid

v0.403
- Changed UI
- FA Water shader
- Fixed terrain shader
- Grid
- Moved all settings files to "Structure" folder
- First windows build (i need app icon! :D )
- Project is now avaiable on github

v0.402
- Fixed "Recent files" menu
- Added Editor Settings menu. You can now change gamedata path there.
- Added support for RGB24 DDS textures (not all FA textures are DXT1 or DXT5)
- Fixed texture mipmap setting and Anisotropic Filter
- Fixed import of Normal Maps
- Fixed wrong IDs in terrain textures
- Changed Shadow settings
- Editor now creates "temfiles" folder if not exist. It is used to extract textures and other assets from FA Gamedata
- Saves script.lua file. It use one of 2 templates (with "spawn with army" or no) or leave it with no changes.
- No water, if map is not using it

V0.401
- Upgraded project to Unity 5.1.2 Personal (free)
- Editor can now save "scenario.lua" and "save.lua" files with all changes. Files have clean format. User can change format, by editing "structure" files.
- Loads some more data from "scenario" and "save", that was not loaded before.
- New icons for markers: Spawn, Hydrocarbon
- Fixed some bugs in terrain
- Fixed some bugs in UI
- Added popup window, that shows when editor is loading or saving files.

Spoiler: show
v0.35
- Fixes in snapping to grid
- Changed map space from map middle is 0,0 to map top left is 0,0 (similar as in supcom)
- Added "Last maps" menu in starting screen
- Map editor now remembers last loaded map
- Fixes in mirror symetry functions
- Markers now can be selected from markers list
- Selected markers are now shown as selected on markers list
- Working map preview image on starting screen (support preview.jpg and all textures generated by faf)
- Selected markers can be moved by dragging blue selection circle (but mirrored selection is still not moving). Markers are moved based on grid.
- Working selection tolerance parameter. Now if you want to move objects that are not exactly mirrored you can increase tolerance to catch them to selection
- If you load map where markers are not snapped to grid, then editor will snap them at start.

v 0.34
- More work on selection
- Working X and Z mirror symmetry
- Some work with getting UI to work
- Added working box selection
- Added symmetry search tolerance
- Force button will create symmetry objects that not exist (not working yet)
- Small improvements in camera controlls

v0.33
- a lot work with new UI
- Selection + controls (shift to change, ctrl to add, alt to remove)
- Camera controls works only when cursor is not on UI
- List of all markers
- Creating of new markers

v0.3
- New UI

v0.21
- New terrain shader
- Used FA terrain shader algorithms to calculate albedo and normal textures blending for terrain (support for 5 textures: Lower stratum + 4 Stratum)
- Used FA water color calculations,
- Used FA Ramp map for water coloring
- Enhancements in imported elements scale, markers positions and overall elements proportions
- Changed importer texture formats for Stratum masks textures (from DXT5 to RGBA32)
- Added fog
- Changed folder for maps (from "[app]/Assets/Maps" to "[app]/maps/")
- Cleaning in project resources

v0.2
- Load terrain data from scmap
- Load light data from scmap
- Load water data from scmap
- Load markers from save.lua
- Terrain shader with water's Deep and Abyss coloring

v0.11
- Implemented new NLua plugin
- Load all data from scenario.lua file
- Load AREA data from save.lua file
- Marged with Rogueleader89's project
- Gameplay area can now be changed in editor.

Alpha v0.1
- Load scenario.lua files
- Load HeightMap from raw file
- Selecting and moving markers
- Changing name and description of map
- Camera movement
Last edited by ozonex on 21 Aug 2015, 21:01, edited 23 times in total.
FAF Map Editor Alpha v0.605 > Get it now!
User avatar
ozonex
Priest
 
Posts: 358
Joined: 16 Feb 2012, 20:11
Location: Poland
Has liked: 197 times
Been liked: 263 times
FAF User Name: ozonex

Re: [WIP] Map editor helper app

Postby Kalvirox » 09 Dec 2014, 22:49

When this is finished, make it android compatible and I will make maps all day for you.
[SFo]T4ffytr0n2014: You can tell Kalvirox comes from the south by what he is having for lunch
SeraphimLeftNut: Two pieces of copper are electrically the same, but you can stab people with one piece and send UDP packets through another
User avatar
Kalvirox
Evaluator
 
Posts: 623
Joined: 31 Aug 2013, 16:19
Has liked: 121 times
Been liked: 133 times
FAF User Name: Kalvirox

Re: [WIP] Map editor helper app

Postby ozonex » 09 Dec 2014, 22:53

this will not edit map itself, only scenario, save and script files.
But it's possible to load Heightmap and mask texture and then edit them in my Unity editor, but it's easier to do it in SupCom map editor.
FAF Map Editor Alpha v0.605 > Get it now!
User avatar
ozonex
Priest
 
Posts: 358
Joined: 16 Feb 2012, 20:11
Location: Poland
Has liked: 197 times
Been liked: 263 times
FAF User Name: ozonex

Re: [WIP] Map editor helper app

Postby nine2 » 10 Dec 2014, 02:15

what language are you using?
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: [WIP] Map editor helper app

Postby ozonex » 10 Dec 2014, 02:22

partytime wrote:what language are you using?

c#
FAF Map Editor Alpha v0.605 > Get it now!
User avatar
ozonex
Priest
 
Posts: 358
Joined: 16 Feb 2012, 20:11
Location: Poland
Has liked: 197 times
Been liked: 263 times
FAF User Name: ozonex

Re: [WIP] Map editor helper app

Postby nine2 » 10 Dec 2014, 03:14

Duck and I have separately done a lot of c# work with maps. We haven't done what you are doing... Duck even managed to render the map in directx using supcoms own shader - so it looks really good. He didn't do decals though.

I'm getting my code together to put on github. Are you interested in doing the same? I'd love to take a look.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: [WIP] Map editor helper app

Postby ozonex » 10 Dec 2014, 03:34

partytime wrote:Duck and I have separately done a lot of c# work with maps. We haven't done what you are doing... Duck even managed to render the map in directx using supcoms own shader - so it looks really good. He didn't do decals though.

I'm getting my code together to put on github. Are you interested in doing the same? I'd love to take a look.

I can, but remember that I'm using Unity3D Pro for it. Right now I want to spend time on reading and saving lua files in unity. This is hard for me and I don't know any good way how to make it. I found some LUA parser plugin, but they are made to execute scripts, not to load variables. It always crashesh when I wanted to load scenario.lua into it.
Right now I created very simple code that reads and parse variables from text loaded into string. It's not the elegant way of doing it, but it works.
Next hard step is reading save.lua that is more complex.
Saving lua files is much more easy.

Image

For terrain I'm just using build in unity terrain. If I will learn how SupCom terrain shaders exactly work, then I can write similar shader in unity. I don't know how to read scmap file, so I will give option to load heightmap with settings (max height, water level) and this should be good for preview.
FAF Map Editor Alpha v0.605 > Get it now!
User avatar
ozonex
Priest
 
Posts: 358
Joined: 16 Feb 2012, 20:11
Location: Poland
Has liked: 197 times
Been liked: 263 times
FAF User Name: ozonex

Re: [WIP] Map editor helper app

Postby Rogueleader89 » 10 Dec 2014, 04:12

A couple months ago I played around with porting some of Duck42's c# port of Hazard's scmap reading code into unity and I have working heightmap generation via creation of meshes rather than using unity's fairly bloated terrain system (the terrain system is great statically but for dynamic sculpting not so much, especially not on mobile devices). I managed to read all of the map data in (not rendering anything more than height map and some minor lighting stuff but the data is there) but I have yet to manage to save the map data back out to a working scmap file (the bit I'm missing is code to write unity textures to dxt5 compressed .dds files if I recall correctly though its been awhile) and I hadn't touched any lua stuff yet; had to drop the project as other things came up in life.

All that said, if you are interested in expanding your app into a larger new map editor project (we really could use one) I think unity is a great cross-platform choice for it and I'd be happy to share what code I have towards that goal as well as offer some minor assistance; though I am still unfortunately rather busy and I'm trying to pick up a bit of python so that I can hopefully contribute to faf elsewhere (though fair warning, this is fairly messy code :P).
Rogueleader89
Avatar-of-War
 
Posts: 130
Joined: 15 Jan 2014, 08:22
Has liked: 5 times
Been liked: 26 times
FAF User Name: JadeXyan

Re: [WIP] Map editor helper app

Postby nine2 » 10 Dec 2014, 05:55

I don't know anything about unity but in c# you can just nuget a lua parser and use it like this:

var luaString = // get it from file
var result = SomeLuaEngine.Execute(luaString)
var bitIWant = result.ScenarioInfo.description

here's an example scenario file:
Spoiler: show
Code: Select all
version = 3
ScenarioInfo = {
  Configurations={
    standard={
      customprops={ },
      teams={
        { armies={ "ARMY_1", "ARMY_2", "ARMY_3", "ARMY_4" }, name="FFA" }
      }
    }
  },
  description="",
  map="/maps/2V2 Sand Box.v0001/2v2 sand box.scmap",
  map_version=1,
  name="2V2 Sand Box",
  norushoffsetX_ARMY_1=0,
  norushoffsetX_ARMY_2=0,
  norushoffsetX_ARMY_3=0,
  norushoffsetX_ARMY_4=0,
  norushoffsetY_ARMY_1=0,
  norushoffsetY_ARMY_2=0,
  norushoffsetY_ARMY_3=0,
  norushoffsetY_ARMY_4=0,
  norushradius=0,
  preview="",
  save="/maps/2V2 Sand Box.v0001/2V2 Sand Box_save.lua",
  script="/maps/2V2 Sand Box.v0001/2V2 Sand Box_script.lua",
  size={ 512, 512 },
  starts=true,
  type="skirmish"
}



that scenario file wouldn't execute by itself though... it doesnt declare the version variable and it doesn't return the scenario info variable. So i would add some extra script to the lua before execution:

var fixedLua = "local version\r\n" + luaString + "\r\n return ScenarioInfo";

and now it should work!

And yes those DXT5 compressed files are annoying. Makes them quite hard to use anywhere except directX.

We have code for reading scmap (like rogue said) including heightmap, water, etc.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: [WIP] Map editor helper app

Postby Lionhardt » 10 Dec 2014, 06:09

this sounds great!
Help me make better maps for all of us, visit my Mapping Thread.

Maps needing gameplay feedback:
Spoiler: show
[list updated last: 31.1.2018]

(maps available in the vault)

- Hexagonian Drylands
- Fervent Soil and Torrid Suns

YouTube Channel
User avatar
Lionhardt
Contributor
 
Posts: 1070
Joined: 29 Jan 2013, 23:44
Has liked: 188 times
Been liked: 144 times
FAF User Name: Lionhardt

Next

Return to Mapping

Who is online

Users browsing this forum: No registered users and 1 guest