algorithm – Making a level progression system similar to Bravely Default’s

So I am working on an RPG and I want the level up system to be similar to Bravely Default’s, which must be similar to how FF classically levels up characters.

What I know about the level up in the game is that.

  1. The game starts of with a large exp pool to fulfill, and the enemies give large drops of exp too (ex: in lvl 1 areas enemies give 50-150 exp points, and you need around 500 exp to reach lvl 2 and so on)
  2. The larger the level, the more exp you will need (to the point you need x0 000 exp points to continue in the midgame), however in the late game, the exp point does not increase exponentially (let’s say it doesn’t reach x00 000 not even at level 99)

Obviously, we want more effort to gain more levels, but this is more about assigning the enemies appropriate exp points depending on the region of the game.

Currently my algorith is lvl = constant * sqrt(exp), however I feel this formula doesn’t work for very large numbers.

Reset Smart values to factory defaults for a Samsung NVMe SSD?

Here https://askubuntu.com/a/687455/974560 is a quesion regarding resetting smart values to factory defaults on old spinning S-ATA disks. In the comments is a link to a youtube video which is not available anymore on youtube. In internet archive you can still see the video https://web.archive.org/web/20170519202031if_/https://www.youtube.com/watch?v=-PPmbxNAWyg
Also in the post is described that you can reset smart attributes with a RS232 cable and the commands described there.

So is there a similiar way to reset smart counters to factory defaults on Samsung NVMe SSDs?

When serializing a class, can its fields take their defaults from the Unity editor?

Can I have a custom serialized class whereby I set a value in the editor and that value persists into runtime, as happens with serialized monobehaviour fields?

Currently it sets itself to 0 or a default hard coded from within the class.

I noticed that using a struct actually works but using a struct breaks the events used in my actual use case (included below).

Example code:

public class Class1 : MonoBehaviour
{
    // this variable can be set in the editor and persist into run time
    (SerializeField) 
    private float testVar1;

    // this variable can not
    (SerializeField)
    private Class2 class2;

    private void Start()
    {
        class2 = new Class2();
    }
}

(Serializable)
public class Class2
{
    (SerializeField)
    private float testVar2;
}

My use case:

(Serializable)
public class EditorFloat
{
    (SerializeField)
    public float value; 
    public EventProperty<float> eventProperty;

    public EditorFloat(EventProperty<float> eventProperty)
    {

        this.eventProperty = eventProperty;
        Object.FindObjectOfType<CentralParams>().OnUiChange += Update;
        this.eventProperty.OnChanged += UpdateEditor;
    }
    public void Update()
    {
        eventProperty.Value = value;
    }
    public void UpdateEditor(float valueFromEventProperty)
    {
        value = valueFromEventProperty;
    }
}

Thanks!

plugins – Gutenberg: Block SelectControl saves attributes but after a reload of Gutenberg it loads its defaults. Why?

I thought I had it. I added an attribute “max_level” and a SelectControl element “SelectMaxLevel”. Everything works according to plan: I can set the max level and it is saved in the block. When I save the post and display the post see that the php part uses the “maximum level” variable. But when I edit the post the blocks loads it’s default value. Why does this happen?

   registerBlockType('simpletoc/toc', {
      title: __('SimpleTOC', 'simpletoc'),
      icon: simpletocicon,
      category: 'layout',
      attributes: {
            no_title: {
                type: 'boolean',
          default: false,
            },
        },
      attributes: {
            max_level: {
                type: 'integer',
          default: 6,
            },
        },
      edit: function(props) {
        const SelectMaxLevel = withState( {
            level: props.attributes.max_level,
        } )( ( { level, setState } ) => (
            <SelectControl
                label={__("Maximum Level", 'simpletoc')}
                help={__('Maximum depth of the headings.', 'simpletoc')}
                value= { props.attributes.max_level }
                options={ (
                    { label: __('Including', 'simpletoc') + ' H6 (' + __('Show all', 'simpletoc') + ')' , value: '6' },
                    { label: __('Including', 'simpletoc') + ' H5', value: '5' },
                    { label: __('Including', 'simpletoc') + ' H4', value: '4' },
                    { label: __('Including', 'simpletoc') + ' H3', value: '3' },
                    { label: __('Including', 'simpletoc') + ' H2', value: '2' },
                ) }
                onChange={ ( level ) => { setState( props.setAttributes( { max_level: level } )) } }
            />
        ) );
        return (
        <span>
        <InspectorControls>
          <Panel>
            <PanelBody>
              <PanelRow>
                <ToggleControl
                    label={__("Disable heading", 'simpletoc')}
                    help={__('Remove "Table of contents" block heading.', 'simpletoc')}
                    checked={ props.attributes.no_title }
                    onChange={ () => props.setAttributes( {  no_title: ! props.attributes.no_title } ) }
                />
              </PanelRow>
              <PanelRow>
                <SelectMaxLevel />
              </PanelRow>
            </PanelBody>
          </Panel>
        </InspectorControls>
        <BlockControls>
          <ToolbarGroup>
            <ToolbarButton
              className="components-icon-button components-toolbar__control"
              label={__('Update table of contents', 'simpletoc')}
              onClick={function() {
                sendfakeAttribute(props)
              }}
              icon="update"
            />
          </ToolbarGroup>
      </BlockControls>
      <p>
        <ServerSideRender block={props.name} attributes={props.attributes} />
      </p>
      </span>
        )
      },
      save: props => {
        return null;
      },
    });

The relevant php part:

register_block_type('simpletoc/toc', (
    'editor_script' => 'simpletoc-js',
    'editor_style' => 'simpletoc-editor',
        'attributes' => array(
                'no_title' => array(
                    'type' => 'boolean',
              'default' => false,
                ),
            'max_level' => array(
                    'type' => 'integer',
              'default' => 6,
                ),
            'updated' => array(
              'type' => 'number',
              'default' => 0,
              '_builtIn' => true,
            ),
    ),
    'render_callback' => __NAMESPACE__ . '\render_callback'
   ));

music.app – Set global defaults for Catalina Music “as Songs” display

In Catalina Music, as in iTunes, choosing View/as Songs shows songs in a column layout that I prefer. However, Music defaults to the following columns, which I don’t like:

Title, Cloud Download, Time, Artist, Album, Genre, Love, Plays

The only ones I want are Title, Time, Artist, and Album, and there are other ones I want that aren’t in the list. It’s easy to choose columns in an individual folder (either by control-clicking on the header bar, or with command-J, which brings up a convenient checkbox dialog). But it’s a real pain when you have hundreds of folders, as I do.

Is there some way to change the default globally? (I’m willing to edit configuration files if that’s what it takes.)

(btw I experienced this problem about a year ago when I first installed Catalina on a different machine, and didn’t solve the problem, but I have gradually fixed folders bit by bit on that machine. Now I have a new machine with all of the old defaults. I’m surprised I didn’t ask earlier, and surprised that someone else has posted this question by now. I see no evidence of either.)

Pandoc doesn’t recognize documented ‘–defaults’ option

I use Pandoc as a static site generator and previous versions of the program allowed me to specify YAML files with metadata about the document like so:

pandoc --defaults ./base.yaml -o ./res/head.html ./res/head.md 

However, now when I install it to a new system I get the following as output:

Unknown option --defaults.

The Pandoc user guide still specifies a –defaults option, but pandoc –help does not list the option.