Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: decals
New feature: decals[message #363425] Sun, 27 June 2021 14:56 Go to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
In a subious attempt to maybe make the game look better, I've added a bit of code that allows us to show several graphical overlays.



What he have for now are blood spatters on full walls if someone takes a significant (> 15) amount of damage. This works on all things that have, well, blood. Vehicles and robots are excluded, as are the bugs, because their blood has a different colour and I couldn't be bothered.

Additionally, structural damage to walls is shown as well.

For the moment both only work on full walls, but theoretically you can do this on any wall you want. If there is enough interest I might expand this to half-sized walls and doors.
This also doesn't have to be restricted to walls. Any structure would work.

I have a few ideas on what else we could show:

  • burn marks from fire on the floor and walls

  • bullet holes. It would require us to save each and every location hit per map, and apply some finicky business adding pixels to the right spot, but nothing insurmountable.

  • spent shells and empty mags on the ground whenever we fire or reload. But those things would be 1 pixel each, which is going to look very stupid.

  • Add a spray can and graffiti the place?
In order for this to show, the Blood & Gore option needs to be active in the game options. Additionally, set
;------------------------------------------------------------------------------------------------------------------------------
; If set to TRUE, additional decals can be seen on some objects (cracked walls, blood spatters etc.).
; Also requires the 'Blood & Gore' option to be toggled ingame.
;------------------------------------------------------------------------------------------------------------------------------
ADDITIONAL_DECALS = TRUE
in JA2_Options.ini. I might remove this option later, for now it's in until someone finds a bug and wants to deactivate it.

The next post will detail how to set up your own graphics.

This is fully savegame compatible.
This has been added to the trunk in r9113 & GameDir r2595. Using the new exe without the new GameDir data will... not show anything, because then I simply won't display anything. Sucker!

[Updated on: Sun, 27 June 2021 15:21]




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

Re: New feature: decals[message #363426 is a reply to message #363425] Sun, 27 June 2021 14:56 Go to previous messageGo to next 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

Re: New feature: decals[message #363430 is a reply to message #363426] Sun, 27 June 2021 23:16 Go to previous messageGo to next message
Kitty

 
Messages:473
Registered:October 2017
Location: Germany
Sweet, I quite often work with maps and this is a neat addition, thanks.

Have to explore it in depth, to see how I can use and abuse this happy

Plus, I'm kinda relieved, I'm not the only one still doing pixel-drawing ... shy

[Updated on: Sun, 27 June 2021 23:17]




How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)

Report message to a moderator

Master Sergeant
Re: New feature: decals[message #363446 is a reply to message #363430] Thu, 01 July 2021 19:01 Go to previous messageGo to next message
Asdow is currently offline Asdow

 
Messages:141
Registered:August 2010
Oh this is really cool! More interactivity to maps is always great! Would it be possible to have scorch marks on the ground after explosions?

Report message to a moderator

Sergeant
Re: New feature: decals[message #363447 is a reply to message #363446] Thu, 01 July 2021 19:36 Go to previous messageGo to next message
Deleted.

 
Messages:2657
Registered:December 2012
Location: Russian Federation
Asdow wrote on Thu, 01 July 2021 21:01
Would it be possible to have scorch marks on the ground after explosions?
Burn marks from explosion are already in the code, just disabled.
I enabled them in +AI, seems to work well.

[Updated on: Thu, 01 July 2021 19:44]




Left this community.

Report message to a moderator

Lieutenant

Re: New feature: decals[message #363511 is a reply to message #363447] Mon, 12 July 2021 22:51 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Seven. wrote on Thu, 01 July 2021 16:36
Asdow wrote on Thu, 01 July 2021 21:01
Would it be possible to have scorch marks on the ground after explosions?
Burn marks from explosion are already in the code, just disabled.
I enabled them in +AI, seems to work well.
Because that seems pretty cool, this has been committed in r9139.



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

Re: New feature: decals[message #363980 is a reply to message #363425] Tue, 16 November 2021 13:34 Go to previous message
garfunkel is currently offline garfunkel
Messages:2
Registered:August 2017
Thanks for making this. I just today saw the big blood spatter on the wall for the first time and dude, it was glorious!

Report message to a moderator

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


Current Time: Tue Dec 03 00:48:18 GMT+2 2024

Total time taken to generate the page: 0.00889 seconds