• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Athena Editor Development Thread

OmfgRegister

Active Member
Joined
Mar 7, 2009
Messages
173
Reaction score
48
Development thread for Athena Editor. wpf c# map editor

Original Thread: My first program, need help
Moved to Discussion for increased visibility/feedback

Very early in development. Decent possibility it never gets finished. If you download the binaries, as with everything you download, run your own virus scans don't trust my word on it.

Started developing this because of certain things I dislike about rme that aren't really changeable without rewriting large portions of it. At the time I also wanted code samples to be able to show a future employer, but I've since decided to stay at my current job a lot longer, and thus no longer need the code samples.

Some features (All need work):
Auto bordering for grounds: Supports small corner to corner auto bordering along with full tile and easy access to specility pieces
Walls: Supports autobording along with easy access to pieces that you don't use in a normal rotation
Random Brush
Composition Brush (placing things that consist of more than one piece, catapults, large rocks, even entire buildings)
Disable Top Order enforcement: This allows you to place posts over wall pieces without the wall pieces being deleted. This is strictly a bug that people have abused so I've built it into the editor.

All of the brushes are editable and addable in the editor itself with UIs.

You can add custom palettes so that you can re arrange the categories of your brushes inside the editor. You can then drag and drop from any other categories to fill your new category with brushes.

Current hardcoded at version 10.98

If anyone is bored and wants to try it, I would really appriciate feedback on the bordering system for grounds aswell as the general direction of the application. The current render I'm using is wpf default rendering, it is slow but works at a close zoom. I have a directX renderer mostly written but it still needs some work so its not live yet. This is also very much in a super early beta. Please don't try to use this for actual mapping, it still has a long way to go.


Requirements: .Net 4.6.2
Source: GitHub - Tidus123746/Wpf-Map-Editor
To compile source, copy files in ItemsToPutInOutputFolders to your output folder (ex: bin/x64/debug/) Additionally you'll need a copy of the tibia.spr for 10.98 and put that in the Version data folder under 10.98 that you will need to copy to your output folder.

Compiled: Athena Editor 0.1
MEGA


Screenshots:
WallBrush
Specialty_Pieces.png


Groundbrush bordering
screen1.jpg


Composition Brush Editor
Composition_Brush.png


Ground Brush Editor
Create_Ground_Brush2.png
 
Last edited:
Interesting.. Guessing it means that manual bordering may be a thing of the past with the alteration to AB? Would save a lot of time.. Intrigued to say the least.. Will keep watching this
 
Interesting.. Guessing it means that manual bordering may be a thing of the past with the alteration to AB? Would save a lot of time.. Intrigued to say the least.. Will keep watching this
I'm amazed your still around Ghost, but no manual bordering will never go away. If you browse the mapping showoff threads, people do things with borders that an auto border system will never be able to replicate. However, it will make manual bordering much less common and not needed for a lot of the cases it is in RME. If your curious, download and try it, I would love to get some feedback. The main problem I have right now is that the full square and corner bordering doesn't mesh pefectly, doing full square around cornering deletes small borders where it shouldn't. Planning on getting that this fixed maybe this weekend.
 
Came to see how the forums going and yh that's what i meant.. Guess i was being a bit ambitious with my comment (or being lazy and hoping lol). Yh, might try it soon.. i rarely map much these days though.
 
Came to see how the forums going and yh that's what i meant.. Guess i was being a bit ambitious with my comment (or being lazy and hoping lol). Yh, might try it soon.. i rarely map much these days though.
Do it! I don't have the palettes or the brushes to support doing any real mapping with it atm anyway, the binaries are mainly just for feedback and testing. But yea I don't map or doing anything OT related these days, except occasionally work on this.
 
My ideal map editor would have a simple but powerdul raw palette with item categories being set in items.xml.

Nice work, opentibia lacks tools but i think we are fine with rme. We are really needing a content editor(which can edit items.xml/items.otb).
 
Last edited:
My ideal map editor would have a simple but power raw palette with item categories being set in items.xml.

Nice work, opentibia lacks tools but i think we are fine with rme. We are really needing a content editor(which can edit items.xml/items.otb).
Maybe, but I think people are fine with RME because that is all they have had
 
Maybe, but I think people are fine with RME because that is all they have had
Maybe. A C# map editor is superior to a C++ map editor because C# is way much easier to learn and work with. Of course C# is not portable as C++ but i think you should not bother about it. RME is pretty much solid mature and not that hard to modify. Anyway, a new approach is always welcome.
 
Maybe. A C# map editor is superior to a C++ map editor because C# is way much easier to learn and work with. Of course C# is not portable as C++ but i think you should not bother about it. RME is pretty much solid mature and not that hard to modify. Anyway, a new approach is always welcome.
Your right about it being mature, and easy to modify. However, the UI changes and the way I want the brushes to work in general would require re writing most of it. When I last looked at the RME code it seemed like it was hard coded to work against a fixed set of brushes. I also don't like how the brushes and palettes are in these massive xml files that are a bear to try and hand edit and get right. I'd much rather prefer everything to modifiable from inside the editor. You could do this with remeres, but again requires a lot of work in a language less friendly for UI. I also think being able to create your own palettes on the fly would be very useful for everyone. Atleast when I used to map, I had general themes I liked to follow. If i was making a swamp I probably used stuff from a fixed number of brushes. But it wasn't worth the effort to make that its own palette and I would end up switching between 8 different things and browsing raw trying to find the brushes. If I could drag whatever brush I find into a common category it would save a lot of time.

As for the C# vs C++. I'm not so sure C# is easier to learn. I think they are probably equivalent, especially if your bringing in wpf and the nuances in general. C++ you have to manage your own memory which in theory makes it a lot harder, but in C# you have to careful not to create circular references by attaching to events and things that you wouldn't obviously think of creating a memory leak. The nice thing about wpf is although I think the learning curve is high, once you have a good understanding of it, its very easy to do very powerful things with the UI. C++ on the other hand is a lot faster language, so without some pretty significant optimizations it will be hard to get the renderer to perform at the same speed as rme.

But yea, keep watching the thread maybe you'll change your mind :)
 
Small update:

Added auto border on deletion. (When you delete a ground tile, or a wall piece, it will re rack the appropriate tiles)
Added ability to import tilesets from rme xml files. (Mostly Raw and Items atm, I don't have random or ground tile brush matching atm)
Fixed memory leak with preview images causing a crash at 40k or so images.
f871265dd8.png



Not newly developed, but never showcased:
When you have multiple tiles selected you can delete all the items, or all the borders in those tiles
f8c1fcfcb0.jpg
 
Last edited:
Starting working on getting Lua brushes implemented.

This community has a lot of lua scripters so it makes sense to provide tools that they can leverage.

Lua code for a simple Raw Brush. Everything seems to be working great. The preview in the toolbox works great, the map preview, and the shift drag, single click, drag click, ect all seem to function identical to the hard coded Raw brush implementation. Obviously the lua brushes aren't meant for simple brushes but to have more complex things like the triangle style roof brush or something similar.
Code:
local dirtGroundId = 103

function PlaceAtOneLocation(map, pos)
  local tile = map:GetTile(pos)
  local item = Item.Create(dirtGroundId)
  tile:AddItem(item)
end

function PlaceAtBox(map, topLeftPos, bottomRightPos)
    for x=topLeftPos.X, bottomRightPos.X,1 do
        for y=topLeftPos.Y, bottomRightPos.Y,1 do
            local pos = Position(x,y,topLeftPos.Z)
            PlaceAtOneLocation(map,pos)
        end
    end
end


function GetPreviewId()
    return dirtGroundId
end

lua_Dirt_Brush.png
 
Additional work on lua brushes.

I was thinking that for more complex brushes you probably want to have 1 source code that you can pass parameters into and not hard code the item types it uses.
This will allow you to create multiple brushes that are based on the same underlying lua.

Therefore modifications to the lua for a raw brush are:

Code:
local itemTypeId

function Initialize(parameters)
    itemTypeId = parameters[0]
end

function PlaceAtOneLocation(map, pos)
  local tile = map:GetTile(pos)
  local item = Item.Create(itemTypeId)
  tile:AddItem(item)
end

function PlaceAtBox(map, topLeftPos, bottomRightPos)
    for x=topLeftPos.X, bottomRightPos.X,1 do
        for y=topLeftPos.Y, bottomRightPos.Y,1 do
            local pos = Position(x,y,topLeftPos.Z)
            PlaceAtOneLocation(map,pos)
        end
    end
end


function GetPreviewId()
    return itemTypeId
end

With the corresponding XML file
Code:
<?xml version="1.0"?>
<LuaBrush xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <UniqueIdentifier>1c8c5799-760d-4a85-9563-60b1b482242c</UniqueIdentifier>
  <Name>Lua Ground Brush</Name>
  <SerializedParamters>
    <anyType xsi:type="xsd:int">103</anyType>
  </SerializedParamters>
  <FilePath>Brushes/LuaBrushes/Logic/RawBrush.lua</FilePath>
</LuaBrush>


The xml file will be generated from a GUI asking you to select parameters, the source file, and the name. The lua file will have a text editor built into the application that allows you to compile it and check for errors.

I also plan on adding a PositionClicked function, which will give you pixel coordinates relative to the specific tile that was clicked. This should allow you to do edge detection or any other action you want to happen that needs more precise information past the tile that was clicked.

Does anyone have any suggestions in regards to lua based brushes?
 
This is looking great, I think donations would come in handy for you :rolleyes:, not from me, I'm poor, can barely take 2 meals a day, but you get what I mean.
Wish to see this one c# map editor actually get somewhere (at least to Simone's if not, better), unlike (Yoshi? Joshi? w/e his nick was) C# Map Editor he dropped and never released the sources of, he didn't get this far, but he did accomplish something.
 
This is looking great, I think donations would come in handy for you :rolleyes:, not from me, I'm poor, can barely take 2 meals a day, but you get what I mean.
Wish to see this one c# map editor actually get somewhere (at least to Simone's if not, better), unlike (Yoshi? Joshi? w/e his nick was) C# Map Editor he dropped and never released the sources of, he didn't get this far, but he did accomplish something.
I appriciate the support. I think I'm already passed someone's in a lot of aspects. I basically need to finish spawns and houses and Il be there. Yoshi seemed like he was off to a decent start but he got distracted with the renderer and spent all his time on a shading engine. Sources would have been nice. If you noticed mine are already released so if development does drop off someone could pick it up. Although that is unlikely.

As for donations I appriciate the sentiment but I'm doing fine job wise. The amount of time I've spent and continue to spend on this can't be repaid in any significant way anywat and I'm not going to ask people who the money probably means more to than it would to me. There was a time when I was a lot poorer and had a different perspective but I'm basically doing this for fun and eventually a code sample for an employer
 
Looks really good. I'm a huge fan of C# so I'll try to follow this. Some notes, by the way, you say the requirements are .NET 4.6.3, but it's actually 4.6.2. I had to install the Developer Pack version of .NET 4.6.2 to not get a framework-targeting error.

Also, when loading the solution file in Visual Studio 2015, it tries to load Performance1.psess (a performance profiler file) and an Overview.modelproj file (a quick Google search says this is only compatible with Ultimate versions of Visual Studio). Neither of these are present so Visual Studio gets angry and throws errors at you. These aren't necessary to include, so a simple edit to the solution file will fix that.

When building, I get an error that a xcopy command exited with code 4. Upon inspection, I found that the path is hardcoded in the MapEditorWPF.csproj file here. This will obviously need to be fixed.

After all that, I was finally able to build the project successfully only to launch the executable and be greeted with an interface that basically did nothing (yes, I moved all necessary files to the output folder). At this point I didn't really feel like jumping into the code to debug it and see what was going on.
qRccYmK.jpg
 
Back
Top