Posted: Wed Nov 20, 2013 2:26 am Post subject:
Banshee - Palette question
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 QUICK_EDIT
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. _________________ QUICK_EDIT
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Wed Nov 20, 2013 4:01 am Post subject:
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... QUICK_EDIT
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 QUICK_EDIT
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. _________________ QUICK_EDIT
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 QUICK_EDIT
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'? QUICK_EDIT
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)". _________________ QUICK_EDIT
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. _________________ QUICK_EDIT
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. _________________
^^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
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 QUICK_EDIT
@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. QUICK_EDIT
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. QUICK_EDIT
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. _________________
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Sat Nov 23, 2013 4:09 pm Post subject:
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. QUICK_EDIT
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. _________________ QUICK_EDIT
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? QUICK_EDIT
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Sat Nov 30, 2013 6:08 pm Post subject:
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... QUICK_EDIT
^^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
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. _________________ QUICK_EDIT
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Sat Dec 07, 2013 2:18 am Post subject:
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. QUICK_EDIT
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.
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.
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