dynamic power control

dynamic power control

Requests for features in the spring code.

Moderator: Moderators

Post Reply
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

dynamic power control

Post by Google_Frog »

This would be for target acquisition control that does not require extensive unit target checks. (I assume power is a unit attribute used in target acquisition...)

Something like "Spring.SetUnitPower(unitID, newPower)". If this was added a getter would be useful as well.

I know you can currently modify xp for limited control of power but that is a really really bad workaround.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: dynamic power control

Post by knorke »

i think this is already possible using TargetWeight and BlockShot in unit scripts? I never got that to work though :?
In this file: https://github.com/spring/spring/blob/m ... LuaRules.h the callins AllowWeaponTargetCheck & AllowWeaponTarget also look promising. (for 0.83)
I know you can currently modify xp for limited control of power but that is a really really bad workaround.
Assuming the game uses experienceMult=0 and xp is used for nothing else, what side effects does it have?
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: dynamic power control

Post by Google_Frog »

The request stems from this thread. In this example I would like to make every single unit treat this unit as a less important target when closed, this would be trivial to do in the unit script if lua could modify power.

The new callins look promising but they seem like overkill for this application. Any solution with these callins looks like it would be slower than a power modification as every unit would need to use the callin to modify the weight of a single target.
Assuming the game uses experienceMult=0 and xp is used for nothing else, what side effects does it have?
From a comment in modrules.lua

Code: Select all

power = default power * (1 + (powerScale * xp/(1 + xp) ) )
This gives a limit range; power range = default power*[1, 1+powerScale)

To be able to 'lose power' a unit must be created with xp. Anyway ZK uses XP to some extent so this isn't a solution. It demonstrates to me that power modification during the game is technically possible (well the parameter could be broken....)
Post Reply

Return to “Feature Requests”