Ability Cooldowns Question

research question

Can the AI trigger a research automatically and in such a way as to not interfere with normal user generated research? Ultimately, I am trying to increase an ability's cooldown as the game progresses.

I have a planetary structure that automatically spawns free units via an ability. I first added another ability to automatically increase the AbilityCooldownRate at set intervals. It triggered automatically and worked about as well as could be expected. But there were two problems with this method. The first is that it creates an unsightly ability for the structure.

Even with no icons, it still displays all the other visual stuff for a passive ability.

useCostType "Passive"
researchPrerequisites
NumResearchPrerequisites 0
nameStringID "IDS_BLANK"
descStringID "IDS_BLANK"
hudIcon ""
smallHudIcon ""
infoCardIcon ""

The second problem is that the ability only activates when the structure is built. So if an instance of this structure is built later in the game, it starts out with the base cooldown rate, not the adjusted rate.

My next step was to use levels on the spawning ability (levelSourceType "ResearchWithBase"). It solved all the problems the ability had, but it created a new problem - you have to activate the research yourself. I want to increase the cooldowns on a free unit for gameplay mechanics - no one in their right mind is going to research something that only penalizes them! And even if I could somehow induce the player to conduct the research, they would have to waste all their research time on it (the first cooldown takes 15min to research, and they only take longer from there.)

So, I'm wondering if I can have an ability be researched automatically. I'm thinking it may be possible to "hide" it in an artifact and just give it to the player at the beginning of the game, but I haven't yet found a way to do this. The only other way I could think to solve this would be if there is another kind of "levelSourceType" that I don't yet know of. I currently use "ResearchWithBase", "Intrinsic", and "fixedLevel0". Is there a "Timed" or "OnDelay" kind of "levelSourceType"?

Hopefully someone knows the answer to this.

Thanks

 

2,418 views 3 replies
Reply #1 Top

The only levelSourceTypes in use in sins (and probably the only ones that exist at all) are FixedLevel0, ResearchWith(out)Base, Intrinsic and StarBaseUpgradeLevel. Researches can't be put on autocast, only the AI can research things "automatically". There is no way of directly checking passed gametime, only the indirect way of applying a buff at the start of the game and then have it do the counting.

Your plan with the artifact has the problem of being tied to the home planet's type. And you could just abandon that planet once you have 5+ other ones, and spawn ships at the base rate. Add to that the hard-coded level maximum of 3 for any ability, and you're screwed.

Passive/Periodic/Overtime buffs are the only things you can rely on, so you have to go with those. I think ApplyBuffToTargetsInRange is limited to one gravwell, so you have to somehow spread the information from ship to ship. Since we're talking about shipyards here, how about forcing the player to construct new ones with special constructor ships, which you have to build in a gravwell containing an existing shipyard? Then you can carry the stacks of debuffs from the original shipyard over to the new one via the constructor ship? Or maybe make the shipyard a low-income Tradeport, then have the Trade Ships carry the debuff from station to station? Needless to say, this is complicated, messy and ugly as hell, so I suggest you tie the debuff to shipyard lifetime and not gametime.

Just make the passive ability less unsightly. Make it a generic armor/shield/hp/regen buff per description: Give the structure 0 base armor, then make the buff give it +1 armor or something. Give it a fancy name and you're set.

 

I doubt your system will work in the end, as there'll always be a loophole: If you tie it to an artifact, people can abandon the planet. If you tie it to the shipyard people can scuttle it. If you somehow tie it to an indestructable tradeport that exists from the start of the game (on each star?) you'll need a crapload of tradeships, each loaded with large stacks of buffs.

The best way I can think of is to apply your counting buff to the host planet of the shipyard, and synchronise all successive shipyards around that planet. That way people would have to scuttle all shipyards and abandon the planet to reset the count for that planet only, which probably won't be worth the effort.

 

Reply #2 Top

Thanks for the suggestions - I'll have to look into that planetary ability idea.

Reply #3 Top

Actually, what happens if you put an ability on every planet, which then accumulates buff stacks on the planet, then applies an equal number of stacks to the shipyard? You still have to give it a passive ability to use LastSpawnerNoLongerHasBuff, which you use to only target the shipyard and not other structures.

The main weakpoint I see with this is that you somehow have to periodically apply the exact number of stacks from the planet to all shipyards, even those constructed after the last "debuffing wave", without accidentally amassing too many stacks on older shipyards.

And of course this means every planet that doesn't have an ability already will have to get one, and you don't seem too fond of dummy passives.