ddnet / ddnet

DDraceNetwork, a free cooperative platformer game
https://ddnet.org
Other
591 stars 417 forks source link

More prediction flags to allow vanilla pickups mixed with ddrace tiles #8923

Open ChillerDragon opened 2 months ago

ChillerDragon commented 2 months ago

When introducing vanilla pickups (armor, health, weapons being collectable and having a different effect than ddrace) the GAMEINFOFLAG_PREDICT_DDRACE has to be removed otherwise ddnet's anti ping removes weapon when touching armor. Removing that flag then breaks all the ddrace tiles that do not conflict with vanilla pickups. Such as stoppers.

So having vanilla pickups mixed with ddrace tiles will never predict correctly. I really think there should be a way for custom servers that want vanilla armor/health/weapons to also predict stoppers/freeze/draggers correctly.

I do understand that having vanilla plus ddrace tiles in the gameplay seems a bit crazy. But its a decade old common desire of the ddnet tinkerer. Also there are already these flags related to gametypes and prediction:

    GAMEINFOFLAG_GAMETYPE_RACE
    GAMEINFOFLAG_GAMETYPE_FNG
    GAMEINFOFLAG_GAMETYPE_DDRACE
    GAMEINFOFLAG_GAMETYPE_DDNET
    GAMEINFOFLAG_GAMETYPE_VANILLA
    GAMEINFOFLAG_RACE
    GAMEINFOFLAG_UNLIMITED_AMMO
    GAMEINFOFLAG_PREDICT_FNG
    GAMEINFOFLAG_PREDICT_DDRACE
    GAMEINFOFLAG_PREDICT_DDRACE_TILES
    GAMEINFOFLAG_PREDICT_VANILLA

So adding yet another one that has to be backwards, forward and sideways compatible introduces a lot of complexity. Also the combination of flags becomes non trivial.

I am ready to implement and test the flag. But we need to have some discussion first about what it should do and how it should work. And how it should be called. Here are some options, ideas and questions:

Tagging in some ddnet modders that might care: @JSaurusRex @fokkonaut @Kaffeine What kind of predictions do you need?

ChillerDragon commented 1 month ago

I would propose the following. Teeworlds vanilla prediction should be the baseline. Everything else including ddrace should be opt in on a specific per feature basis. No implicit predictions based on gametypes.

Remove GAMEINFOFLAG_PREDICT_VANILLA and replace it with:

When looking at the flags being sent it should be obvious what they do. Not like currently where GAMEINFOFLAG_GAMETYPE_FNG might mean that it applies a custom hardcodet hammer tuning value or nobody knows what should happen when both GAMEINFOFLAG_PREDICT_DDRACE and GAMEINFOFLAG_PREDICT_VANILLA are set or how GAMEINFOFLAG_PREDICT_DDRACE_TILES and GAMEINFOFLAG_PREDICT_DDRACE are related. For backwards and non ddrace based server compatibility all these flags can be implied by the gametype but modern flags should be precise, flexible and non ambiguous.

It can still support third party gametypes but that also on a per feature basis. So instead of GAMEINFOFLAG_PREDICT_FNG there should be a GAMEINFOFLAG_PREDICT_FNG_HAMMER.

heinrich5991 commented 1 month ago

There should not be more customization options like that without a clear use case. This rules out your proposal (currently) because I don't see a clear use case for each flag.

ChillerDragon commented 1 month ago

There should not be more customization options like that without a clear use case. This rules out your proposal (currently) because I don't see a clear use case for each flag.

The use case is clearer code. And more flexibility for prediction. This would allow using ddrace features in non ddrace modifications. Such as vanilla weapons and damage with stoppers and speedups.

heinrich5991 commented 1 month ago

With a "clear use case", I mean a concrete project that you have in mind and a specific flag you'd need for that.

ChillerDragon commented 1 month ago

With a "clear use case", I mean a concrete project that you have in mind and a specific flag you'd need for that.

ddnet-insta is the concrete project. It is pvp but also has the ddrace tiles. For CTF/DM based modes it is currently required to turn off ddnet prediction because of heart and shield which breaks anti ping for ddrace tiles.

I would like to change the approach from having wrongly predicted mods first and then some hacky support from ddnet later to a more proactive approach. Where ddnet is flexible enough so innovation can happen without breaking prediction.

ChillerDragon commented 1 month ago

Seems to be a duplicate of https://github.com/ddnet/ddnet/issues/7853

heinrich5991 commented 1 month ago

What DDRace tiles do you use in ddnet-insta?

ChillerDragon commented 1 month ago

What DDRace tiles do you use in ddnet-insta?

Everything but vanilla pickups (no ddrace weapons, shields and armor).

But I do not want to add another PREDICT_DDNET_INSTA flag. But make sure prediction flags are flexible for every project by opting in to ddrace prediction on a per feature basis.