[Bug?] Records not saving in AscendingScore context

Moderator: English Moderator

Post Reply
User avatar
Dommy
Translator
Translator
Posts: 1900
Joined: 25 Aug 2011, 21:45
Location: Poland
Contact:

[Bug?] Records not saving in AscendingScore context

Post by Dommy » 11 Nov 2019, 08:19

I'm currently trying to make a point-based campaign in TM, where the best player is determined by their points score. However, I encountered a problem while setting the player's new record.

I have tested both in title edit mode and compiled title, results are the same. My title right now has one campaign with one map. In ManiaPlanetTitle.xml the solo section looks like this:

Code: Select all

<score_context>
    <name>NewSoloCampaign</name>
    <maprecord_type>0</maprecord_type>
    <medals_enabled>true</medals_enabled>
    <compute_medals_from_maprecord>false</compute_medals_from_maprecord>
    <author_medals_enabled>true</author_medals_enabled>
    <skillpoints_enabled>true</skillpoints_enabled>
</score_context>
<campaign num="0">
    <playlist name=""/>
    <mode name=""/>
    <score_context>NewSoloCampaign</score_context>
    <official_record_enabled>true</official_record_enabled>
    <disable_unlock_system>true</disable_unlock_system>
    <maps folder="Campaigns\New\"/>
</campaign>
Note that I replaced some specific word here with "New" to keep my new project somewhat hidden from public for now.

I start my map using PlayMap(Text Map, Text Mode, Text SettingsXml). Synchronisation status seems to be okay:

Code: Select all

::ELocalScoreStatus::Loaded
::EMasterServerScoreStatus::Synchronized
When I drive the first run, I try to save the new record using this method:

Code: Select all

declare Ghost = ScoreMgr.Playground_GetPlayerGhost(Event.Player);
declare NewRecordTask = ScoreMgr.Map_SetNewRecord(NullId, Map.MapInfo.MapUid, "NewSoloCampaign", Ghost);
wait(!NewRecordTask.IsProcessing);
if (NewRecordTask.ErrorCode != "") log(NewRecordTask.ErrorCode^": "^NewRecordTask.ErrorDescription);
I assume the campaign uses Score instead of Time when context is set to type 0 (ascending scores). CTmResult of the ghost looks as follows:

Code: Select all

== CNod ==
Ident Id NullId
== CTmResult ==
Integer Time 23089
Integer Score 83
Integer NbRespawns 0
Integer[] Checkpoints [9750, 23089]
However, instead of saving a record I am greeted by this message after calling the method (the error message):

Code: Select all

Unexpected: Previous record is best than this one.
To see how my record looks like now, I call a few functions and they return this data:

Code: Select all

ScoreMgr.Map_GetRecord(NullId, Map.MapInfo.MapUid, "NewSoloCampaign");
// Record is -1
ScoreMgr.Map_GetRecordGhost(NullId, Map.MapInfo.MapUid, "NewSoloCampaign");
// Ghost is Null
ScoreMgr.Map_GetSkillPoints(NullId, Map.MapInfo.MapUid, "NewSoloCampaign");
// SP are 0
ScoreMgr.MapLeaderBoard_GetPlayerRanking(NullId, Map.MapInfo.MapUid, "NewSoloCampaign", "World");
// My rank is 1st
ScoreMgr.MapLeaderBoard_GetPlayerCount(Map.MapInfo.MapUid, "NewSoloCampaign", "World");
// 1 player on record
In conclusion, it looks like the "ascending score" campaigns are not working properly right now since I can't get my mode to set a new record and my online record is always -1. Would be welcome if this could get patched.

Bonus question:
Is it possible to use this campaign system in ShootMania? In theory, Playground_GetPlayerGhost should work with CSmPlayer and the CTmResult of the ghost can be edited to contain the information required for the online records.
Ryzen 7 2700X, GTX 1070 Ti, 16 GB RAM, Windows 10 Insider Build
FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT

Contact me via GALAXY & PURSUIT DISCORD

User avatar
BigBang1112
Posts: 379
Joined: 20 Jul 2015, 12:44
Location: Czech Republic
Contact:

Re: [Bug?] Records not saving in AscendingScore context

Post by BigBang1112 » 11 Nov 2019, 23:53

+1
Creator and competent racer. YouTube Discord
- Nadeo Envimix (remake coming 2020)
- Videomaker (coming 2020)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows

User avatar
WTCYoStunt12
Posts: 401
Joined: 28 Jan 2012, 15:45
Location: Toulouse, France
Contact:

Re: [Bug?] Records not saving in AscendingScore context

Post by WTCYoStunt12 » 12 Nov 2019, 00:09

This issue is probably related to how MP manages saves. In the following function, if _Context is related to ascending score, the score isn't saved. However, if it's related to descending score / time / respawns, is saved. (it even works with an invalid map uid)

Code: Select all

Void NewCustomRecord (Text _Context, Integer _Score) {
    if (G_PlaceholderGhost == Null) {
        Private_LoadPlaceholderGhost();
    }

    G_PlaceholderGhost.Result.Score = _Score;
    declare request = ScoreMgr.Map_SetNewRecord(LocalUser.Id, "g7H3LCnjEy4GjSxPWO0Qafef2Aa", _Context, G_PlaceholderGhost);
    wait(!request.IsProcessing);
}
"I can lag more than you can think"-Me
YouTube Twitter

User avatar
BigBang1112
Posts: 379
Joined: 20 Jul 2015, 12:44
Location: Czech Republic
Contact:

Re: [Bug?] Records not saving in AscendingScore context

Post by BigBang1112 » 12 Nov 2019, 17:49

I actually realized that the issue is very highly the thing of -1. As -1 is always smaller than any score you set, even zero, so -1 is mathematically the best score in the ascending order. :idea:
The thing that would (possibly) do is to always set a new record if personal best score is -1 (or smaller than zero).

So it should be a minor fix, but a major fix, tho needed on the engine side.

It would be awesome to use the ascending order for record types like distance. :)
Creator and competent racer. YouTube Discord
- Nadeo Envimix (remake coming 2020)
- Videomaker (coming 2020)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows

User avatar
adamkooo2
Posts: 1357
Joined: 13 Jun 2014, 08:43
Location: Slovakia / Slovensko,
Contact:

Re: [Bug?] Records not saving in AscendingScore context

Post by adamkooo2 » 11 Jun 2020, 15:27

+1
well, documented

I am another one who needs this to be working :D
/\rkady
Image

Post Reply

Return to “MP4.1 REPORTS / BUGS / INFORMATION”

Who is online

Users browsing this forum: No registered users and 0 guests