.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > The Camo Workshop > WinSPMBT
Notices


Reply
 
Thread Tools Display Modes
  #21  
Old October 18th, 2024, 09:12 PM
MarkSheppard's Avatar

MarkSheppard MarkSheppard is offline
Lieutenant Colonel
 
Join Date: Jun 2005
Posts: 1,378
Thanks: 101
Thanked 619 Times in 410 Posts
MarkSheppard is on a distinguished road
Default Re: Next Generation SHP Viewer

I think I may have finally generated correct working SHP decompilation code. It correctly renders a lot of stuff including AOR and PG SHPs which did not render correctly before.

EDIT: It all comes down to the SHP header data.

xStart and yStart in the SHP Icon Headers are irrelevant in Steel Panthers; because everything always begins in the upper left corner of the SHP file, whether it's a screen image, button, or unit icon.

But in Age of Rifles; because of the extensive use of paperdolls with multiple SHP images overlaid over each other; some way of "offsetting" x/y had to be done:



AHA!

It's because Steel Panthers uses the xStart and yStart SHP header variables differently than other SSI programs -- in Steel Panthers, this is used to place the turret and hull offsets to place icons centered on the battlefield.

I need to go look deeper into Fred's code; to see if he had any flags that recognized a Steel Panthers SHP image and treated it differently than a "regular" SSI SHP

EDIT: I figured it out.

SHPs that are used in transparent "paper dolls" have POSITIVE numbers for xStart + yStart.

SHPs that use xStart + yStart to store centroid information for turret placement are NEGATIVE numbers; and this is how SSI differentiated between them, while maintaining compatibility

Last edited by MarkSheppard; October 18th, 2024 at 09:59 PM..
Reply With Quote
The Following 2 Users Say Thank You to MarkSheppard For This Useful Post:
  #22  
Old October 19th, 2024, 07:34 AM
DRG's Avatar

DRG DRG is offline
Shrapnel Fanatic
 
Join Date: Mar 2005
Location: GWN
Posts: 12,493
Thanks: 3,965
Thanked 5,702 Times in 2,814 Posts
DRG will become famous soon enough
Default Re: Next Generation SHP Viewer

Great news. This all sounds very promising .
__________________


"You are never to old to rock and roll if you are too young to die".--- What do you expect to be doing when you are 80?


https://www.youtube.com/watch?v=8kWt8ELuDOc
Reply With Quote
  #23  
Old October 21st, 2024, 07:31 PM
MarkSheppard's Avatar

MarkSheppard MarkSheppard is offline
Lieutenant Colonel
 
Join Date: Jun 2005
Posts: 1,378
Thanks: 101
Thanked 619 Times in 410 Posts
MarkSheppard is on a distinguished road
Default Re: Next Generation SHP Viewer

Still haven't cracked the SHP recompression code; but I'm close to cracking the SPHeader fix code.

As requested, you can double click on the location to get into the gross area of where you want your new centroid to be; and then use the +/- buttons to dial in the exact location.

The "write header to all icons" is for when you have a massive collection of 40 x P-51 mustang icons in that SHP and they all have the same basic centroid.

EDIT: Further work will have to wait for later; everything here so far is a proof of concept working on a massively kludged system; I have to go back and refactor more code to make storing/editing the new header data easier and actually doable.


Last edited by MarkSheppard; October 21st, 2024 at 07:54 PM..
Reply With Quote
The Following 2 Users Say Thank You to MarkSheppard For This Useful Post:
  #24  
Old October 21st, 2024, 09:18 PM
DRG's Avatar

DRG DRG is offline
Shrapnel Fanatic
 
Join Date: Mar 2005
Location: GWN
Posts: 12,493
Thanks: 3,965
Thanked 5,702 Times in 2,814 Posts
DRG will become famous soon enough
Default Re: Next Generation SHP Viewer

Quote:
Originally Posted by MarkSheppard View Post
; everything here so far is a proof of concept working on a massively kludged system
Funnily enough if it was not for kludges made to work the game would not exist
__________________


"You are never to old to rock and roll if you are too young to die".--- What do you expect to be doing when you are 80?


https://www.youtube.com/watch?v=8kWt8ELuDOc
Reply With Quote
  #25  
Old October 22nd, 2024, 09:31 PM
MarkSheppard's Avatar

MarkSheppard MarkSheppard is offline
Lieutenant Colonel
 
Join Date: Jun 2005
Posts: 1,378
Thanks: 101
Thanked 619 Times in 410 Posts
MarkSheppard is on a distinguished road
Potion Re: Next Generation SHP Viewer

Here's version 0.80 -- chosen because it's 80% of the way there; that last 20% will be probably quite difficult.

As before, the password is SPCAMO.

Changes with this version:

1.) More accurate SHP file decoding than previous versions.

2.) You can now edit SP Header files; either by typing in the data yourself, double clicking on the general area you want the centroid to be, and/or using the buttons to fine tune the centroid placement.

BIG NOTE: Currently, the SP Header edit (right click and choose SHOW ICON SP HEADER DATA) has options that are not data friendly.

For example, we have

Write Header to this Icon
Write Header to 'N' Icons
Write Header to This + Alternating Icons

Buttons.

The last two are "extras" to make writing 35 icons of the same exact type (i.e. 35 versions of the same P-51D Mustang) simpler and save you time.

The current implementation when it's used for write header to 'N' icons just copies the "bounding box" -- the last two variables in the SHP header -- xEnd and yEnd -- from the icon in the pop up menu to the next 'N' icons.

It works great if the bounding boxes (i.e. rightmost+bottom-most pixel that is not transparent) are the same. But what happen if the bounding boxes are not the same; i.e. we take the bounding box from a hull icon and paste it over a turret icon?


(Image from SHPEd)

Yeah, that happens.

I need to revise (in the future) the "paste into N" buttons to include a 'recalculate bounding boxes on the fly' function to eliminate this possible failure mode.

But I wanted to get this out for input and testing.
Attached Files
File Type: zip SHPView_v0-80.zip (72.8 KB, 194 views)

Last edited by MarkSheppard; October 22nd, 2024 at 09:48 PM..
Reply With Quote
The Following 2 Users Say Thank You to MarkSheppard For This Useful Post:
  #26  
Old October 22nd, 2024, 09:47 PM
MarkSheppard's Avatar

MarkSheppard MarkSheppard is offline
Lieutenant Colonel
 
Join Date: Jun 2005
Posts: 1,378
Thanks: 101
Thanked 619 Times in 410 Posts
MarkSheppard is on a distinguished road
Default Re: Next Generation SHP Viewer

Sharp eyed people may notice a "Replace SHP Image" option in the right click menu that has functionality that lets you select images to replace an existing SHP icon with.

You can then set the replacement SHP image's header with SHOW SHP HEADER DATA.

What's remaining to do is the last major hurdle -- trying to figure out how to get this thing to do correct SHP compression and then reassembly so that the Replace SHP Image is actually useful, and not just a tech demo.

Last edited by MarkSheppard; October 22nd, 2024 at 10:11 PM..
Reply With Quote
The Following 2 Users Say Thank You to MarkSheppard For This Useful Post:
  #27  
Old October 22nd, 2024, 10:05 PM
DRG's Avatar

DRG DRG is offline
Shrapnel Fanatic
 
Join Date: Mar 2005
Location: GWN
Posts: 12,493
Thanks: 3,965
Thanked 5,702 Times in 2,814 Posts
DRG will become famous soon enough
Default Re: Next Generation SHP Viewer

In the viewer I was able to add a new BMP into a tester SHP file I have in the folder with the viewer.

I was able to adjust the X/Y coordinates to center where I wanted the tester hull in the file

But

When I viewed the full file the number of that Hull was gone as was the crosshair I had centered inside the turret ring



I can see the result of the changed header but I could not find a way to save the file with the new hull

Is that what you see or did I miss something?

As you say not 100% yet but it is very interesting
Attached Thumbnails
Click image for larger version

Name:	wip.png
Views:	271
Size:	1.5 KB
ID:	17063  
__________________


"You are never to old to rock and roll if you are too young to die".--- What do you expect to be doing when you are 80?


https://www.youtube.com/watch?v=8kWt8ELuDOc
Reply With Quote
  #28  
Old October 22nd, 2024, 10:17 PM
MarkSheppard's Avatar

MarkSheppard MarkSheppard is offline
Lieutenant Colonel
 
Join Date: Jun 2005
Posts: 1,378
Thanks: 101
Thanked 619 Times in 410 Posts
MarkSheppard is on a distinguished road
Default Re: Next Generation SHP Viewer

Re: being unable to download file with images in them -- the SHP compression logic necessary to actually download a SHP file with the new images isn't there yet.

I was a little bit ahead of myself here.

To edit headers; this is the procedure:

1.) Right Click on image you want to edit header for and select SHOW ICON SHP HEADER DATA.

3.) Move the Centroid Cross to where you want it through double clicking or using the X/Y buttons.

4.) Push "Write Header to this Icon" button.

5.) Close pop up window.

6. ) Click on Rewrite Headers to SHP to download a SHP file with just the headers edited.
Reply With Quote
The Following 2 Users Say Thank You to MarkSheppard For This Useful Post:
  #29  
Old October 23rd, 2024, 04:49 AM
DRG's Avatar

DRG DRG is offline
Shrapnel Fanatic
 
Join Date: Mar 2005
Location: GWN
Posts: 12,493
Thanks: 3,965
Thanked 5,702 Times in 2,814 Posts
DRG will become famous soon enough
Default Re: Next Generation SHP Viewer

Quote:
Originally Posted by MarkSheppard View Post
Re: being unable to download file with images in them -- the SHP compression logic necessary to actually download a SHP file with the new images isn't there yet.

I was a little bit ahead of myself here.

To edit headers; this is the procedure:

1.) Right Click on image you want to edit header for and select SHOW ICON SHP HEADER DATA.

3.) Move the Centroid Cross to where you want it through double clicking or using the X/Y buttons.

4.) Push "Write Header to this Icon" button.

5.) Close pop up window.

6. ) Click on Rewrite Headers to SHP to download a SHP file with just the headers edited.
Yes, that is how I did it as well and the "Centroid Cross" had moved to where I put it on the new image but, of course, the new icon was not actually saved in the file

You have made some real progress with this and it looks very promising
__________________


"You are never to old to rock and roll if you are too young to die".--- What do you expect to be doing when you are 80?


https://www.youtube.com/watch?v=8kWt8ELuDOc
Reply With Quote
The Following User Says Thank You to DRG For This Useful Post:
  #30  
Old October 24th, 2024, 09:13 PM
MarkSheppard's Avatar

MarkSheppard MarkSheppard is offline
Lieutenant Colonel
 
Join Date: Jun 2005
Posts: 1,378
Thanks: 101
Thanked 619 Times in 410 Posts
MarkSheppard is on a distinguished road
Default Re: Next Generation SHP Viewer

I'm currently stalled on the SHP compression; I can get it to compress the first row of pixels in an icon; then it just stops compressing pixel rows.

The GOOD: Both SHPed and this show the exact same broken image; so my image decompression code is valid.
Reply With Quote
The Following User Says Thank You to MarkSheppard For This Useful Post:
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 03:59 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.