Limiting entered values in OpenMW-CS

Involved development of the OpenMW construction set.
Post Reply
User avatar
Atahualpa
Posts: 745
Joined: 09 Feb 2016, 20:03

Limiting entered values in OpenMW-CS

Post by Atahualpa » 18 Mar 2017, 23:00

Hello everyone,

the current version of OpenMW-CS only uses very generic limits for data fields (the min/max range of the used data types). However, vanilla Morrowind and, thus, our code need many values to be within a specific range.
This is true for line edits (32-signs limit for certain strings), spin boxes (limits for attributes or AI behaviour), and double spin boxes (limits for weapon speed or weapon reach). While this may "only" lead to unexpected behaviour in some cases, wrong values can break or crash the game.

Currently, modders only have the (optional and incomplete) verifier in order to check their changes for typos and plain mistakes. If you ask me, we should change that in the future. One possible way to do this:
  • Create a list of all value ranges for the various record data. (Already done.)
  • Implement some kind of limit mapping to be used while processing record data.
  • Automatically add field limits to all user-editable fields using that map.
  • Automatically add tool tips to all these fields in order to (i.a.) provide information about the corresponding value ranges.
  • Extend the verifier's functionality to cover all record data (again, using the limits map).
In that case, there are two questions left:
  • What shall we do, if an existing file contains values which are out of range?
  • What limits shall we use, if a certain restriction isn't present in OpenMW? The vanilla limits or custom ones?
These are my two cents on that matter. What do you think?


Best regards,
Atahualpa

User avatar
DestinedToDie
Posts: 1048
Joined: 29 Jun 2015, 09:08

Re: Limiting entered values in OpenMW-CS

Post by DestinedToDie » 19 Mar 2017, 07:06

If we're talking about object ID's, being able to use long strings is preferrable.

User avatar
Zini
Posts: 5119
Joined: 06 Aug 2011, 15:16

Re: Limiting entered values in OpenMW-CS

Post by Zini » 19 Mar 2017, 13:45

I think this is more about numerical values, right?
It makes sense to be as permissible as possible in the editor. If a limit does not break things in OpenMW, then there is no point to enforce it in OpenMW-CS even if TES-CS does so. If out of range values break things then we should clamp them down to a non-breaking range (both at load and at input).

User avatar
Atahualpa
Posts: 745
Joined: 09 Feb 2016, 20:03

Re: Limiting entered values in OpenMW-CS

Post by Atahualpa » 20 Mar 2017, 15:49

Zini wrote:I think this is more about numerical values, right?
Well, it's mostly about numerical values. However, there also are certain strings with a hard-coded length of 32 characters. (See Bug #3066.)
Zini wrote:It makes sense to be as permissible as possible in the editor. If a limit does not break things in OpenMW, then there is no point to enforce it in OpenMW-CS even if TES-CS does so.
We already talked about this in my other editor thread: I'm going to do some research on which values are acceptable in OpenMW. There may also be edge cases -- e.g., negative trading gold amounts (which I consider a feature) -- which need further discussion.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest