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
    That's awesome! Feel free to post some screens of the ongoing work.


    BTW, I was wondering how exactly will the new interfaces and font work?
    You were able to increase the font size by changing the font, which differs by 2 or 3 pts if I'm not mistaken.
    And now you're working on the interfaces.

    So if this is doable, then in principle it should be possible for the player to choose from a couple of different "resolutions" (fonts + UIs) from the T-X launcher correct?
    This would "just" require using another font (or making one if needed) and using different UIs files. Is this correct or is it too soon to tell?

    Thanks
     
  2. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    I don't know that we'd add options to TFE-X, probably just add it all in to the regular mod. It would be automatic.

    I'll have some new revelations soon ... not all of them good. :(
     
  3. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Okay, here's the bottom line:

    What we can do:

    • Change the font for various interfaces as seen in the images above to a larger, more stylish, existing font, namely Priory. Noteable interfaces where this can be done:
      • the logbook, minus the combat section of the ego tab
      • the worldmap and the townmap
      • hover text (not the hovering dialog window)
      • character ui item, skill, feat, and spell descriptions
      • various aspects of character creation
      • popup or 'alert' boxes like area descriptions
      • maybe some other aspects of the character ui (stats, etc., with some fiddling)
      • other pissant interfaces
    • Add nice-looking backgrounds to the various printed text interfaces
    What we can't do:

    • Add new fonts. Tried this many ways and new fonts don't get recognized.
    • Replace existing fonts. Tried this many ways and the replacements don't get recognized.
    • Because of this, and being as there are no separate control files for the regular dialog interface, we can't mod the dialog text. It seems our predecessors were right and the dialog font/function is hardcoded. The fact that override measures are fruitless likely means that the game is not actually looking at the installed fonts folder to get font info. Sorry.
    • Change the font for the Help system. Actually we can, but as some other guy discovered some time back, doing so causes the radial menu and bottom right menu hover text to turn into the new font as well. This wouldn't be a bad thing if it was like that from the outset, but it only becomes that way after accessing a help hyper-link, and it turns back to the old after accessing an element of character ui. The back-and-forth would be goofy and shoddy.
    • Change the sizes of various interface boxes to accomodate larger text. (At least I haven't figured it out yet. If we can't, some of the other ui changes will have to go because we'll have text spilling out all over the place.)

    I'll post some screens later of the remaining things we can change.
     
  4. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    PARTY POOL

    screen0016.jpg

    CHARACTER CREATION

    screen0017.jpg

    All aspects of this have the Priory font in the description pane.
     
  5. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Here's a screen of what I worked up for a new character ui to accomodate the larger Priory font and to generally be easier on the eyes.

    screen0018.jpg

    Changes:

    • alignment, sex, and race have moved to the top bar.
    • encumbrance has moved from the lower center to the top right to make room for enlarging the text box.
    • the use item and drop item buttons have been shortened and moved to the bottom right to make room for enlarging the text box.
    • the text box has been enlarged, growing several pixels in height upward to the bottom edge of the inventory box. Basically it now accomodates 7 lines of Priory text, whereas before it accomodated 5. This pretty much makes all the difference as far as text not spilling over goes, except for a few remaining instances.
    • the character sheet has been overhauled. It kind of needed to be in order for Priory to look right in there (enlarged boxes, aligned boxes, etc.). If the colors look garish we could change them to a muted grey or ToEE's regular boring slate blue, but I thought color differences might actually be helpful for that stuff. The level boxes might not be able to stay where they are now though (outside the normal sheet for lack of space), as they don't highlight and hyper-link like they're supposed to over there. The numbers are certainly easier to read.
    • another issue is the stupid painted on scroll bar that's not a scroll bar and doesn't scroll ... it's shorter than the text box now and can't be changed or gotten rid of. Yay!
    You wouldn't believe how much effort this all took. :blegh:

    [edit]

    Can't remember if I mentioned this before ... the basic problem here that makes redesigning the ui necessary (assuming the use of the Priory font) is that the basic box can't be enlarged. (At least I can't figure it out.) This means that instead we have to make better use of the existing box by reclaiming whatever idle real estate we can, hence the move to make the text box bigger and eat up the space between it and the inventory box, etc. Hope that makes sense.
     
  6. GuardianAngel82

    GuardianAngel82 Senior Member

    Joined:
    Oct 3, 2007
    Messages:
    3,481
    Likes Received:
    5
    It looks good to me! :thumbsup:
     
  7. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Tweaked ...

    screen0019.jpg

    Now the level boxes are back in the normal pane. The height and weight boxes are limited to what the height and weight of the character are, leaving out the boxes that say "height" and weight." (This again due to lack of space.) They're connected by a little line though so people who get confused by a random number sitting there (weight) might see that it's somehow connected to the clear height indication (feet and inches) and then deduce that it's weight, since height and weight usually go together. :hug:

    [edit]

    Here's with a pixel shaved off the outer edge of each of the boxes. Seems to give it a bit more breathing room.

    screen0020.jpg
     
  8. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    That is fantastic looking Gaear! Great job :D

    What will the new backgrounds look like ingame? (when you implement)
     
  9. random1

    random1 Member

    Joined:
    Dec 8, 2010
    Messages:
    93
    Likes Received:
    0
    That looks really nice Gaer!

    I prefer the cosier version: http://www.co8.org/forum/attachment.php?attachmentid=5729
    Just one suggestion: color (solid or not-solid) the Total Weight label background (that is now blueish) to some brownish of the same tone as the backpack icon. Maybe do some type of connector from it to the inventory grid (like the backpack icon does).


    I basically spent all of my weekend, and some more, debugging temple.dll with the hope of finding where to hack it, so that it would be possible to load another font instead of arial for the dialog. I did learn a lot about the font initialization process (and how inefficient compilers can be), but I did not succeed in achieving my goal :(
    It seems no access to the font (bmp, fnt, fntart) or dialog UI files is made when talking, so I think these files are only read during startup and then cached, which are then referenced latter.
    An odd thing that I found was that only fntart files (texture type of things) are being read. The bmps and fnt files weren't read. I could be wrong, but that was what I was able to conclude so far.

    Some other 2 approaches that I must try:
    - putting a memory breakpoint at the memory region to where the fntart files are loaded (this I already know).
    - also try setting a breakpoint on .dlg file access and pick up from there
     
  10. random1

    random1 Member

    Joined:
    Dec 8, 2010
    Messages:
    93
    Likes Received:
    0
    I don't know what the hell is the problem with my PC, but he started acting weird.
    Initially he was like:

    [​IMG]



    But then he got very angry with Oolgrish!!!

    [​IMG]



    Eventually they seemed to solve their differences and he lowered his tone.

    [​IMG]





    :yes:
    That's right baby :pelvicthr
    I think I was able to get it to work :pelvicthr

    In the end this is kind of a small victory since we're limited to the existing fonts, which have a serious gap from 12pt to 24pt.
    In principle it should be possible to add other fonts as well, but those would have to be made (fnt, bmp, fntart files) and I don't know the format.
    I don't think it should be too hard, but I'm not sure if I want to find out :p
    I've put way too many hours into this already.

    Funny facts:
    - I haven't even finished the game yet.
    - I'm playing the game on a VM with a 1024x768 resolution, so for teh moment I don't really need the font.
    - I guess I don't like ToEE thaaat much... But it sure looks pretty :)
    IMHO it lacks a good story (eg: Hommlet rewritten) and interesting quests (ie: not just fedex, but having more roleplay/replay to them) to act as a backbone to all the combat. I felt that the game started to "dungeon crawl" a bit too much for my taste.
    (just to clear out any doubts!!! I'm not criticizing co8 in any way with the NC or the likes, if anything it's exactly the opposite)

    I guess I went with this task a bit for the challenge and also a chance to contribute.



    Now for the temple.dll patch:
    Code:
    1014BBB7      6A 0C         PUSH 0C
    1014BBB9      68 BC262910   PUSH temple.102926BC                     ;  ASCII "priory-12"
    ...
    1014C58F      6A 0C         PUSH 0C
    1014C591      68 BC262910   PUSH temple.102926BC                     ;  ASCII "priory-12"
    

    I'm curious, but would using the arial-bold-24 font be of interest to anyone?
    I think it should be possible to change the .mes file to properly accommodate the dialog.
     
  11. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Wow ... :suprised:

    I had no idea you were capable of a .dll hack, random. That's great work. I think all we need do then is change the Arial-10 reference to Priory-12 - that will make all .dll level font instructions change to Priory across the board (I asume), which combined with the stuff we have changed via mes files et al will basically just transform ToEE from an Arial font game to a Priory font game. I think that's all we want, in a nutshell, because Priory-12 is bigger and nicer looking, end of story.

    You'll have to tell me exactly how to patch the .dll with your code. (Either that or I can post the most current .dll here and you can patch it and send it back.) I assume you're just using a hex editor?

    One thing I notice is that in your last example the hover text is still Arial-10. Does that mean that there are different calls to fonts in the .dll for different things? If so we'll have to patch them all.

    I don't think that the changed font will be an issue for low resolution players, as Priory-12 is only a two point increase - IMO it basically makes the game legible for high res players without making it absurd for low res players.

    I also don't think using Priory-12 (as opposed to adding new fonts) is a big deal: it basically addresses all our needs anyway.

    The Arial-24 font is already used for things like the stat increase interface, random encounter survival checks, and so on. We wouldn't need to alter that at all.

    Good stuff. :)
     
  12. random1

    random1 Member

    Joined:
    Dec 8, 2010
    Messages:
    93
    Likes Received:
    0
    I tried to find a way to change the dialog font color but I wasn't able to.
    Kind of ironic as it would supposedly be almost direct since the colors (00ff00 and ffff00) should be easy to find and patch.
    Not that this is a deal breaker, but the golden colors in Surf Solar mockup did fit the setting better.

    I kind of lost track of things as I was solely focused on dialog and had the idea that you had been able to fix the text for all the other UI.
    But now that I read your previous post, with this hack and with your changes, all that is missing is the help menu and the radial menu, correct?

    There are over 90 references to "arial-10" and also because I was only thinking on dialog I didn't consider replacing all. Also because there might be cases were there would be text overflowing out of the UI or text humping.

    I'll see if I can fix the help and radial menus.

    I used ollydbg to debug and patch it in memory.
    It was kind of sad not finding any free half-decent hexeditor, so if you don't have any decent one (that allows hex code find and replace) you can send me the latest temple.dll and I'll patch it (with a linux program --- like I said I'm running the game in VM so no problem here).
    The changes to be made in the .dll are:
    Code:
    find:         83EC2453566A016A0A68D8D72610
    replace with: 83EC2453566A016A0C68BC262910
    
    find:         8B1C95A4A92F106A016A0A68D8D72610
    replace with: 8B1C95A4A92F106A016A0C68BC262910

    Regarding the font size, well what I initially had in mind was for the player to be able to select different font sizes. But that isn't possible since for the moment nobody here knows how to create "troika" fonts.
    I'm playing at a lower resolution and I still prefer the 12pt font. I just don't know if for people playing at 1600x???? it'll make the necessary difference.
     
  13. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    Always good to see DLL hackers.

    You didn't happen to stumble across whatever code it is that controls how many dialogue responses are possible, by any chance? I've always wanted to increase it so more than 5 are possible, and didn't have much luck crawling through the ASM...
     
  14. random1

    random1 Member

    Joined:
    Dec 8, 2010
    Messages:
    93
    Likes Received:
    0
    As always, things have to be more complicated than they should.

    1) The help menu uses a different way to set the font.

    2) There is a minor problem with the new font size in the dialog. If the string wouldn't cause for a word-wrap in arial-10 it will not do it in priory-12 as well, which will mean sometimes there will be text right over the top UI frame, which looks ugly and makes it difficult to read -_-
    I'll have to see if I can fix that latter.
    http://i.imgur.com/IvI3r.png


    Sitra, regarding the number of dialog options, I quit don't understand what you mean.
    What's the problem with paging options like the Hommlet directions sign in front of the Inn?
    In any case if you wanted to have from 1 to 9 dialog options at once, I suspect the first thing to do would be to see if it's possible to increase the dialog UI size.
    The possibility of success in this is very "variable", it really depends on how things were done.
    For example, I'm now having that unexpected text spill in the dialog UI, because things are being done statically, the code simply does not use the font size I now pass to the dialog print routines.
    For the dialog UI check:
    art\interface\DIALOG in ToEE1.dat
    art\interface\history in ToEE1.dat
    mes\dlg_ui.mes in ToEE3.dat


    One question:
    If I want to overwrite one of the files in ToEE*.dat do I really need to pack and overwrite it. Or can I just place the file in ToEE dir and the game will consider that as the latest version of that file instead of the one in ToEE*.dat ?
     
  15. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    I wouldn't worry about that either ... as we've already seen, our plate will full on this job just getting the basics switched over. ;) Best to keep the focus narrow.

    Not really. The truth is I don't know exactly what is missing, because the mes portion of all this stuff is so scattershot - only some things are controllable, some things control other things that don't make any sense, etc. What I do know is that we couldn't touch dialog and dice rolls, so I would focus on that initially. The Help system we actually can change on my end, but it has the added affect of altering the radial menu and hover text over the bottom right controls temporarily.

    My thinking on this is to pretty much just change them all and eliminate Arial-10 from the game. Otherwise we don't really know what we're leaving in, and Arial-10 has little value anyway so we're not losing out on anything. As far as text overflow problems go, that's going to be another story entirely and will likely require art changes to the backdrops, unless you can figure out how to make them 'dynamic.' It seems virtually every UI operates differently however, so we have to be careful and take them on a step-by-step basis. Dialog for example: I patched the .dll with your code and observed the overflow problem you describe above, where it appears the game is still only accomodating the smaller Arial-10 in the dilaog box. If we can just make the boxes bigger that will take care of that, and it's possible we may be able to because the game seems to fluidly scroll them on the fly for dialog based on how much is there. Anyway, we can get into that more later.

    No, let's put that out of our mind right now.

    I use the highest supported resolution (1680 x 1050) and it looks great with Priory-12. So between you and me, we've got the extremes covered and needn't worry about it any further.

    Is hover text dialog connected to the Help system somehow? I see from your pic that the hover text is now Priory-12.

    Not really sure what you're asking, but any file in the installed game dirtectory will override anything that the game is pulling from the dats, yes.
     
Our Host!