.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
  #1  
Old October 9th, 2024, 10:15 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 Next Generation SHP Viewer

So; this is something I knocked out over a few hours with ChatGPT + Fred Chlanda's old SHPEd code that he released decade(s) ago.

You might be wondering "Where's the file? Where's everything?"

Everything is contained in that HTML file; you can open it up; it's only 275 lines of code to inspect (of which 40 are used to define the SPCAMO palette).



A lot has changed over the last 15 years -- web browsers have become standardized multi-purpose machines with Javascript + HTML5 elements -- there was some early tentative steps this way back with Panzer Command and a scenario generator/editor that used Internet Explorer; but it was the early days of that and it quickly broke with the advance of the internet.

But now that things have standardized, as long as you don't attempt to do anything too crazy; HTML5 code will last a long(er) time (hopefully).

Right now; this is just a "proof of concept" to prove that you can read SHP files and display them graphically in a Chrome-based browser (which is everything nowadays). I've tested it in Chrome + Edge and they both work.

Potential future work:

1.) Integrating the Master Icon Lists so that you know right away what something is without having to cross check.

2.) Figuring out how to dump the SHP icon files with their header data included so that you can easily import them into other SHP files and everything automagically updates.

3.) Integrating other Palettes (and option of loading your own JASC PIC PAL file)

But for now I'm just going to sit back and see what shakes out of this -- the biggest advantage of this primitive v0 is that you now can use a modern Windows dialogue/file path box, allowing cut and pasting of your SPCAMO path instead of having to navigate up down the file tree to it.
Attached Files
File Type: zip NextGenSHP_Viewer_v000.zip (4.0 KB, 4585 views)

Last edited by MarkSheppard; October 9th, 2024 at 10:25 PM..
Reply With Quote
The Following 7 Users Say Thank You to MarkSheppard For This Useful Post:
  #2  
Old October 10th, 2024, 08:31 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

As a simple SHP viewer, it is faster than ShpEdit to call up a SHP file but that is all it is for v0.00.

I see the potential is there to be more though
__________________


"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
  #3  
Old October 12th, 2024, 09:51 AM
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

Version 0.00L

Major Changes:

I've started to separate major things into individual javascript .js files to keep things organized -- this was needed for the 146kb of palette information I added.

Also; there's a third-party javascript library - jszip (NextGenSHP_Viewer_jszip.min.js) included to handle ZIP functionality within the program.

What's new:

There's an option to organize in rows of 2 (to make turreted SHP files look more organized)



I hard coded as many palettes as I could in -- including all of the original PALs that shipped with Fred's SHP Edit many moons ago. Default is the current (2021+) SPCAMO full icon palette.

To Swap palettes or organize in rows of 2, select your new palettes or click on the organize in rows of 2 checkbox and then push the RELOAD button.

To save an individual icon; just right click on any of the icons and choose SAVE IMAGE; a PNG version helpfully named:

{filename}+{4 digit leading icon position}.png will be downloaded to your DOWNLOAD directory.

So if you were saving the second icon from a file named icon0090.shp, it would be named: icon0090-0002.png

The Export SHP to ZIP button dumps all the SHPs using that above terminology into a new zip file in your download directory; named after the original SHP file. Thus, if your file was icon0090.shp, the file will be icon0090.zip.

Also, there will be a metadata CSV file inside the zip file -- containing the following information
Attached Thumbnails
Click image for larger version

Name:	IconDump.png
Views:	3334
Size:	40.7 KB
ID:	17055  
Attached Files
File Type: zip NextGen_SHP_View_v000L.zip (58.4 KB, 3346 views)

Last edited by MarkSheppard; October 12th, 2024 at 09:59 AM..
Reply With Quote
The Following 7 Users Say Thank You to MarkSheppard For This Useful Post:
  #4  
Old October 13th, 2024, 08:15 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

The default palette for viewing game Icons should be the Icon only palette NOT the full palette

The "Organize in two rows for Turreted Vehicles" is a nice touch
__________________


"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 13th, 2024 at 08:38 AM..
Reply With Quote
  #5  
Old October 13th, 2024, 03:10 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

Quote:
Originally Posted by DRG View Post
The default palette for viewing game Icons should be the Icon only palette NOT the full palette
Version 0, Ausf M changes to that as teh default palette.

NOTE: I had to add a password - SPCAMO - to the zip file to upload it; because the forum upload software kept blocking it.

There's a bunch of new features here:

You can now load SHP files contained within ZIP images, or from a folder on your hard drive; with the option to load all, or just the icon SHPs.



This was a direct load of the exact ZIP file contained in this post

https://forum.shrapnelgames.com/showthread.php?t=52719
P-51D, F-51D, Cavalier, Piper Mustang evolution after WW2

Making it easier to evaluate mods that are posted on the forum.

Using the "load entire folder; only for icon files" feature is considerably faster on:

WW2\Game Data\Graphics
than it is on
MBT\Game Data\Graphics

It takes a while (a couple minutes) to load all 11,200 or so icons for MBT but there is this nice surprise at the end for you at Icon0196.shp:



FYI, total memory use for that Chrome tab with every single MBT icon loaded was 392~ MB; something easily afforded today.

There's a revised right click dialog for hovering over individual SHP icons:



Copy to Clipboard saves it as a paint shop pro compatible cut and paste image.

Save Image as PNG is slightly obvious -- it saves it in this case as Icon0105-0002.png (2nd icon slot in ICON0105.SHP).

Export SHP to ZIP works, even for an entire MBT icon folder run through -- as before, it works a bit slow; but eventually coughs out the file -- in that specific use case, a 17.3 MB file containing 11,199 individual PNG files
Attached Files
File Type: zip NextGen_SHP_View_v000M.zip (63.5 KB, 3320 views)
Reply With Quote
The Following 5 Users Say Thank You to MarkSheppard For This Useful Post:
  #6  
Old October 13th, 2024, 04:17 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:
.............there is this nice surprise at the end for you at Icon0196.shp:


I wondered when someone would notice that
__________________


"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:
  #7  
Old October 13th, 2024, 04:27 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
Exclamation Re: Next Generation SHP Viewer

be very careful about loading entire folder folders!


YEP


There are a LOT of Icons

What is nice from my POV is if a section needs a closer look a simple "print screen" on my keyboard picks them up which is what I can do with ScenHack now but this picks up in bulk




I've even found things I had forgotten were there!
__________________


"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 13th, 2024 at 04:42 PM..
Reply With Quote
The Following 2 Users Say Thank You to DRG For This Useful Post:
  #8  
Old October 14th, 2024, 10:00 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

Version 0, Ausf P

NOTE: I had to add a password - SPCAMO - to the zip file to upload it; because the forum upload software kept blocking it.

There's a bunch of new features here:



Scaler -- scale the icons by 1x, 2x or 4x; because we're all getting old. I was a teenager when SP2 was released and you can guess my age now. Also, a zoomed in option lets you inspect icons carefully now.

Draw SP Header Cross-- Graphically represent the "centroid" of the icon as put in the SHP header and editable through
SHPEd's "Fix SP Header".

An example of how you can combine the SP Header Cross and 2x Zoom/Scaleup is this one:



NOTE This software is a bit non-idiot proof - in that there's no internal checks on saving/exporting when you have higher zoom levels (2x or 4x) or the SP Header Cross selected -- it will happily export the scaled up images or the header cross images -- so always doublecheck to see if you're in 1x mode and that cross checkbox is unchecked....

The right click menu is slightly changed:



You can now dump a single image, two images (for turreted icon slots), and "n" amount of images (if you want to dump 3 turreted images, you'd put in 6).
Attached Files
File Type: zip NextGenSHP_Viewer_v000_AusfP.zip (63.6 KB, 3293 views)

Last edited by MarkSheppard; October 14th, 2024 at 10:16 PM..
Reply With Quote
The Following 3 Users Say Thank You to MarkSheppard For This Useful Post:
  #9  
Old October 14th, 2024, 10: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

One of the things I need to do next is to systematically validate the image decompress routines by comparing SHPEd BMP images with the PNG images generated by this; to ensure that pixel values are correct; because if they're off slightly; errors can start compounding if this is used as an alternative for MOBHack + Print Screen + Paint Shop Pro; and somewhere there's a bug making pixel values off slightly.
Reply With Quote
The Following User Says Thank You to MarkSheppard For This Useful Post:
  #10  
Old October 15th, 2024, 11:21 AM
RecruitMonty's Avatar

RecruitMonty RecruitMonty is offline
Captain
 
Join Date: Jul 2005
Location: London (Great Britain)
Posts: 838
Thanks: 200
Thanked 144 Times in 87 Posts
RecruitMonty is on a distinguished road
Default Re: Next Generation SHP Viewer

What a good idea.
__________________
"Wir Deutschen sollten die Wahrheit auch dann ertragen lernen, wenn sie für uns günstig ist."
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:59 AM.


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