Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: decals
Re: New feature: decals[message #363426 is a reply to message #363425] Sun, 27 June 2021 14:56 Go to previous messageGo to previous message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Q & A

Q: This is nice and all, but the graphics look terrible. Any way you can fix that?

A: Well, yeah. My drawing skills are limited at drawing single pixels at MS Paint. To improve that, take a look at the .sti libraries for the new decals in Data/Tilecache, bloodspatter_wall.sti, walldamage0.sti and walldamage0.sti.

https://i.imgur.com/ljmOFSP.png
That's how the images look in the editor. The vaguely beige colour is the transparency colour in the colour palette used (it's the same one as in some animations), the blood is the exact colour used for the blood as in corpses. Of course now the question is: where to paint so that it's in the proper place ingame?

https://i.imgur.com/TjgEkru.png
That's the template I used for the left and rightside walls. It's a simple 24x62 pixel box, the bright green parts are everything that isn't the wall, the beige part is the wall. Use the above pictures, add your decal of choice, fill the green part with the beige part to make it transparent, done.

Note that there is no x/y offset in the .sti file. While we can do that, it seems a lot easier to me to just use the above pictures and not have to worry about that, I add the proper offset ingame.

Now, every one of these .sti libraries has an even number of pictures. The first part is for walls from upper left corner to lower right corner, the second part is for wall from lower left to upper right.

In the case of blood spatters, the picture in question is
(number of tile where wall is sitting on % pics per side) + pics per side if wall goes from lower left to upper right

It is advised that the number of pics per side does not divide the map length per side - 160 or 360 - without remainder. Otherwise if, say, you have 8 pics per side, neighbouring walls might always get the same pattern, which looks odd!

In the case of structural damage, we obviously want to see the damage expand. It wouldn't to to have cracks disappear, we want them to increase!
Thus each .sti contains two 'sets' of damage, with the first pic starting with the most damage, the last with the least and so on.

The pic is selected as
( wall hitpoints / maximum wall hitpoints) * pics per side + pics per side if wall goes from lower left to upper right

The picset itself is chosen depending on whether the number of the tile the wall is sitting on is odd or even. As that's only two sets there is a lot of repetition. But as my drawing of the structure damage is especially ugly, Im very happy you offered to provide better .stis, dear questioner!

Wow, hold on there. I said your pictures suck, not that I'm going to provide something better. I mean, I obviously can, but I won't.

You know, you're like the distilled essence of what annoys me about this community.

Q: Why u no bullet holes?

A: Because that requires storing each and every bullet hit with the exact coordinates they hit with (which are less varied than one would think) and the holes would be what, 1 pixel? Storing that requires requires altering the savegame format (which the feature until didn't require, which is neat) and the result will likely look like dirt anyway.

Q: You should all an overlay that adds holes to the wall!

A: You mean you want me draw a picture over another picture that then reveals what was below that picture?

Yes.

That's... sort of magic.

What are you, a chicken?

No. But I'm also not Marty McFly, so dream on.

[Updated on: Sun, 27 June 2021 16:03]




I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: filling a canteen
Next Topic: New feature: AI medics and officers
Goto Forum:
  


Current Time: Tue Dec 03 02:31:56 GMT+2 2024

Total time taken to generate the page: 0.00629 seconds