Author Topic: [DONE] [Suggestion] Grenades, mines, etc. on minimap  (Read 5452 times)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
[DONE] [Suggestion] Grenades, mines, etc. on minimap
« on: August 01, 2017, 04:58:03 pm »
Request 1 (Dioxine): flag to hide mines on the minimap

Code: [Select]
items:
  - type: STR_TRAP_KNOCKOUT_GAS
    hiddenOnMinimap: true

Request 2 (Nepnep): primed grenades in red color on the minimap

...no ruleset changes needed

Of course, there can be a million grenades on a single tile and I can't check all of them... so the algorithm is as follows:
1. if the first item on the tile is a primed item (grenade, proxy, flare, ...) and is not flagged as hidden... render a red icon
2. otherwise, if the first item is hidden and there are no more items on the tile... don't render anything
3. otherwise, render normal icon


New algorithm:
1. if all items on a tile are hidden, don't show anything
2. otherwise, if at least one item is primed, show red icon
3. otherwise, show normal icon

See attached example.
« Last Edit: July 17, 2018, 03:06:50 pm by Meridian »

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Grenades, mines, etc. on minimap
« Reply #1 on: August 01, 2017, 05:40:46 pm »
A typical scenario where this optimization is harmful is when a soldier gets killed/stunned by reaction fire, an entire inventory (+a fresh body) will be dropped in place, and the player will never be lucky enough to have the pre-primed explosive end up as the "first" item.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Grenades, mines, etc. on minimap
« Reply #2 on: August 01, 2017, 06:15:30 pm »
Fully aware. I warned you.

If anyone has a better idea (other than to check potentially a million items on the ground), I'm open to suggestions.

Offline SteamXCOM

  • Colonel
  • ****
  • Posts: 150
    • View Profile
Re: Grenades, mines, etc. on minimap
« Reply #3 on: August 01, 2017, 06:48:06 pm »
Like to see something like this in the nightlies, occasionally throw a proximity grenade and its easy to loose track of it

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Grenades, mines, etc. on minimap
« Reply #4 on: August 01, 2017, 07:32:24 pm »
OK, so after a few more discussions, I did it brute force anyway.
Let's just hope modders and players will be sane enough not to bring a million credit chip items into a base defense.

New algorithm:
1. if all items on a tile are hidden, don't show anything
2. otherwise, if at least one item is primed, show red icon
3. otherwise, show normal icon

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Grenades, mines, etc. on minimap
« Reply #5 on: August 01, 2017, 07:44:39 pm »
Let's just hope modders and players will be sane enough

 ::)

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Grenades, mines, etc. on minimap
« Reply #6 on: August 01, 2017, 08:31:46 pm »
The geoscape itself will start having performance issues before the minimap does.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: Grenades, mines, etc. on minimap
« Reply #7 on: August 02, 2017, 02:51:29 am »
If anyone has a better idea (other than to check potentially a million items on the ground), I'm open to suggestions.
Check up to 64 items. Nobody is going to put more than 64 items on one soldier except maybe Dioxine.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11775
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Grenades, mines, etc. on minimap
« Reply #8 on: August 02, 2017, 08:17:22 pm »
A mine covered with 500 kg of weapons is probably non-functional anyway. :P

Also, next stop: mine detection. B)