Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement difficulties #1

Closed
jakubg1 opened this issue Jul 22, 2020 · 4 comments
Closed

Implement difficulties #1

jakubg1 opened this issue Jul 22, 2020 · 4 comments
Assignees
Labels
A: Game Data Issue with game data. D: Feature Request A feature that may be implemented in a future version. R: Implemented A suggestion has been added into the code.

Comments

@jakubg1
Copy link
Owner

jakubg1 commented Jul 22, 2020

Difficulties are stored in runtime.json in a particular game's main directory, however they are not used.
Change the type from integer to string.
Difficulties alter some values. Consider implementing them similarly to Luxor 2's system. Example from difficulty.gvf (one of the difficulties):

{
   Directory           = "adventure"
   StartStage          = 1
   FinalStage          = 14
   StartingLives       = 4
   CoinsForLife        = 30
   MinCollapseCount    = 3
   SpeedScale          = 0.50
   StageStepSpeedScale = 0.019
   ScoreScale          = 1.0
   Timescale           = 1.0
   TimescaleWarmup     = 1.5
   LivesBonus          = 50000i64
   PerfectBonus        = 10000i64  
   Downgrade
   {
      LossDelay        = 1
      Reductions       = 5
      MidSpeed         = -5.0
      MinSpeed         = -0.2
      SpawnStreak      = 20
   }
}

If one implements such values like here (preferably in the main game config file), there's no need to do it separately in that case.

@jakubg1 jakubg1 added D: Feature Request A feature that may be implemented in a future version. R: Open labels Jul 22, 2020
@jakubg1 jakubg1 removed the R: Open label Apr 16, 2021
@jakubg1 jakubg1 added A: Code A: Modding Issue which will impact modders if worked on. Potentially a breaking change. labels Aug 16, 2021
@jakubg1
Copy link
Owner Author

jakubg1 commented Mar 2, 2022

Planned feature in Beta 5.0.0.

Outline:

  • Each difficulty will contain:
    • A score set.
    • A level set.
    • Some general values, like sphere speed multiplier (look the table above?)
    • Possibly more stuff in the future.
  • Difficulties will be sitting in config/difficulties/<name>.json and each difficulty will get its own file.
  • Multiple level sets will be possible since they will be moved to config/level_sets/<name>.json.
  • Also, a new element called a score set will be added to config/score_sets/<name>.json.
    • The idea is to make any score change to use a score set.
    • A score set will consist of score events.
    • Each score event will have their name.
    • A score event will consist of a value, a string associated with it, and possibly some more.
    • It will be possible to launch score events via i.e. game events (i.e. powerups and coins).
    • Example: "gem_6":{"value":6000,"text":[{"type":"parameter","name":"score"}],"font":"score0.json"}
      • Font and text can be set to null if we want the score to appear silently.
    • Sphere matching has a whole lot of difficulties, because all of the parameters can change when changing the number of the balls, color of the balls, and also combo and chain multipliers. Hope we can solve this.
      • Possible solution, although messy:
            "spheres": {
                "value": {
                    "type": "multiply",
                    "values": [
          	          100,
          	          {
          		          "type": "add",
          		          "values": [
          			          {"type":"parameter","name":"length"},
          			          {
          				          "type": "if",
          				          "condition": {"type":"parameter","name":"comboBoost"},
          				          "if": {
          					          "type": "max",
          					          "values": [
          						          {
          							          "type": "subtract",
          							          "values": [
          								          {"type":"parameter","name":"comboLv"},
          								          3
          							          ]
          						          },
          						          0
          					          ]
          				          }
          			          }
          		          ]
          	          },
          	          {"type":"parameter","name":"chainLv"}
                    ]
                },
                "text": {
                    "type": "concat",
                    "values": [
          	          {"type":"parameter","name":"_score"},
          	          {
          		          "type": "if",
          		          "condition": {
          			          "type": "and",
          			          "values": [
          				          {"type":"parameter","name":"comboBoost"},
          				          {
          					          "type": "greater_than",
          					          "values": [
          						          {"type":"parameter","name":"comboLv"},
          						          2
          					          ]
          				          }
          			          ]
          		          },
          		          "if": {
          			          "type": "concat",
          			          "values": [
          				          "\nCOMBO X",
          				          {"type":"parameter","name":"comboLv"}
          			          ]
          		          }
          	          },
          	          {
          		          "type": "if",
          		          "condition": {
          			          "type": "not_equal",
          			          "values": [
          				          {"type":"parameter","name":"chainLv"},
          				          1
          			          ]
          		          },
          		          "if": {
          			          "type": "concat",
          			          "values": [
          				          "\nCHAIN X",
          				          {"type":"parameter","name":"chainLv"}
          			          ]
          		          }
          	          }
                    ]
                },
                "font": {"type":"parameter","name":"font"}
            }
        
        • By the way, here's how it could look in the game editor, so it would be nicer and less of a hassle to edit:
          • Value:
            100 * ( [length] + {
              IF [comboBoost] THEN ( max ( [comboLv] - 3, 0 ) )
            } ) * [chainLv]
          
          • Text:
            [_score] .. {
              IF ( [comboBoost] && ( [comboLv] > 2 ) ) THEN ( "\nCOMBO X" .. [comboLv] )
            } .. {
              IF ( [chainLv] != 1 ) THEN ( "\nCHAIN X" .. [chainLv] )
            }
          
    • It resolves some problems though, because we can just pass a score event with parameters and get both your score added and a text displayed (or not) automatically.
    • More info soon, I guess...

@jakubg1
Copy link
Owner Author

jakubg1 commented Aug 5, 2022

The same solution again, written in currently supported expression data:

    "spheres": {
        "value": "100 * ([length] + ([comboBoost] ? max([comboLv]-3, 0) : 0)) * [chainLv]",
        "text": "[_score] .. ([comboBoost] && [comboLv] > 2 ? \"\nCOMBO X\" .. [comboLv] : \"\") .. ([chainLv] != 1 ? \"\nCHAIN X\" .. [chainLv] : \"\")",
        "font": "[font]"
    }

In order for it to work, the following expression features need to be added:

  • String support
  • .. (concatenation)

@jakubg1 jakubg1 mentioned this issue Nov 24, 2022
3 tasks
@jakubg1 jakubg1 added A: Game Data Issue with game data. and removed A: Modding Issue which will impact modders if worked on. Potentially a breaking change. A: Code labels May 19, 2024
@jakubg1
Copy link
Owner Author

jakubg1 commented May 22, 2024

Score Events have been added here: 05d1213

@jakubg1
Copy link
Owner Author

jakubg1 commented May 22, 2024

Implemented in a basic form for now: 8b1b853

@jakubg1 jakubg1 closed this as completed May 22, 2024
@jakubg1 jakubg1 added this to the Full 1.0 release milestone May 22, 2024
@jakubg1 jakubg1 self-assigned this May 22, 2024
@jakubg1 jakubg1 added the R: Implemented A suggestion has been added into the code. label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: Game Data Issue with game data. D: Feature Request A feature that may be implemented in a future version. R: Implemented A suggestion has been added into the code.
Projects
None yet
Development

No branches or pull requests

1 participant