ikemen-engine / Ikemen-GO

An open-source fighting game engine that supports MUGEN resources.
https://ikemen-engine.github.io
Other
717 stars 125 forks source link

[Feature] Scoring system #61

Closed Amidweiz closed 4 years ago

Amidweiz commented 5 years ago

A possible implementation for this would be to have it contained within the mugen.cfg file under it's own section. It should be able to be utilized by the screenpack and the character itself (possibly with a sysvar of it's own)

[Score] ;Enables the scoring system enable = 1 ;Enables or disables addition of score with multi hit attacks ;such as kung fu man's crouching hard punch multiHit = 1 ;Sets whether the scoring system is counted by interegers or double values scoreType = integer ;Sets the significant digits and the decimal place of the score counter ;integers will ignore the decimal place. sigDig = (5,0) ;Enables or disables score rollover. Values will be saved as their true values ;in the save file rollOver = 1 ;normal score values normalAttack = 50 normalProjectile = 50 normalThrow = 50 ;special score values specialAttack = 100 specialProjectile = 100 specialThrow = 100 ;hyper score values hyperAttack = 500 hyperProjectile = 500 hyperThrow = 500

K4thos commented 4 years ago

There are 2 approaches that I think we can follow to create a score system:

  1. Leave it all to an external CNS file (for example add004 style common1 that already has scoring) and just get the data stored in a character variable at the end of match (there is already a function that can be used for this purpose - getCharVar).

  2. Follow Amidweiz's suggestion and do the scoring calculations in-engine, using values customizable via DEF.

Not sure what would be better. Either way, I think add004 values could be used in either of these approaches - that system proved to work great in mugen environment, regardless of what characters are used, so instead of coming up with new values and formulas (or reverse-engineering some commercial games), we could just use add004 calculations (if author is not against it)

K4thos commented 4 years ago

If someone finds how scoring systems works in some commercial games please post links. Here are my findings so far:

K4thos commented 4 years ago

Here are values from Street Fighter Alpha 3: SFA3.txt

K4thos commented 4 years ago

I've finished implementing in-engine support for scores that is flexible enough to allow creating both CVS2 style GP System (float values, same move affecting both attacker's and opponent's score) as well as traditional SF style scores. Values can be assigned directly in HitDef sctrl, scores are remembered between matches, lifebar def file has now [Score] section, where we can adjust how it will be rendered in-game.

But that's stuff mostly for fullgame makers. When the score assignment is missing in HitDef the engine should still provide score calculation similar to above posted commercial implementations. The static values proposed by @Amidweiz is not really a good enough solution, imo. Every single hyper move worth exactly the same score? Light kick worth the same as Hard kick? No relation between combo score and/or hit damage with the score? It definitely ain't enough considering default values will be used by majority of the engine users. Leaderboards results out of static implementation like this would not resemble scores from fighting games at all, regardless of what values we assign in DEF file. It needs additional factors, damage multipliers, variations, time being taken into account etc.

As mentioned above, in order to create default score values system I'd prefer to base calculations on add004 implementation. Either by coding it in engine and externalizing formulas into DEF file parameters or by leaving the default values calculation to common1.zss distributed with engine (in such case the default score value will be assign via new ScoreAdd/TargetScoreAdd sctrls).

Alternatively similar formulas could be designed from scratch, if someone comes up with a new system.

My CNS knowledge is not good enough to figure out how Shiyo Kakuge calculates values in add004, so a help from experienced CNS coder is needed to extract these calculations from common1.cns distributed with add004. Also if anyone knows e-mail address to Shiyo, please let me know.

Scores and leaderboards code is currently on hiatus, since I can't push these changes to github without default customizable scoring working alongside it.

Tabris666 commented 2 years ago

The only way to make a scoring system is using common1.cns there is no other way to get it this is a way it was implemented in old winmugen https://mugenguild.com/forum/PHPSESSID.b8gp27p4fhosd3bdhvrh1cht14/topics/score-system-147166.0.html