Author Topic: Selectable Difficult for scenarios  (Read 14799 times)

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
Selectable Difficult for scenarios
« on: 24 September 2011, 21:54:35 »
Copied from MegaGlest feature requests

I mean the following:
If in the script of the scenario are these lines:
Code: [Select]
<difficult-selectable value="true"/>
<difficult number="1" name="Easy"/>
<difficult number="2" name="Medium"/>
<difficult number="3" name="Hard"/>
</difficult-selectable>
You will be ask before start for difficult and
there is a variable for the producer of the scenario (like unitCount )
This variable is set on the number before the name of the difficult.

If this is to hard to make this way may be easier:
Questions ingame: Then you can ask for something like "Do you want 20 archers or swordmans?" too.

i need that for my time is the enemy scenario because i want to ask for difficult.  :P
« Last Edit: 25 September 2011, 01:44:53 by Omega »
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Selectable Difficult for scenarios
« Reply #1 on: 25 September 2011, 01:42:48 »
First of all, it should not use a "name" parameter, since that part in particular is translatable. Instead, it should use the number system scenarios already use (0-5), which would be translated into the equivalent word. As well, get rid of the number attribute, for reasons explained below (which would make the tag <difficulty value="x"/>).

Secondly, it would be easier if there was a function to get the difficulty level, eg:
Code: [Select]
if difficultyLevel()==3 do
   createUnit( ... )
end
(Where difficultyLevel() is our function that returns the difficulty selected, as the specified number described above (0-5), in the same method as the other functions do (we don't use variables for other callbacks; we always use functions, and consistency is nice).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Psychedelic_hands

  • Guest
Re: Selectable Difficult for scenarios
« Reply #2 on: 25 September 2011, 02:01:51 »
If both engine are going to implement this, please do it the same way.  :)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Selectable Difficult for scenarios
« Reply #3 on: 25 September 2011, 06:03:35 »
If both engine are going to implement this, please do it the same way.  :)
Strong agreement. Note that the same thread exists on the MegaGlest board.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Selectable Difficult for scenarios
« Reply #4 on: 25 September 2011, 20:12:45 »
While I certainly prefer the engine callback, it would be best to have some mechanism so that a scenario could tell the engine what difficulty levels it supports, not all authors will be wanting to support all levels.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Selectable Difficult for scenarios
« Reply #5 on: 26 September 2011, 06:12:38 »
While I certainly prefer the engine callback, it would be best to have some mechanism so that a scenario could tell the engine what difficulty levels it supports, not all authors will be wanting to support all levels.
Example of my proposal method in proper XML:
Code: [Select]
<difficulty-selectable value="true"/>
<difficulty value="0"/>
<difficulty value="3"/>
<difficulty value="5"/>
</difficulty-selectable>
(Note from the first post, difficult -> difficulty)
This would mean we'd have the 0, 3, and 5 difficulties available (aka: "Very easy", "Hard", and "Insane" in the default english translation). As well, the difficulty-selectable tag would replace the difficulty tag, and if both occur, it will take priority. As well, for displaying the "chooseable" difficulty levels, it would probably display it as GAE currently does, with a table showing information about the scenario, but the difficulty value would have arrows around its value. The default value of the difficulty field would be whichever "difficulty" tag appears first, so if the tag is:
Code: [Select]
<difficulty-selectable value="true"/>
<difficulty value="3"/>
<difficulty value="0"/>
<difficulty value="5"/>
</difficulty-selectable>
Then the default difficulty will be 3 (Hard), that way if a scenario has support for a far easier than intended difficulty level, a player who doesn't realize they can choose won't end up playing in a way easier than intended; though more-over it's just to give modders an extra element of choice.

This graphical method of using arrows around the value (similar to how maps used to work, before the new GUI allowed drop-down boxes) could later be expanded to allow choices for different factions or tilesets (though different factions would be far more complex and would also need some method of checking what faction the player chose; in order to create the correct units, etc). A whole world of possibilities exist, though, should only be taken one step at a time, and I would say it's a higher priority to finish what is planned already and get 0.4 released (it's been more than 9 months since the last GAE release). Unless it ends up being harder than expected, perhaps something for 0.5?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: Selectable Difficult for scenarios
« Reply #6 on: 26 September 2011, 06:17:27 »
The approach I think is infinitely more flexible is for the scenario to expose some 'settings' that are shown in the UI when starting the scenario so that the user can change them.

Then a difficulty setting would just be something some scenarios exposed and did something based on the values of.

Other scenarios could expose all kinds of scenario-specific properties for the user to tweak before starting.

In GAE terms this might mean a bit of UI layout XML and such in the scenario, which is given space as some kind of panel in the start game screen.