Improving ToEE's User Interface

Discussion in 'Community Projects' started by Gaear, Oct 27, 2011.

Remove all ads!
  1. random1

    random1 Member

    Joined:
    Dec 8, 2010
    Messages:
    93
    Likes Received:
    0
    Is the temple.dll in 6.1.0 NC the latest version of the dll?
    If not, them upload the latest to rapidshare or somewhere else so that I can patch the arial-10 references.

    Since there are tons of references, it will make things easier for both of us instead of me having to copy paste hex codes in the forum.


    No. I just patched a couple of more references that were done during game initialization, one of those were tooltips.

    Yes that was what I was asking.
    I was thinking on trying to make a change to the image files for the UI to work around that text overlap. But the fact is that it will always occur on the "next line". What I mean is, in the pic I linked the text would be 1 line in arial-10 but became 2 lines. By induction, when the text would be 2 lines in arial-10 there will be a case where it will be 3 lines... as so forth.



    On some other news... Kelly Hu :dribble: sure is hot... :pelvicthr
    (I just watched the last part of Scorpion King on tv when I was having a snack)
    oh and I'd love for an RPG with that lore and setting.
     
  2. random1

    random1 Member

    Joined:
    Dec 8, 2010
    Messages:
    93
    Likes Received:
    0
    Oh man... this one is really a big mess in terms of configuration!
    I replaced all references to "arial-10" and "arial-bold-10" and the history and some other things still use arial-10.
    I guess it will be needed to replace all those mes files with references to "arial-10"

    here is my dll: http://www.mediafire.com/?3tpoyuxa4uus0l3


    I'll also have to debug a bit more and try to see if there are dynamic references being made somehow.
     
  3. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    6.1 is technically not the latest (since the dev state one I have would be), though it's probably functionally identical. But thinking of this, I think it would be better to post all that stuff here for posterity anyway. It would suck if a few years down the line our descendants wanted to do something with this and couldn't because we didn't document anything. ;)

    I think I have fixed this issue by working around it. If the box is the problem ... get rid of the box. :p Here we see the gang chatting up Ostler's wife, with no bounding box to fudge things up - no text printed over lines, no lines at all, just a black background.

    [​IMG]

    Larger blocks of text work too - they just stack it upward. Still no box to mess it up.

    [​IMG]

    But wait! If the text prints over in-game graphics, you'll see an ugly black box behind it with no artsy bounding lines!

    No - because the background is actually now transparent, not black!

    [​IMG]

    Let's step outside and see how this looks on an outdoor map. Furnok is waiting for us ...

    [​IMG]

    Larger blocks still scan fine.

    [​IMG]

    And if you want to see the dialog history, the box reappears. Apparently the history box doesn't suffer from the same issues and scans properly. We could get rid of this in the same fashion as the other boxes if we wanted though.

    [​IMG]

    A few notes on this -

    • This would pretty much mean that we don't get cool-looking backgrounds, at least for the dialog window. Personally I don't have a problem with that. I think this transparent approach actually looks really slick and is a vast improvement appearance-wise, particularly in combination with the Priory font.
    • If you're worried that the text printed over in-game art isn't clear, it really isn't a problem. All you need to do is shift the screen around if you're having problems reading something (color or contrast issue or whatever). It's hard to show this in static images, but trust me, it's no big deal.
    • I had to tweak the disembodied dialog 'head' a bit so it didn't look like it was still hooked to the invisible dialog box. We could probably move that somewhere else if we wanted, although it might intefere with printed text if we do.
    • The dialog box is still there and is constraining the text in the same fashion; you just can't see it.
    • There are four different dialog boxes ToEE uses: the main for history, and three minis. The three minis are supposed to accomodate different amounts of text in the NPC line. I changed them all, so none of that matters now. :)
     
  4. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Can you post the dialog hover-text .dll code here like you did above, random?

    As far as font listings in the .dll go, I see looking at it with a Hex Editor that all the usual supsects are listed in plain English. The code you supplied earlier pointed to some gibberish that was not one of the plain English references. So what I'm getting at is that there are probably references in the .dll that don't control font displays ... maybe they just load fonts for other uses or something. (Hopefully you know more about that than me.) So what I'm ultimately ultimately getting at is that maybe not all font references in the .dll will have to be changed.

    I suppose the way to go about this will just be to change stuff piecemeil and see what's left over. To that end I suppose I should post all my changes here so we're all on the same page.
     
  5. random1

    random1 Member

    Joined:
    Dec 8, 2010
    Messages:
    93
    Likes Received:
    0
    :rant:

    :)

    Code:
    Find all occurences of hex string: 6A0A68D8D72610
    And replace them with:             6A0C68BC262910
    After this there were still 3 references to arial-10 that I need to patch individually.
    find:    C7442408D8D72610
    replace: C7442408BC262910
    find:    68D8D72610
    replace: 68BC262910
    find:    68EC042A10
    replace: 68BC262910
    
    Also replace all arial-bold-10 to priory-12:
    find string:  6A0A68C8262910
    replace with: 6A0C68BC262910
    
    Regarding the DLL or executables this is how it works:
    - they have a data section which are mostly string data, this data gets attributed a virtual address
    - this address is then used as a pointer, in the code section, by the several functions across the executable/DLL
    - what I patched was the machine code where all the references to the string "arial-10" and "arial-bold-10" and also another argument that was passed that is the font size
    If you just opened a hex editor and replaced the text "arial-10" with "priory-12" the game would very likely kaput because the code would then refer to "priory-12" and then assume that its font was 10pt.
    I hope that made things clearer.



    Regarding the transparent dialog box:
    Well I think some will like it, others will not.
    I'm one of those that don't :(
    The idea was to make the text easier to read, and IMHO by making the box invisible we would just be increasing eye strain (your last 2 screens are a good example) and annoy the player with moving the screen around.
    I'll see if I can fix that issue, if not then I would still prefer to keep the dialog box by either increasing the top frame or having the frames all black (so in practice it would be just a black background with no borders).



    Now for some good news!
    :evil_laug


    [​IMG]


    [​IMG]




    It's just a shame that the radial menu still has arial-10.

    oh wait! it doesn't has arial-10! It now has priory-12! [​IMG]
    It works! Everything works!

    What I did was just basically search all those .mes files in the interface and replace all arial-10 and arial-bold-10 with priory-12 (and the size to 12 too)


    BTW, do you think it would be possible to adjust the portraits so that the numerial HP fits better?

    EDIT2: could you upload the files for the inventory that you changed?
    That way I could continue to play the game with the new font :)
    (otherwise I would have to go back or play with a messed inventory)
     
    Last edited: Nov 14, 2011
  6. random1

    random1 Member

    Joined:
    Dec 8, 2010
    Messages:
    93
    Likes Received:
    0
    I update the other post with the 3 missing patches.

    But the reason for this post is: there's no longer a problem with the text overlapping the dialog UI frame.
    I've now tried it again and it no longer occurs. I guess updating the mes files font info fixed that problem.


    w00t!


    edit: AFAIK the only problem now regarding the font, and it's quite minor, is the slight overlap of the numerical HP.

    edit2: ok, the crafting UI looks bad! I don't remember if you tweaked that UI Gaer. It needs to have its width increased.
     
  7. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    :thumbsup:
    Well you're gonna have to learn to love it then, because unless you can fix the boxes' dynamic scalability via the .dll, it's either transparent backgrounds or Arial 10 point. I can't fix the boxes conventionally, and I'm frankly not really inclined to try any further when we've got a solution that basically takes care of the whole problem in one fell swoop.

    I understand that people have their own opinions and aesthetic points of view, but when it comes to this stuff we have to look at it with a different filter. In this case: Arial 10 point at high resolution is nearly illegible to many players. Priory 12 point with transparent backgrounds fixes the problem. The question should then be "Is it an effective solution," not "Do I like it aesthetically on a personal level." We're not really doing this to please ourselves (for example, I myself don't have trouble reading Arial 10 point at 1680 x 1050), we're doing it to serve the broad player base.

    I've seen the transparent background in action and I maintain that it's not difficult to read text overtop of it in-game, and that moving the screen around to improve the view if necessary is not a big deal; people move the screen around all the time anyway.

    Having just a black background is unacceptable - it looks amateurish, and we're not going to sacrifice our standards for this. If we can't do it 'professionally,' we won't do it at all.

    This is what I've been doing all along. (See all the previous images.) :p The radial menu will turn to Priory if we change the scrollbar mes file accordingly, once a help menu topic has been clicked on. But then it will turn back to Arial when an inventory tab is clicked. I'm hopeful that the across-the-board .dll changes will fix this.

    In what way? If we move it up it will cover the player faces, if we move it down it will cover the HP bar.

    I wouldn't recommend that just yet - it's not all entirely copasetic. There's still a wide variety of issues that need to be resolved, mainly with various other UIs, popup text boxes, etc., etc. Hence the one-thing-at-a-time approach here. This whole endeavor will need to be done rather precisely and methodically, given ToEE's vast number of different interfaces.
     
  8. random1

    random1 Member

    Joined:
    Dec 8, 2010
    Messages:
    93
    Likes Received:
    0
    Well I said I didn't like it because it just made it harder to read the text. Not because of aesthetics.
    In any case, that problem is now gone. So I hope we can keep the original dialog UI.


    I forgot what was working and what was not.
    The help and radial menus now seem to work fine consistently.

    In the last picture I posted it almost looks as if the HP info for the first PC is being crossed by a line.
    I think it would be better to move it a few pixels up so that it stays "inside" the portrait as it was originally.
    Given the UI functionality the player can enable/disable the numerical HP info if he feels it's obstructing too much of the PCs' faces.


    I wasn't asking for the UIs to be released to the general public.
    I was just making a request for the inventory UI files so that I can continue playing the game. You can even consider me as beta tester in that regard :)
     
  9. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    [this started life as an [edit]]

    I updated the .dll with all your code, thanks. :thumbsup:

    I see what you mean about the dialog boxes now - they seem 'auto-fixed.' That must have been a feature of something in the .dll though, because I've had the mes files changed for like a week already and nothing had changed. At any rate, there is still an issue: in cases where there is what would have been a full box-full of Arial-10 text in the largest 'mini' size dialog window (this is not uncommon in my longwinded NC stuff), the text still goes outside the box on the top. This can be fixed instantly by the transparent background solution, or I will be made miserable for months to come by having to go through all of the too-long dialog and shorten it line-by-line, adding tons of new shorter lines everywhere.

    I see - that sounds okay.

    As they say at Codex, "Bro," this is what I've been saying all along. ;) There are UIs all over the place that will have to be changed. I noticed like a half dozen just going through the start a new game routine.

    This will be doable and well worth the effort, but it's going to take some time and innovation, and I fear that the transparency bugaboo must needs get involved again at some point. :X

    Okay, here it is (just the character ui). Extract to data/art/interface.
     

    Attached Files:

  10. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    Personally, I very much like the fancy box background and would be sad to have it not happen.

    In practical terms, having no background makes it difficult to see on the map, eye strain and whatnot. Also, with a transparent background, it starts to look like floating dialogue instead of something that you should be clicking on, confusing newer people.

    The whole point of the dialogue box background is to make it easy to see the text (problem 1 above) and show the player that there is in fact a big deal to it (problem 2). Without, the text there just seems unofficial, like an afterthought.

    And yes, the fancy new background looked super cool and I hope it can happen.
     
  11. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Are you guys really serious about this? And if so, is it the same for all the shots above?
     
  12. random1

    random1 Member

    Joined:
    Dec 8, 2010
    Messages:
    93
    Likes Received:
    0
    Gaer,
    about those long lines of text, the biggest ones break to 5 lines in the game dialog UI, right?




    I was able to increase the dialog box size by editing the TGA files of dialog_backdrop_mini_3*

    However, it's not working properly yet because the game engine decides to shift the box bellow (so it covers a bit of the portraits) :rant:
    The TGA coordinates and corresponding img file seem to be correct.
    So I suspect there must be a mes file which defines the starting coordinate to start rendering the box (it uses that coordinate as an origin and the referential points to the lower of the screen) which at this time is configured to the old dialog_backdrop_mini_3 file dimensions.
    mmm... or maybe it isn't on a file and it's done dynamically :-|

    edit: alternatively, considering that when I changed the mes files font and font size info that resulted in an automatic increase of the UI, maybe it would also be possible to give it a fictitious size (eg: 16) so that it increases the necessary.
     
    Last edited: Nov 14, 2011
  13. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    It'll actually go on to infinity ... you can put as much text in an NPC's dialog file as you want. The game just stacks it upward (and overtop the bounding box, into the game field, and everywhere else) indefinitely, using the largest mini background once you go beyond a ceratin point. The problem of course is that we've been guaging the dialog text based on Arial 10 all along, not Priory 12, and Priory takes up more space.

    I've been through all that stuff quite a bit already and have yet to find a working solution, but if you can, by all means go for it. If there is none, we're left with either me truncating all the over-long lines in the entire dialog folder or going with the transparent background.

    One thing is certain: we're going to have to innovate and think outside the box with some of this stuff, because for some things there is no clear solution. As an example, last night I started working on the alignment UI for character creation (the first box that pops up after you select new game). Priory 12 text (for "Chaotic Neutral," etc.) goes outside the alignment buttons, so the boxes have to be enlarged. That's not too terribly hard for the background, but hold on!! - ToEE draws the buttons themselves (select, hover, normal, etc.) into the boxes 'dynamically,' so lengthening the .tgas for them doesn't work. Result: we need to figure something else out (e.g. innovate). But if we're getting hamstrung by people rejecting various resulting forms of innovation due to them not floating their boat personally or worrying over a change to something they're familiar and comfy with (because people are generally afraid of change), this whole project will never really get off the ground. :shrug: (I'm not pointing the finger at you with that; it's moreso a general norm that people tend to embrace.) That would be a shame, because we'd basically be telling all the players who suffer through Arial 10 point to go f*ck themselves just so we can keep wearing our comfy slippers. That's where I'm coming from with the 'big picture' point of view.
     
  14. TheLadiesOgre

    TheLadiesOgre Member

    Joined:
    Dec 15, 2008
    Messages:
    47
    Likes Received:
    0
    @random1

    I was wondering something similar, you wouldn't happen to have found a way to allow currently disallowed resolutions such as 1920x1200 have you?
     
  15. random1

    random1 Member

    Joined:
    Dec 8, 2010
    Messages:
    93
    Likes Received:
    0
    But when the game was using arial-10 what was the longest number of lines you saw on a dialog?
    I'm not sure of how dynamic this thing is because in the DIALOG dir there are 3 variations of the dialog_backdrop_mini_ TGAs, so it would point out to a max limit on the number of lines a dialog sentence can have.
    With that said I was wondering if I could get it to work with, let's say, 5 lines that it could be a reasonable solution to the problem. Not that I have.


    Regarding the character/party creation, if that's possible maybe that part could be kept using arial-10 or arial-10-bold?
    Since party creation is just an infinitesimal part of total gameplay, maybe it can be endured.


    :)
    Haven't looked. Haven't seen it.



    EDIT: Ok, it seems ToEE is exactly expecting 3 versions of the dialog_backdrop_mini_ files. So I don't think it's dynamic in the sense that it would allow for unlimited text in the dlg files and the engine will break it nicely.
     
Our Host!