Author Topic: Tile Explosion/in correct explosion animation.  (Read 5943 times)

wcho035

  • Guest
Tile Explosion/in correct explosion animation.
« on: October 19, 2019, 02:36:50 pm »
One thing I noticed when a terrain tile explodes, because I have a hybrid mod, the explosion always show of an underwater bubble explosion instead of the land base version. If it happened on land.

The only way to fix this is to add the extra line hitanimation: something to switch the explosions for land and sea correctly. I do have offset handling between sea and land explosions. All weapons in my items.rul are working correctly with land and sea explosion switching. It’s only the damaged or exploding terrain that I can’t find the section in the ruleset to add this needed hitanimation line to fix it.

I assume you can’t do this in the MCD file, is there somewhere in the ruleset can this line be added?
« Last Edit: October 19, 2019, 04:53:19 pm by Precentor Apollyon »

Offline krautbernd

  • Commander
  • *****
  • Posts: 1108
    • View Profile
Re: Tile Explosion/in correct explosion animation.
« Reply #1 on: October 19, 2019, 03:43:05 pm »
This is not related to the terrain tiles, but to the spritesheet used for explosions (https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Sounds_and_Animations -> X1.pck for explosive weapons). You might be using the wrong sprite sheet, or your offsets might be wrong.

Are you using UFO or TFTD as your base game?

wcho035

  • Guest
Re: Tile Explosion/in correct explosion animation.
« Reply #2 on: October 19, 2019, 04:40:24 pm »
This is not related to the terrain tiles, but to the spritesheet used for explosions (https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Sounds_and_Animations -> X1.pck for explosive weapons). You might be using the wrong sprite sheet, or your offsets might be wrong.

Are you using UFO or TFTD as your base game?

If you want to help, at least read my request carefully. What you propose above is a problem I have resolved a long time ago.
« Last Edit: October 19, 2019, 04:42:15 pm by Precentor Apollyon »

Offline krautbernd

  • Commander
  • *****
  • Posts: 1108
    • View Profile
Re: Tile Explosion/in correct explosion animation.
« Reply #3 on: October 19, 2019, 04:54:42 pm »
If you want to help, at least read my request carefully. What you propose above is a problem I have resolved a long time ago.

Your original post stated nothing of that sort since it didn't include the
Quote
I do have offset handling between sea and land explosions. All weapons in my items.rul are working correctly with land and sea explosion switching. It’s only the damaged or exploding terrain that I can’t find the section in the ruleset to add this needed hitanimation line to fix it.

part.

You only stated that that the in-game explosions display their underwater instead of their land version, which I replied to.

wcho035

  • Guest
Re: Tile Explosion/in correct explosion animation.
« Reply #4 on: October 19, 2019, 05:21:22 pm »
I asked which part of the ruleset that I need to add a hitanimation:somthing, so I can correct the problem with underwater explosion appearing on land, when the land terrain tile exploded. Due to weapon damage. That was my original question asked.

Unless this line hitanimation: something is added,  the incorrect explosion is shown on land. This is a problem I have tested in my mod. Once this line is added, to any explosion type weapon on my item.rul, the switch worked correctly.

So I was asking where in the ruleset I can find some reference to terrain tiles explosion.

The solution you offered, I am already fully aware of it. It is not related to my question asked.

Thank you for helping, I do appreciate the input. However, I do prefer if one of the developer to answer this, so to avoid too many unnecessary posting just to answer this question.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9091
    • View Profile
Re: Tile Explosion/in correct explosion animation.
« Reply #5 on: October 19, 2019, 05:47:38 pm »
Land explosion offset is defined by a global variable (check vars.rul in TFTD):

Code: [Select]
constants:
  explosionOffset: 24      # index into X1.PCK

Underwater explosion offset is smaller by 8.
For example if land offset is 24, underwater offset is 16 (=24-8).

wcho035

  • Guest
Re: Tile Explosion/in correct explosion animation.
« Reply #6 on: October 19, 2019, 05:55:25 pm »
Thanks you for this Meridian.

 
Land explosion offset is defined by a global variable (check vars.rul in TFTD):

Code: [Select]
constants:
  explosionOffset: 24      # index into X1.PCK

Underwater explosion offset is smaller by 8.
For example if land offset is 24, underwater offset is 16 (=24-8).

My mod is UFO base hybrid, how different is the offset compare to TFTD? If it is different to that of TFTD?
« Last Edit: October 19, 2019, 05:59:15 pm by Precentor Apollyon »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Tile Explosion/in correct explosion animation.
« Reply #7 on: October 19, 2019, 05:57:45 pm »
In order to switch from above ground to underwater explosions, TFTD in OXC checks whether the alienDeployment/terrain for the mission has a depth greater than 0. If the depth is greater than zero, then the game picks the explosion 8 frames earlier in X1.PCK. To make this not crash, there is an extra offset added at the mod level in the standard/xcom2/vars.rul file:

Code: [Select]
constants:
  # bunch of other stuff ....
  explosionOffset: 8

This means the above water explosion will start at frame 8 of X1.PCK and the underwater explosions start at frame 0. Notice also in xcom2's items.rul that explosives have hitAnimation: 8 instead of hitAnimation: 0.

If you want to use custom explosion animations, they need to follow the same format. Put the underwater sprites at frame x - 8 in X1.PCK, the above water sprites at frame x, and hitAnimation: x on the explosive item.

wcho035

  • Guest
Re: Tile Explosion/in correct explosion animation.
« Reply #8 on: October 19, 2019, 06:02:06 pm »
Thank you Meridian and thank you too Ohartenstein23. I am very grateful for the detail reply. Most appreciate of the help again.

Offline krautbernd

  • Commander
  • *****
  • Posts: 1108
    • View Profile
Re: Tile Explosion/in correct explosion animation.
« Reply #9 on: October 19, 2019, 06:18:47 pm »
I asked which part of the ruleset that I need to add a hitanimation:somthing, so I can correct the problem with underwater explosion appearing on land, when the land terrain tile exploded. Due to weapon damage. That was my original question asked.

Unless this line hitanimation: something is added,  the incorrect explosion is shown on land. This is a problem I have tested in my mod. Once this line is added, to any explosion type weapon on my item.rul, the switch worked correctly.

So I was asking where in the ruleset I can find some reference to terrain tiles explosion.

The solution you offered, I am already fully aware of it. It is not related to my question asked.

Thank you for helping, I do appreciate the input. However, I do prefer if one of the developer to answer this, so to avoid too many unnecessary posting just to answer this question.
Feel free to ignore any of the following
After rereading what you wrote it sounds like originally all explosion animations where displayed incorrectly (underwater explosions on land), which in case of items/weapons you were able to fix by adding/changing the hitanimation entry.

The explosions of terrain objects (barrels etc.?) however still displays the wrong animation (underwater on land). Does any of this apply to smoke effects (these also have two versions)? Are these also displayed incorrectly?

Explosion and smoke animations are to my knowledge not defined on a per-tile basis (i.e. you can't define a tile as having this or that smoke/explosion effect). The game differentiates between 'land' and 'underwater' terrain via the depth[] entry in the terrain definition and applies animations accordingly ( ->TFTDs X1.PCK contains animations for land/underwater terrains).

Either your terrain defintions are off or your animation offsets (explosionOffset / smokeOffset) are wrong.

EDIT: was about to post this, might as well. Sounds like it was the offsets after all. Glad you got this sorted out in the end.
« Last Edit: October 19, 2019, 06:20:51 pm by krautbernd »

wcho035

  • Guest
Re: Tile Explosion/in correct explosion animation.
« Reply #10 on: October 19, 2019, 06:45:23 pm »
Do me a favor krautbernd. Why don't you ignore of anything that I will post in the future within this forum. It will make life simpler for you and I.

I asked a simple question and yet it got inflated to something that it needed more time from you and I to invest on.

Meridian and ohartenstein23 have both answered the question. No need for the extra details or more investment on the same topic. Time to move on. I know I will.


Either your terrain defintions are off or your animation offsets (explosionOffset / smokeOffset) are wrong.


You can speculate all you like.. if this makes you happy.
« Last Edit: October 19, 2019, 07:11:43 pm by Precentor Apollyon »

wcho035

  • Guest
Re: Tile Explosion/in correct explosion animation.
« Reply #11 on: October 19, 2019, 07:13:27 pm »
In order to switch from above ground to underwater explosions, TFTD in OXC checks whether the alienDeployment/terrain for the mission has a depth greater than 0. If the depth is greater than zero, then the game picks the explosion 8 frames earlier in X1.PCK. To make this not crash, there is an extra offset added at the mod level in the standard/xcom2/vars.rul file:

Code: [Select]
constants:
  # bunch of other stuff ....
  explosionOffset: 8

This means the above water explosion will start at frame 8 of X1.PCK and the underwater explosions start at frame 0. Notice also in xcom2's items.rul that explosives have hitAnimation: 8 instead of hitAnimation: 0.

If you want to use custom explosion animations, they need to follow the same format. Put the underwater sprites at frame x - 8 in X1.PCK, the above water sprites at frame x, and hitAnimation: x on the explosive item.

Hi! adding the constant solved my problem, thanks!

Offline krautbernd

  • Commander
  • *****
  • Posts: 1108
    • View Profile
Re: Tile Explosion/in correct explosion animation.
« Reply #12 on: October 19, 2019, 07:35:07 pm »
For the record I told you in my initial reply that your offsets might be wrong. I linked you to the ruleset reference which not only includes the offset in the section I linked, it also list both offsets in the section 'Other (TFTD) Constants'. I asked you whether or not you're using a TFTD-based mod precisly because the offsets are different.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Tile Explosion/in correct explosion animation.
« Reply #13 on: October 20, 2019, 06:07:07 am »
Quote from: Forum Rules
Don't be a jerk
I am sick of getting reports for you two. You keep derailing threads with your passive-aggressive bickering.
Either hash it out in private or learn to use the ignore list. Next offense I'm banning you both.

wcho035

  • Guest
Re: Tile Explosion/in correct explosion animation.
« Reply #14 on: October 20, 2019, 08:41:45 am »
Hi SupSuper

I am prepare and will do anything to avoid krautbernd.

If you can show me how to use the ignore list. I will use it.

As much as I tried to ignore him, he seems to unable to take the hint that I am not interested in his replies.

Or he's forcing the issue. In this thread here, I am asking Meridian or the developers for help with a simple issue. This is something I asked Meridian in private messaging, before he asked me to post it here.

I did so reluctantly.

If you check the threads.

https://openxcom.org/forum/index.php/topic,4830.435.html

I did my best to ignore him, when he criticize my idea on suicide bombers.

Do me a favor krautbernd. Why don't you ignore of anything that I will post in the future within this forum. It will make life simpler for you and I.


I have written this specifically, so everyone could be in view that I have done my best to in trying to avoid a forum bickering.


« Last Edit: October 20, 2019, 08:48:26 am by Precentor Apollyon »