Development > Newbie Coding
Encumbrance/TU penalty
DarkRain:
Hello
I wanted to have some opinions om my third experiment with the source, this time id about TU penaltys and encumbrance:
The purpose is to add a TU penalty to some items like armour and heavy weapons, the way I made this is apply the penalty to movement costs, this will make a soldier with say a machinegun have less mobility but be able to use max TUs to fire (assuming he/she is not encumbered) as opossed to have TUs cut from the max
Also to add weight to items so soldiers that carries a weight over a threshold (based in strength) will have their TUs cut during combat
Note that this is WIP missing features include:
* having a limit to what a soldier can carry (also based in strength) so soldiers wont be sitting ducks crushed under the weight of their equipment (that happened once while testing - I'm not using sensible weights for testing so no surprise there)
* Actually changing the scripts (I'm not submiting any changes to them here) - sugestions for sensible weights and/or TU penalty welcome
* This should be shown to the user (or so I think) - sugestions and help on how/where to do this welcome (not good at UI desing)
* edit: almost forget: a way to prevent auto equiped actors (skirmish, aliens in campaign ...) from becoming overloaded/underequiped
I´d like to know your opinions/sugestions/help on this
Duke:
--- Quote from: DarkRain on August 26, 2010, 12:50:12 am ---The purpose is to add a TU penalty to some items like armour and heavy weapons, the way I made this is apply the penalty to movement costs, this will make a soldier with say a machinegun have less mobility but be able to use max TUs to fire (assuming he/she is not encumbered) as opossed to have TUs cut from the max
--- End quote ---
I fear I have not fully understood that concept. Please elaborate on that. TUs are TUs.
Looking at the diff, I'd like to see your concept (as I understand it) better encapsulated in some GetTUsAvailableForMovement() further down the call tree.
Thx for helping us anyway :)
DarkRain:
--- Quote from: Duke on August 26, 2010, 02:04:28 am ---I fear I have not fully understood that concept. Please elaborate on that. TUs are TUs.
--- End quote ---
Well english is not my first lenguage... I'll try to explain what I meant
The idea was to add a property to the objectdef (the TU penalty) for some items like heavy weapons that will increase the amount of TUs the actor needs to move, thus reducing his/her mobility (will spend more TUs for moving) but won't affect TUs given at the start of the turn, unlike encumbrance the other concept introduced wich will cut TUs given to the actor at the start of the turn based on strenght to weight of the items (also a new property) ratio
--- Quote ---Looking at the diff, I'd like to see your concept (as I understand it) better encapsulated in some GetTUsAvailableForMovement() further down the call tree.
--- End quote ---
As I said this is not near finished yet, I'm open to sugestions
edit: maybe an example will help to explain: apply the attached diff over the one in the first post and
TU penalty: equiping the Combat Armour or the Rocket Launcher will cause a soldier to use 3 TU per square when walking and 4 when crouch walking (equiping both should cause them to use 4 and 6)
Encumbrance: equiping both the Combat Armour and the Rocket Launcher may cause (depending on strenght) the soldier to start the turn with less TUs than normal (maybe even 0 that part is still half done)
Mattn:
well, in general i like the idea - having a soldier equipped with a heavy machinegun is not running as wide as a soldier equipped with a knife - but please don't put the knowledge of this down into the grid_* functions or the interface - try to encapsulate that a little bit better.
Duke:
I think I understood now: There are two concepts, 'penalty for walking only' and 'reduce max TUs', and your diff implements them *both*. Correct ?
I'd suggest the penalty to be expressed as a float factor like the crouching penalty.
I forgot that Grid_MoveCalc doesn't know the entity anymore. So encapsulating further down the calltree is not an option. Perhaps it's time to create some ActorMoveInfo_t and pass that instead of a dozen params.
Iterating the whole inventory is a little time-consuming. Grid_MoveCalc is called pretty often, especially in the AI code. Maybe you find a place to do that calculation further up the calltree ?
Navigation
[0] Message Index
[#] Next page
Go to full version