orxEditor v0.1 alpha

edited April 2015 in Projects - Tools
Anouncement:

Hi all, after a long time, loads of coffee, hundreds of hours of work and 160 commits I finally present you: the orxEditor!

This is my attempt to create a what you see is what you get editor for ORX.

As of now it supports: multiple objects selection, camera groups, visual collision edition and the loading of sprites. It runs on Linux and Windows (though created scenes will only load in the system they were created) and should run on OSX (I don't have one to test, so I can't be sure).

Here is a screen shot of the scene in the editor and on orx:

https://drive.google.com/file/d/0B0UdeUM9pB-nWWFMdF9ublM2MXEta2VkRURKaFVha013S19F/view

Finally I want to thank iarwain and sausage for all the support they gave me during this project as well as for the grammar review of the project wiki.

Links:

Project github:
https://github.com/fgmcoelho/orxEditor

Project wiki:
https://github.com/fgmcoelho/orxEditor/wiki

Roadmap:

I am focusing some upgrades in the collision forms editor as well as a major revamp of the UI (I know, it looks terrible on high resolution screens).

Please, keep in mind that this is still a very early version so the editor may crash (I tried my best to make it crash, but
had no problems in my PC).

Any bug reports and suggestions are welcome.

Updates

04/01/2015 - Some updates in the collsion form editor:
- The editor will now check if the mesh is Convex (the mesh will become red if it is not valid).
- Added the option to move the form instead of a single point by holding control.
- Added the option to move all points of the form, keeping the form ratio by using the right button.

Comments

  • edited March 2015
    Sweet nice one! A long time coming. Time to try this thing out.
  • edited March 2015
    looks great.
    stupid question: how do I run the editor?
  • edited March 2015
    You need kivy (the UI framework I used). Have you tried those steps?

    1) Install Python.
    2) Install Kivy (http://kivy.org/#download). The editor was developed and tested using Kivy 1.8, so it is highly advisable that you use this version.
    3) Open a command or a terminal.
    4) (Windows only) Get to the folder you installed kivy (in the command shell), and execute the 'kivy.bat'.
    5) Get to the folder you cloned the repository and execute: 'python tileeditor.py'

    This should be the normal flow, I tried on linux (ubuntu) and windows 32 (vista) and 64 (vista and 8), if you have problems, please tell me what OS you are using

    PS: I have a meeting now I probably will only be able to look at your reply in about four hours.
  • edited March 2015
    Congrats! :) The editor seems very nice.

    As far as I can see, you're using the standard Python ConfigParser for parsing .ini files, and you don't seem to handle any orx-specific .ini expressions, such as inheritance. This is actually the same with the Orx Animation Editor, as a matter of fact, it's much worse with the Animation Editor, since it doesn't parse .ini files at all, it just generates them.

    How do you plan to handle the .ini parsing in the long run? Do you intend to be able to parse any existing .ini file and use the editor on it? If yes, we have a common problem, as I also intend to(with Sausage's suggestion) enable the Animation Editor to parse existing Orx projects.

    The Animation Editor is in Java, but all the solution alternatives I have in mind would be trivially transferable to Python as well.

    What do you think? Would orxEditor benefit from a true Orx .ini parser?
  • edited March 2015
    I have though of loading resources from a path recursively, so I could parse the user assets. Still this is low on my priority list.

    I haven't really put much thinking into the algorithm, at first my idea was to parse by sections and recursively load the properties of the children first, then override the properties correctly.

    Still I need to find a way to determine what the section refers to (orxObject, orxCamera, etc) and to validate the data.
  • edited March 2015
    Using existing projects is really a non-trivial task. Looking at the config syntax section, significant work is needed just to get the right values for the right keys (think of inheritance, randomness, self-reference with '@').

    Then even when you get the parser going, it's a big task to represent the complex relations the sections could have amongst themselves. For instance, when I first designed the animation editor, each animation contained a number of frames in a hierarchical manner, while in .ini files, many animations can contain the same frame, so it's not really hierarchical. What's worse is that multiple frames could share certain values through inheritance or explicit reference to each other.

    It's a tough job to represent the true nature of the sections in a GUI, and I guess that's the fundamental reason why plaintext configuration is always more flexible than graphical tools. That's not to say graphical tools don't have a place (If I thought that, I wouldn't work on the animation editor anyway), but it's a big challenge to try to replace the .ini files entirely, even for something as specific as animations.
  • edited March 2015
    Wouldn't it be possible to use the load the ini files with the orx API? In python you can load .so/.dll files and invoke their functions.

    Maybe it would be the way to go.
  • edited April 2015
    I agree that using the orx API is probably the best thing to do, but how to use it in a cross-platform manner? Calling into the .so/.dll is tedious (you need to provide the function signatures yourself) and dangerous (it's really a disaster if you provide them wrong) even on a single platform. In the case of orx + cross-platform this is much worse, since the signatures of the functions change based on the OS + 32/64 bitness.

    There's some discussion about this on the animation editor thread , there seems to be two viable alternatives:+
    1. We're planning to compile orx to javascript anyway, so maybe we could compile the config module first, and run the javascript version inside the editor. This way, you get a true cross-platform solution, that doesn't use .so/.dll at all. Running javascript inside a Java application (the animation editor) is extremely easy, since the Java standard library comes with a javascript interpreter that can run compiled javascript code. I've made a quick search, and it's less easy for Python, and probably not as well supported.

    2. There's a very nice tool called SWIG, it's used to create bindings for C/C++ libraries, and it can target many (>15) languages including Java and Python. I've been very happily using it for a very long time, and it creates very natural interfaces in the target language. The downside of this alternative is that, SWIG generates some C/C++ glue code that you need to compile for each platform that you're planning to use it.

    Iarwain kindly offered to perform the compilation of (2) on orx's build servers, so that's a big help. I've been mildly leaning towards (1) since it's truly cross-platform, but it would be convenient for Java only. Since many nice tools are being built by the community using various languages, maybe it's best to go with (2). And who knows, (2) could evolve to be a complete binding of orx (and not just the config module) and people could use it in any of the 15 languages that SWIG supports. I believe it could even be extended to run on mobile, so that you could write cross-desktop-mobile orx applications using Python! At this point, this is just an ambitious dream of course :)
  • edited April 2015
    Yeah, I was thinking about that today, multiple plataforms will be a bitch to handle. Still I was planning on having a previwer, so I guess it is something I will have to do sooner or later.

    On javascript I have no ideas how to integrate python with it. SWIG, I have used on my work to create bind from C to PHP, it is pretty handy, but I have to first create a C++ layer. I think that to create binds for python Cython (http://cython.org/).

    On ambition, let's go on with baby steps.
  • edited April 2015
    The cross-platform issue is really really big when you try to use the .so/.dll directly. I've tried doing that in Java. I've managed to use the config module on 64 bit machines, but could never get it to work the same way on 32bit as well. I think the best way to handle this is to use SWIG to generate an intermediate layer, and use that to call into orx. Think of it this way; SWIG generates some C/C++ code to interface Python with orx, and that code is compiled by a C/C++ compiler, which knows how to deal with platform issues the best.

    I'll write to Iarwain on the animation editor thread about how to proceed with the compilation and distribution of the SWIG generated interfaces. In the end, we should have ready-to-use orx bindings for various platforms.
  • edited May 2015
    Well, just some on going work.

    I have been working in recreating the UI and adding a few features. Here is a screenshot of the work being is done:

    https://drive.google.com/file/d/0B0UdeUM9pB-nTkdTaUp5MXJxWlE/view?usp=sharing

    There is still a long way to go, but now there is a mini map and most things have a description. I am trying to also add buttons to do things that right now are only available shortcuts.

    I also mean to have some distributable package for easy instalation, at least on windows. Hope you guys like it and any suggestions are always welcome.
  • edited May 2015
    Hey Knolean

    don't know if it's on purpose, but I have this message for the last screenshot

    "You need permission
    Want in? Ask the owner for access, or switch to an account with permission"

    Cheers !
  • edited May 2015
    Ops, really sorry about that guys, the link should be working now. I didn't realise that until your post.
  • edited May 2015
    Thanks for fixing the screenshot! It's nice to see your work moving forward steadily. :)
  • edited September 2015
    Knolan, for the editor, what is the recommended version of python to use? There are two choices at the moment: Python 3.4.3 and Python 2.7.10.

    Also Kivi 1.8 is recommended, but only 1.9 seems to be available. Should a direct link to 1.8 be provided in the editor wiki if one can be found? Or will it run ok with 1.9?
  • edited September 2015
    Hi sausage, it is using python 2.7 right now (I don't really think many people are using python 3 right now :laugh: )

    The new UI is pretty much finished right now and uses kivy 1.9, so if you want to use that branch instead (the viewer is still not working on 64 bits linux). I still want to update the wiki or create some youtube tutorial before merging with the master.

    I would love to hear some opinions on it.
  • edited September 2015
    No probs. I'll update the editor wiki to reflect that.
  • edited September 2015
    In case you cloned it in the last days, there was a bug with the resource loader grid in the last days, I commited some fixes yesterday and it should be working properly now.

    The "stable" commit is this c53e27763ee7199447ab3708f3167fa7bdc40e75.

    There are still a few functionalities I want to add before merging with the master, so this should be the most stable commit in the next days.
  • edited September 2015
    Yep I did clone yesterday but I think there were a few things not working. But I noticed Kivy includes a build of python so I wanted to try not having to install the seperate python installer.

    I guess I can't get away with doing that?
  • edited September 2015
    Asumming you are using windows, in the folder you unzip kivy there is a "kivy-2.7.bat" double click on it and it will open a cmd where you should have python available, as well as kivy.
  • edited September 2015
    Not sure I follow. I ran the .bat which sets up the pathing and enviroment variables and so forth.

    But I didn't have an offical python available as such. But it all went through and executed.
  • edited September 2015
    If you look at the files of the kivy package in the windows version you will see that there is a python there.

    That bat file probably sets the environment to use that python and add the path to the kivy libraries.
  • edited September 2015
    Cool so based on the setup instructions, do you think the version that ships with Kivy 1.9 is sufficient to run the editor?

    If so that would remove one barrier to installing the editor for people wanting to try it without much fuss.
  • edited September 2015
    It should work. I am using it with no other packages and it works perfectly (both on my PC - win 8 - and on my notebook - win 7).

    I would love to know if anyone is having any trouble, since I assume it will work for everyone.
Sign In or Register to comment.