.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
  #31  
Old October 25th, 2024, 03:20 PM
Mobhack's Avatar

Mobhack Mobhack is online now
National Security Advisor
 
Join Date: Mar 2005
Location: Dundee
Posts: 5,956
Thanks: 465
Thanked 1,896 Times in 1,234 Posts
Mobhack is on a distinguished road
Default Re: Next Generation SHP Viewer

Quote:
Originally Posted by MarkSheppard View Post
I'm currently stalled on the VFX 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.
Mark - check your PM's as I sent you an email address there which you can reply to for a copy of the design specs for the VFX library SHP format by Miles Design. That includes the compression formulae they used.

You will need to pass me a valid email as there is no way to attach a zipfile to PM's, and I'm not putting it up here in case of copyright issues.

oh - found that he seems to have put it up on github so I'll PM you with the linky

cheers
Andy
Reply With Quote
The Following 2 Users Say Thank You to Mobhack For This Useful Post:
  #32  
Old October 28th, 2024, 10:29 AM
DRG's Avatar

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

Just curious, was there any difficulty setting up the SHPEdit code in HTML5 ?
__________________


"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
  #33  
Old October 28th, 2024, 08:06 PM
MarkSheppard's Avatar

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

I think I've made a semi breakthrough; I was stuck on trying to recompile SPCAMO stock SHP Icon111 from WW2; and I tried some other SHP files and they showed correctly:



Likewise, some old Warhammer 40K SHPs partially show up:



With this (helped by the very useful cross overlay) I think what's happening is that I've got the SHP compression code now mostly correct...

BUT somewhere along the way, the SHP header stuff is not being passed along correctly; and the SHP header stuff plays a big important part in the SHP file compression procedure; because it defines a bounding box of pixels that we compress and discard the rest (to save pixel space)
Reply With Quote
The Following User Says Thank You to MarkSheppard For This Useful Post:
  #34  
Old October 28th, 2024, 09:43 PM
MarkSheppard's Avatar

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

So, I --THINK-- I may have gotten it to work; but it's late at night and I don't feel like editing game files; but I've validated the files in Fred's SHPEd afterwards; so they load in that at least.

Here's v0.82; once again, SPCAMO is the password to let me upload it.

big glaring warning

this is currently not validated completely; so don't use it for heavy file editing [i.e. replacing 100 icons etc] just yet.
Attached Files
File Type: zip SHPView_v0-82.zip (82.7 KB, 126 views)
Reply With Quote
The Following User Says Thank You to MarkSheppard For This Useful Post:
  #35  
Old October 28th, 2024, 10:05 PM
MarkSheppard's Avatar

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

now that I can actually save SHPs; I'm doing some more case testing -- and I need to make some changes to the icon replacement code -- it works fine if the icon is the same size as the one being replaced; but looks horrible if there's a size disparity between the new/old icons.

To fix this, here's a quick replacement; as once again SPCAMO is password.
Attached Files
File Type: zip SHPView_v0-83.zip (82.9 KB, 109 views)

Last edited by MarkSheppard; October 28th, 2024 at 10:23 PM..
Reply With Quote
The Following 2 Users Say Thank You to MarkSheppard For This Useful Post:
  #36  
Old October 28th, 2024, 10:40 PM
DRG's Avatar

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

Take a break. You are making great progress but walk away for a day or two and clear your head

I made a copy of a SHP file I am putting new icons into and replaced the hull and turret of one I had tinkered with a bit

When I was done I loaded it into SHPedit and the hull looked good but the turret had black Kruf below the turret which I fixed with SHPedit as none of that showed in the new editor. I saved the file and viewed the icon in MOBHack



That is usually caused by the wrong-sized Shp file the icon is in and SHPEdit reports

#7 Problem??
cols 72, lines 27
Last #67
#8 Problem??

Shpedit also reports the main file is 89x89 BUT this new editor is reporting them as 90x90 which may explain above

My other issue is I've been using SHPEdit for over 2 decades. I know I saved the file once that is how the screenshot was produced but this is not intuitive to me and I have attempted to go back and redo this but I cannot find how I saved the first time ( it's late here too.......)
Attached Thumbnails
Click image for larger version

Name:	Not quite yet.png
Views:	127
Size:	23.8 KB
ID:	17078  
__________________


"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
  #37  
Old October 28th, 2024, 11:01 PM
DRG's Avatar

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

OK I figured out how to save correctly " write headers+ images to SHP" ( " write headers+ images to SHP to SAVE" might be better

I looked at the recompiled.SHP with Shpedit and it reports
recompiled.shp
99 Icons
90 Max Height
90 Max Width

It should not be reporting they are 90 and EVERY file in that recompiled SHP reports 90x90 when checked with SHPedit SPFix .

I renamed it to the correct SHP file nameand loaded it in MOBhack and the Icons were skewed like the screen shot above

But also

ALL the icons I never touched with the new editor are skewed because they are 90x90



But it gets more interesting

This icon I never touched at all and this is what shows up in the game (EDIT) using the file I created with your viewer.... it does not show up with the grey zone around the turret barrel like that in the game with the SHPEdit created file.



Sorry for the bad news but I suspect whatever it is a simple thing...... it's finding it that might be a problem
Attached Thumbnails
Click image for larger version

Name:	not yet 3.png
Views:	115
Size:	24.6 KB
ID:	17080   Click image for larger version

Name:	not yet 2.png
Views:	116
Size:	35.5 KB
ID:	17081  
__________________


"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

Last edited by DRG; October 29th, 2024 at 11:12 AM..
Reply With Quote
  #38  
Old October 29th, 2024, 11:45 AM
DRG's Avatar

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

I ran an experiment

I built 2 test Icon inside an 88x88 square instead of 89x89
I check the recompiled.shp with SHPEdit and......

recompiled (1).
99 Icons
89 Max Height
89 Max Width

With V83 it reports



89x89 for that Icon but for all the others in the V83 generated SHP it's



90x90

The change I made using the v.83 version shows up OK in MOBHack


BUT in the game it shows up



and the other icons in the file that I did not touch show up in MOBhack show up skewed as before and in the game with the same issue with the turret as above

There is a glimmer of good news their..... v,83 is making the SHP too big which accounts for the skewing in MOBHack but I have NO IDEA why the turret issue is happening
Attached Thumbnails
Click image for larger version

Name:	Image1.png
Views:	28
Size:	45.5 KB
ID:	17088   Click image for larger version

Name:	Image2.png
Views:	29
Size:	32.4 KB
ID:	17089   Click image for larger version

Name:	Image3.png
Views:	31
Size:	5.2 KB
ID:	17090   Click image for larger version

Name:	Image4.png
Views:	31
Size:	5.6 KB
ID:	17091  
__________________


"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
  #39  
Old October 29th, 2024, 11:45 AM
DRG's Avatar

DRG DRG is offline
Shrapnel Fanatic
 
Join Date: Mar 2005
Location: GWN
Posts: 12,490
Thanks: 3,960
Thanked 5,694 Times in 2,812 Posts
DRG will become famous soon enough
Exclamation Re: Next Generation SHP Viewer

I ran an experiment

I built 2 test Icon inside an 88x88 square instead of 89x89
I check the recompiled.shp with SHPEdit and......

recompiled (1).
99 Icons
89 Max Height
89 Max Width

With V83 it reports



89x89 for that Icon but for all the others in the V83 generated SHP it's



90x90

The change I made using the v.83 version shows up OK in MOBHack


BUT in the game it shows up



and the other icons in the file that I did not touch show up in MOBhack show up skewed as before and in the game with the same issue with the turret as above

There is a glimmer of good news here..... v,83 is making the SHP too big which accounts for the skewing in MOBHack but I have NO IDEA why the turret issue is happening

HOWEVER

There is another issue



That grey around the turrets is FLASHING in the game,
Those colours are NOT in the Icon palette....... those are the cycling greys used for smoke so that is NOT the "SPCamo Icon only palette ( 2021+) that shows being loaded at start.... it cannot be as those entries are blacked out in that file so that is the full palette being used

Icon palette on left, full palette on right. The flashers are all blacked out in the Icon version

Attached Thumbnails
Click image for larger version

Name:	Image11.png
Views:	30
Size:	70.0 KB
ID:	17092   Click image for larger version

Name:	Image14.png
Views:	29
Size:	25.9 KB
ID:	17093  
__________________


"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

Last edited by DRG; October 29th, 2024 at 12:10 PM..
Reply With Quote
  #40  
Old October 29th, 2024, 07:33 PM
MarkSheppard's Avatar

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

Thanks for the testing; I've been so focused on making sure that everything decompresses/compresses in SHPEd as a "major sanity check"; that I haven't done testing in the actual game(s) yet.

Did a slight detour away from file compression issues (after spending so long bashing my head against it) and went back into designing usability features.

EDIT:

I think I may have fixed the distorted images:

In my SHPView_sHeaders.js file I had this:

Quote:
function readImageHeader(dataView, offset, imageNumber)
{
// SHP Image Header: 24 bytes long

const height = dataView.getUint16(offset + 0, true) +1;
const width = dataView.getUint16(offset + 2, true) +1;

const var1 = dataView.getInt32(offset + 4, true); // Use getInt32 to allow for negative numbers
const xStart = dataView.getInt32(offset + 8, true); // Use getInt32 to allow for negative numbers
const yStart = dataView.getInt32(offset + 12, true); // Use getInt32 to allow for negative numbers
const xEnd = dataView.getInt32(offset + 16, true); // Use getInt32 to allow for negative numbers
const yEnd = dataView.getInt32(offset + 20, true); // Use getInt32 to allow for negative numbers

// Include the image number in the log message
conditionalLog(`Image ${imageNumber} Header - Height: ${height}, Width: ${width}, Var1: ${var1}, xStart: ${xStart}, yStart: ${yStart}, xEnd: ${xEnd}, yEnd: ${yEnd}`); // only if verbose logging included.

return { height, width, var1, xStart, yStart, xEnd, yEnd };
}
Removing the +1 from height & width in that function made things show up inside the game + MOBHack for me with no skewed icons.

I then rewrote Icon0128.shp for MBT; doing a test with replacing

{12800, 12801}, //4948. SPW-60PB DDR *********NEW

with a Caesar like SPH icon



Transparency no good in the "zoom out" icon, but seems to work in the zoom in feature.

I then skipped down to an icon in Icon0128.shp that I did not edit:

{12810, 12811}, //4953. 2S1 Gvozdika Ukraine *********NEW winSPMBT v16

It exhibits the same issue:



So I guess I need to look at palette mapping codes....

Last edited by MarkSheppard; October 29th, 2024 at 08:06 PM..
Reply With Quote
Reply

Bookmarks


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 05:31 PM.


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