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

Expose additional minigame metadata in foreground host activity #81

Open
rikkolovescats opened this issue Dec 4, 2022 · 6 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers plugin Everything plugin

Comments

@rikkolovescats
Copy link
Collaborator

In built-in minigames in Bombsquad, there is additional metadata that gets exposed which may then be accessed through plugins using the foreground host activity object, such as in meteor shower:
https://github.com/efroemling/ballistica/blob/4248540d887340de25e47539fdf567525ae8918e/assets/src/ba_data/python/bastd/game/meteorshower.py#L37-L49

which can be accessed through:

>>> _ba.get_foreground_host_activity().allow_mid_activity_joins
False

Let's also make sure to have these fields in all minigames under plugin manager, so any local plugins that make use of these fields don't break. Such as zombie_horde currently only has the name field:

# ba_meta export game
class ZombieHordeCoop(ZombieHorde):
name = 'Zombie Horde'
@classmethod
def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:

@rikkolovescats rikkolovescats added enhancement New feature or request plugin Everything plugin good first issue Good for newcomers labels Dec 4, 2022
@Freaku17
Copy link
Collaborator

If you take a closer look...
IMG_20230118_170350
IMG_20230118_170415

I don't think without this ba.TeamGameActivity we can register a minigame...
And it already contains these fields in them...

So I don't believe there's any need to change anything, soooo close issue??

@rikkolovescats
Copy link
Collaborator Author

you're right, but it still seems to be missing the allow_mid_activity_joins field here:

# ba_meta export game
class ZombieHorde(ba.TeamGameActivity[Player, Team]):
name = 'Zombie Horde'
description = 'Kill walkers for points!'
scoreconfig = ba.ScoreConfig(label='Score',
scoretype=ba.ScoreType.POINTS,
none_is_winner=False,
lower_is_better=False)
# Show messages when players die since it's meaningful here.
announce_player_deaths = True
@classmethod
def get_available_settings(

this minigame was only an example, there might be more minigames in plugin manager that i haven't checked yet that maybe missing a few fields, so missing fields would needed be added for those minigames as well

@Freaku17
Copy link
Collaborator

Freaku17 commented Jan 18, 2023

you're right, but it still seems to be missing the allow_mid_activity_joins field here:

IMG_20230118_221658
IMG_20230118_221716

Which ultimately contains:
IMG_20230118_221734

@Freaku17
Copy link
Collaborator

this minigame was only an example, there might be more minigames in plugin manager that i haven't checked yet that maybe missing a few fields, so missing fields would needed be added for those minigames as well

What I mean is a minigame can't be registered without this ba.TeamGameActivity, so ultimately all minigames does contain these information...

So no need for this "expose additional metadata"

@rikkolovescats
Copy link
Collaborator Author

yep, even still, the defaults may not be what we're looking for; zombie horde game doesn't have allow_mid_activity_joins defined, so the foreground activity will expose the default value which is True which could break any dependant plugins.

such as an AFK auto player remover plugin which doesn't want to remove players in activities that have allow_mid_activity_joins set to False, so that players aren't auto removed in elimination type games even if they're AFK, but such a plugin will still auto remove AFK players in zombie horde since zombie horde will default allow_mid_activity_joins to True which doesn't seem right as players have limited lives in zombie horde similar to elimination minigames.

@Freaku17
Copy link
Collaborator

Freaku17 commented Jan 19, 2023

yep, even still, the defaults may not be what we're looking for; zombie horde game doesn't have allow_mid_activity_joins defined, so the foreground activity will expose the default value which is True which could break any dependant plugins.

Okay, and here it's developer's fault since ZombieHorde is like Elimination and shouldn't allow_mid_activity_joins 🤔

I understood, I think only some games will have this issue 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers plugin Everything plugin
Projects
None yet
Development

No branches or pull requests

2 participants