Jump to content

GUI for editing units?


MirceaKitsune
 Share

Recommended Posts

This is something I've been wondering for a while now. I had plans to play around with making custom factions, either using the models / sounds of the default ones in a custom setup or even unique assets from other mods if anyone has any to share. So far I've briefly played with modding to change a few default functionalities as a mod, I'm aware you do it by editing or creating json files for units. Of course doing so manually in a text editor can be harder and more time consuming... thus I was wondering: Is there a GUI to facilitate unit editing and creation?

ii0Vygu.png

I was thinking something similar to the character editor in RPG Maker: You pick an unit (building, soldier, trooper) and have fields to easily edit all the basic features... icon, health, armor, upgrades you can research, unit cost and upgrades required, build restrictions, territory decay, etc. Same with aura and upgrade and such definitions. It could even be expanded to define custom resources or the parameters for random maps!

I'm not aware of such a thing existing at this time unfortunately; Depends on whether anyone considers it worth it enough to make one, personally I'd find it very useful especially if it had stuff like previewing the models. It would probably be easy to do as a Python script since there's libraries for both Qt and GTK to define an UI... this could also be made into a component of the Atlas map editor which could make more sense, even editable from Pyrogenesis itself which would allow realtime previewing though this could be more complicated.

Link to comment
Share on other sites

2 minutes ago, Stan` said:

Sadly there isn't. The only tools we have are the actor editor and my C# version https://github.com/StanleySweet/0AD-Actor-Viewer

I suppose the templates change too often for it to be easy to do .

Yeah the fields would need to be kept up to date. What was the original actor editor? A good design idea might be to keep the fields easily editable in the GUI software, so things can be quickly updated without having to recompile everything or do massive restructuring if a unit field changes.

Link to comment
Share on other sites

8 hours ago, MirceaKitsune said:

Yeah the fields would need to be kept up to date. What was the original actor editor? A good design idea might be to keep the fields easily editable in the GUI software, so things can be quickly updated without having to recompile everything or do massive restructuring if a unit field changes.

It's next to the pyrogenesis executable, in your installation folder.

Fields are easily editable, the issue is more the validation and the addition of new fields.

E.g image fields are just text field.

  • Thanks 1
Link to comment
Share on other sites

  • 1 year later...

I had been thinking about something; Not a thing I'm likely to do myself especially as I haven't modded 0 A.D. yet, but I was at least wondering if it's possible. What would stop us from having this as a mod? Unit editor mod: When enabled you open a special menu which lets you edit units during a game and apply changes!

I presume the biggest obstacles would be realtime asset loading and hot reloading of unit settings. The former would likely be manageable, you'd just get stutter when loading an unit that wasn't already precached at level start... the later would require being able to change the stats of existing units as well as add or delete them during a match, this would likely be complicated as the engine wasn't designed with that in mind: You may be able to change the health / attack / defense of existing units but probably can't define new ones, not to mention making then use different icons / models / sounds whereas things like new command icons appearing on existing units would also be a problem (eg: I defined a new soldier and want it to appear in the barracks the moment I hit Apply). Other than that I presume no sandboxing system forbids a mod from saving changes to a unit json like a text editor would, so you could do edits in fields and have the menu translate them to text and update that unit file.

How far would such a system be able to get right now? What engine changes would be required to support such an unconventional idea? Even if the engine didn't have obstacles I doubt someone would put time into this... unlike Minetest I never made mods for Pyrogenesis but am familiar with JavaScript so if I had a base example maybe I could do the fields? Imagine how awesome it would be though, having an in-game menu to edit units with immediate effects while a match is running... we could even give it multiplayer support to have collaborative game design! Probably just a dream but a nice one to have :)

Edited by MirceaKitsune
Link to comment
Share on other sites

Currently templates are not reloaded until you restart the game. You can however use the modifiermanager component to add modifications at run time to specific units using JS. Kinda like fake techs.

You can technically create new files using the engine, but the paths are restricted, so you might not be able to create the XML files. Another thing to have in mind is you cannot write in the public.zip mod so the files will probably end up in /Documents/My Games/0ad/mods/user or some analoguous path.

Do note however that you will break the replay and make it unusable.

 

There was also this by wraitii.

https://mod.io/g/0ad/m/balance-test-mod

https://github.com/wraitii/balance_test_mod

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...