.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Mods (http://forum.shrapnelgames.com/forumdisplay.php?f=249)
-   -   Distorted shp images in MobHack?? (http://forum.shrapnelgames.com/showthread.php?t=50142)

Gooseman2448 February 16th, 2014 08:50 AM

Distorted shp images in MobHack??
 
Hey guys,

Been working on a few things finally after a fatal hard drive issue. (My usb drive I was using got knocked off my desk... it was heart breaking.)

I had modified an icon (winter version of the LAV III 25) added it to a shp file and went to add it in MobHack but, the image was distorted.

Everything looks good in the shp file and as a bmp. It also looks fine in game.

I am just wondering if someone else had that issue and what you did to fix it.

I added the bmp files to a shp file I did previously and the images in line before these are fine in MobHack.

Anyway,
Cheers and great work by all as usual.
Gooseman2448

DRG February 16th, 2014 08:54 AM

Re: Distorted shp images in MobHack??
 
what are the exact dimensions of your shp image.... not the artwork, the pink square it sits on

Gooseman2448 February 16th, 2014 12:08 PM

Re: Distorted shp images in MobHack??
 
Well,

The bmp I modified is:

89x89
1.229x1.229 inches (yank measurement... lol)
72 pixel per inch
24 bit
16 million colors

I used a blank bmp exported from shped, copied and pasted from a bmp exported from MobHack. I made my modifications and saved as a new bmp.

I notice though that bmp images from MobHack are:

88x88
1.222x1.222 in
72 ppi
24 bit
16 mil

I then noticed in shped in SP Fix the images I put in are sized as 87x87 and all the others that look fine in MobHack are 88x88.

This confusses me because I have done this a hundred times before and made dozens of shp files and have not noticed this. It may be something basic I am missing or a change I am mot aware of, just not sure what.

If I can I will try to post my files, may be tomorrow when I can get to my desktop and better connection.

Thank you for taking the time to help DRG.

Mobhack February 16th, 2014 12:38 PM

Re: Distorted shp images in MobHack??
 
Shped is using a zero-based index (normal "C" behaviour). So 87 is 88 i.e. pixels 0..87. SHPED is not our code, it is a third party utility provided for your convenience, with permission.

Mobhack adds 1 to give an end-user friendly result and not what makes sense to C programmers;). End users tend to count from 1 up, not zero and up (the offset from the initial pointer index). That's why I report weapon slot 1 to 4, and not the 0 to 3 the game thinks they are, forex.

If replacing an existing SHP inside a SHP file then you have to use the exact same size. The icon sizes are hard-coded in internal game data. Your 89 pixel bitmap will likely have been packed into the space expected of the 88 square, so its going to produce weirdness.

Andy

DRG February 16th, 2014 01:04 PM

Re: Distorted shp images in MobHack??
 
89x89 is the accepted size for a standard BMP image to be processed into a SHP so disregard what Andy suggested. He doesn't work with them but I do but he is correct that Shped is using a zero-based index .

The numbers you said your image originally was should have worked and should not have produced a distorted image. HOWEVER.. because you ended up with 87x87 showing in SPFix I suspect you were set up for 88x88 not 89x89

Don

mkr8683 February 16th, 2014 11:20 PM

Re: Distorted shp images in MobHack??
 
How is it being distorted? I know it freaks out if you forget to save it in 24-bit.. also Mobhack shows weird icon images if they're bigger than 89x89.

Mobhack February 17th, 2014 12:03 AM

Re: Distorted shp images in MobHack??
 
How would I know? - SHPEdit is someone else's code, after all. As is the magic bit of indecipherable Delphi that someone sent me to decode SHP files way over a decade ago. Nor have I read the SHP file format specification since 2005 or thereabouts.

But - it probably stuffs the compression routine up no end by giving it an unexpected amount of data (each icon is individually compressed, not the SHP file as an entirety - that is about the only thing I half remember form 10-15 years ago).

Utter guess of course - I am not going to spend hours and hours reading code (especially obscure code I never wrote) to try to figure out whatever it does to answer some casual forum query, especially since there's a fix for the 'problem' that is already known..

Andy

mkr8683 February 17th, 2014 03:37 PM

Re: Distorted shp images in MobHack??
 
Andy, I was asking Gooseman what he means by the image being distorted.

Mobhack February 17th, 2014 03:50 PM

Re: Distorted shp images in MobHack??
 
Quote:

Originally Posted by mkr8683 (Post 823821)
Andy, I was asking Gooseman what he means by the image being distorted.

OK

Andy

DRG February 17th, 2014 04:42 PM

Re: Distorted shp images in MobHack??
 
Quote:

Originally Posted by mkr8683 (Post 823816)
How is it being distorted? I know it freaks out if you forget to save it in 24-bit.. also Mobhack shows weird icon images if they're bigger than 89x89.

NO, it does not....... but you cannot just drop anything in there you want

It's been YEARS since I've had to deal with this......thinking 15 at least. 89x89 is the standard for 99% of the BMP's that are made into SHP's but larger SHP's...... like the Vulcan bomber or the Russian Badger are a good examples of larger than 89x89 images that do NOT cause MOBHack to "freak out"

The Vulcan and Badger are 109x109 and I believe I have used 101x101 as well but for certain 89x89 and 109x109 work in MOBHack and those two sizes will cover every Icon needed by either game.

Don

mkr8683 February 17th, 2014 11:06 PM

Re: Distorted shp images in MobHack??
 
SHPED does freak out if you upload a BMP into it that's not saved in 24-bit. It will show a white tile with black streaks. All you have to do is save the BMP in 24-bit and upload it again, and all is well. MOBHack produces a badly garbled image if it's even bigger than the bomber icons you mentioned. The same icon, showed in the encyclopedia in-game, will show their 'tail end' as you scroll down through the other entries.

But all of this is a moot point, as it doesn't affect the game display. I was just throwing out suggestions as to what Gooseman's issues may have been due to.

DRG February 18th, 2014 08:16 AM

Re: Distorted shp images in MobHack??
 
As I already said, the fact that he reported

Quote:

I then noticed in shped in SP Fix the images I put in are sized as 87x87 and all the others that look fine in MobHack are 88x88.
tells me the original BMP he converted to a SHP was 88x88 instead of the required 89x89

Gooseman2448 February 18th, 2014 04:11 PM

Re: Distorted shp images in MobHack??
 
1 Attachment(s)
Thanks Guys,

The response is awesome. This group of fans are still intensely involved. (wish there could be a new Generation game)

Sorry Don, I did not mean for you to get tortured by the past (lol... always seem to come back at ya one way or another)

I have not been able to get back to work on anything, "real" work has been getting in the way again.

I lost all my original bmp files and I am attempting to rebuild my collection again and work on my USA 1980-2020 mod for the next upgrade. The problem is they are in SHP files. Should I export them from SHPed or MobHack? Which will cause the least problems if I want to make new SHP files or new bmp files?

I am including the actual bmp files that are giving me problems (I only modified the turrets, the hulls were exported from MobHack). I also included the SHP file I am using.



Anyway, as mkr8683 said. this is more a nuisance than a game stopper, it does work in-game. I just would like to have what I do be as compliant with official work as possible.

Thanks again,
Gooseman2448

DRG February 18th, 2014 04:57 PM

Re: Distorted shp images in MobHack??
 
The problem is EXACTLY what I said it would be .....the BMP is 88x88. IT NEEDS TO BE 89x89

:doh::doh::doh::doh::doh:

Gooseman2448 March 3rd, 2014 08:24 PM

Re: Distorted shp images in MobHack??
 
Don,
You were correct. The problem was in proceedure. Even though MobHack needs a 89x89 bmp, it exports an 88x88 bmp. ShpEd can use almost any size ship bmp thus it works in gsme.

The trick is to export a blank 89x89 bmp from ShpEd and use it as a template to paste an image into it or start from scratch and save it.

So, MobHack is kind of the issue. Lol. It wants an 89x89 image to look at but, puts out a 88xx88 to mess with your head.

Thanks again for helping me work this out. Made some new shp's and everything is working great again.

Gooseman out...


All times are GMT -4. The time now is 12:27 AM.

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