![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|
12-26-13, 03:45 PM
|
#1 | |||||||
|
Helmsman
![]() Join Date: Jun 2011
Posts: 105
Downloads: 181
Uploads: 0
|
Fantastic!
Quote:
Is that prudent? I mean, AFAICT the ini structure itself with those [Gxx Iyyy] identifiers just represents the actual UI tree (or forest, actually), but flattened backwards. These bracketed numbers don't present any meaningful info for editing, do they? Plus if you store them, you'd have to recalculate them for the whole subtree every time you add or remove UI elements, instead of just once when saving the file.IDs (ItemID, ParentID), on the other hand, are a different matter, since they are pretty much responsible for the actual UI structure. Quote:
Quote:
For adding new items, I've hacked together a rather naive ID generator which sort of works, although it's not completely in line with what I think it was intended for IDs, but again we have to consider that the program may be working with files edited by hand, which also don't strictly follow the developers intent. From what I can tell, IDs were intended to be in the form XX000000 for pages and XXYY0000 for groups (no matter how deep in the tree those groups are), with only the lowest two bytes being used by all other item types, and in a way that a child items would respect that numbering in their own IDs. In practice, however, we could potentially encounter files that don't follow this convention, esp. the last part. Quote:
Regarding ID checking, yeah. While I was drafting the parser, I quickly found out that I can't really read the file if I consider it an error if there are duplicate or incorrect IDs: MaGUI, for example, has several duplicates and one ID that wouldn't fit into 32 bits ![]() Quote:
Quote:
Quote:
![]() vanjast, can I PM you as well for further discussion? Or should we keep it here so as much as possible would be public? |
|||||||
|
|
12-26-13, 03:54 PM
|
#2 |
|
Stowaway
Posts: n/a
Downloads:
Uploads:
|
I do C++ and did play with QT a bit. I never got into QT that much and tend to keep things very short and rough.
I'll answer anything I can and there's a bunch of people that can be called on to assist you Guys if needed. ![]() As far as replaceing/copying S3D and how it works? I'd not waste the time when there's still a bunch of stuff you could address that S3D does not handle. |
|
12-26-13, 04:02 PM
|
#3 |
|
Helmsman
![]() Join Date: Jun 2011
Posts: 105
Downloads: 181
Uploads: 0
|
I contemplated for a long time whether or not I should use D for this project. Sadly, I had to put it aside since UI libraries are not there yet, and it would be tremendous work to implement it all by hand. Though after vanjast said he uses Masm, I feel celestially humbled
|
|
|
12-26-13, 04:11 PM
|
#4 |
|
Stowaway
Posts: n/a
Downloads:
Uploads:
|
I dropped working Assembly around the release of Windows 1
|
|
12-27-13, 02:01 AM
|
#5 | ||
|
Sea Lord
![]() Join Date: Jun 2006
Location: Somewhere else now
Posts: 1,797
Downloads: 1214
Uploads: 4
|
Quote:
Quote:
Maybe it'll also help the modder keep track of what he/she's doing. No problem with the PMs I've used a variety of dev kits MsC, C++, Visual Basic and Masm (and other similar embedded stuff) , but still gravitate to Masm - I like tinkering Last edited by vanjast; 12-27-13 at 02:21 AM. |
||
|
|
12-28-13, 04:38 AM
|
#6 |
|
Sea Lord
![]() Join Date: Mar 2011
Location: In the conning tower of my VIIC scanning the sea through the periscope
Posts: 1,682
Downloads: 173
Uploads: 7
|
All thumbs up for you guys
__________________
[SIGPIC][/SIGPIC] NYGM+H.sie v16+Stiebler 4C+MaGui WS |
|
|
12-29-13, 09:44 AM
|
#7 | |||
|
Helmsman
![]() Join Date: Jun 2011
Posts: 105
Downloads: 181
Uploads: 0
|
![]() Quote:
Even more, customized UIs (i.e. MaGUI, not sure about OLC) may have "invalid" [Gxx Iyyy] entries that for example don't contain ItemID or ParentID: the IDs are either commented out or missing. I assume this was done to "remove" items without having to renumber the whole groups. The game just seems to ignore these entries (at least I didn't see any error messages pop up). Don't get me wrong. I'm not trying to convince you that my views regarding this are "correct". I'm just trying to understand if there are any gains in your approach that I don't see. Quote:
Quote:
--- Anyway, here's probably my final pre-New Year progress and discoveries. Material loading and rendering is mostly done. No font/text rendering yet. Fancy widgets like editboxes, listboxes, etc. are not rendered properly either, that for after the New Year. In one of the recent threads Seeadler mentioned that there are some hardcoded UI pages. I probably should ask him if he knows of any pages in particular to avoid any further "surprises"; Privateer, maybe you also have some insight on this? Here's what I found today (vanilla menu.ini): ![]() That's "Page barracks" (G67 or 0x67000000). Note a whole lot of gibberish where the U-boat compartments should be. I have one of those "items" selected in the tree (it's highlighted with yellow dashed line on the graphical display). At first I thought I had an error in my "Crop" computations, so I opened the tga those items are referencing (data/menu/data/comp-2.tga) and checked. Turns out that my app follows the Crop correctly, the regions just end up in the wrong areas of the image. Furthermore, the "comp-2.tga" is a compartments atlas for Type-II U-boat. There are other files for other types of boats, but they're not referenced anywhere in the menu.ini file. Also note that the item itself has an ID of 0x27A50009, even though it's inside page 0x67000000. Now, page 0x27000000 is "Page binoculars", and thus shouldn't have anything to do with barracks. There are other items here that have their ID start with 0x27, so there's definitely something fishy going on.This leads me to believe that this page is handled elsewhere (i.e. game code). If not completely, then at least item positions, material references and Crop parameters are ought to be changed by the game in order to display this page correctly for every type of U-boat. There are also pages named "Equipment Icon", "Typ2", "Typ7", "Typ9" and "Typ21", but they're empty and just reference file "data/menu/menu_UBoats.ini" which simply doesn't exist ![]() I'm not sure right now how to best deal with this. Now to another page, "Page attack periscope" (same goes for "Page obs periscope"): ![]() Note this "Glass" item in the Water Level group. It's laid out horizontally, even though in game it appears vertical. It has a Display mode of 5 ("Linear&Rotation"). Why exactly is it made like this, right now I only have a guess: the image itself is packed into the atlas in the bottom part of "data/menu/gui/periscope.tga", and it's laid out horizontally there. Since there's no way to turn horizontal image into vertical item (because instead of storing texture coordinates, the devs decided to store rectangles in the Crop parameter ), they probably had to rely on the game engine to "rotate" the item into correct position. Now, why exactly does it get rotated (it doesn't seem to be connected to any "dial" in dials.cfg), is a mystery to me (unless it's hard-coded as well).
|
|||
|
|
12-29-13, 01:56 PM
|
#8 | |
|
Pacific Aces Dev Team
![]() |
Quote:
|
|
|
|
01-02-14, 09:11 AM
|
#9 |
|
Helmsman
![]() Join Date: Jun 2011
Posts: 105
Downloads: 181
Uploads: 0
|
Thanks, Seeadler. So it seems this behavior is not that widespread among pages. That's good to know.
Now to some more fiddling. I've been investigating the various Display types for images, which included reading the existing guides and good old "see for yourself" method. Here's what I came up with regarding this parameter (warning, image with white font on transparent background): ![]() That's how a source image (32x32 pixels) looks like in a 128x64 menu item in various Display modes. I've intentionally left the yellow selection border to better visualize the item's bounding rectangle. For all modes except mode 0 (No Stretch), cropping rules apply: source image rectangle is "cut out" from the actual .tga image using first two "Crop" numbers as X,Y coordinates for top-left corner and last two "Crop" numbers as width and height (these numbers are normalized into [0,1] range where 0 means "top" or "left" and 1 means "full width" or "full height".
Last edited by radcapricorn; 01-02-14 at 10:35 AM. |
|
|
01-10-14, 12:51 AM
|
#10 | |
|
Watch
![]() Join Date: Jun 2011
Location: Moscow, USSR
Posts: 28
Downloads: 153
Uploads: 0
|
Quote:
For the barracs page. First, it is used in port as barracs page and at sea as damage control & crew page. Second, it does have "general" positions for compartments (not sure if it correlates with any sub type). And exact positions are indeed hardcoded. I've wrote that info early here. Check that thread for some info that probably could be usefull for your effort.
__________________
Yoda's modding rules: - You must unlearn what you have learned. - Try not. Do... or do not. There is no try. - Size matters not. |
|
|
|
01-16-14, 12:25 PM
|
#11 |
|
Hellas
![]() |
were have you been all this time guys ? this tool would have been a real treasure and would have save a lot of hours spended on the lines of menu_ini ! but ,as always, better now than...never !
from the pics that you have posted seems that it will be very handy , well done guys ! ps: the sh5 has a menu_ini editor and i think that i read somewhere that it can be used for sh4 and sh3 too. never tried it though but have you guys checked if it can be adjusted to serve the needs of sh3's menu_ini ?
__________________
Knowledge is the only thing that nobody can ever take from you... ![]() Mediafire page:http://www.mediafire.com/folder/da50.../Makman94_Mods |
|
|
12-26-13, 07:18 PM
|
#12 | |
|
Sonar Guy
![]() Join Date: Oct 2013
Posts: 382
Downloads: 64
Uploads: 0
|
Quote:
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
