r/truetf2•
TimePath

WYSIWYG HUD Editor - Coming Together

Beta thread

Current version - permalink to the latest version

Currently working on: Image loading (the pictures you see on your HUD). If anyone has information regarding what happens after the first 64 bytes in a VTF file, or VMT files, please share :)

Since my last post here, I've been focused on the UI and in turn user experience. As such, I have added a bunch of non-functioning menu items to try and get a feel for how I want it to look. I have also further optimized the methods which draw components on the screen, but they still aren't completely accurate, nor do I claim them to be. Still to-do: text, images. Ideas for UI design welcome.

To get them to be accurate, I have to load vtf files from the game itself. To load the vtf files, I have to load them from the gcf files... Would it be unreasonable to include those files in the editor, at least until I can implement loading of the local gcf and vtf files? The file size would jump at least 20mb higher from the current <64kb, and I really don't like the thought of that for multiple reasons: updates changing or adding things, more to download/upload when something is updated.

Also included is an auto-update feature. Note that this feature can be buggy sometimes and overwrite the editor with a bogus copy - you will have to re-download it manually. I will try to push a minor update out at least every 48 hours with at least one visible feature.

I have started writing the code to deal with saving your modifications, but I think I will have to re-design a few things internally to make it function correctly.

Planned interface additions:

  • Making the properties table content-sensitive. i.e, if the value is a colour, show a colour chooser.
  • Drag and drop palette (labels, images, coloured rectangles)
  • Making everything work :P

So.. opinions/thoughts on interface design? Please don't just vote and move on..

Posted Oct 23, 2012, 10:19 AM UTC · edited

7352
meffijScout•

For the vtf resources you could make them a separate download that you didn't update as much so that every update to your program didn't require users to redownload resources. They could just unzip to a specific directory.

11
TimePathOPEngineer•

Wow, why didn't I think of that? >_< Now I won't feel so bad for packaging them as raw images.

8
secondgenesisSpy•

This is a good fallback solution for as long as you need to avoid reading them from the game itself. From one programmer to another, what is the downside of reading the files from the local game installation?

3
meffijScout•

Just a stopgap to tide the program over till it can read from the game files. Seems like the project goals would suggest pursuing a working interface before implementing reading the game files. In addition, putting the files in a directory in the installation allows the user to drop in their own files in a similar way and have them implemented consistently by the program, if anyone wanted to do that.

2
TimePathOPEngineer•

Not that many would be overriding those - they don't work on sv_pure.

2
meffijScout•

Then where do custom frames and stuff for the hud end up? Sorry if I have no idea what i'm doing...

2
TimePathOPEngineer•

If I read from the game itself, I don't have to manually update whatever is new. Meaning I won't get yelled at to update it after a major TF2 update ;)

2
secondgenesisSpy•

I may have misspoke. I presume that is the upside of reading the files from the local game installation as opposed to some other source. I just wasn't sure if there was some sort of computation or complexity downside to that to make it not considered as an initial solution.

1
TimePathOPEngineer•

I just wasn't sure if there was some sort of computation or complexity downside to that to make it not considered as an initial solution.

The complexity is that I have never worked with those file formats before, and they would take a while to implement which would mean less progress elsewhere. It is just me working on this too...

1
GoogaNautGodJoKOR, Aspiring 6v6 Demo -•

Sorry for asking, this may sound dumb.

Is this a HUD or an add on for any HUD? Like quality of life improvements and stuff?

5
[deleted]•

It's a HUD editor. I haven't checked it out yet but the idea is that you can create your own custom HUD in a way that normal people can understand.

10
TimePathOPEngineer•

In a way that normal people can understand.

Normal people being: I know which file I want to change, but I can't visualise numbers.

Don't worry though - I'm in the middle of working out a system to make knowing what files to edit easier. In the end, you won't even know what files you're editing, they'll just be there!

6
secondgenesisSpy•

It's looking nice so far. I think once the canvas is more functional the rest of the user experience will come together. For right now, the operations available from the menus seem comprehensive enough. When this is actually released, it might be good to post a youtube video of yourself using this tool in some simple examples and reference the video in the help menu. Also, just want to point out that the key/value/info table's first row is always \n/null/\n.

Some additional usability suggestions:

  • Perhaps include an import from zip file features. Most huds are downloaded as zip files and then extracted directly into the installation directories, so it requires an additional step from the user to extract the hud to a working directory before using your tool.
  • Add validation to the resolution changer to ensure the user selects a valid game resolution, or better yet, build a replica of the game's resolution change controls so the user is guaranteed to select a valid resolution and more likely to quickly and easily choose the resolution that matches the one they use in game. Going one step farther, you can attempt to automatically detect their in game resolution (not sure if this is made accessible in config files or not).
  • When the update check is complete, having the correct version should not cause an error dialog telling the user they have the latest version. Attempting to actually update would perhaps trigger an error condition, but simply checking for updates should result in a success since the update check didn't fail. This might confuse some users.
  • Not directly related to usability, but from past experience, undo/redo are very crosscutting features, and if they are not implemented early, they will require significant refactoring later on.
  • For more of a wysiwyg feel, you can try allowing the users to select a few hudless in game images to set as the background instead of a blank canvas and as the hud is updated, populate data fields within the hud with dummy data from whatever might have been going on in the game (or better yet, allow selection of dummy data from presets including low health, high health, overheal, low ammo, high ammo, low cloak, etc). Moving bounding rectangles around on the screen is a good first step, but even after those rectangles may include images, it still will not be entirely wysiwyg until you don't feel like you need to test it in game after every significant change.
  • Dual monitor support would be nice. Many people playing this game will have multiple monitors, and if they set the canvas resolution to their game resolution, the canvas will not fit entirely into the editor window (sometimes it scrolls correctly, other times it just leaves a bunch of black space which may or may not be a result of your code). Dual monitor support could be achieved by allowing the canvas to split off into its own window and keeping the toolbar and editor context in a separate window. The canvas window could be placed full screen on one monitor, and the editor window in the other. Moving a JPanel from one window to another is quite simple, so this could be an easy option to implement off the view menu.

I may come back to this thread when I think of a few more. Good work so far, though. This could be quite a project.

5
TimePathOPEngineer•

This is the stuff I wanted to hear :)

Just want to point out that the key/value/info table's first row is always \n/null/\n.

Oops, that should be hidden ;) I'm saving new lines so I can write the hud back the same way I found it, in case some poor soul wants to manually edit it.

Perhaps include an import from zip file features

Sure, will be in the next update.

Add validation to the resolution changer to ensure the user selects a valid game resolution, or better yet, build a replica of the game's resolution change controls so the user is guaranteed to select a valid resolution and more likely to quickly and easily choose the resolution that matches the one they use in game. Going one step farther, you can attempt to automatically detect their in game resolution (not sure if this is made accessible in config files or not).

I did consider using a combo box, but I didn't know what to put in it so I went with spinners. I'll give it another look. I already detect the current aspect ratio on startup, so it's feasible.

When the update check is complete, having the correct version should not cause an error dialog telling the user they have the latest version. Attempting to actually update would perhaps trigger an error condition, but simply checking for updates should result in a success since the update check didn't fail. This might confuse some users.

I probably shouldn't be abusing my error method like that.. I'll change the icon at least, and this function will be more polished as time goes on. For now, I just need it to work.

For more of a wysiwyg feel, you can try allowing the users to select a few hudless in game images to set as the background instead of a blank canvas and as the hud is updated, populate data fields within the hud with dummy data from whatever might have been going on in the game (or better yet, allow selection of dummy data from presets including low health, high health, overheal, low ammo, high ammo, low cloak, etc). Moving bounding rectangles around on the screen is a good first step, but even after those rectangles may include images, it still will not be entirely wysiwyg until you don't feel like you need to test it in game after every significant change.

The initial code was actually using a background from in-game. I removed it because I wasn't scaling them correctly. I'll add a few of they'd be a good addition. The levels of elements such as ammo and charge will get done when I start actually rendering things :)

Dual monitor support would be nice. Many people playing this game will have multiple monitors, and if they set the canvas resolution to their game resolution, the canvas will not fit entirely into the editor window (sometimes it scrolls correctly, other times it just leaves a bunch of black space which may or may not be a result of your code). Dual monitor support could be achieved by allowing the canvas to split off into its own window and keeping the toolbar and editor context in a separate window. The canvas window could be placed full screen on one monitor, and the editor window in the other. Moving a JPanel from one window to another is quite simple, so this could be an easy option to implement off the view menu

I'll look into dual monitor stuff.

3
TimePathOPEngineer•

I've implemented most of these changes; except for loading from a zip, validation of user input, and dual monitor support floatable canvas.

I'll need to do some refactoring to load from zipped archives, validation is a little more challenging than I initially thought, and I'll do some dual monitor stuff when I can get access to another one - hopefully soon.

I also implemented automatic updating on startup, these changes should be available from the menu in the version you already downloaded if you feel like testing that.

2
secondgenesisSpy•

That's some pretty quick work. Well done. The update feature worked smoothly, although I was a bit curious for a second as to whether a dialog would pop up to notify me of completion or if there was or wasn't another mechanism I would be notified by. Since you probably don't want the user messing with the program files while the new version is being downloaded, you might consider just using a modal popup/message window with a progress bar. Also, I wasn't sure if the changes would take effect immediately or if I needed to restart the program, so I just restarted it. On restart I was greeted with an up to date version dialog, which was a good notification, but perhaps a status bar would be a less intrusive place for it. Just a minor tweak, though, and one person (myself) is not really a representative sample for a usability survey/test on that sort of thing.

The background image addition looks nice and scales well. The data grid/jtable looks cleaner as well. And you've got to love the changelog message of "added this changelog window". :)

Something else I'm noticing now is that after scaling the drawing panel to 1024x768 and adding a box element to it, dragging and dropping the element on the canvas results in an exponential increase in distance between the cursor and the box. They start off together, but the further you drag, the further ahead the window gets of the cursor. Further testing finds that the closer the resolution is to the default on startup, the less this effect is realized, and the larger the resolution, the larger the distancing effect. A similar effect happens when decreasing the resolution from the default. This appears to be an issue where the scale factor is not taken into account with the drag and drop coordinates. Additionally, rescaling the canvas after boxes are already drawn resulted in a box ending up off the canvas once for me (I could not reliably reproduce this issue, so it may be irrelevant). One last note about the resolution changing is the spinners will rarely be used because of the range they will have to cover between resolutions and the time it will take. This point just contributes towards the earlier discussion of refactoring that view a bit.

In general, good work. I'm impressed with how quickly you pushed this update. You must be spending a decent amount of time on this.

1
TimePathOPEngineer•

You might consider just using a modal popup/message window with a progress bar. Also, I wasn't sure if the changes would take effect immediately or if I needed to restart the program, so I just restarted it.

In future, this will work better with a progress bar, a restart prompt and some failsafes.

Perhaps a status bar would be a less intrusive place for it.

Java doesn't actually have a swing component for a status bar - but I can always make a look alike out of a JPanel. I was already going to have one for displaying mouse coordinates, but placing notifications down there seems like a good idea too.

And you've got to love the changelog message of "added this changelog window". :)

That's actually loading a webpage, so I can update that without updating the editor. It can take a while to load sometimes though, so I might prefetch it.

Dragging and dropping the element on the canvas results in an exponential increase in distance between the cursor and the box. They start off together, but the further you drag, the further ahead the window gets of the cursor.

This bug has been around for a while - I'm still not sure how best to approach it, but it is something I will take another look at soon.

Additionally, rescaling the canvas after boxes are already drawn resulted in a box ending up off the canvas once for me (I could not reliably reproduce this issue, so it may be irrelevant).

Never had this happen in testing before..

One last note about the resolution changing is the spinners will rarely be used because of the range they will have to cover between resolutions and the time it will take.

You can type numbers into them, but I'll certainly add a combobox above them with some defaults.

1
OutrightVillainy•

Quick question: I've heard that some custom huds allow you to get a visual indicator when you do damage by changing the crosshair (instead of dinging), would this be supported? That's pretty much the only thing I'd like to change in my hud to be honest!

3
TimePathOPEngineer•

Hud animations are planned but currently unimplemented.

5
OutrightVillainy•

Thanks, good to know!

2
Killer_TomatoMedic•

if you use a hud crosshair you can easily do this by adding in some lines in the event damaged player. I have a yellow + with a white circle normally but when I hit someone the inside of the circle fills red.

event DamagedPlayer
{
//==========================DAMAGE COLOUR CROSS====================================
Animate CrossHairCircleFilling FgColor "255 0 0 225" Linear 0.0 0.00001//color when hit
Animate CrossHairCircleFilling FgColor "255 215 0 0" Linear 0.15 0.1//back to invisible but fades to crosshair color
}

If you want the crosshair to flash and not just the filling then replace another hud crosshair with the contents of the one you are using. Then use the replaced crosshair name. That way it wont fade away it will just flash. Also make sure to make the flashing crosshair have a high zpos than the other one otherwise it wont show.

2
OutrightVillainy•

What's a hud crosshair, a crosshair from a custom hud? Can this be done with any of the default crosshairs? I use the small red dot, but if I could get a crosshair change, I'd probably change it from a horizontal-vertical crosshair to diagonal on hit. Thanks for the info anyway!

1
Killer_TomatoMedic•

A hud crosshair is a crosshair that comes with a custom hud. Some of them change color with your health or are shapes not available from default. You can do this with the default crosshairs but it wont replace them just flash over or around them.

1
SporkVSpy•

Love the idea, but downloaded it, and I cant figure out how to use it?

I think I get how it should work, but how do I actually import HUD elements?

1
TimePathOPEngineer•

File > open. What did you try? I'm going to add an 'open archive' there as well so you can open zip files and such. I might also make the whole thing drag and drop so you can just drop your hud on it and it will load.

1
SporkVSpy•

open what though?

ive never built a tf2 hud before

EDIT:Nevermind, figured out I need to open a custom HUD, but when I double click on stuff, but only an outline of a box pops up, nothing else to show how it looks.

is it just not possible to open the default HUD?

1
TimePathOPEngineer•

but only an outline of a box pops up, nothing else to show how it looks.

is it just not possible to open the default HUD?

I need to implement some other file formats (vtf, gcf) to display anything other than boxes and to load the default hud, but I'll bundle the images and default hud in the next major update.

0
SporkVSpy•

awesome, I look forward to giving it a try

1
[deleted]•

[deleted]

0
TommmmmSoldier•

I haven't actually checkd this version out as I'm on mobile but do you plan on adding a background like a screenshot of the game, instead of a gray screen, to check how it will actually look? You could maybie add a few different locations to check how it looks on dark/light backgrounds.

Sorry if you have actually implemented that, just ignore me if so and keep up the good work :p

1
TimePathOPEngineer•

Next update will include a few backgrounds to look at - probably taken from r/TF2

EDIT: Took one from the wiki of badlands

1
[deleted]•

[deleted]

1
TimePathOPEngineer•

Do I need TF2 installed to be able to use it?

I was unable to do anything with the program.

No, just hud files from a custom hud. The program doesn't have anything bundled with it, so you have to load from somewhere else. I'll add some default resources to it in a future update.

2
[deleted]•

[deleted]

2
TimePathOPEngineer•

The list on the right hand side has clickable nodes - most of the green ones are displayable.

1
[deleted]•

[deleted]

1
juanceeMedic•

I feel stupid for asking, but how do you use this? As in, execute the file? Sorry for the complete noob question, but this seems pretty neat and I want to learn to use it.

1
TimePathOPEngineer•

It requires java to be installed. Simply double click it and it should open. If not, post back.

1
juanceeMedic•

So I got Java (rather, had it apparently) and opened it up to get this. Where do I go from here? Do I look for resources and scripts from the tf folder and open them up? Thanks again for the help :)

1
TimePathOPEngineer•

If you aren't already using a custom hud, it won't be in your tf folder. Currently loading the default hud is unsupported, but it loads custom ones. Also, what OS is that?

0
juanceeMedic•

Thanks for the help, I've successfully loaded it. I think so anyway.
Also, the OS is Windows 7 but I use a shell skin and custom icons. If you want, I can link you to it.

1
aido727AU UGC Highlander Soldier•

That OS is a visually modded Windows 7 ;)

1