Author Topic: [DONE] Support for underwater weapon vapor clouds for hybrid mods  (Read 8435 times)

Offline scarf

  • Sergeant
  • **
  • Posts: 27
  • hello world
    • View Profile
    • reddit page
[DONE] Support for underwater weapon vapor clouds for hybrid mods
« on: September 10, 2019, 04:40:49 pm »
In TFTD, projectiles that are fired underwater leaves traces of bubble, or bullet trajectory (couldn't figure out the exact name to call it). I am wondering which part of the ruleset causes it. Also, I'd like to know if the 'trajectory' can be implemented on surface shooting/ xcom 1. I think it would be a great missile smoke trails.
« Last Edit: February 02, 2023, 10:40:16 am by Meridian »

wcho035

  • Guest
Re: How underwater bullet trajectory works?
« Reply #1 on: September 10, 2019, 05:19:56 pm »
vaporColor    The color offset (0-15) to use for the vapor trail.    -1
vaporDensity    The vapor cloud density (number of particles) for the vapor trail.    0
vaporProbability    The vapor cloud probability (0-100%) for the vapor trail.

Offline scarf

  • Sergeant
  • **
  • Posts: 27
  • hello world
    • View Profile
    • reddit page
Re: How underwater bullet trajectory works?
« Reply #2 on: September 10, 2019, 06:57:27 pm »
Thanks for your information. Also, would there be a way to implement the vapor into xcom 1?

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: How underwater bullet trajectory works?
« Reply #3 on: September 10, 2019, 07:50:09 pm »
would there be a way to implement the vapor into xcom 1?
I've been wondering about that as well.

wcho035

  • Guest
Re: How underwater bullet trajectory works?
« Reply #4 on: September 11, 2019, 09:09:20 pm »
I have been experimenting with this at the moment, the game keep crashing.

Okay, here is my research so far, after a few consultation.

The bubble trail will work and replace bulletsprite only at depth greater than zero, so in your terrain rul, you need to have depth greater than zero.

From the TFTD var file you need to copy over the transparencyLUTs to the xcom var file.

I have attempted to implement this on my Sonic weapons, with

vaporColor    
vaporDensity    
vaporProbability

Unfortunately, there is where the crash starts.  Still awaiting consultation from the others. I will post more.. later when I have more replies.

wcho035

  • Guest
Re: How underwater bullet trajectory works?
« Reply #5 on: September 12, 2019, 08:57:44 am »
I have been told that’s its sound issues that’s the cause of the crash, yet my code for my sonic weapon works perfectly on the land. All the firing and hit sounds.

Question is, does the weapon uses a different firing sound underwater? If that is the case, is it in the Var. ruls from TFTD which handles all the sounds? Oh well, I will experiment this tonight.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8597
    • View Profile
Re: How underwater bullet trajectory works?
« Reply #6 on: September 12, 2019, 09:54:45 am »
Just look at the log file, if it says something about missing sounds, then it is missing sounds.

Most likely however it is missing transparencyLUTs, which are not moddable yet.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: How underwater bullet trajectory works?
« Reply #7 on: September 12, 2019, 01:45:18 pm »
transparencyLUTs are moddable, the problem is he's setting the depth value greater than zero but doesn't have a battle2.cat to pull the audio from (that's my take on it anyway)

wcho035

  • Guest
Re: How underwater bullet trajectory works?
« Reply #8 on: September 12, 2019, 03:58:15 pm »
For the sake of testing. I have copy the Sample.cat from TFTD sound folder to UFO Sound folder of and renamed it as Sample4.cat

Here are my var.rul
startingTime:
  second: 0
  minute: 0
  hour: 12
  weekday: 6
  day: 1
  month: 1
  year: 1999
costEngineer: 25000
costScientist: 30000
timePersonnel: 72
initialFunding: 6000
disableUnderwaterSounds: true
alienFuel: [STR_ELERIUM_115, 50]
fontName: Font.dat
#soundDefs:
#  - type: BATTLE2.CAT
#    file: SAMPLE4.CAT
#    soundRanges:
#      - [0, 47]
#      - [99, 117]
#    sounds: [48]
#constants: #done
#  - doorSound: 47
#  - slidingDoorSound: 46
#  - slidingDoorClose: -1
#  - smallExplosion: 30
#  - largeExplosion: 29
#  - itemDrop: 44
#  - itemThrow: 42
#  - itemReload: 45
#  - walkOffset: 0
#  - flyingSound: 66
#  - buttonPress: 0
#  - windowPopup: [1, 1, 1]
#  - ufoFire: 5
#  - ufoHit: 4
#  - ufoExplode: 3
#  - ufoCrash: 2
#  - interceptorHit: 2
#  - interceptorExplode: 2
#  - explosionOffset: 8
#  - smokeOffset: 56
#  - underwaterSmokeOffset: 8
#  - basescapeCursor: 42
#  - graphsCursor: 144
#  - goodDebriefingMusic: GMDEBGOO
#  - badDebriefingMusic: GMDEBPOR
transparencyLUTs: #done
  - colors:
     - [  8,  8, 12, 2 ] # "white"
     - [ 16,  8,  0, 2 ] # orange
     - [  0, 12, 12, 2 ] # cyan
     - [  4, 16,  4, 2 ] # green

For my item.rul I have

  - type: STR_BLASTA_CANNON
    size: 0.3
    costBuy: 1
    costSell: 171600
    weight: 8
    bigSprite: 570
    floorSprite: 570
    handSprite: 381
    bulletSprite: 8
    hitAnimation: 150
    fireSound: 111
    hitSound: 112
    power: 130
    damageType: 0
    accuracySnap: 80
    accuracyAimed: 120
    tuAimed: 70
    tuSnap: 50
    clipSize: -1
    battleType: 1
    twoHanded: true
    invWidth: 2
    invHeight: 3
    recoveryPoints: 5
    armor: 50
    vaporColor: 3
    vaporDensity: 30
    vaporProbability: 100

extraSounds:
  - type: BATTLE.CAT
    files:
      111: Resources/Sounds/Fire.wav
      112: Resources/Sounds/sonichit.wav
  - type: BATTLE2.CAT
    files:
      111: Resources/Sounds/Fire.wav
      112: Resources/Sounds/sonichit.wav

It still crash. So, I must be missing something.
The game crash exactly when the bubble was about to be drawn. I can hear the hit sound, but not the fireSound in the underwater map.
« Last Edit: September 12, 2019, 04:03:45 pm by wcho035 »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8597
    • View Profile
Re: How underwater bullet trajectory works?
« Reply #9 on: September 12, 2019, 04:04:15 pm »
transparencyLUTs are moddable, the problem is he's setting the depth value greater than zero but doesn't have a battle2.cat to pull the audio from (that's my take on it anyway)

As discussed:
1. they are supposed to be moddable, but there's a bug which makes them not moddable... fixed today
2. currently only master mods can mod them... discussion in progress

Also:
3. currently only TFTD-based mods support them... because the LUTs are created only from the LBM palette files... so UFO-based hybrid mods won't have LUTs calculated even if defined
4. (OXCE only) even if point 3 is implemented, there can still be only one LUT per depth... i.e. can't have multiple LUTs for OXCE custom palettes

In other words... it's not working for UFO-based mods... it can be implemented (see screenshot), but it won't support all OXCE palette features.

@wcho035: is this a serious feature you're missing, or are you just playing around and don't really need it?

wcho035

  • Guest
Re: How underwater bullet trajectory works?
« Reply #10 on: September 12, 2019, 04:21:29 pm »
Hi Meridian, this is a feature I love to (or must) have with my underwater weapons. Even Luke could not get it to work, if there is a way to get it working. I am sure he and not to mention to me, I would be very grateful.

"2. currently only master mods can mod them... discussion in progress"

"(OXCE only) even if point 3 is implemented, there can still be only one LUT per depth... i.e. can't have multiple LUTs for OXCE custom palettes"

Not 100% what they means, but I am happy to find away to make it happen. I am not picky, just one vaporcolor is good enough for me.

If possible, I would like to keep disableUnderwaterSounds: true and let the vapor trail sound work in the depth. AKA no need for Battlecat2, because if I disableUnderwaterSounds: false, this will bring up other headaches.. 
« Last Edit: September 12, 2019, 04:33:28 pm by wcho035 »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8597
    • View Profile
[DONE] Support for underwater weapon vapor clouds for hybrid mods
« Reply #11 on: September 12, 2019, 06:30:52 pm »
Hi Meridian, this is a feature I love to (or must) have with my underwater weapons. Even Luke could not get it to work, if there is a way to get it working. I am sure he and not to mention to me, I would be very grateful.

Test mod attached as zip.

Test build: https://lxnt.wtf/oxem/builds//Extended/Extended-5.6.3-ecaa78032-2019-09-12-win64.7z

EDIT: also see here support for non-hybrid mods: https://openxcom.org/forum/index.php/topic,11060.0.html
« Last Edit: February 02, 2023, 10:54:23 am by Meridian »

wcho035

  • Guest
Re: How underwater bullet trajectory works?
« Reply #12 on: September 12, 2019, 08:20:33 pm »
I have tried your mod. It work on the surface for the Plasma rifle and pistol but not the Heavy Plasma. I can see the particle or vapor trail for both! Your mod hasn't got any underwater maps. So I also tried them on mine. Problem still persist unfortunately. It is a great effort and eye popping amazement! Seeing them working on UFO1.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8597
    • View Profile
Re: How underwater bullet trajectory works?
« Reply #13 on: September 12, 2019, 08:25:43 pm »
I have tried your mod. It work on the surface for the Plasma rifle and pistol but not the Heavy Plasma. I can see the particle or vapor trail for both! Your mod hasn't got any underwater maps. So I also tried them on mine. Problem still persist unfortunately. It is a great effort and eye popping amazement! Seeing them working on UFO1.

It doesn't work on surface... surface doesn't have any vapor, ever.

It works only under water.
My mod has underwater maps... two of them... medium scout and large scout.
I have modded only plasma pistol and rifle, not heavy plasma... haven't you seen that in the ruleset?

It's a very simple mod... is it really so hard to read?

PS: I guess your mistake is in metadata.yml... please check it again

wcho035

  • Guest
Re: How underwater bullet trajectory works?
« Reply #14 on: September 12, 2019, 09:00:39 pm »
Wow.. it really worked! THANK YOU MERIDIAN! It is the metadata that is messing up in my mod. Also I was not using an Aliendeployment in my mod. Problem Solved!

You are a total legend Meridian! Absolute total legend! I bet Luke would say the same to you!

Sorry about the mistake! Kind of late in the night..