Author Topic: How underwater bullet trajectory works?  (Read 4617 times)

wcho035

  • Guest
Re: How underwater bullet trajectory works?
« Reply #15 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.

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6996
  • OXCE developer
    • View Profile
    • My Wiki
Re: How underwater bullet trajectory works?
« Reply #16 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 #17 on: September 12, 2019, 08:42:56 pm »
Sorry, it is 3am here, late the day, made a few mistakes. I will check it out again.

wcho035

  • Guest
Re: How underwater bullet trajectory works?
« Reply #18 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..

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6996
  • OXCE developer
    • View Profile
    • My Wiki
Re: How underwater bullet trajectory works?
« Reply #19 on: September 12, 2019, 09:18:41 pm »
Sorry about the mistake! Kind of late in the night..

No worries... and go to bed already ;-)

Offline luke83

  • Commander
  • *****
  • Posts: 1567
    • View Profile
    • openxcommods
    • Email
Re: How underwater bullet trajectory works?
« Reply #20 on: November 25, 2019, 07:20:41 am »
Finally added this today, thankyou Meridiam. :P

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6996
  • OXCE developer
    • View Profile
    • My Wiki
Re: How underwater bullet trajectory works?
« Reply #21 on: May 14, 2020, 08:14:53 pm »
Since OXCE v6.5, having surface weapon vapor trail is possible also for non-hybrid mods, i.e. just normal xcom1-based mods.

Steps are also much easier than for hybrid mods.

Sample mod attached.

Offline efrenespartano

  • Commander
  • *****
  • Posts: 677
  • I know a lot about the law and other lawyerings.
    • View Profile
    • Email
Re: How underwater bullet trajectory works?
« Reply #22 on: May 23, 2020, 07:36:38 pm »
Wonderful! I expected to have this feature a long time ago.

Question: I notice the vaporColors are limited to four colors: white, cyan, orange and green. Could be possible the add more colors (like red or purple)?

Also: how does
Code: [Select]
colors works?

Code: [Select]
transparencyLUTs:
  - colors:
      - [  8,  8, 12, 2 ] # "white"

Those numbers are indexes on the Battlescape palette?
« Last Edit: May 23, 2020, 07:40:53 pm by efrenespartano »

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6996
  • OXCE developer
    • View Profile
    • My Wiki
Re: How underwater bullet trajectory works?
« Reply #23 on: May 23, 2020, 07:48:59 pm »
Question: I notice the vaporColors are limited to four colors: white, cyan, orange and green. I tried your test mod and I found that the cyan, the white and the green were basically the same. Could be possible the add more colors (like red or purple)?

They are not the same, but they can sometimes appear the same based on what is in the background.

For example green and cyan on green background will look almost the same.
But the same cyan and green on light grey background will look different.
Try it.

OpenXcom palette is very limited and simulating transparency just isn't possible in all background/foreground color combinations.


Also: how does
Code: [Select]
colors works?

Code: [Select]
transparencyLUTs:
  - colors:
      - [  8,  8, 12, 2 ] # "white"

Those numbers are indexes on the Battlescape palette?

I don't know how it works... I was trying to read it for a long time, but it's too cryptic without someone telling you what it is.

As far as I can tell, the numbers correspond to [(R)ed, (G)reen, (B)lue, Step], where R G B are not real RGB (0-255), also not xcom RGB (0-63) and also not OpenXcom colors/indices.
I also don't know what values they can have, probably between 0 and 15, but that's just a wild guess. "Step", no idea.

Probably the only guy who can answer this is Warboy.
If you find out, do let us know!

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 2526
    • View Profile
Re: How underwater bullet trajectory works?
« Reply #24 on: May 23, 2020, 07:58:23 pm »
If I recall correctly this is "desired" color you want have, after that game iterate for each palette and try find best matches for desired color.
Logic is somthing like:
Get some color for palette, mix in your desired color in RGB, now for this new color in RGB find best match in same palette.
This will give transition from original color to final one in same palette and it represent transparent vapor cloud.

Offline efrenespartano

  • Commander
  • *****
  • Posts: 677
  • I know a lot about the law and other lawyerings.
    • View Profile
    • Email
Re: How underwater bullet trajectory works?
« Reply #25 on: May 24, 2020, 09:33:11 am »
They are not the same, but they can sometimes appear the same based on what is in the background.

For example green and cyan on green background will look almost the same.
But the same cyan and green on light grey background will look different.
Try it.

OpenXcom palette is very limited and simulating transparency just isn't possible in all background/foreground color combinations.

Hahaha I noticed it after I tried on the Polar terrain. My bad, that's why I deleted that specific part of my question hahaha.  ;D
The change is more noticeable if the
Code: [Select]
vaporDensitySurface is set above 20.

Quote
I don't know how it works... I was trying to read it for a long time, but it's too cryptic without someone telling you what it is.

As far as I can tell, the numbers correspond to [(R)ed, (G)reen, (B)lue, Step], where R G B are not real RGB (0-255), also not xcom RGB (0-63) and also not OpenXcom colors/indices.
I also don't know what values they can have, probably between 0 and 15, but that's just a wild guess. "Step", no idea.

Probably the only guy who can answer this is Warboy.
If you find out, do let us know!

If I recall correctly this is "desired" color you want have, after that game iterate for each palette and try find best matches for desired color.
Logic is somthing like:
Get some color for palette, mix in your desired color in RGB, now for this new color in RGB find best match in same palette.
This will give transition from original color to final one in same palette and it represent transparent vapor cloud.


Oh, dang. I think I could do some random tries to see if I could get a new color, then. Thanks for the quick reply, folks.  :D

Offline Ethereal

  • Colonel
  • ****
  • Posts: 474
    • View Profile
Re: How underwater bullet trajectory works?
« Reply #26 on: April 15, 2021, 03:26:58 pm »
Vapor works only underwater.
Fake underwater... as the name says... is not underwater.

For surface (including fake underwater) missions, you can use surface vapor.

Poporobuy. "Vapor...Surface" does not work with setting depth on the terrain. And without the set depth, "drawBubbles", underwater animation of explosions, missions and  race "_UNDERWATER" do not work.

In my modification, the rocket launchers have "vaporColorSurface:" and "vaporDensitySurface:", but this only works on land. And if we set the usual "vaporColor: vaporDensity:" we get -

Code: [Select]
[15-04-2021_15-25-20] [FATAL] A fatal error has occurred: Segmentation fault.
[15-04-2021_15-25-20] [FATAL] 0x5b6d50 OpenXcom::CrossPlatform::stackTrace(void*)
[15-04-2021_15-25-20] [FATAL] 0x5b7bc0 OpenXcom::CrossPlatform::crashDump(void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
[15-04-2021_15-25-20] [FATAL] 0x41c7f0 signalLogger(int)
[15-04-2021_15-25-20] [FATAL] 0x9ba390 OpenXcom::UfopaediaStartState::think()
[15-04-2021_15-25-20] [FATAL] 0x774e72fc _C_specific_handler
[15-04-2021_15-25-20] [FATAL] 0x774fbee0 _chkstk
[15-04-2021_15-25-20] [FATAL] 0x774cff00 RtlInitializeResource
[15-04-2021_15-25-20] [FATAL] 0x774fb5f0 KiUserExceptionDispatcher
[15-04-2021_15-25-20] [FATAL] 0x55f0f0 OpenXcom::Map::drawTerrain(OpenXcom::Surface*)
[15-04-2021_15-25-20] [FATAL] 0x68ed50 OpenXcom::Surface::blit(SDL_Surface*)
[15-04-2021_15-25-20] [FATAL] 0x68d290 OpenXcom::State::blit()
[15-04-2021_15-25-20] [FATAL] 0x5cef20 OpenXcom::Game::run()
[15-04-2021_15-25-20] [FATAL] 0x41c950 SDL_main
[15-04-2021_15-25-20] [FATAL] 0x9bbec0 console_main
[15-04-2021_15-25-20] [FATAL] 0x9bbfe0 WinMain
[15-04-2021_15-25-20] [FATAL] ??
[15-04-2021_15-25-20] [FATAL] ??
[15-04-2021_15-25-20] [FATAL] 0x77385550 BaseThreadInitThunk
[15-04-2021_15-25-20] [FATAL] 0x774e3840 RtlUserThreadStart
[15-04-2021_15-25-23] [FATAL] OpenXcom has crashed: Segmentation fault.

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6996
  • OXCE developer
    • View Profile
    • My Wiki
Re: How underwater bullet trajectory works?
« Reply #27 on: April 15, 2021, 04:53:50 pm »
If you're using depth on fake underwater terrain it counts as normal underwater again, and normal vapor should work too.

Upload a save where it doesn't work pls.
« Last Edit: April 15, 2021, 04:57:17 pm by Meridian »

Offline Ethereal

  • Colonel
  • ****
  • Posts: 474
    • View Profile
Re: How underwater bullet trajectory works?
« Reply #28 on: April 15, 2021, 05:20:38 pm »
Saves is not necessary. You can simply test it in "Battle" mode. In this mode, everything works the same as in a regular game. I checked. Very convenient, by the way.

Although, here's the save, if that's more convenient for you.
« Last Edit: April 15, 2021, 05:42:17 pm by Ethereal »

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6996
  • OXCE developer
    • View Profile
    • My Wiki
Re: How underwater bullet trajectory works?
« Reply #29 on: April 15, 2021, 06:42:12 pm »
You are missing PAL_BATTLESCAPE_3 (for sea depth = 3).

Just add this to your custom palettes and it will work.

Code: [Select]
  - type: PAL_BATTLESCAPE_3L83
    target: PAL_BATTLESCAPE_3
    file: Resources/PALS/battlescape_seadepth2.jasc

And of course also this for STR_HWP_ROCKETS

Code: [Select]
    vaporColor: 9
    vaporDensity: 40