Jump to content


Photo

Rearranging Character Record screen in classic BG2


  • Please log in to reply
13 replies to this topic

#1 Vakarian89

Vakarian89
  • Member
  • 73 posts

Posted 15 June 2021 - 05:06 AM

Total noob here when it comes to BG modding, so please be forgiving.

 

I was toying with Character Record .chu and .mos files in NearInfinity, trying to rearange some elements, to make Record more user-friendly and to squeeze something more out of the, somewhat limited, space there is. I understand the basics, elements that make that screen and so on, but there is one thing I cannot figure out. What file tells specific elements what information they include.I would like to separate that long list of all character stats into few pieces, but how to do it? Let's say I want to make a list of character weapon proficiencies and delete them from the current list. Would I have to modify the "raw data" to achieve that goal? Or is it something that cannot be changed so easily?



#2 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 16 June 2021 - 02:56 AM

There is no such files, all elements from .chu hardcoded in bgmain.exe - every Panel, every Button.Big text fields generated dynamicaly by code too. You can change available propertiies of many element, but you can't change behaviour/color/etc



#3 Vakarian89

Vakarian89
  • Member
  • 73 posts

Posted 16 June 2021 - 04:48 AM

Thank you very much for your answer. I have feared it may be hardcoded in bgmain.exe. Bummer. Well, I'd have to bear with that damn stat-list, so it seems. Thanks again.



#4 Vakarian89

Vakarian89
  • Member
  • 73 posts

Posted 23 June 2021 - 10:35 AM

A theoretical question: if someone would like to make a "total conversion" of BG2 GUI's graphics and layout, is it possible to make Record, Inventory and other screens bigger than the standard 512x480px (and still properly centered)? To make a GUI with, let's say, resolution 1280x800 in mind and make a better use of all that empty/unused space. Or is it the way it is and there's no way to change that?



#5 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5148 posts

Posted 23 June 2021 - 11:09 AM

A theoretical question: if someone would like to make a "total conversion" of BG2 GUI's graphics and layout, is it possible to make Record, Inventory and other screens bigger than the standard 512x480px (and still properly centered)? To make a GUI with, let's say, resolution 1280x800 in mind and make a better use of all that empty/unused space. Or is it the way it is and there's no way to change that?


Well, you can install the Widescreen mod with any resolution you want in the non EE game, and then edit the GUI to make a mod, and if you set the mods installer check the Widescreen mods resolution, or rather that it exists, it's users own fault if the resolution is set to a wrong setting, you can have the character record be centered and in the proper place ... even in 1920x1080 resolution. There's a BG1 GUI mod just for this thing in a Polish site.

I have a 4k cabable 28" monitor and the 1920x1080 is kinda streching the detail individualiation rate, most of the time.

At least in theory. You'll need to check the files structure in Near Infinity after installing the Widescreen mod... and then add the extra panel space to the centered structure(aka you just replace the file) and check out if it's displayed properly in-game as a result.


Edited by The Imp, 23 June 2021 - 11:20 AM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#6 Vakarian89

Vakarian89
  • Member
  • 73 posts

Posted 23 June 2021 - 12:07 PM

You get me wrong (or I get you wrong...). I ask is there a way to make an "active" part of inventory screen bigger than 512x480, not the higher resolution. How to put it... OK, file inventor.mos is a background of inventory screen and it's size is 512x480px. But if someone would like to make bigger inventor.mos and make inventory screen also bigger, let's say 800x700 (just an example), is it possible? The left panel is set at x coordinate 0, and there cannot be negative values here, so... Is it hardcoded in BGmain.exe?



#7 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5148 posts

Posted 23 June 2021 - 01:27 PM

If you want to change the inventory space, you first take a look at the GUIINV.CHU file with Near Infinity, both in View and Edit views. That has all the definitions for the places where things are. Which is why I adviced to first install the widescreen mod, as that might change things, after which you can then adjust the things. PS, the panel spaces(in the Edit view) can have negative x and y poisitions, but I am unaware if they will show up correctly if they do.


Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#8 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 24 June 2021 - 02:21 AM

Hi
You get me wrong (or I get you wrong...). I ask is there a way to make an "active" part of inventory screen bigger than 512x480, not the higher resolution. How to put it... OK, file inventor.mos is a background of inventory screen and it's size is 512x480px. But if someone would like to make bigger inventor.mos and make inventory screen also bigger, let's say 800x700 (just an example), is it possible? The left panel is set at x coordinate 0, and there cannot be negative values here, so... Is it hardcoded in BGmain.exe?
Size of any panel hardcoded to bgmain.exe, it always show as "640x480" minus left panel minus right panel = 512x480
Widescreen mod change some of constants inside bgmain.exe to allow fit main game screen to your monitor resolution.
 
If you smart enough, you can change coordinates and size of screen panels too :)
some of important places inside bgmain.exe:
  • AB90F0 640
  • AB90F2 480
  • 432803 code precalculate global position of panels depending on monitor resolution
same code in decompiled form (label names are mine, dont sure if it is right):
if (xRight == 800 )
    {
      v13 = xRight;
      yBottom = 600;
      v14 = 600;
      xStart_MinWindow = 64;
      yStart_MinWindow = 0;
      xEnd_MinWindow = 736;
      yEnd_MinWindow = 510;
      xStart_MaxWindow = 64;
      yStart_MaxWindow = 0;
      xEnd_MaxWindow = 736;
      yEnd_MaxWindow = 318;
      xStart_Med2Window = 64;
      yStart_Med2Window = 0;
      xEnd_Med2Window = 736;
      yEnd_Med2Window = 446;
      dword_B84C58 = 64;
      yStart_Med1Window = 0;
      xEnd_Med1Window = 736;
      yEnd_Med1Window = 461;
      xStart_Med3Window = 64;
      yStart_Med3Window = 0;
      xEnd_Med3Window = 736;
      yEnd_Med3Window = 490;
      xStart_Med4Window = 64;
      yStart_Med4Window = 0;
      xEnd_Med4Window = 736;
      yEnd_Med4Window = 354;
      xStart_Max2Window = 144;
      yStart_Max2Window = 66;
      xEnd_Max2Window = 656;
      yEnd_Max2Window = 450;
      xZero2 = 0;
      yZero2 = 0;
      xRight2 = xRight;
      yBottom2 = 600;
}

part2:
word_B61510 = 3 * (unsigned __int16)(((yBottom2 - yZero2 + 63) / 64 + 1) * ((xRight2 - xZero2 + 63) / 64 + 1)) / 2;
v6->m_u6c7c.u6c7c = -5;
v6->m_u6c7c.u6c88 = 1;
v6->m_u6c7c.u6c86 = v14;
v6->m_u6c7c.u6c84 = ((unsigned __int16)v13 - (unsigned __int16)Const_x640) / 2;
v6->m_u6c7c.u6c80 = 0;
v6->m_u6c7c.u6c82 = 0;
v6->u6c98 = -4;
v6->u6ca4 = 1;
v6->u6ca2 = v14;
v6->u6ca0 = ((unsigned __int16)v13 - (unsigned __int16)Const_x640) / 2;
v6->u6c9c = v6->m_u6c7c.u6c84 + Const_x640;
v6->u6c9e = 0;
v6->u6cb4 = -3;
v6->u6cc0 = 1;
v6->u6cbe = ((unsigned __int16)v14 - (unsigned __int16)Const_y480) / 2;
v6->u6cbc = Const_x640;
v6->u6cb8 = v6->m_u6c7c.u6c84;
v6->u6cba = 0;
v6->u6cd0 = -2;
v6->u6cdc = 1;
v6->u6cda = ((unsigned __int16)v14 - (unsigned __int16)Const_y480) / 2;
v6->u6cd8 = Const_x640;
v6->u6cd4 = v6->m_u6c7c.u6c84;
v6->u6cd6 = v6->u6cbe + Const_y480;

Edited by Insomniator, 24 June 2021 - 02:23 AM.


#9 Vakarian89

Vakarian89
  • Member
  • 73 posts

Posted 24 June 2021 - 05:48 AM

WOW, thank you, Insomniator, for an elaborate answer! So it is possible, but requires changing BGmain.exe.

 

If you smart enough, you can change coordinates and size of screen panels too :)

 

Well, I'm probably not, because I don't know a thing about bgmain.exe changing and most of your post looks like magic to me. :lol: My question was more out of curiosity than anything else. Remaking the whole BG2 GUI would be a great task, and it would require someone who'll take care of the graphical side of the project and a coder with the knowledge of Infinity engine. Sad but true, I'm neither.



#10 Vakarian89

Vakarian89
  • Member
  • 73 posts

Posted 01 July 2021 - 07:09 AM

Another portion of GUI-related questions. Sorry if they are noobish, stupid or simply annoying.

 

Big text fields generated dynamicaly by code too. You can change available propertiies of many element, but you can't change behaviour/color/etc

 

OK, the last time I assumed it's not possible to break the list into smaller pieces, but when I think of it further, I must admit I don't exactly understand what that answer means. Can't change behaviour - it means one can't change what information is inside a big text field? To make it a little easier (for me and for all of you) I've made a quick, simple Character Record screen design (picture below - don't mind the typo in "alignment"), and have one question: is it possible to achieve such layout? Is it possible to have several stat-lists/text fields (I have marked them with yellow outline and red description) with the specific content instead of the default one?

 

record1.png

 

Second question is: if one would want to make a higher resoultion (1280x720) GUI conversion, what about notes on map screen? The actual map (area map, I mean) wouldn't be bigger (for that bigger area maps would be necessary), but screen would be - will it mess up existing map notes coordinates? Or are they relative to the actual map size, so as long the map area is the same, map notes will be unchanged? (sorry if it's a little hard to understand)


Edited by Vakarian89, 01 July 2021 - 07:20 AM.


#11 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 09 July 2021 - 08:59 AM

Hi Vakarian89

Another portion of GUI-related questions. Sorry if they are noobish, stupid or simply annoying.
 

Big text fields generated dynamicaly by code too. You can change available propertiies of many element, but you can't change behaviour/color/etc

 
OK, the last time I assumed it's not possible to break the list into smaller pieces, but when I think of it further, I must admit I don't exactly understand what that answer means. Can't change behaviour - it means one can't change what information is inside a big text field? To make it a little easier (for me and for all of you) I've made a quick, simple Character Record screen design (picture below - don't mind the typo in "alignment"), and have one question: is it possible to achieve such layout? Is it possible to have several stat-lists/text fields (I have marked them with yellow outline and red description) with the specific content instead of the default one?

Yes, this mean you can not split existing fields on screen

 

Infinity Engine uses object-oriented GUI, this mean every element on screen is C++ object with many fields/methods.

main Record screen is GUCG.CHU, panel #2, total 31 elements. Engine parse .chu file and create 31 object, engine already know type of every element by ID.

 

You want to tune screen and add new elements, what will happen ? Nothing ! Engine dont know nothing about new element, it will skip it or even crash.TobEx has way to create new element on any screen but you need code it in C++: define new object, write some methods (update, click, ...), inject to main screen_update() to print something on new element.



#12 Vakarian89

Vakarian89
  • Member
  • 73 posts

Posted 09 July 2021 - 09:10 AM

Once again, thank you for the answer and for your time! :Bow:  I must admit it kinda sukcs that it's so hard to spice up the in-game screens. I had a dream of a new, higher-resolution GUI with all-new graphics, but well - it looks I'm too short for that kind of job. Bummer.



#13 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 09 July 2021 - 09:17 AM

I had a dream of a new, higher-resolution GUI with all-new graphics, but well - it looks I'm too short for that kind of job

learn c++ and i386 asm reverse engineering => dreams come true
 



#14 Vakarian89

Vakarian89
  • Member
  • 73 posts

Posted 09 July 2021 - 12:58 PM

learn c++ and i386 asm reverse engineering => dreams come true


It's a great advice, but I tried scripting/programming before and, well, it was bit of a disaster. I've never liked math logic + I'm rather nervous, so... It wasn't pretty. :lol: