aliens

Author Topic: Random component to Ufo selection and trajectories  (Read 2059 times)

Offline Eddie

  • Commander
  • *****
  • Posts: 545
    • View Profile
Random component to Ufo selection and trajectories
« on: February 04, 2016, 07:46:23 pm »
I recently had my first look at the way Ufos are generated and how trajectories work. I didn't realize it up to that point, but from the speed and type of the Ufo, you can more or less know exactly if it will land or not, even without a hyperwave decoder. For example, P8 is the only trajectory with 56% max velocity, so if I see a Ufo with that speed I know I need to shoot it down now because it's not going to land and soon will get away. You also know exactly what the next Ufo is gonna be.

For me, it's not much fun playing a game where I know what will happen next. So I would like to add some randomness to Ufo type selection, trajectories and speed.

- I would like to add a random component to the speed, so I cannot tell what the trajectory is by just looking at the speed.
- I would like to add a randomness to the selection of waypoints or trajectories, so that it's not 100% guaranteed that an Ufo on abduction mission will land.
- And most of all, I would like to have some tech level or causality dependent selection of Ufo size and number, with a random factor. By causality dependent I mean that if an Ufo fails to accomplish it's mission, the next Ufo is going to be a bigger one than if the mission had not failed. Or they send two instead of one.


Offline Hobbes

  • Commander
  • *****
  • Posts: 3502
  • Infiltration subroutine in progress
    • View Profile
Re: Random component to Ufo selection and trajectories
« Reply #1 on: February 04, 2016, 08:09:42 pm »
I recently had my first look at the way Ufos are generated and how trajectories work. I didn't realize it up to that point, but from the speed and type of the Ufo, you can more or less know exactly if it will land or not, even without a hyperwave decoder. For example, P8 is the only trajectory with 56% max velocity, so if I see a Ufo with that speed I know I need to shoot it down now because it's not going to land and soon will get away. You also know exactly what the next Ufo is gonna be.

If you have an excellent memory or a list of all the UFOs and trajectories then yeah. Then again if you're not interested in being able to predict UFO behavior, then you shouldn't look into the technical details of the game ;)

Quote
For me, it's not much fun playing a game where I know what will happen next. So I would like to add some randomness to Ufo type selection, trajectories and speed.

- I would like to add a random component to the speed, so I cannot tell what the trajectory is by just looking at the speed.
- I would like to add a randomness to the selection of waypoints or trajectories, so that it's not 100% guaranteed that an Ufo on abduction mission will land.
- And most of all, I would like to have some tech level or causality dependent selection of Ufo size and number, with a random factor. By causality dependent I mean that if an Ufo fails to accomplish it's mission, the next Ufo is going to be a bigger one than if the mission had not failed. Or they send two instead of one.

The first two are already possible if you add variations of the vanilla missions, where each UFO wave has a different composition and settings (speed, trajectories, etc.) than vanilla. The randomness isn't as big as you probably had in mind but it will give some variety.

Offline Eddie

  • Commander
  • *****
  • Posts: 545
    • View Profile
Re: Random component to Ufo selection and trajectories
« Reply #2 on: February 04, 2016, 08:58:10 pm »
If you have an excellent memory or a list of all the UFOs and trajectories then yeah. Then again if you're not interested in being able to predict UFO behavior, then you shouldn't look into the technical details of the game ;)

Well, I wanted to incease the likelyhood of medium sized Ufos and you can't do that without looking at the game files. And what has been seen, cannot be unseen.

I don't know how the code works exactly, but I was hoping that adding some +-10% random speed to Ufos is just one added variable in a line of code.

Offline Hobbes

  • Commander
  • *****
  • Posts: 3502
  • Infiltration subroutine in progress
    • View Profile
Re: Random component to Ufo selection and trajectories
« Reply #3 on: February 04, 2016, 10:19:09 pm »
I don't know how the code works exactly, but I was hoping that adding some +-10% random speed to Ufos is just one added variable in a line of code.

That change can't be done through the ruleset files and would require to make changes to the executable itself.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5297
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Random component to Ufo selection and trajectories
« Reply #4 on: February 05, 2016, 05:39:50 pm »
This also can be dangerous for modders if overdone - it is sometimes imperative for an UFO to move exactly as planned else unexpected behaviour will happen, potentially even leading to breaking the campaign.
Although adding randomness to everything in general is never a bad idea...

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 9808
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Random component to Ufo selection and trajectories
« Reply #5 on: February 06, 2016, 04:38:35 pm »
This also can be dangerous for modders if overdone - it is sometimes imperative for an UFO to move exactly as planned else unexpected behaviour will happen, potentially even leading to breaking the campaign.

Aren't you the one who's (rightfully so) always criticizing saving modders from themselves? :D

I can understand there's some (very little) danger in that. Which can generate bugs. Bugs then get fixed. Everybody's happy.

Can you elaborate on how the game can be broken with this feature? I can't think of anything. Well, maybe if you really don't want a UFO to land, but then it does.

Hmm, maybe a compromise would be to create a closed list of trajectories to choose randomly from?

Offline Dioxine

  • Commander
  • *****
  • Posts: 5297
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Random component to Ufo selection and trajectories
« Reply #6 on: February 08, 2016, 05:36:08 pm »
Yeah I'll give you an example. I say I want something move exactly at the speed of light. If there was a random to this, I couldn't :) But adding an extra 'randomize' parameter would be just fine (eg. some speedRandomness as a Trajectory parameter, it has a % parameter and rolls a dice every time UFO changes speed; the dice roll is substracted or added to speed stated in Trajectory).

Offline Hobbes

  • Commander
  • *****
  • Posts: 3502
  • Infiltration subroutine in progress
    • View Profile
Re: Random component to Ufo selection and trajectories
« Reply #7 on: February 08, 2016, 06:52:54 pm »
Hmm, maybe a compromise would be to create a closed list of trajectories to choose randomly from?

I've already implemented something similar to random trajectories on Redux. Each alienMission like Alien Abductions now has 3 entries (ALIEN_ABDUCTIONS1, 2, 3) and the ufos/trajectories defined on the waves section are different for the 3 alienMissions. Then it's just a matter of adding the additional alienMissions to regions to be added to the mission table. 

You could create 5, 10, 20, etc. different variations for each alienMission. The problem is that the game can then select the same mission type several times in a row due to the RNG.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 9808
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Random component to Ufo selection and trajectories
« Reply #8 on: February 08, 2016, 07:50:22 pm »
Yeah I'll give you an example. I say I want something move exactly at the speed of light. If there was a random to this, I couldn't :) But adding an extra 'randomize' parameter would be just fine (eg. some speedRandomness as a Trajectory parameter, it has a % parameter and rolls a dice every time UFO changes speed; the dice roll is substracted or added to speed stated in Trajectory).

Oh sure, forcing it would be bad. I thought of an additional, optional parameter. :)

I've already implemented something similar to random trajectories on Redux. Each alienMission like Alien Abductions now has 3 entries (ALIEN_ABDUCTIONS1, 2, 3) and the ufos/trajectories defined on the waves section are different for the 3 alienMissions. Then it's just a matter of adding the additional alienMissions to regions to be added to the mission table. 

You could create 5, 10, 20, etc. different variations for each alienMission. The problem is that the game can then select the same mission type several times in a row due to the RNG.

OK, sounds like a reasonable solution (well, more like a reasonable hack to be honest, but I have nothing about hacks). Still, it's a lot of work and makes the ruleset harder to manage. A clear list of possible trajectories, with its own header, would be cleaner and neater.