Author Topic: psyHoTik's experiments  (Read 15844 times)

Offline Xeno Wiper

  • Sergeant
  • **
  • Posts: 45
    • View Profile
Re: psyHoTik's experiments
« Reply #15 on: March 22, 2016, 02:00:23 am »


Experiment 1 - Alien Snipers
The goal was to give the aliens the ability to shoot at revealed targets they don't personally see, just like X-com soldiers do in most cases (you fire at enemy spotted by another soldier). In theory this could make game more challenging and unarmed or weak enemies would still pose a threat as they could relay your position to their buddies. The build actually works and such game may be even considered fun...



As if aliens weren't cheating enough with their extended vision...  :P


The psi thing is actually interesting, but it makes things fair.... :D


But seriously, those are nice options to make the game more balanced, instead of relying in cheat stuff for that.


Any chance for Warboy to merge it to the main build (as an option/mod, not actually a fixed feature)?
« Last Edit: March 22, 2016, 02:03:35 am by Xeno Wiper »

Offline psyHoTik

  • Sergeant
  • **
  • Posts: 38
    • View Profile
Re: psyHoTik's experiments
« Reply #16 on: March 22, 2016, 10:15:52 pm »
Ladies and Gentlemen , by special request from SolariusScorch...

Experiment 3 - variable sight range for armors. I've add 2 parameters for rulesets, that define sight range at day and night. It was done in most simple way and may not be exactly what you've expected, but here are the details:
1. In ruleset "sightRangeDay" and "sightRangeNight" will define the sight radius. If you don't define it, the default values will be 20/9
2. sightRangeNight should be lower or equal than sightRangeDay, otherwise it may not work as planned (but feel free to test it)
3. For aliens sightRangeDay will be used for both day and night. It is not possible to make alien sight different at night without radical changes in gameplay, because your soldiers glow, so for game logic there's always a "day" around them.
4. The light radius around your soldiers is not changed so if you set the values high you will detect units out of light radius.
5. LOS blocking by smoke and fire is unaffected by those parameters.

I've included a simple mod to show how it works. It adds night vision for human armors and also make Floaters even more pathetic by halving their sight range (just for show). Sniping aliens and PSI rework included.

Also a bug was fixed - hitting an alien on their turn via reaction fire should no longer bring counter-barrage on shooting soldier if he remained unseen.
« Last Edit: March 22, 2016, 10:21:16 pm by psyHoTik »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: psyHoTik's experiments
« Reply #17 on: March 22, 2016, 10:23:35 pm »
Awesome! Thanks. Now I need to ask Meridian to include your code.

Offline psyHoTik

  • Sergeant
  • **
  • Posts: 38
    • View Profile
Re: psyHoTik's experiments
« Reply #18 on: March 22, 2016, 10:25:26 pm »
Awesome! Thanks. Now I need to ask Meridian to include your code.
Better test it first :)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: psyHoTik's experiments
« Reply #19 on: March 22, 2016, 10:27:21 pm »
Better test it first :)

He's more qualified :)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: psyHoTik's experiments
« Reply #20 on: March 24, 2016, 05:03:44 pm »
I've included a simple mod to show how it works. It adds night vision for human armors and also make Floaters even more pathetic by halving their sight range (just for show). Sniping aliens and PSI rework included.

Can you share just that single change? As a git patch? Or maybe upload to github?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: psyHoTik's experiments
« Reply #21 on: March 25, 2016, 05:23:07 pm »
I couldn't really use this, can't see what was changed. And I also needed to consider OXCE changes as this was for vanilla only. So I made my own version: https://github.com/MeridianOXC/OpenXcom/commit/8bf5a9d4abf8c839028bff6717bed791faa2c737

1. In ruleset "sightRangeDay" and "sightRangeNight" will define the sight radius. If you don't define it, the default values will be 20/9

OXCE already has "visibilityAtDark".
I have added "visibilityAtDay".

2. sightRangeNight should be lower or equal than sightRangeDay, otherwise it may not work as planned (but feel free to test it)

visibilityAtDay can be lower than visibilityAtDark, if you wish so... Solarius seems to have a use case for everything... but both of them must be lower or equal to a global limit (20)... the global limit is configurable too in OXCE... that DOESN'T mean I suggest to change it... be very careful about that!

3. For aliens sightRangeDay will be used for both day and night. It is not possible to make alien sight different at night without radical changes in gameplay, because your soldiers glow, so for game logic there's always a "day" around them.

I am using both limits also for aliens; in OXCE you can turn off the "glow", so no problem.

Btw. definition of dark is "tile shade > limit" (this limit is also globally configurable in OXCE). If unit is on fire, it is automatically not in dark. If unit is lighted by external source (e.g. flare) or by personal lighting ("glow") it is also not in dark.

4. The light radius around your soldiers is not changed so if you set the values high you will detect units out of light radius.
5. LOS blocking by smoke and fire is unaffected by those parameters.

I didn't change any of that either.

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: psyHoTik's experiments
« Reply #22 on: March 25, 2016, 05:42:56 pm »
I kinda remember a hotkey "L" to toggle the light around your characters, though I'm not sure what gameplay effect it has, if any.

Offline psyHoTik

  • Sergeant
  • **
  • Posts: 38
    • View Profile
Re: psyHoTik's experiments
« Reply #23 on: March 25, 2016, 09:43:40 pm »
I couldn't really use this, can't see what was changed. And I also needed to consider OXCE changes as this was for vanilla only. So I made my own version:
So you don't need my code anymore? That's a shame  ;D
But seriously, if you could provide me with some tutorial on how to make those Git patches or how to use Github properly, I would be very grateful. I have Github installed but I used it only to clone the repository. I don't know what else should I do with it to make everything lege artis.

If we are talking about light, I have some idea for next experiment, but I need to earn some EXP and advance a level i coding first :) The idea is:
1. Soldiers do not emit any light or this light is very weak.
2. Items have "flashlight" parameter, defined in ruleset . Such items, when hold in hand, emit a cone of light in front of soldier, not around him.
3. By setting flashlight value we can set the strength of light. This way we can have weapons with build in light (weak light), handheld flashlights (decent light source but blocking a hand slot) and some hi-tech, elerium powered super-light sources (maybe mounted on shoulders, if this is codeable)
4. Turning light off allows to hide from some species of aliens, that don't see good during the night. Turning it on makes soldier visible and exposed.
5. Shooting at target in darkness gives big penalty to accuracy (don't know if this is codeable, as I haven't looked at accuracy routines yet). So you should either illuminate the target or use weapon with night scope (another flag in ruleset) that would ignore this penalty)
6. Ultimate achievement would be learning the AI to use such light sources too.

That's the idea. Anyone tried that? :)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: psyHoTik's experiments
« Reply #24 on: March 26, 2016, 01:04:14 am »
but both of them must be lower or equal to a global limit (20)...

Well it's a bit of an issue, since it would be interesting to have aliens with vision 24. :)
I kinda remember a hotkey "L" to toggle the light around your characters, though I'm not sure what gameplay effect it has, if any.

It just turns off lights on X-Com soldiers. Which means they're not shining brightly in the dark for everyone to shoot at them.

1. Soldiers do not emit any light or this light is very weak.

Why? You can always turn off the lights with 'L'.

2. Items have "flashlight" parameter, defined in ruleset . Such items, when hold in hand, emit a cone of light in front of soldier, not around him.

Yeah, that'd be great.

4. Turning light off allows to hide from some species of aliens, that don't see good during the night. Turning it on makes soldier visible and exposed.

That's actually easily done in OXCE. I prefer to fight humans at night, because you can outsmart them using flares and shadows. Ninja style.

5. Shooting at target in darkness gives big penalty to accuracy (don't know if this is codeable, as I haven't looked at accuracy routines yet). So you should either illuminate the target or use weapon with night scope (another flag in ruleset) that would ignore this penalty)

This could be interesting, but no nightvision please, this has been discussed to death twice over. ;) Unless we have a special slot for headgear maybe.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: psyHoTik's experiments
« Reply #25 on: March 26, 2016, 09:49:48 am »
Well it's a bit of an issue, since it would be interesting to have aliens with vision 24. :)

Increasing global limit to 24 is OK, feel free to do that... just don't go to something ridiculous as 50 or 100... for "true vision" we would need a different algorithm.

Code: [Select]
maxViewDistance: 24 #global visibility limit
maxDarknessToSeeUnits: 9 #0-9 is day, 10-15 is dark
...
armor:
  type: STR_XCOM_ARMOR_TO_MAKE_MERIDIAN_ANGRY
  visibilityAtDark: 4
  visibilityAtDay: 8
...
  type: STR_ARMOR_TO_MAKE_FLOATERS_OP
  visibilityAtDark: 24
  visibilityAtDay: 24
...

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: psyHoTik's experiments
« Reply #26 on: March 26, 2016, 08:47:06 pm »
OK, I was hoping it would work. Thanks, effendi :)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: psyHoTik's experiments
« Reply #27 on: April 02, 2016, 10:27:46 am »
OK, I was hoping it would work. Thanks, effendi :)

I did some testing after upgrading to newest piratez, and with maxViewDistance=30 it starts lagging on maximum xcom movement speed on large maps.

So, to be on the safe side, I'd recommend keeping maxViewDistance on 30 or less... otherwise you need to warn the users they may experience lags and need to decrease the unit movement speed.

PS: tested with above average 2016 hardware
PS2: attached a save with most lag