[TOOL] PayDay's Map Editor


(Christoph Timmermann) #1

Greetings guys, I’m excited that I can finally release the first version of this new tool!

Introduction

Based on DAEnerys’ GUI and rendering system, this application allows you to open .level lua files, look at and edit them in realtime 3D and save them back into lua code.

If you just want to use it straight away: The downloads are at the bottom!

  • The importing is done using a lua interpreter library called NLua, the exporting is just a matter of string building.
  • The rendering is done with OpenTK, the meshes for the editor are loaded by Assimp.

This editor also needs your exported Homeworld data aswell as mod data, if you have any custom map objects that you want to use. (Like DAEnerys)

This is how the 3D view looks like:


Manual

Configuration

You will get a notification telling you that you haven’t specified any data paths yet when starting the editor for the first time.
You can fix that by opening the Settings window by clicking on the tool button at the upper-left corner.
There you can click on Add to browse to your keeper.txt, it should be at the root directory of your game/mod data.
The editor has to be restarted after doing that, this step is important as the program won’t be able to find asteroid types etc. without this information.

Now you can also take a look at the Hotkeys if you want to.
You can modify all of the key bindings there, but I tried to set the default ones as practial as I could think of.

Map options

The Map tab allows you to set all of the options that set the mood of your map aswell as important stuff like player count, description, camera distances, etc…

One cool feature is that you can preview how the fog will look like in-game. To activate this, check the Display checkbox in the Fog section.

3D view and camera

You will see the following in the main part of the editor:

The grid, circle and degree indicators resemble the sensors manager of Homeworld.
This gives you an idea of how big your map is and if you placed everything correctly.

To rotate the camera, hold the right mouse button and move around the mouse.
To zoom the camera, scroll the mouse wheel.
To move the orbit point around, use the (default WASD) keys.
To adjust the height of the orbit point, use the (default Q and E) keys.
To reset the camera, press the reset camera key (default R).

You can also change to orthographic mode by pressing the key (default NumPad5) or switching in the top-right corner.
The view can be set to front, back, left, right, top and down by pressing the associated keys (default on the Numpad).


Opening existing maps

Click on the Open button at the top to browse to a .level file, this will discard all unsaved stuff you currently have open, so beware.

Saving your map

Click on the Save button at the top to find a place and name where your map will get saved.


Creating objects

To create an object, go to the Create tab, choose the type to create and it’s parameters, then move the mouse over the 3D view to set the position.
A copy of the object will be created by left-clicking. You can then switch to the Map tab and select it to change it again.

Selecting objects

You can select objects by either just clicking on it, or dragging a selection box around the stuff you wish to select (You know that from many other apps).
If you hold the add to selection key (default CTRL), the object(s) will be added to the previous selection instead of overwriting it.

Moving objects

Once you select one or more objects, a translation gizmo will appear in the 3D view.

Pulling one of the arrows will result in a position change on that axis depending on how far you move the mouse.

You can also set the position directly in the Selection tab:

Rotating objects

You can change the gizmo mode by pressing the translation- or rotation mode key (default T or Z).
There is also a little drop-down button at the top of the editor.

Setting the gizmo mode to rotation will result in this:

You can drag the circles to rotate the object(s) around the associated axis.
The rotation is done per-object, so it doesn’t rotate all of the objects around the shared pivot, but rotates them independently around their own center.
The other mode will probably be added in the future.

You can also set the rotation (in degrees) directly in the Selection tab:

Modifying object parameters

All of the map objects have different parameters that you can set.
These appear in the Selection tab, but only if you have exactly one object selected.
Multiple parameter editing will be implemented in the future.

These are the settings for dust clouds:

Copying/pasting objects

Press the copy selection key (default CTRL + C) to save all selected objects into the clipboard.
After that, you can press the paste selection key (default CTRL + V) to place exact copies of the objects in the clipboard.
The pasted objects will automatically get selected.
They will be in the same position as the original ones, so be sure that you don’t have two objects in the same place.

Deleting objects

Hit the delete selection key (default DEL) to remove all selected objects from the map.


Notes

  • Player starting positions are Points and have to have a name like “StartPos0” (0 is the zero-based index).
  • The fog preview isn’t that accurate, mostly because there is no background.
  • Parameter editing with multiple objects is not yet supported.
  • The selection system is pretty bad. It renders all selectable objects a second time and assigns a unique color to them. Then the color of the pixel that you clicked on can be used to identify the object you picked. This is an ugly way as this tutorial describes.
    So keep that in mind when you have problems with it.
  • Many things like cameras, clouds, paths, tendrils etc. are not yet supported.
  • Some dust cloud types are crashing the game without info in the log (though they work in the HW1 campaign).
    The first (default) one is one of them, so keep that in mind.
  • The asteroid mesh is not accurate in some cases, it’s just one I made in Blender to give you an idea of how it will look. The size of it is determined by the resource value of the asteroid type (in data/resource/asteroid/), because asteroids with much resources tend to be larger.
  • Theoretically, it should be possible to create things in Lua with loops or other magic. The interpreter of this editor understands that.

Planned features

  • Support for all remaining object types.
  • Rotation around the shared pivot of all selected objects.
  • Symmetrical editing.
  • Better selection system.
  • Better problems tab.
  • Auto-updating (I actually looked at this before, but it didn’t work out so well with the file overwriting).

Downloads

All downloads are available on the Bitbucket page.
You can also look at the source there, if you want to.


So here it is, I hope this tool is helpful for some of you.
Please report issues/ideas here so I can improve on it.

And very important:
If you have any name ideas for this tool, please tell me so we can have another poll like for DAEnerys. :slight_smile:


How to Create Maps for Homeworld Remastered
[TUTORIAL] Single Player Mission
[TOOL] DAEnerys - DAE Ship Editor
Modding tutorials Master Thread
(Siber) #2

Very cool tool. However…

I’m a bit concerned by the fact that NLua uses a modern version of Lua, people might hit situations where valid code for the editor isn’t valid for the game and visa versa. Is this something you’ve guarded against at all?


(Christoph Timmermann) #3

Currently not. There is no loop after exporting the map from the editor anymore though, because it just prints the stuff out in function calls.


(Siber) #4

Hm. Potentially a bit limiting when it comes to opening existing map files(mine have accumulated a fair amount of logic for labor saving), but that’s a pretty small thing against the utility of having a working map editor.

Something I’d suggest, from my own plans for a hypothetical map editor, is to have a directory for representation models so that mods can properly visualize maps with custom ships/objects placed on them.


(Christoph Timmermann) #5

That’s a good thought. Where would the editor look for models? And for what formats?
Currently it searches through the data/ship/ folder, maybe just look if there’s an .obj (for example) in that folder?
Then the default white cube could be replaced with that.

Too bad that you can’t open HODs…


(Cloaked) #6

Thanks PayDay!

Glad to finally see a modern replacement for Skunk’s map editor.


(Sastrei) #7

YES! Was waiting for you to release this. :smiley:


(Chimas) #8

List of suggestions so far:

  • When pressing the HOME key, it focus the center of the map (0,0,0) and shows the MAP tab so we can check the size of the map;
  • When selecting a dust or radiation cloud, the selected object shows a line perimeter in the vertical axis, so we can see which object was selected (so, it’s a circle, not a sphere);
  • TAB key for jumping from one object to the next when multiple objects are selected.

Will you add something like an equation editor to spawn pebbles randomly?
Or the abbility to import and add pebbles from other maps? Also, an inverter for these distributions, axis based?

Btw, it’s looking awesome, again. Keep up the great work …


(Christoph Timmermann) #9

I may be misunderstanding, but isn’t the R key already doing that? (Except for showing the Map tab)

Something like this?

Sure thing! Added to the todo-list.

I thought of a function to import additional external lua files. That would make that possible. :slight_smile:

Thanks. :slight_smile:


(Chimas) #10

Yes it is, thanks. I thought I read it somewhere.

Yes, you made horizontal, it looks better. Another option is changing/highlighting the color of the selected object, maybe it’s better and faster than drawing a line.

You could use tab also for similar objects when selecting only one object. I was looking for other maps, and a dust cloud can be actually dozens of aligned “sphere” clouds, so if you select one cloud and IF it’s not the one you want you could use TAB or SHIFT+TAB to go back and forth until you select the desired object (unless this is already done and I didn’t pay attention again)


(isned2000) #11

Is there any possibility of a mac port?


(Christoph Timmermann) #12

Well, all of the libraries that the editor uses are available for Mac.
The mono project has a Windows Forms port. OpenTK, NLua and Assimp have Mac-versions.

You would have to copy the extracted Homeworld Data onto your Mac for this to work though.

So yes, there is a possibility. But I have absolutely no experience with Macs, I can’t test it on one either.
If I get it to compile, you would only have an untested build that could not even work.


Another option would be to try it with Wine, it should work pretty nicely I think.


#13

My anti-virus program woke up and went to war on the executable. I don’t doubt this isn’t a virus, but has anyone else had issues with this file?

Also, on the topic of ship visualizations, would it be possible to have the editor search in the .ship file of the target/desired ship and use the in-game tab overlay icon (the triangle, square, diamond, parallelogram, and other outlines)?

The line to search for in the .ship file is:
NewShipType.TOIcon="…"

If this works, it should help creators distinguish ship classes with ease.


(Christoph Timmermann) #14

Yeah, I can assure you that it’s not a virus. :grin:
I just checked it with VirusTotal.
1 / 57


That’s doable. I already have the 2D-rendering in place, added to the list. :wink:


(Snake_B5) #15

Me gusta very beaucoup !

Great work as always :slight_smile:


#16

Also, the ability to undo or redo and action would probably benefit the editor more than anything else right now.

Oh, and an option for objects to be placed along a specified plane such that the object doesn’t spawn way out towards the end of the map.


(Nathanius) #17

First of all, well done! :smiley:

Secondly, could I use this to turn a randomly generated map into a “multiplayer safe” map? It would mean having some rudimentary scripts run through your program but… in all honesty… the random map generator we have makes better maps than I ever could by hand, and they cause desyncs with all the random()s that are in the script >_<


(isned2000) #18

Ok, I just tried the getting this running with WINE. I immediately got a crash, no ui or anything.
Here is the crash log: http://pastebin.com/dgpkuEMU
I can’t make much sense of it but you might.


(ajlsunrise) #19

Yes, you could!


dofilepath, DetermChunk, and NonDetermChunk are HW2/HWRM specific functions. They’re not built into Lua. However, we can do a work-around for them. :slight_smile:


(ajlsunrise) #20

Oh the joys of programming Windows/Mac.