Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DF RawEditor Preview  (Read 1252 times)

Caldfir

  • Bay Watcher
    • View Profile
DF RawEditor Preview
« on: October 19, 2010, 08:39:15 pm »

THIS IS INTENDED AS A PREVIEW ONLY.  NOT YET READY FOR YOUR MODDING NEEDS.  PRESENTED HERE FOR COMMUNITY FEEDBACK.

Hi everybody.  I've been super bored over the past few weeks, so I finally started a project I've been meaning to get to for quite some time.  Introducing:

DF RawEditor
**Preview v0.00a**
Spoiler (click to show/hide)

This is a just a small sample program that parses some (slightly modified) RAW files, and presents them in a graphical interface.  Its current incarnation has little real functionality, but I thought I'd drop it by all the same so that people could see what I've been up to.  See if anyone cares.  It's likely I'll be slightly ripped into for having programmed it in Java (which means that you'll need the latest version of the JRE to run it), but it's mainly because I'm a terrible programmer, so yeah, rip away. 

Extract all the files into some directory (as they appear - don't remove anything from the 'ParamFile' folder), and run the executable, and you should get a screen to popup with a tree navigation-type thing on the left.  Clicking on an actual raw entry will bring up a tab containing the contents, which you can edit.  There is not yet any save functionality. 

Intended Future Functionality: (crossed out means ready for next release, but not in current)
  • save changes to files
  • be able to open unmodified DF raw files
  • open more types of DF raw files
  • display color information
  • display tiles
  • identify and compare duplicate raw file entries
  • link between related entries (like from a creature with bones, to the bone material definition)
  • support for sub-entries
  • some minimal raw-related debugging aids

Long-Term Goals:
  • UI for creation/display of body parts for creatures

Let me know what you think. 

« Last Edit: November 13, 2010, 11:44:58 am by Caldfir »
Logged
where is up?

Caldfir

  • Bay Watcher
    • View Profile
Re: DF RawEditor Preview
« Reply #1 on: October 19, 2010, 08:39:32 pm »

reserved
Logged
where is up?

Halnoth

  • Bay Watcher
  • Plan for the Worst. Hope for the Best. Have Fun!
    • View Profile
Re: DF RawEditor Preview
« Reply #2 on: October 19, 2010, 10:16:58 pm »

This looks badass. I know next to nothing about programing so whenever I have to change something in the RAWS I feel like I am swimming in pudding. I have sort of gotten the hang of it but it is hit or miss with changes as I make them based off of what I read here and not out of any actual understanding.

This sort of interface would make the entire situation much much easier.
Logged
One of the dwarfs walked in front of Thor to get a better view of the prye, and Thor kicked him irritably into the middle of the flames, which made Thor feel slightly better and made all the dwarfs feel much worse.

Cloth Armor Mod http://www.bay12forums.com/smf/index.php?topic=158967.msg7063531#msg7063531

Untelligent

  • Bay Watcher
  • I eat flesh!
    • View Profile
Re: DF RawEditor Preview
« Reply #3 on: October 19, 2010, 10:40:32 pm »

The raws aren't really programming, it's like sticking a bunch of fridge magnets to a fridge. With your keyboard.
Logged
The World Without Knifebear — A much safer world indeed.
regardless, the slime shooter will be completed, come hell or high water, which are both entirely plausible setbacks at this point.

Halnoth

  • Bay Watcher
  • Plan for the Worst. Hope for the Best. Have Fun!
    • View Profile
Re: DF RawEditor Preview
« Reply #4 on: October 19, 2010, 11:51:55 pm »

The raws aren't really programming, it's like sticking a bunch of fridge magnets to a fridge. With your keyboard.

Sure it is sort of like that. I guess it would be easier to see through all the [...] and / and < and blah blah blah layer 0,0,0 if you had some rudimentary understanding of programing or how games function at least.

In any case this interface (once/if completed) would cut through all that.
Logged
One of the dwarfs walked in front of Thor to get a better view of the prye, and Thor kicked him irritably into the middle of the flames, which made Thor feel slightly better and made all the dwarfs feel much worse.

Cloth Armor Mod http://www.bay12forums.com/smf/index.php?topic=158967.msg7063531#msg7063531

Caldfir

  • Bay Watcher
    • View Profile
Re: DF RawEditor Preview
« Reply #5 on: October 20, 2010, 12:40:58 am »

the real advantage I'm trying to add is that the program dynamically creates a library of allowed values for a token from the set of existing tags (for tokens that may only be one of a set of predetermined things) - ideally this means that you don't have to go to the wiki and look up the stringdump every time you want to know what variables you're allowed to cram into a particular space, because the dropdown boxes have them all

also the program wouldn't accidentally let you do something dumb like type "S00" in stead of "500" - which is another form of error checking, that might not make raw modding easier, but would probably make it faster

in practice it might not turn out quite that well, but who knows
Logged
where is up?

Dr. Melon

  • Bay Watcher
    • View Profile
Re: DF RawEditor Preview
« Reply #6 on: October 20, 2010, 05:11:54 am »

The raws aren't really programming, it's like sticking a bunch of fridge magnets to a fridge. With your keyboard.

Sure it is sort of like that. I guess it would be easier to see through all the [...] and / and < and blah blah blah layer 0,0,0 if you had some rudimentary understanding of programing or how games function at least.

In any case this interface (once/if completed) would cut through all that.

I find that the raws are more like configuration files, much less like programming. For example, .ini files can come quite close.
Logged

MaximumZero

  • Bay Watcher
  • Stare into the abyss.
    • View Profile
Re: DF RawEditor Preview
« Reply #7 on: October 20, 2010, 06:42:50 am »

Ooooh, shiny. Looks good, bro, keep up the good work.
Logged
  
Holy crap, why did I not start watching One Punch Man earlier? This is the best thing.
probably figured an autobiography wouldn't be interesting

Chromasphere

  • Bay Watcher
  • UUUUU,.,..,..,U,.""T"T"T"T""T
    • View Profile
Re: DF RawEditor Preview
« Reply #8 on: October 20, 2010, 10:22:16 am »

Looks interesting.
Logged
"I saw the best minds of my generation destroyed by tantrums, starving hysterical naked,
    dragging themselves through the dwarven streets at dawn looking for a helpless cat"-Vaftrudner

"We aren't customers or investors - we're spectators tossing donations into the coin box while watching someone build their work of art"-Psieye

Eagleon

  • Bay Watcher
    • View Profile
    • Soundcloud
Re: DF RawEditor Preview
« Reply #9 on: October 20, 2010, 11:22:15 pm »

No shame in using Java for this. Actually it's a better choice IMO than .net or similar. Feels good not having to deal with ridiculous cross-platform idiosyncrasies. DF is a multi-platform game, with a multi-platform community.

I'm getting some index-out-of-bounds exceptions from graphics.RAWFrame.addButtonTab(157) and graphics.RAWFrame.valueChanged(RAWFrame.java:121) Is this normal? Might just be my messed up installation.

Head in the clouds idea for the future: use the JGraphT library to allow simple visual editing of body definitions :D Push the bodyparts into a tree, adding branches and connections as you walk through them, and then visualize it using JGraph - it will automatically space-distribute the nodes for you, and render them how you like. It's surprisingly straightforward to use once you learn a bit of the terminology. Body/tissue definitions are definitely a major barrier for most people getting into DF modding that want to create custom creatures. A tool to at least show the immediate effects of their tinkering would be a godsend.
Logged
Agora: open-source, next-gen online discussions with formal outcomes!
Music, Ballpoint
Support 100% Emigration, Everyone Walking Around Confused Forever 2044

Caldfir

  • Bay Watcher
    • View Profile
Re: DF RawEditor Preview
« Reply #10 on: October 21, 2010, 11:32:10 am »

I'm getting some index-out-of-bounds exceptions from graphics.RAWFrame.addButtonTab(157) and graphics.RAWFrame.valueChanged(RAWFrame.java:121) Is this normal? Might just be my messed up installation.

OK - I found the offensive code and fixed it.  Thanks for the heads-up.  It will be next time I update the file

The concept for body definition trees is an interesting one.  It is certainly doable, however it'll be a little while before I get the basic features of the current editor working.  I'll add it to the list of desired features. 
« Last Edit: October 21, 2010, 11:39:39 am by Caldfir »
Logged
where is up?

Ockad

  • Bay Watcher
  • Take a look at my fine wares!
    • View Profile
Re: DF RawEditor Preview
« Reply #11 on: October 26, 2010, 07:41:00 am »

Excellent.
If you are serious with this, then it'd be even more excellent beyond excellent.

Especially the feature to display tiles, as it is hard to find it out currently. I support you.

Caldfir

  • Bay Watcher
    • View Profile
Re: DF RawEditor Preview
« Reply #12 on: November 13, 2010, 11:42:47 am »

OK, after a difficult (but mostly worth it) rewrite of the file reader and string parsers, at the very least I have gotten back to the point where things were working before.  The rewrite reduced the lines of code required by about 400, and should improve memory performance by a factor of n or something. 

After that I got to work on figuring out the biggest hurdle so far - the handling of sub-entries (like how there are caste-level tags that affect a sub-entry of a specific creature - the caste).  The solution I came up with ended up being not TOO ugly, and I think it should work.  It's all in place, but needs some testing. 

Before I can get to any of that though, it has finally come time that I need to make a comprehensive DF raw tag database.  If anyone knows if toady has already released such a thing, then I would be glad to see it.  Otherwise, I'm going to just be slogging through the raws for the next couple weeks carefully documenting each new type of tag.  Luckily, because of the way the program reads the raws, the tokens (that is: [tag:token1:token2:etc.]) do NOT need to be input into any files, since they are simply read and documented as the program runs.  Once I get a better handle on linking tags to other tags however, this may end up changing. 

Oh, also, the entire database ends up being a bunch of linked lists that are held together by other linked lists - some of that should probably be changed to trees at some point so that when processing the whole DF database the program doesn't end up with an embolism. 
Logged
where is up?