Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 11:46 am
All times are UTC + 0
Banshee - Palette question
Moderators: stucuk
Post new topic   Reply to topic Page 1 of 1 [31 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Wed Nov 20, 2013 2:26 am    Post subject:  Banshee - Palette question Reply with quote  Mark this post and the followings unread

I recently restarted working on the project, I have to say I don't know if I'll really remake it,
but right now I've only got a couple of things done.

Anyway, doesn't matter, I was just curious in something you did when loading  .pal files.
Do you know why you had to multiply by four the RGB values?
By that I mean, do you know why the devs divised the RGB values of their palettes when saving them?

With the division or not, it just takes 3 bytes to store a color so it doesn't make sense right now.

Last edited by Zaaz on Wed Nov 20, 2013 7:36 am; edited 1 time in total

Back to top
View user's profile Send private message
Starkku
Cyborg Commando


Joined: 28 Dec 2007
Location: Finland

PostPosted: Wed Nov 20, 2013 3:01 am    Post subject: Reply with quote  Mark this post and the followings unread

C&C game palette files use 6 bits per each component in RGB (values in bytes ranging from 0-63) as opposed to 8 bits (ranging from 0-255). Don't ask why. Possibly because the games itself use 16-bit 5-6-5 RGB color display and conversion from 24-bit would result in more inaccuracies, or require more processing power.

_________________

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID Twitter Channel URL
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyorgy, Hungary

PostPosted: Wed Nov 20, 2013 4:01 am    Post subject: Reply with quote  Mark this post and the followings unread

I think the latter. Keep in mind that this subsystem didn't changed since TibDawn.

_________________
"If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more...

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Wed Nov 20, 2013 4:08 am    Post subject: Reply with quote  Mark this post and the followings unread

Oh, alright. Thanks for the info. Another quick thing then, if you know that too.
I've been able to load and save SHPs, but somehow, for example, I lose 1 KB when saving e1.shp, compared to the original file.

I checked and both have the same amounts of Compression 1 & 3 frames.
So I'm wondering if Compression 1 frames adopts a stride larger than its width?

Because I really can't explain it otherwise, I looked at all their frames when loaded and they are identical.
I don't seem to be losing useful data.

Last edited by Zaaz on Wed Nov 20, 2013 7:35 am; edited 1 time in total

Back to top
View user's profile Send private message
Bittah Commander
Defense Minister


Joined: 21 May 2003
Location: The Netherlands

PostPosted: Wed Nov 20, 2013 4:21 am    Post subject: Reply with quote  Mark this post and the followings unread

I know for one that SHPs saved with XCC Mixer are somehow different from SHPs saved with OS SHP Builder, regardless of the compression you choose in the OS SHP Builder settings.
That's why overlay saved with OS SHP Builder (with any compression) always shows up as hexadecimal numbers in FinalSun, but this doesn't happen if the SHP was saved with XCC Mixer.

So either XCC Mixer uses a different compression or it saves SHPs with some extra data which OS SHP Builder doesn't bother with.

_________________

Back to top
View user's profile Send private message Send e-mail ModDB Profile ID YouTube User URL Facebook Profile URL
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Wed Nov 20, 2013 4:55 am    Post subject: Reply with quote  Mark this post and the followings unread

I logged some stats and it seems XCC saves C3 frames with a length that's a multiple of 4. It doesn't seem to pad C1 frames tho.
Whereas OSSB doesnt pad anything at all. Im gonna take a look at XCC's code. Interesting interesting!

Thanks for the heads up bittah

Last edited by Zaaz on Wed Nov 20, 2013 7:31 am; edited 2 times in total

Back to top
View user's profile Send private message
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Wed Nov 20, 2013 7:30 am    Post subject: Reply with quote  Mark this post and the followings unread

Huh, the decoder/encoder in the XCC source is exactly like OSSB.
XCC doesn't really touch SHPs, it just copys them as new files.

I find it weird that FinalSun only displays correctly SHPs from the Mixer.
Is this overlay you're talking about contained in a SHP in the Mix file or do you select  'copy as shp'?

Back to top
View user's profile Send private message
Bittah Commander
Defense Minister


Joined: 21 May 2003
Location: The Netherlands

PostPosted: Wed Nov 20, 2013 2:44 pm    Post subject: Reply with quote  Mark this post and the followings unread

SHPs are always contained by MIX files, since both TS or FinalSun won't read them otherwise. And yes, with saving as SHP with XCC Mixer I mean using the "Copy as SHP (TS)" function or "Paste as SHP (TS)".

_________________

Back to top
View user's profile Send private message Send e-mail ModDB Profile ID YouTube User URL Facebook Profile URL
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Thu Nov 21, 2013 8:33 pm    Post subject: Reply with quote  Mark this post and the followings unread

Original Shps have their C3 frames padded to a multiple of 8 (not 4 as I mentionned in my last posts).

Anyway, doesn't matter. Give me an example Bittah. Which extracted file would appear correctly in FS?

Back to top
View user's profile Send private message
Bittah Commander
Defense Minister


Joined: 21 May 2003
Location: The Netherlands

PostPosted: Thu Nov 21, 2013 8:58 pm    Post subject: Reply with quote  Mark this post and the followings unread

Any SHP file that was originally converted by XCC Mixer will appear correctly in FinalSun. If you open that same SHP file with OS SHP Builder and then re-save it, it will no longer correctly appear in FinalSun anymore, no matter what settings you used.

_________________

Back to top
View user's profile Send private message Send e-mail ModDB Profile ID YouTube User URL Facebook Profile URL
Morpher
General


Joined: 28 Jan 2005

PostPosted: Fri Nov 22, 2013 4:17 am    Post subject: Reply with quote  Mark this post and the followings unread

Has anyone ever actual figured out why this is?

_________________


Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Fri Nov 22, 2013 12:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

I have no idea why FinalSun is so restrictive.

Back to top
View user's profile Send private message Visit poster's website Skype Account
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Fri Nov 22, 2013 1:56 pm    Post subject: Reply with quote  Mark this post and the followings unread

So is FinalAlert 2, I think it has to do with the fact that FS/FA2 share the same type of code used in XCC tools.
Maybe OS SHP Builder uses it too, I'm not sure but this could be a reason.

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Fri Nov 22, 2013 3:07 pm    Post subject: Reply with quote  Mark this post and the followings unread

^^Doubt that's the reason, because buildings and other SHPs show up fine in FS/FA regardless if they are saved with SHP Builder or XCC Mixer.
There seems to be some special logic behind the way FS/FA treat Overlay SHPs.

I think Matze got some infos directly from WW and coded special logics in the program which he didn't made public and we aren't aware of. e.g. FS is also using code from game.exe to load and find certain files.

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Sat Nov 23, 2013 1:18 am    Post subject: Reply with quote  Mark this post and the followings unread

I found some instructions that you could add to OSSB banshee, in order to fix the issue Bittah talked about.
I'd do it, but I don't have delphi to recompile your code.

I thought the padding was the problem, but it's not.
It has to do with the Unknown property of a frame header (from the XCC code).
In your code, you named that property Transparent.

Here's what XCC does, but not OSSB:
FrameHeader.Unknown = (ImageCount & 1) > 0 || frameIndex < ImageCount / 2 ? 0x70000 : 0;

I tested it with my code. I could now see in FinalSun  the SHP overlay I saved.
However I don't really know why FinalSun requires it.

It doesn't make sense for that property to be transparency. It's either set to 0 or R=0, G=0, B=112 7, A=0 (oops).
Unless FinalSun reads it differently.

Last edited by Zaaz on Sat Nov 23, 2013 2:41 pm; edited 1 time in total

Back to top
View user's profile Send private message
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Sat Nov 23, 2013 1:36 am    Post subject: Reply with quote  Mark this post and the followings unread

@Lin Kuei Ominae
It might certainly be the case. I recently contacted Matthias and he told me he couldn't release the source of his editors
since he collabd with Olaf and people from Westwood studio. And since Westwood was owned by EA, some code
in his editors is still owned by the company.

I try contacting EA to ask them if they could give permission to Matt to release his code, but I swear to god I couldnt find
anything from their website that could help me reach someone that could do that. Their support and twitter gave no results.

I've no idea how to contact them directly. I think I'll have to call/harass them or something.

Back to top
View user's profile Send private message
ApolloTD
Commander


Joined: 19 Nov 2003

PostPosted: Sat Nov 23, 2013 1:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

The Issue has to do with radar color rgb field, offset 20-22, shp builder sets it to 0,0,0 while xcc 0,0,7 and WW uses various values and of course shp builder value is bad for FS/FA map editor.

Ingame its not really used but map editor wants it.

Back to top
View user's profile Send private message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Sat Nov 23, 2013 3:13 pm    Post subject: Reply with quote  Mark this post and the followings unread

Zaaz wrote:
I try contacting EA to ask them if they could give permission to Matt to release his code, but I swear to god I couldnt find
anything from their website that could help me reach someone that could do that. Their support and twitter gave no results.

I've no idea how to contact them directly. I think I'll have to call/harass them or something.


Did the exact same.
FA2 is owned by Westwood, but FinalSun has no trademark or copyright other than Matze's. I asked him for the source of FinalSun and next thing I know, all downloads were gone from his website.
FA2 YR most likely has code (can't see why since the editor is quite static/abstract, pure display, no in-game logics needed), and since FS is derived from FA2 YR, I wouldn't be surprised FS has some too.

Tried contacting EA_Cire, no response. I think it's a lost cause. Focusing on a possible transformation of the map render tool to a map editor seems more realistic than begging for FS' source.

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Sat Nov 23, 2013 4:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

EA_CIRE was fired with the whole development team. So, I'm not surprised that he won't be able to help you with that. We'll have to wait until the next team who works in a C&C game presents itself... or you'll have to contact someone in a higher position at EA. I have no idea who would be.

By the way, I've made a committ to OS SHP Builder using the code that Zaaz has displayed above.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Bittah Commander
Defense Minister


Joined: 21 May 2003
Location: The Netherlands

PostPosted: Sat Nov 23, 2013 4:54 pm    Post subject: Reply with quote  Mark this post and the followings unread

It actually would be nice if you could add a function to OS SHP Builder which assigns the average color of the SHP as the radar color. This would be useful for tiberium and all other SHPs which have a radar color ingame; these currently all show up as black on the radar unless you manually change the radar color with Nyerguds' tool afterwards and this has to be done every single time you edit the SHP.

Edit:
I just did a test to see if FinalSun would display overlay such as concrete walls with other radar colors than 0,0,7 and it indeed works; even colors that aren't multiples of 4 work (such as 0,0,1).

So instead of making OS SHP Builder save all SHPs with radar color 0,0,7 by default, I think it would be better if it'd always use the average of the colors used as the radar color.

_________________

Back to top
View user's profile Send private message Send e-mail ModDB Profile ID YouTube User URL Facebook Profile URL
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Sat Nov 23, 2013 7:55 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ok, I'll work on it tomorrow.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Sat Nov 30, 2013 10:54 am    Post subject: Reply with quote  Mark this post and the followings unread

Another question, Banshee.
In OSSB, when you open a TS Shp and you view a shadow frame,
why does it only permits you to select 0x001 or 0x000?

Why not 0x0CC instead, which is (I think) the shadow color?
EDIT: I just read that 0x001 is the shadow. Are there multiple values for it then?

Back to top
View user's profile Send private message
Bittah Commander
Defense Minister


Joined: 21 May 2003
Location: The Netherlands

PostPosted: Sat Nov 30, 2013 5:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

TS/RA2 only use 0x001 for the the shadow, while TD/RA1 use 0x004.

_________________

Back to top
View user's profile Send private message Send e-mail ModDB Profile ID YouTube User URL Facebook Profile URL
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyorgy, Hungary

PostPosted: Sat Nov 30, 2013 6:08 pm    Post subject: Reply with quote  Mark this post and the followings unread

AFAIK everything which isn't 000 on the second half of the frames will be rendered as shadow.

At least in TS/RA2 it does.

_________________
"If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more...

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Sat Nov 30, 2013 7:16 pm    Post subject: Reply with quote  Mark this post and the followings unread

^^correct
I'm not sure, but i think there is also a special compression bonus for the shadow color which makes the file smaller, when you use the shadow color only and no other color for the shadow frames.

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Sat Nov 30, 2013 7:31 pm    Post subject: Reply with quote  Mark this post and the followings unread

Zaaz's question was answered by both Bittah and Graion.

And LKO, No. The SHP (TS) format only compresses 0s and not the other colors. I'm not acquainted with the SHP (TD) format anymore.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Bittah Commander
Defense Minister


Joined: 21 May 2003
Location: The Netherlands

PostPosted: Wed Dec 04, 2013 10:41 am    Post subject: Reply with quote  Mark this post and the followings unread

It seems that OS SHP Builder uses the wrong palette for shadow frames now. I'm not talking about the shadow color, but the gray-scale colors which the normal are drawn over the shadow frames with.

From what I can tell the palette that's used is always unittem.pal, regardless of what palette you actually have selected.

_________________

Back to top
View user's profile Send private message Send e-mail ModDB Profile ID YouTube User URL Facebook Profile URL
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Sat Dec 07, 2013 2:18 am    Post subject: Reply with quote  Mark this post and the followings unread

Bittah Commander wrote:
It actually would be nice if you could add a function to OS SHP Builder which assigns the average color of the SHP as the radar color. This would be useful for tiberium and all other SHPs which have a radar color ingame; these currently all show up as black on the radar unless you manually change the radar color with Nyerguds' tool afterwards and this has to be done every single time you edit the SHP.

Edit:
I just did a test to see if FinalSun would display overlay such as concrete walls with other radar colors than 0,0,7 and it indeed works; even colors that aren't multiples of 4 work (such as 0,0,1).

So instead of making OS SHP Builder save all SHPs with radar color 0,0,7 by default, I think it would be better if it'd always use the average of the colors used as the radar color.


Banshee wrote:
Ok, I'll work on it tomorrow.


'Tomorrow' may have taken about two weeks... but it has arrived. Check revision 36 and tell me if it looks good.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Zaaz
Disk Thrower


Joined: 21 Apr 2013
Location: Canada

PostPosted: Sat Dec 07, 2013 5:09 am    Post subject: Reply with quote  Mark this post and the followings unread

Here's a demo build that I think fixes your issue, Bittah. I also included the modified FormMain.pas .

EDIT:
Banshee, is this normal that the first time I opened a SHP with your rev 35 on WinXP, it popped up a box saying theres no disk in my tray? Nevermind, VM problem.

EDIT:    updated the demo with a slight change.
EDIT 2: added description of modifications.



Modifications.txt
 Description:
Description of the modifications in FormMain.pas

Download
 Filename:  Modifications.txt
 Filesize:  917 Bytes
 Downloaded:  38 Time(s)


Demo.zip
 Description:
Demo .exe with the mofified file.

Download
 Filename:  Demo.zip
 Filesize:  856.8 KB
 Downloaded:  55 Time(s)


Last edited by Zaaz on Sat Dec 07, 2013 8:23 pm; edited 1 time in total

Back to top
View user's profile Send private message
Bittah Commander
Defense Minister


Joined: 21 May 2003
Location: The Netherlands

PostPosted: Sat Dec 07, 2013 12:39 pm    Post subject: Reply with quote  Mark this post and the followings unread

Banshee wrote:
Check revision 36 and tell me if it looks good.

It does indeed use the color that's used the most as the radar color, but unfortunately it's not excluding the background color.

I confirmed this by using Nyerguds' SHP Radar Color Editor by the way, since it still shows up as black in FinalSun; FinalSun only seems to have an exception for (green) tiberium.
Zaaz wrote:
Here's a demo build that I think fixes your issue, Bittah.

That indeed fixes it Smile

_________________

Back to top
View user's profile Send private message Send e-mail ModDB Profile ID YouTube User URL Facebook Profile URL
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Sat Dec 07, 2013 3:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

It has been committed to revision 37.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [31 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.2075s ][ Queries: 13 (0.0125s) ][ Debug on ]