Author Topic: GUI based unit editor  (Read 1771 times)

MirceaKitsune

  • Technician
  • ****
  • Posts: 147
    • View Profile
GUI based unit editor
« on: 1 October 2016, 12:25:26 »
This is something I've been meaning to ask about for some time. I make custom Megaglest factions, usually based on the existing art and assets. Although I can't complain too much, I do find that it's ultimately time consuming and problematic to edit the xml files of units manually, even in text editors with syntax highlighting and other helpful tools. For one thing you must find the correct code blocks and lines to make corrections based on what you notice in-game, whereas you're also bound to cause errors that only appear when you try starting a new game in Megaglest.

Has anyone considered creating a simple GUI for editing tech trees, and including it alongside the Map Editor and g3d Viewer? I'm thinking a basic program that lets you select a tech tree, lists all of its techs and units, and offers editable fields for every variable... allowing you to delete or create units and skills and attacks, and browse for g3d files or icon graphics or sounds to be included. The program would essentially read existing xml files and update them when you save your changes, offering visual fields for what you currently have to dig up in the xml's yourself. Later on it could have extra features too... like using the g3d viewer to show 3D previews of each unit, graphs for skills, even predicting the balance between techs and letting you know how overpowered they are from one another! The editors in RPG Maker are a good example of how I'm generally imagining such a visual interface.



I understand that making this program would be a bit of work, and the developers have limited time to spend on new features. I won't complain if it can't be considered or happen anytime soon. But I will say that as a developer, I'd find it extremely helpful and useful, and consider the effort totally worth it! People would find it a lot easier to create new tech trees, we should see more content of even better quality in MG. Let me know what you think please.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: GUI based unit editor
« Reply #1 on: 2 October 2016, 22:02:31 »
Gosh, something like this totally came up before. Heck, I think even tried my hand at some rudimentary variant? And others did similar? But it's been a while and I don't remember much. I don't have any of my early work, anyway. Nothing more than about 3 years old, when I started throwing everything in my GitHub.

Anyway, I don't actually support the idea anymore. I feel like it's very unnecessary. The main issue is that making a mod is a somewhat technical thing. Yet, it's really not that complex. Put bluntly, I feel like if you can't figure out how to work with the very straightforward and reasonably well documented XML files (documented on the wiki, that is), then you're not really ready or good enough to make a mod. And I really don't care about users who just wanna edit small things. It's really not that hard to figure out how to give something more health or similar. Plus, they need a certain level of technical skill or they'll break stuff (eg, multiplayer CRC checks).

And if you want anything novel on the graphical front, that's the real technical bottleneck.

At any rate, I don't see this as adding value for anyone with good tech skills. And anyone who really needs it probably would be limited in what value they could add, anyway...
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: GUI based unit editor
« Reply #2 on: 4 October 2016, 18:54:43 »
I made one of these. Unfortunately its not MG-compatible. Its relatively simple to do though. Making the GUI is the most difficult part. I had mine included directly in the game, just like the map editor I made was. Easier than making an all new separate program. Plus if you do it in the game you can easily test it by simply copying XML loading code the game itself uses.

kagu

  • Administrator
  • Horseman
  • ********
  • Posts: 203
    • View Profile
Re: GUI based unit editor
« Reply #3 on: 4 October 2016, 19:12:39 »
Are you developing this or are you asking for help ?
If so, I am interested to get involved. I can do it with PyQt 5
Megaglest Chat
Please support:
1. CEGUI 2. In-process games 3. Registered Players
Playtime:
Every Sunday 21:00 - 01:00 CET

MirceaKitsune

  • Technician
  • ****
  • Posts: 147
    • View Profile
Re: GUI based unit editor
« Reply #4 on: 4 October 2016, 23:25:52 »
Just to be clear: I'm not saying that having to edit xml files manually is a stopper or something I lack knowledge on. It's simply something that feels like it's making things much harder than they could be. There are mainly two reasons: The first is that you need to do a lot of searching or copy-pasting, which is a rather tedious task when you have a lot of files. The second is that you're bound to make errors in the editing process, including xml syntax or file referencing... which you only notice when you start up a new game and Megaglest shows an error screen (then crashes a second later). Even when you have to edit simple values, you need to go through several long files and spot what you want buried between other values... but before that you must configure the skills and attacks of units to begin with, so you usually copy-paste and modify a lot of large code blocks.

Here's an example from my own practical experience: I copy the worker from the Tech faction in a faction that I've made. I then decide I want to give him an attack! So I open the xml of the swordsman, and I copy-paste the attack skill and attack command. Then I edit the paths to the model and icon and sounds, the files often having to be moved or copied in between directories. Then I launch Megaglest and test; I get approximately 3 errors for my unit... either because I forgot to include a model or icon or sound or particle file, or because I made a format error like forgetting to close a function with />. After that it finally starts: I test out the unit's attack, but after a long match find that it's too weak or strong in relationship to other units! So I open a dozen xml files (that of every unit with attacks) and constantly go up and down spotting and tweaking numbers like health / armor / attack speed / attack damage / etc. If for all this I could have used fields and buttons in a window, hours lost on writing functions and copying files and pinpointing values could have been spent on testing or improving other aspects.

Using an interface like GTK or QT5 (ideally the later) would definitely be best. Throw in a library for reading xml files, then simply tie certain interface elements to given xml elements! If someone already started such a project, perhaps they can share the source code and it can be ported for MG?

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: GUI based unit editor
« Reply #5 on: 5 October 2016, 06:20:34 »
Copy pasting is like 70% of new unit making. Its just a tedious pain in the ass to write all the tags and sub-tags out by hand, especially if you mistype something. When I began my current game development project where I wrote all my own code, I immediately dumped XML for plain text. There are occasionally some issues if I want to nest something where I have to write a special function to load each class of object but the actual writing of data files is immensely simpler.

What Omega fails to understand is that XML editing isn't a matter of difficulty, its a matter of "holy shit this is boring and takes forever I'd rather roll around in a nest of fire ants that type out 50000000 lines of XML for this new faction".