OpenXcom Forum

Modding => OpenXcom Extended => OXCE Suggestions DONE => Topic started by: Meridian on August 01, 2017, 04:58:03 pm

Title: [DONE] [Suggestion] Grenades, mines, etc. on minimap
Post by: Meridian 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.
Title: Re: Grenades, mines, etc. on minimap
Post by: yrizoud 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.
Title: Re: Grenades, mines, etc. on minimap
Post by: Meridian 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.
Title: Re: Grenades, mines, etc. on minimap
Post by: SteamXCOM 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
Title: Re: Grenades, mines, etc. on minimap
Post by: Meridian 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
Title: Re: Grenades, mines, etc. on minimap
Post by: Hobbes on August 01, 2017, 07:44:39 pm
Let's just hope modders and players will be sane enough

 ::)
Title: Re: Grenades, mines, etc. on minimap
Post by: yrizoud on August 01, 2017, 08:31:46 pm
The geoscape itself will start having performance issues before the minimap does.
Title: Re: Grenades, mines, etc. on minimap
Post by: The Reaver of Darkness 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.
Title: Re: Grenades, mines, etc. on minimap
Post by: Solarius Scorch 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)