Project

General

Profile

Bug #2663

OpenMW-CS: autocalc does not work for NPCs added with OpenMW-CS

Added by Who Knows over 2 years ago. Updated 12 months ago.

Status:
Confirmed
Priority:
Normal
Assignee:
-
Category:
Editor
Target version:
Start date:
06/11/2015
% Done:

0%

Reproducibility:
Always
Operating system:
Other
Severity:
Normal

Description

open the objects table view > open "Caius Cosades" > select "add record" in the objects table > copy every entry from Caius to the new NPC (except the skills and attributes) > check/uncheck the "autocalc" -> the skills and attributes will not change from 0
Setting level to 1 didn't help.
I guess "autocalc" is intended to do the same as the TES-CS: set standard values for skills and attributes based on race (,class, level, gender and faction+rank).
OSG: OpenMW version 0.36.0 (revision 712cef36b0)
non-OSG: OpenMW version 0.36.0 (revision 67f04e0ba1)

History

#1 Updated by cc 9cii over 2 years ago

If there is a formula somewhere we can apply that I guess.

#2 Updated by Who Knows over 2 years ago

http://www.uesp.net/wiki/Morrowind_talk:NPCs#WIP

Attributes depend on wether or not "Auto calculate stats" is checked for an NPC in the CS. If not, then the NPC's stats were predetermined. If yes, it is calculated with Attribute = Base Attribute + (Level - 1) * (Sum of Modifiers for every skill governed by Attribute)
Where the modifiers are:
Major skill: 1
Minor skill: 0.5
Misc. skill: 0.2
So a level 6 Orc Warrior (Long Blade as a Major skill, Axe, Blunt weapon, Armorer as Minor and Acrobatics as Misc.) should have 55 + (6 - 1) * (1 + 0.5 + 0.5 + 0.5 + 0.2) = 68.5 Strength, Which is rounded down to 68. Values ending in .1 - .5 are rounded down, .6 - .9 are rounded up.
Also NPC Magicka is Intelligence * 2 without racial/birthsign bonuses.
Fatigue is Strength + Willpower + Agility + Endurance
[...]
NPC's health is calculated with: ([Current Strength] + [Current Endurance]) / 2 + (Level - 1) * [Constant]
Where [Constant] in based on the NPC's specialization:
Magic: 3
Stealth: 4
Combat: 5
If one of the NPC's favoured attributes is Endurance, then the constant increases by 1

I guess the above is implemented already, isn't it?

I think that the base attributes and skills are based on the race, gender and class.
I will play with the TES-CS and try to give a basic formula in a few hours.

#3 Updated by Marc Zinnschlag over 2 years ago

  • Description updated (diff)
  • Category set to Editor
  • Target version set to openmw-0.37

It should be implemented in OpenMW, but I don't think we have it in OpenMW-CS.

#4 Updated by Who Knows over 2 years ago

It is not so easy, all races have different attributes. Skills is - so far - no problem.
Is the information still needed?

#5 Updated by cc 9cii over 2 years ago

@Zini, we can easily copy autoCalculateAttributes() in mwclass/npc.cpp, but that will lead to code duplication. But then it seems a little awkward to pull a single method out to a library. What would you suggest?

#6 Updated by Who Knows over 2 years ago

Attribute calculation should be something like

// attributes = [ "str" , "int" , ... ]
// fav_attribute contains the two attributes that can be choosen when making an own class, otherwise they are set by the class
//
FOREACH attribute IN attributes DO
result.[$attribute] = race.gender.[$attribute]
IF $attribute==fav_attributes0 THEN result.[$attribute] += 10
IF $attribute==fav_attributes1 THEN result.[$attribute] += 10
DONE

// easier than I thought

#7 Updated by Marc Zinnschlag over 2 years ago

@cc 9cii:

That is a complicated questions. Code duplication is out of the question. I agree that moving the code to a component feels wrong. I was going to suggest to do it anyway, but then I noticed another problem:

We are unlikely to keep the hard-coded form of autocalc as it is. I would expect this being moved to scripts eventually, which means we can not do it in OpenMW-CS at all.

#8 Updated by cc 9cii over 2 years ago

  • Status changed from New to Resolved
  • Assignee set to cc 9cii
  • % Done changed from 0 to 100
  • Operating system changed from Linux to Other

@Zini, it turns out there isn't much of code duplication - the way openmw keeps/accesses data are different to opencs. The algorithms are necessarily the same but that's about it.

#9 Updated by Who Knows over 2 years ago

Maybe you can put the algorithm in a separate file like a "library" and access/use it by the CS and the game engine? I bet there are cases like that already. Like - I assume - the renderig in the edit-view of instances or such? I guess it would be easy to extend that lib for using selfmade formulae by overloading once that should be offered to modders.

#10 Updated by Who Knows over 2 years ago

ah, well - resolved - sorry then

#11 Updated by cc 9cii over 2 years ago

  • Status changed from Resolved to In Progress
  • % Done changed from 100 to 50

It seems that more work is needed.

#12 Updated by cc 9cii about 2 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100

#13 Updated by cc 9cii about 2 years ago

  • Status changed from Resolved to Confirmed
  • Assignee deleted (cc 9cii)
  • % Done changed from 100 to 0

A different approach is needed.

#14 Updated by Marc Zinnschlag almost 2 years ago

  • Target version changed from openmw-0.37 to openmw-0.38

#15 Updated by Marc Zinnschlag over 1 year ago

  • Target version changed from openmw-0.38 to openmw-0.39

#16 Updated by Marc Zinnschlag over 1 year ago

  • Target version changed from openmw-0.39 to openmw-0.40

#17 Updated by Marc Zinnschlag about 1 year ago

  • Target version changed from openmw-0.40 to openmw-cs-1.0

#18 Updated by Marc Zinnschlag 12 months ago

  • Target version changed from openmw-cs-1.0 to openmw-future

I am moving this issue to future for now. As discussed the whole feature may become problematic with the post 1.0 changes. Better not waste time on it now and instead tackle (or reject) it after we know exactly where we stand with the post 1.0 enhancements.

#19 Updated by Who Knows 12 months ago

I suggest setting it ("future" - as you did) and status "can'tfix". I think "reject" more probably won't be looked at in a few month.

Also available in: Atom PDF