Jump to content

Dynamic UFO spawns


Solver

Recommended Posts

I have not thought of a good way to do it yet. Adding a mission per se would not be difficult, but all the logic that makes each mission special is in the source code. I could though see myself eventually coding some other missions :)

Link to comment
Share on other sites

Kabill, this thread's for you. Go ahead with your suggestions for source code changes that can improve the dynamic spawn mod and/or make it easier to develop.

Oh, Solver, you spoil me!

So, some thoughts:

Basically, the entire Dynamic UFO mod is a massive work-around, using randomness in the wave spawn-in times as an RNG. It works, but it's clunky and is, more or less, the thing that needs replacing.

Therefore, ideally, there would be some way of setting multiple UFO types to a particular mission. So, for example, for any given ticker point having several columns were you can specify a UFO type and the game will randomly choose between the various options.

Ideally, for full control over the relative probabilities of UFOs appearing, you'd be able to add in as many UFO types as you like. So, for example, if you wanted to set a mission type with a 2:1 chance of getting a Scout vs. Light Scout, you'd have two entries for the Scout and one for the Light Scout. There's possibly better ways you could control the probabilities, but that to me seems the easiest in terms of coding.

In principle, I think that's all that the mod needs in order to work better. All of the subsidiary elements (diversified crews, funding changes) are already reasonable enough in terms of the mod's core purpose.

That said, I want to pitch something that would enable the dynamic UFO system to work better than it does at the moment - and possibly better than the above - but is also a lot more powerful. Indeed, it's already been suggested by TD: being able to create new missions.

First of all, I don't mean creating them with their own scripting. All I mean is being able to create a new mission type and have it use one of the existing scripts, thus essentially creating copies. This is a very useful thing for many reasons:

- It allows a dynamic UFO system, because if you have multiple missions of the same type running simultaneously with different UFOs assigned to them, there's your dynamic system right there. You also have less clunky control over the relative chance of the UFOs spawning as you can control this using the mission spawn chance.

- It would allow dynamic crew types. Since each mission would count differently on the crew loadouts, you could have multiple missions with the same type but different crews.

- As an addition to this, it would allow you to have "scaling" crew loadouts, that is, allow you to increase/change the strength of crews in particular UFOs as the game goes on. This would work by having a mission replaced by another of the same type. E.g Early_Scout is a Scouting mission with particular crew loadouts, and is later phased out and replaced with Late_Scout which is a Scouting mission with a tougher alien crew.

- Potentially, with other changes, it would allow you to set the UFO mission effects (e.g. funding damage chance, ticker increase, etc.) on a per-mission basis. This would allow you to randomise those characteristics or (better) scale the effects as the game goes on/on the basis of UFO type. (You could possibly even link in some other things like spawn-in time and landing-time as well.)

For this to work, I think it would be a good idea of having a means of removing a mission from the mission pool as well as adding them in, as this would make the system a lot more flexible (so, adding in a "max ticker count" variable after which the mission type stops spawning). And with that, I think you have a very powerful and flexible tool for not only making a Dynamic UFO system, but also other things as well.

The only downside I can think of is that it might be more complex to put together a mod using it compared with simply having randomisation within a mission type. The latter is fairly self-explanatory (add in extra mission types when you want), where as adding in extra mission types is strictly speaking still a workaround and a bit harder to conceptualise/work out balance for.

So, I guess, both systems together would be the truly ideal case but I don't know whether it would be worth the effort to do both when being able to add in new missions would do most of the job by itself.

(Wasn't sure if this was on-topic, but there's the whole conversation we had about alien base growth as well.)

Link to comment
Share on other sites

Therefore, ideally, there would be some way of setting multiple UFO types to a particular mission. So, for example, for any given ticker point having several columns were you can specify a UFO type and the game will randomly choose between the various options.

Ideally, for full control over the relative probabilities of UFOs appearing, you'd be able to add in as many UFO types as you like. So, for example, if you wanted to set a mission type with a 2:1 chance of getting a Scout vs. Light Scout, you'd have two entries for the Scout and one for the Light Scout. There's possibly better ways you could control the probabilities, but that to me seems the easiest in terms of coding.

Ah yes. Sadly that particular data structure is built in a somewhat opposite way compared to how I would have done it, but this should be possible.

That said, I want to pitch something that would enable the dynamic UFO system to work better than it does at the moment - and possibly better than the above - but is also a lot more powerful. Indeed, it's already been suggested by TD: being able to create new missions.

[..]

- It allows a dynamic UFO system, because if you have multiple missions of the same type running simultaneously with different UFOs assigned to them, there's your dynamic system right there. You also have less clunky control over the relative chance of the UFOs spawning as you can control this using the mission spawn chance.

I do not understand why this is a good thing? If you can have 1 UFO running a Scouting mission and another UFO running some CustomScouting mission, how is that different from just having 2 UFOs running Scouting?

- As an addition to this, it would allow you to have "scaling" crew loadouts, that is, allow you to increase/change the strength of crews in particular UFOs as the game goes on. This would work by having a mission replaced by another of the same type. E.g Early_Scout is a Scouting mission with particular crew loadouts, and is later phased out and replaced with Late_Scout which is a Scouting mission with a tougher alien crew.

Do you not essentially control that already via ufoconents, and by adjusting the crew for each UFO type?

Anyway, adding mission types is not currently on the table :) Maybe later, but there's too much hardcoding for it to be a quick fix. Not only are the mission logic AIs hardcoded, but there are other places in the code that rely on the missions being that specific list which they are now.

(Wasn't sure if this was on-topic, but there's the whole conversation we had about alien base growth as well.)

Oh yeah. This needs to be made to work. It would probably be too much of a pain for you to recap that ;) So how about these?

Keep medium/large Alien Base ticker limit variables.

Add variable: alienBaseIndependentGrowth.

Add variable: alienBaseGrowthRate

If alienBaseIndependentGrowth is off:

- vanilla behaviour applies

If alienBaseIndependentGrowth is on:

- bases start at small, with their own internal ticker at 0

- internal base ticker increases at alienBaseGrowthRate

- the variables mediumAlienBaseTickerLimit and largeAlienBaseTickerLimit apply to bases individually, and upgrade them to medium/large once the individual base's internal ticker reaches that value

Link to comment
Share on other sites

I don't being able to mod in mission types will ever feasibly be a thing. While adding new mission types is certainly doable, I don't see any way to externalize this since you can't really get around coding the AI, victory conditions, etc.

That said, mission types is certainly something I'd be interested in looking into in the future. Some ideas that I think sound interesting: rescue missions for MIA troops, VIP missions a la FiraXCOM, military base missions (per the unmet stretch goal). I'm sure there are more that could be made to work with more or less effort.

It would be fun to eventually add an Exalt/Cult of Sirius organization that you could fight against as well.

Link to comment
Share on other sites

I do not understand why this is a good thing? If you can have 1 UFO running a Scouting mission and another UFO running some CustomScouting mission, how is that different from just having 2 UFOs running Scouting?

Different UFOs can be assigned to the same type. So Scouting_Default is assigned a Scout while Scouting_Custom is assigned a Corvette (or whatever). So can also vary crews, so have Scouting_Default spawn a Scout with Sebillian/Caesan crew but have Scouting_Custom spawn with Wraith/Harridan crew (or whatever).

So the mission script stays the same (it's doing a scouting mission) but you can thoroughly mix up the UFOs/aliens doing those missions so you're not stuck with the same type at any given point in time/across the whole game.

Do you not essentially control that already via ufoconents, and by adjusting the crew for each UFO type?

You do, but there's only a small number of degrees of freedom here (i.e. not many "basic" mission types). Also, it means you're tying crew difficulty to mission type, which isn't necessarily a bad thing, but it's another restriction.

So, basically, being able to add in new missions allows full, unrestricted freedom of movement in terms of crew spawns for mission types.

Anyway, adding mission types is not currently on the table :) Maybe later, but there's too much hardcoding for it to be a quick fix. Not only are the mission logic AIs hardcoded, but there are other places in the code that rely on the missions being that specific list which they are now.

That's fine. I was only telling you what you asked for :P

Oh yeah. This needs to be made to work. It would probably be too much of a pain for you to recap that ;) So how about these?

Keep medium/large Alien Base ticker limit variables.

Add variable: alienBaseIndependentGrowth.

Add variable: alienBaseGrowthRate

If alienBaseIndependentGrowth is off:

- vanilla behaviour applies

If alienBaseIndependentGrowth is on:

- bases start at small, with their own internal ticker at 0

- internal base ticker increases at alienBaseGrowthRate

- the variables mediumAlienBaseTickerLimit and largeAlienBaseTickerLimit apply to bases individually, and upgrade them to medium/large once the individual base's internal ticker reaches that value

That's fine. Again, it would be good if there was some way of integrating the alien ticker into that as well (perhaps adding a proportion of the alien ticker to the start value? So if it was set to 0.5, for example, it would start the base at half the current alien ticker value?). I'm just thinking that it would be useful to have some mechanism by which bases don't have to start entirely from scratch.

Link to comment
Share on other sites

Different UFOs can be assigned to the same type. So Scouting_Default is assigned a Scout while Scouting_Custom is assigned a Corvette (or whatever).

If you get your fine-grained control over spawns, why not make the Scouting mission have a 50/50 chance of Scout vs. Corvette? You get the same thing, or?

That's fine. Again, it would be good if there was some way of integrating the alien ticker into that as well (perhaps adding a proportion of the alien ticker to the start value? So if it was set to 0.5, for example, it would start the base at half the current alien ticker value?). I'm just thinking that it would be useful to have some mechanism by which bases don't have to start entirely from scratch.

Yep, definitely.

Link to comment
Share on other sites

If you get your fine-grained control over spawns, why not make the Scouting mission have a 50/50 chance of Scout vs. Corvette? You get the same thing, or?

I'm sorry for intruding, as I'm thinking in terms of modular UFOs - there is massive difference in being able to assign same type UFO to multiple variations of the same mission. That is if there is no simple way to add entirely new UFO types from scratch. Let's say I have 10 different modular variations of Corvette - do all of them have to be limited to just 3 potential crews (1 for each race)? That would be very limiting.

Link to comment
Share on other sites

I'm sorry for intruding, as I'm thinking in terms of modular UFOs - there is massive difference in being able to assign same type UFO to multiple variations of the same mission. That is if there is no simple way to add entirely new UFO types from scratch. Let's say I have 10 different modular variations of Corvette - do all of them have to be limited to just 3 potential crews (1 for each race)? That would be very limiting.

Assuming each of those UFOs are of a different kind (e.g. the Andron Corvette was literally a different aircraft type to the Caesan Corvette and treated completely separately) then that's not a problem as each UFO has it's own crew list. The only problem would be with regards to alien race type displayed with the quantum cryptography centre, since if you wanted crew variants for each of the race specific ones you'd have to use the three different race types (Caesan, Sebillian and Andron) to differentiate them so it would look like they had different races even when they don't (if that makes sense; I'm about to write something on the main suggestions thread about this if it doesn't though).

@Solver: If I read that image right, you set both a UFO type and a chance of occurring to each entry. Presumably you can change the chance of a UFO type occurring by adding another entry of the same time with a different chance set to occur at a later ticker point?

E.g.:

corvette - ticker: 0 chance: 50

landing ship - ticker: 0 chance: 50

corvette - ticker: 100 chance: 0

cruiser - ticker: 100 chance 50

In this instance, between ticker point 0-100 you can spawn either a corvette or landing ship for the mission with a 50/50 chance of each. At ticker point 100, corvettes are removed from the pool and cruisers added in so there's now a 50/50 chance of landing ship or corvette?

Assuming I've read that right, that's excellent.

Also, does the total chance have to add up to 100 or does it work like the UFO mission chances (i.e. add up all values and RNG between 0 and the total)? The latter would probably make things a bit easier, but the former is quite workable assuming you can change the chances later on like I assume you can.

Link to comment
Share on other sites

Yes, your reading is basically right. All the ships that have the same value in the second column form a group that can be spawned with that ticker value, and the chances are like UFO mission chances - just weighted probabilities, although I simply prefer making them add up to 100.

So that picture is, at ticket 0, a 10% chance for Corvettes and 45% for Carriers and Battleships each.

Except you do not need to remove anything by setting a chance to 0. If you have:

corvette - ticker: 0 chance: 50

landing ship - ticker: 0 chance: 50

then whenever you specify another ticker value, that begins the next band, so then simply writing

cruiser - ticker: 100 chance: 100

will change all of those to Cruisers at 100 ticker.

Link to comment
Share on other sites

I'll be honest, I can't promise that's going to happen. It depends on how much time I've got on Saturday (all the updates to do!).

Although actually, I assume that with the changes you've added in the old mission files won't work any more (as they won't have the "chance" column for the UFO types) so it might actually be about as quick to update to the new system as make the old mod compatible with 0.25.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...