Home » MODDING HQ 1.13 » v1.13 Coding Talk » RII - Resolution Independent Interface [UPDATE :RII v4f]
Re: RII - Resolution Independent Interface[message #205566] Mon, 05 January 2009 00:29 Go to previous messageGo to next message
BirdFlu is currently offline BirdFlu

 
Messages:438
Registered:September 2007
Location: Lampukistan
Indeed.

Report message to a moderator

Master Sergeant
Re: RII - Resolution Independent Interface[message #205570] Mon, 05 January 2009 03:08 Go to previous messageGo to next message
Kaerar is currently offline Kaerar

 
Messages:2022
Registered:January 2003
Location: Australia :D
Germany 1 - Lampukistan 1

It's a draw guys Smile

So in other words the interface can be handled with non-palettized images in 16bpp?
If that's the case then a lot more can be done with the images. However what image format can it be read from?
Do the images still need to be converted to STI? Because that in itself limits it to 256 colour...

Can raw BMP format be used? or PNG? Both are lossless and easy to make/read (to the best of my knowledge) though PNG are smaller I think.

Report message to a moderator

Lieutenant

Re: RII - Resolution Independent Interface[message #205645] Tue, 06 January 2009 01:34 Go to previous messageGo to next message
BirdFlu is currently offline BirdFlu

 
Messages:438
Registered:September 2007
Location: Lampukistan
Kaerar
So in other words the interface can be handled with non-palettized images in 16bpp?
If that's the case then a lot more can be done with the images. However what image format can it be read from?
Do the images still need to be converted to STI? Because that in itself limits it to 256 colour...

Can raw BMP format be used? or PNG? Both are lossless and easy to make/read (to the best of my knowledge) though PNG are smaller I think.
I would have to take a closer at this. Until then i can't give a definitive answer. I mean, of course it is possible when investing enough time and effort, but we have be to be realistic here. You will just have to wait and see.

Report message to a moderator

Master Sergeant
Re: RII - Resolution Independent Interface[message #205651] Tue, 06 January 2009 10:40 Go to previous messageGo to next message
Kaerar is currently offline Kaerar

 
Messages:2022
Registered:January 2003
Location: Australia :D
Could I just bring up the point that Wildfire 6 already uses 24bpp images. That maybe a good place to start as far as finding out what can be done image wise Wink

Report message to a moderator

Lieutenant

Re: RII - Resolution Independent Interface[message #205893] Thu, 08 January 2009 21:11 Go to previous messageGo to next message
BirdFlu is currently offline BirdFlu

 
Messages:438
Registered:September 2007
Location: Lampukistan
I previously promised details on the new XML files. Here they are.

1. Introduction
The graphical user interface can be seen as consisting of three components. These components are the structure, the layout and the function of the GUI. The structure is the set of all GUI elements like buttons, images, regions, text areas, etc. The layout describes where the single GUI element is located on the screen. Some elements are functional, like buttons and regions, in the sense that they react somehow when a mouse cursor is hovering over that element and alternatively a mouse button is pressed or released.

The idea of this project is to externalize the layout of the GUI. The structure and the function remain hardcoded. This approach is relatively simple to implement as the positions of the single elements, and also futher properties, can be defined in an external file. This data is then read in on program start and can then be used during the rendering process. The structure of existing code remains the same. Therefore, the introduction of new bugs should be minimal and mostly be restricted to misaligned GUI elements.

2. Type hierarchy
There are several GUI elements accessible through the XML files and they have the following basic form
   ... 

Element names have to be explicitly defined in the code, so only registered elements can be accessed from outside. Names have to be unique for all registered elements. The type of an element can only be one of the following values
  "Node", "Surface", "Image", "TextArea", "Button"

The types build a hierarchy starting with Node. The hierarchy can be seen as a IsA relationship. So, a Surface is a Node, an Image is a Surface, etc.
  Node
   `- Surface
       |- Image
       |- TextArea
       `- Button


2.1 Node element
Depending on the type, several properties can be defined. The Node element has only the 'offset' property that defines a displacement to another Node element. If no other element is given, then 'offset' is the displacement to the screen origin (0,0) or (left,top).
  
    
  

When the offset property is not defined, then the 'x' and 'y' values are set to 0 by default. You can also define only 'x' or only 'y', the missing one gets the default value.

2.2 Surface element
As a Surface is a Node, it inherits the 'offset' property, but it also defines a 'size' property
  
    
  

Both width 'w' and height 'h' have to be defined, as no default value would make much sense. It is though possible to explicitly set a value of 0. The reason for this is that the 'size' property is not always fully evaluated (only width is required, for example). Sometimes a surface element is supposed to contain some text. In such cases it is desirable to define the height of this surface depending on the used font. To do that you can replace 'h' with 'fontheight'
  

where the value of 'fontheight' has to be one of the registerd fonts (see section about element type TextArea).

2.3 Image element
An Image element is a Surface and thus has the two properties 'offset' and 'size'. Additionaly it lets you define a video object by specifying a filename of a STI image file.
  
    
  

As STI is multi-image file format you can also specify the subimage with the 'subimage' attribute. Obviously the value of 'subimage' has to be nonnegative.

2.4 TextArea element
The TextArea element allows you specify the appearance of the text that is supposed to be rendered inside.
  
    
  

You can specify the font by setting the value of the 'fontname' attribute to on of the values from the following list
  "LARGEFONT1", "SMALLFONT1", "TINYFONT1", "FONT12POINT1", "CLOCKFONT",
  "COMPFONT", "SMALLCOMPFONT", "FONT10ROMAN", "FONT12ROMAN", "FONT14SANSERIF",
  "FONT10ARIAL", "FONT14ARIAL", "FONT10ARIALBOLD", "FONT12ARIAL", "BLOCKFONT",
  "BLOCKFONT2", "FONT12ARIALFIXEDWIDTH", "FONT16ARIAL", "BLOCKFONTNARROW", "FONT14HUMANIST"

You can also specify the foreground and the background color of the font. The 'background' attribute can be one the colors from the following list
  "FONT_BLACK", "FONT_BEIGE", "FONT_BLUE", "FONT_LTBLUE", "FONT_LTGREEN",
  "FONT_LTRED", "FONT_RED", "FONT_WHITE", "FONT_YELLOW"

Additionaly you can set the values
  "MAP_BOTTOM_COLOR" = 32 * 4 - 9 
  "CHAR_TITLE_COLOR" = 6
  "CHAR_TEXT_COLOR"  = 5

Instead of the given symbolic color names, sometimes index values from the palette of the font are used in the code. Thus, you can omit the 'foreground' attribute and instead specify the 'foregroundindex' attribute that takes nonnegative integer values.

2.5 Button element
The Button element lets you specify multiple button specific properties. Additionally to the obligatory 'offset' and 'size' properties the Button element also accepts the 'buttonimage' and 'buttonstate' property.
  
    
    
  

Similar to the 'vobj' property of the Image element, the 'buttonimage' property also accepts the path to STI image file that contains the required images for the different states of the button. These states are defined in the 'buttonstate' property, where the attributes 'grayed', 'off_normal', 'off_hilite', 'on_normal', 'on_hilite' can take a nonnegative integer value that corresponds to a valid image index in the given button image file. If an attribute is omitted its value is set to -1 by default.

3. Layout hierarchy
The section about type hierarchy defines how one GUI component can be described in an XML file. This section is about the definition of many GUI components and its logical grouping.

A relevant relationship between two components is the relative distance of their origins on the screen. This distance doesn't change when one component is moved, which consequently means that the other element has to be moved too. In this situation one component can be considered as a root node to the other component and it is describes in the XML file in the following way
  
    
     
	  
	    
	  
	  
	    
	  
	  
	    
	  
	
  

With this approach it is possible to move or position a whole group of elements by just offsetting their root node. Since every GUI component type is a "Node" it can be a parent or root node of many other GUI components.

Currently a layout hierarchy of the Map Screen is defined in the code and is accessible via an XML file. The hierarchy is not enforced though, that is when an element is declared as a child of another element in the XML file it is not tested whether this corresponds to the definition in the code. This allows to just write down every element as a plain list, but it is harder to "see" the relationship in the XML file. To do so, you have to look it up in the code. So this leaves us with three possibilities.
  • leave it as it is
  • remove the layout hierarchy and just keep the plain list
  • remove the hardcoded hierarchy and implement the possibility to dynamically define the parent/child relationship for two elements and so allow to build custom hierarchies
That's it. Should be enough to understand what is going on in the XML files. So, open the files, change values and see what happens.

PS. I didn't write a list of all possible element names, but you can look them up in the XML files.

Report message to a moderator

Master Sergeant
Re: RII - Resolution Independent Interface[message #205902] Fri, 09 January 2009 00:47 Go to previous messageGo to next message
BirdFlu is currently offline BirdFlu

 
Messages:438
Registered:September 2007
Location: Lampukistan
Kaerar
For me as a gfx artist does this mean I can make 16bpp images and use them ingame? Does it allow for transparency? Or is 24bpp needed for that?
24bpp is only rgb. For rgba you need 32bpp. And speaking about transparency, do you mean full transparency (visible or not) or also partial transparency (all 256 values for the alpha channel) ?

Report message to a moderator

Master Sergeant
Re: RII - Resolution Independent Interface[message #205907] Fri, 09 January 2009 05:26 Go to previous messageGo to next message
Kaerar is currently offline Kaerar

 
Messages:2022
Registered:January 2003
Location: Australia :D
I would obviously prefer partial transparency as that would allow for soft edges to items and the ability to do some nice transition effects. So for that I guess 32bpp would be better. I wonder if its possible to change it to render in 32bpp?

Also I don't know if this intersects with the interface but is it possible to move all the MD and SM items into separate STI files instead of looking in the STI libraries as that would allow for correctly coloured MD and SM items.

Report message to a moderator

Lieutenant

Re: RII - Resolution Independent Interface[message #205973] Fri, 09 January 2009 23:41 Go to previous messageGo to next message
BirdFlu is currently offline BirdFlu

 
Messages:438
Registered:September 2007
Location: Lampukistan
Kaerar
Also I don't know if this intersects with the interface but is it possible to move all the MD and SM items into separate STI files instead of looking in the STI libraries as that would allow for correctly coloured MD and SM items.
Do you mean to split the files
"INTERFACE\mdguns.sti"
"INTERFACE\mdp1items.sti"
"INTERFACE\mdp2items.sti"
"INTERFACE\mdp3items.sti" ?
These seem to be only the MD items. Where are the SM items?
And what is the exact problem? The shared palette?

[Updated on: Sat, 10 January 2009 00:14] by Moderator

Report message to a moderator

Master Sergeant
Re: RII - Resolution Independent Interface[message #205979] Sat, 10 January 2009 03:08 Go to previous messageGo to next message
Kaerar is currently offline Kaerar

 
Messages:2022
Registered:January 2003
Location: Australia :D
SM are in the '%JA2Root%>Data1.13>tilesets>0' folder. Again same four but with SMxxxx.STI.

When I say split I mean like the Bigitems folder so that all images are separate. Currently the code looks into the library and takes what it wants from the library. I would like it to be adjusted so that it looks into the MDGuns folder and takes the single image with MDgun001 for instance. This would increase the flexibility for the item colours due to no more shared palettes (and the you see the MD pics more than any other ingame).

Report message to a moderator

Lieutenant

Re: RII - Resolution Independent Interface[message #205992] Sat, 10 January 2009 10:26 Go to previous messageGo to next message
Starwalker is currently offline Starwalker

 
Messages:759
Registered:October 2005
Location: Hannover, Germany
Or maybe they could be put into their own multi-STIs, like a single STI for one item, containing all three sizes of pics for a single item (with the same pallette)? If we want to keep the STI-format...

Report message to a moderator

First Sergeant

Re: RII - Resolution Independent Interface[message #205997] Sat, 10 January 2009 12:09 Go to previous messageGo to next message
Kaerar is currently offline Kaerar

 
Messages:2022
Registered:January 2003
Location: Australia :D
True, but wouldn't that be harder than altering the code to be the same as already existing code? Also making triple STI files for all the guns is far more work than altering the existing MD and SM files to be single files each...

If it goes to a new format then the single files won't be much of an issue any more anyway. I know it's neater having the single STI for the same gun, but altering the code to look the same way it does for the big items, for the MD and SM is a lot simpler to the best of my knowledge. Also with a folders named after the files themselves its actually very easy to edit applications like the XML editor etc...

Report message to a moderator

Lieutenant

Re: RII - Resolution Independent Interface[message #206001] Sat, 10 January 2009 13:46 Go to previous messageGo to next message
BirdFlu is currently offline BirdFlu

 
Messages:438
Registered:September 2007
Location: Lampukistan
The SM images, as far as i have seen it, are not directly referenced in the code. They are processed with some generic tileset handling functions, i guess. And the images are soooooo tiny anyway that giving each one an own palette is like going from ugly 50 pixels to some not so ugly 50 pixels, but what do i know.

Splitting MD images, on the other hand, should be relatively simple.

And rendering rgba images is problematic in its own way. Multiple rendering of one rgba image can have different results. This is so, because the result depends on the image itself AND on the surface you want render to. If you render the rgba image two times the surface has to be identical both times. With rgb rendering this is not a problem, since you overwrite whatever was there before. With rgba rendering, however, you blend the image with the surface AGAIN. To void this you would have to rerender the other surface too. And, the more rgba images you have on the screen at one time, the more you have to rerender stuff. This would probably require some modifications to the rendering code. So, keeping the rgba images at a low level would be advisable.


Edit :

Here are the splitted images
MD sti images
MD png images
We gotta start with something.

[Updated on: Sat, 10 January 2009 15:25] by Moderator

Report message to a moderator

Master Sergeant
Re: RII - Resolution Independent Interface[message #206051] Sat, 10 January 2009 20:49 Go to previous messageGo to next message
Starwalker is currently offline Starwalker

 
Messages:759
Registered:October 2005
Location: Hannover, Germany
Kaerar
True, but wouldn't that be harder than altering the code to be the same as already existing code? Also making triple STI files for all the guns is far more work than altering the existing MD and SM files to be single files each...

If it goes to a new format then the single files won't be much of an issue any more anyway. I know it's neater having the single STI for the same gun, but altering the code to look the same way it does for the big items, for the MD and SM is a lot simpler to the best of my knowledge. Also with a folders named after the files themselves its actually very easy to edit applications like the XML editor etc...

Yes, it would be more work, but it would also keep all the pics for a single item in one place, thus minimizing chaos. Whether or not it's worth the work is up to the person trying to do it... Wink

Report message to a moderator

First Sergeant

Re: RII - Resolution Independent Interface[message #206075] Sun, 11 January 2009 04:47 Go to previous messageGo to next message
Kaerar is currently offline Kaerar

 
Messages:2022
Registered:January 2003
Location: Australia :D
I was thinking that to implement the Bigitems method would be a quicker fix than changing the whole pathing structure, but that was just my impression. Of couse it would be sensible to have them all in a single directory for editing (even as a single STI file too). I am just not sure the extra work is worth the effort of doing that.

Report message to a moderator

Lieutenant

Re: RII - Resolution Independent Interface[message #206085] Sun, 11 January 2009 11:53 Go to previous messageGo to next message
BirdFlu is currently offline BirdFlu

 
Messages:438
Registered:September 2007
Location: Lampukistan
Starwalker
but it would also keep all the pics for a single item in one place
Kaerar
Of couse it would be sensible to have them all in a single directory for editing (even as a single STI file too)

So, should it be one directory for all files or one directory per item (= a lot of directories)? And if the all images of one item should be merged in one file, they would have to share a palette again. The question is, are the three palettes of the three images equal or not? If not, we would probably have to create each item image by hand. Just splitting the files (and converting them to png) is easy. I can do it automatically for every paletted sti image.

Report message to a moderator

Master Sergeant
Re: RII - Resolution Independent Interface[message #206088] Sun, 11 January 2009 12:54 Go to previous messageGo to next message
Starwalker is currently offline Starwalker

 
Messages:759
Registered:October 2005
Location: Hannover, Germany
In my opinion, each item should have a single STI (if we stay with that format), which contains all three sizes (BigItem-, MD-, and SM-pic) and use the pallette of the BigItem pic (the BigItem pics already have all their own pallettes). Sharing that pallette is not a problem, IMHO, because it is the same item, anyway.

All these STI-files should then be in a single directory.

Report message to a moderator

First Sergeant

Re: RII - Resolution Independent Interface[message #206090] Sun, 11 January 2009 13:57 Go to previous messageGo to next message
Kaerar is currently offline Kaerar

 
Messages:2022
Registered:January 2003
Location: Australia :D
I go with individual PNG's all the way as long as the game can render transparency effects (partial most importantly).

The only issue I can see with this is the animations are all going to need their own folders. It would neaten things up a lot though Smile

Report message to a moderator

Lieutenant

Re: RII - Resolution Independent Interface[message #206093] Sun, 11 January 2009 14:18 Go to previous messageGo to next message
BirdFlu is currently offline BirdFlu

 
Messages:438
Registered:September 2007
Location: Lampukistan
We could also store images in a container like zip or 7z. No need for "crappy" 3rd party programs then. I'm just saying.

Report message to a moderator

Master Sergeant
Re: RII - Resolution Independent Interface[message #206099] Sun, 11 January 2009 15:08 Go to previous messageGo to next message
Kaerar is currently offline Kaerar

 
Messages:2022
Registered:January 2003
Location: Australia :D
That would be really helpful Very Happy .7z for the win Smile

Report message to a moderator

Lieutenant

Re: RII - Resolution Independent Interface[message #206568] Sun, 18 January 2009 02:08 Go to previous messageGo to next message
Kaiden is currently offline Kaiden

 
Messages:504
Registered:September 2003
The UB source was released (not in the USA though). That's where I got all the code for the IMP webpages. It's 2.6MB zipped, same directory structure as JA2 source code, in fact, it's the same code, they just severely crippled it for UB.

Let me know where to send it if you or anyone else wants to redistribute it.

Report message to a moderator

First Sergeant

Re: RII - Resolution Independent Interface[message #206569] Sun, 18 January 2009 02:19 Go to previous messageGo to next message
Khor1255 is currently offline Khor1255

 
Messages:1817
Registered:August 2003
Location: Pleasantville, NJ
Kermi or someone like him might be happy to host it. This way it is available for anyone who asks.

I didn't know the UB source code was ever released. Maybe we could have a mod import feature? The way I think of this working is similar to the way UB lets you import characters from vanilla but with xmls for parameter changes instead of the default losses of things you get when you import from vanilla to ub. Hell, with a sophisticated enough xml system it might even be possible to import characters to two completely different mods.

I know that last bit is pie in the sky and actually not terribly important. But it would be cool to have an import feature so a mod maker could make a series of small mods rather than one giant mod.

Sorry, caffeine.

Report message to a moderator

Sergeant Major
Re: RII - Resolution Independent Interface[message #206570] Sun, 18 January 2009 02:23 Go to previous messageGo to next message
Kaiden is currently offline Kaiden

 
Messages:504
Registered:September 2003
No worries, Khor, since I'm on and you're on, can I just send it to you so I don't forget and get sidetracked? I think Kermi would host it if asked.

Report message to a moderator

First Sergeant

Re: RII - Resolution Independent Interface[message #206571] Sun, 18 January 2009 02:29 Go to previous messageGo to next message
Khor1255 is currently offline Khor1255

 
Messages:1817
Registered:August 2003
Location: Pleasantville, NJ
That would be cool. I sent him a bunch of stuff last year and he also said he would host the 687 version for those of us who would like to build a mod on a foundation other than quicksand. You once said you had the 687. I have the installer .exe but apparently it is missing something because when I try to just copy/paste that to a version and install the 687 it does not work.

If you do have the 687 I would like to also have this. I have it on both computers I work on but I don't know how to zip up just it's contents so I could offer it for distribution. Also, the installer is quite cool and would save a lot of time for anyone who wanted to have a better modding platform.

Good to hear from you again.

Report message to a moderator

Sergeant Major
Re: RII - Resolution Independent Interface[message #206573] Sun, 18 January 2009 02:33 Go to previous messageGo to next message
Kaiden is currently offline Kaiden

 
Messages:504
Registered:September 2003
That's not something I can easily e-mail though...

And JA 2.5 source commin atcha

[Updated on: Sun, 18 January 2009 02:34] by Moderator

Report message to a moderator

First Sergeant

Re: RII - Resolution Independent Interface[message #206574] Sun, 18 January 2009 03:43 Go to previous messageGo to next message
Marlboro Man

 
Messages:1159
Registered:October 2005
Location: USA
UB Source code would definately be nice to have available.

Report message to a moderator

Sergeant Major

Re: RII - Resolution Independent Interface[message #206576] Sun, 18 January 2009 04:38 Go to previous messageGo to next message
Kaerar is currently offline Kaerar

 
Messages:2022
Registered:January 2003
Location: Australia :D
Perhaps the implemented changes in JA2 can be ported over to UB and fix it's crippled state Wink

Report message to a moderator

Lieutenant

Re: RII - Resolution Independent Interface[message #206583] Sun, 18 January 2009 08:46 Go to previous messageGo to next message
Kaiden is currently offline Kaiden

 
Messages:504
Registered:September 2003
You got it too MM, maybe it can get hosted somewhere and not lost. I'm sure it's on Nitrat's site somewhere, but I've never found it anywhere. I got it from someone off the Basis forums years ago.

@Kaerar, by crippled, I mean it's the same source with all the strategic stuff commented out, I think some of the original JA2 source files are missing, and I'm sure some code was just flat out deleted instead of commented. I also think the hacked things together in UB worse than they did in the original JA2.

On the other hand, there are some nice things to say about UB, like um well, it has snow. So it's highly possible that someone may consider porting 1.13 over for those who like... snow. Smile

Now back to your regularly scheduled thread about dynamic resolutions (woot).

Report message to a moderator

First Sergeant

Re: RII - Resolution Independent Interface[message #206584] Sun, 18 January 2009 09:02 Go to previous messageGo to next message
Kaerar is currently offline Kaerar

 
Messages:2022
Registered:January 2003
Location: Australia :D
OT: Kaiden if you send it to me, then I'll upload to Kermi's server when I get it.

On Topic: The XNA project looks like it would work well with dynamic resolutions too. Wonder if BF and whoever it was should have a chat Wink

Report message to a moderator

Lieutenant

Re: RII - Resolution Independent Interface[message #206594] Sun, 18 January 2009 15:21 Go to previous messageGo to next message
Marlboro Man

 
Messages:1159
Registered:October 2005
Location: USA
Quote:
You got it too MM,



Thanks. Wink

Report message to a moderator

Sergeant Major

Re: RII - Resolution Independent Interface[message #206682] Mon, 19 January 2009 18:38 Go to previous messageGo to next message
zilpin is currently offline zilpin

 
Messages:63
Registered:October 2007
I'm not a fan of making JA2 XNA based.
Adopting any new rendering boiler plate takes great deal of effort.
For that amount of time & work, JA2 should become more platform agnostic, not more platform dependent.
Besides, the rendering problems won't disappear just by changing the underlying engine.

Lots of little changes spread through lots of files, where the original developers used differing methods to draw UI elements in the correct location based on different assumptions about screen resolution. Lots of hard-coded and half-hard-coded nastiness in there.

Impressive overhaul to make it work "right".

Report message to a moderator

Corporal
Re: RII - Resolution Independent Interface[message #207067] Sat, 24 January 2009 13:45 Go to previous messageGo to next message
Kermi is currently offline Kermi

 
Messages:81
Registered:October 2002
Kaiden: I can put the source up, email should be workable solution for it. Address is in my profile.

Report message to a moderator

Corporal 1st Class
Re: RII - Resolution Independent Interface[message #209665] Tue, 03 March 2009 16:54 Go to previous messageGo to next message
jaggy is currently offline jaggy

 
Messages:13
Registered:May 2007
Hi, BirdFlu. I'm unable to download the "rii" file from Turbo Upload and was hoping you or anybody on this thread could please e-mail it to me at "vinegarandice@yahoo.com" as its relatively small, it would be very much appreciated. Thanks in advance.

Report message to a moderator

Private
Re: RII - Resolution Independent Interface[message #209677] Tue, 03 March 2009 22:19 Go to previous messageGo to next message
BirdFlu is currently offline BirdFlu

 
Messages:438
Registered:September 2007
Location: Lampukistan
jaggy
Hi, BirdFlu. I'm unable to download the "rii" file from Turbo Upload and was hoping you or anybody on this thread could please e-mail it to me at "vinegarandice@yahoo.com" as its relatively small, it would be very much appreciated. Thanks in advance.
That's strange. It does work for me (both alpha_v1 and alpha_v2), although i had to wait a little longer until the download(s) started. If it still doesn't work for you,
i can then send it to you per mail :bomb: (e-mail of course).

Anyway, the next update is on the way, maybe around next week. There will be only a small RII update, though. The rest will be new non-gameplay stuff.

Report message to a moderator

Master Sergeant
Re: RII - Resolution Independent Interface[message #209705] Wed, 04 March 2009 18:12 Go to previous messageGo to next message
jaggy is currently offline jaggy

 
Messages:13
Registered:May 2007
Hi, BirdFlu. Managed to download it at work. This will not work with revision 2124, right? Tried it but it crashes to desktop. Any chance of getting this to work with earlier revisions? Too far into the game to want to start all over again. Thanks in advance.

Report message to a moderator

Private
Re: RII - Resolution Independent Interface[message #209720] Wed, 04 March 2009 23:31 Go to previous messageGo to next message
BirdFlu is currently offline BirdFlu

 
Messages:438
Registered:September 2007
Location: Lampukistan
jaggy
Hi, BirdFlu. Managed to download it at work. This will not work with revision 2124, right? Tried it but it crashes to desktop. Any chance of getting this to work with earlier revisions? Too far into the game to want to start all over again. Thanks in advance.
Theoretically, it would be possible to backport my stuff to older revisions, as it doesn't really rely on much. But practically, there is no easy, automatic way to do this. I would have to merge the two revisions manually, meaning working on something that is already obsolete. And if I had to choose, i would rather work on the future than on the past.

And anyway, this project is still in a very early stage with a lot of things not working properly. You probably wouldn't want to play a whole game right now.

Report message to a moderator

Master Sergeant
Re: RII - Resolution Independent Interface[message #210464] Wed, 18 March 2009 03:13 Go to previous messageGo to next message
BirdFlu is currently offline BirdFlu

 
Messages:438
Registered:September 2007
Location: Lampukistan
Ok, here is the new version (Alpha_V3) of this mod (based on SVN revision 2624).

This update contains little RII related code, it only fixes the time display when planning a path on the strategic map. The rest is completely new stuff, which is
  • VFS : Virtual File System
  • Conversion of SLF archives to 7z (.jdc.7z) archives (with additional STI to PNG conversion)
  • Loading and Drawing PNG files
  • Splitting MDGUNS.STI, MDP1ITEMS.STI, MDP2ITEMS.STI, MDP3ITEMS.STI in separate STI files
Here the same with a little more details.

VFS :

There has to be a new file (vfs_config.ini) in the directory of the executable file. I provide three example files that implement three different configurations. One that uses the old SLF libraries and two that use the new 7z archives. You have to rename one of these files to "vfs_config.ini" or the game won't start. Inside the vfs_config.ini you will find several (non-commented) sections. In the first section (vfs_config) you define which profiles will be looaded.
[vfs_config]
PROFILES = SlfLibs, Vanilla, v113, RII, UserProf

Each Profile has a name ("NAME="), a link to the real file system ("PROFILE_ROOT") and a list of locations
[PROFILE_SlfLibs]
NAME = SLF Libs
LOCATIONS = Ambient, Anims, ...
PROFILE_ROOT = 

[PROFILE_Vanilla]
NAME = Vanilla Dirs
LOCATIONS = data_dir
PROFILE_ROOT = 
A location is a place where data files can be found and is defined by a location type ("TYPE="), that can be either "DIRECTORY" or "LIBRARY", a mount point in the VFS ("MOUNT_POINT=") and the path to the actual location (directory or archive) specified relative to the PROFILE_ROOT. In the case of a library there is an alternative way to specify the path ("VFS_PATH="), where the archive file will be searched in the VFS first, and when unsuccessful default to the "PATH=" entry.
[LOC_RII_dirs]
TYPE = DIRECTORY
PATH = 
MOUNT_POINT = 

[LOC_Ambient]
TYPE = LIBRARY
PATH = Data/Ambient.slf
VFS_PATH = Ambient.slf
MOUNT_POINT = 


There is one "special" profile
[PROFILE_UserProf]
NAME = Player Profile
LOCATIONS = 
PROFILE_ROOT = Profiles\UserProfile
WRITE = true
that is defined as writeable. You won't (should not) be able to write any files when you don't have a writeable profile. This profile is supposed to contain user data, like temporary files, config files and also savegames. Make sure you have at least one writeable profile, and one of these profiles should ideally be on top of all other profiles (rightmost profile in the vfs_config.ini file).

SLF -> 7z :

In order to use the new 7z archives you have to create them first. There is a second executable file (Ja2Convert.exe) that can do this for you. There are also two batch files (convert.bat, convert_nopng.bat) that calls Ja2Convert.exe with different parameters and converts all slf archives. The new 7z archives are written into the directories "Profiles/libs" and "Profiles/libs_png" that are also referenced in two of the three vfs_config.ini files.

STI -> PNG@7z :

Creating PNG files is nice, but using them in the game is even nicer. Actually, whenever a STI file (filename.sti) should be loaded, i first look whether there is a .jpc.7z (filename.jpc.7z) counterpart. When there isn't one, i load the STI file. Right now the conversion is as straight as possible, meaning that paletted STI images will be converted to paletted PNG images. To be more precise, one STI image is converted into an 7z archive where the subimages of the STi file will be stored as separate PNG images (named 0.png - n.png, or 00.png - nn.png). When there is additional data stored in the file, it will be written to the file "appdata.xml" and also stored in the archive. Non paletted STI images are written as 24 bit rgb files (0.png@filename.jpc.7z). These are mostly loadscreens, but also a couple of other files too.

MDP :

I splitted the files MDGUNS.STI, MDP1ITEMS.STI, MDP2ITEMS.STI, MDP3ITEMS.STI into separate STI files and load these file into their own 'VideoObject's. There isn't really much more to say about it.


Have fun.


EDIT : forgot the things that are not working
  • videos are not working (different file calls, not the regular FileOpen, FileRead function). will have to take a closer look at it
  • multiplayer is not working, because of the ini file (that i don't evaluate now)
  • only enhanced description box is working, in the regular box i seem to have forgotten to load the background image (probably lost during merging)
  • stuff that didn't work in older versions

[Updated on: Wed, 18 March 2009 03:44] by Moderator

Report message to a moderator

Master Sergeant
Re: RII - Resolution Independent Interface[message #210465] Wed, 18 March 2009 03:18 Go to previous messageGo to next message
Kaerar is currently offline Kaerar

 
Messages:2022
Registered:January 2003
Location: Australia :D
Do the Archives for images have a limit for amount at the moment?

For instance you say "0.png - n.png, or 00.png - nn.png" does it go up to 0000.png - nnnn.png?

Report message to a moderator

Lieutenant

Re: RII - Resolution Independent Interface[message #210466] Wed, 18 March 2009 03:21 Go to previous messageGo to next message
BirdFlu is currently offline BirdFlu

 
Messages:438
Registered:September 2007
Location: Lampukistan
Kaerar
Do the Archives for images have a limit for amount at the moment?

For instance you say "0.png - n.png, or 00.png - nn.png" does it go up to 0000.png - nnnn.png?
there are no limits, besides those that you have know in the code that so many files exist

Report message to a moderator

Master Sergeant
Re: RII - Resolution Independent Interface[message #210467] Wed, 18 March 2009 03:21 Go to previous messageGo to next message
CptMoore

 
Messages:224
Registered:March 2009
Questions about 24bit pngs? Can I use them for the gun images? And the loading screens?

Just asking, me don't need no features (yeyeye, hollywood english at its best with double negative only counting as one).

Report message to a moderator

Sergeant 1st Class
Re: RII - Resolution Independent Interface[message #210468] Wed, 18 March 2009 03:31 Go to previous messageGo to previous message
BirdFlu is currently offline BirdFlu

 
Messages:438
Registered:September 2007
Location: Lampukistan
Loading screens are already 24 bit. As for the gun images, well that depends on what drawing function is called in the code. If it is a generic function, the it probably will work, as i try to identify such images and call the fitting function. If a specific function is called that doesn't "understand" 24 bit, then the game will just crash. But you can try out for yourself. Create a new Profile and add it in the vfs_config.ini. Put your files in your new profile directory and start the game. If it fails, just remove the profile and no harm was done to your old files.

Hint: everything that has to be shaded (animations, tilesets) won't most probably work with 24 bit.

Report message to a moderator

Master Sergeant
Previous Topic: Learning how the tactical AI works
Next Topic: Folding Stock Revamp
Goto Forum:
  


Current Time: Fri Mar 29 10:16:14 GMT+2 2024

Total time taken to generate the page: 0.02468 seconds