Skip to content

feat(multiplayer): Add character selection system#3813

Open
pevides wants to merge 2 commits into
SuperTux:masterfrom
gvalves2005:feature
Open

feat(multiplayer): Add character selection system#3813
pevides wants to merge 2 commits into
SuperTux:masterfrom
gvalves2005:feature

Conversation

@pevides

@pevides pevides commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

This PR refactors the local multiplayer player initialization to remove hardcoded paths to Tux's sprites, introducing a dynamic Character Profile system. Players (in either multiplayer or singleplayer) can now select between Tux, Penny, and Larry in the multiplayer menu using the arrow keys.

Since full animation sheets for Penny and Larry do not exist yet, we implemented static placeholder sprites to make the feature testable.

This PR also lays the groundwork for future gameplay diversification. By decoupling the player logic from hardcoded assets, the game can now easily be expanded to support characters with unique stats, or new abilities, or gameplay mechanics in the future.

Video Showcase: https://www.youtube.com/watch?v=kMhap_W9TzM

Implement multiplayer character selection allowing players to choose
between Tux, Penny, and Larry. Each character has unique physics
attributes (speed, jump force, acceleration, etc) that affect gameplay.

Character selections persist across level restarts, save/load cycles,
and worldmap transitions when edited during gameplay. Starting from main
menu loads the characters selected on the last session.

Co-authored-by: Gustavo Alves <gustavoalves@tecnico.ulisboa.pt>
@swagtoy

swagtoy commented Jun 2, 2026

Copy link
Copy Markdown
Member

Quick skim; probably won't be a while until I (or someone else) reviews this due to its scale and priorities, but: I feel like we should move the list of characters into a separate s-expr file instead of hardcoding it directly in some places.

Something like

(supertux-playerlist
  (player tux "spriteinfo.sprite" blahblah)
  (player penny "penny.sprite" blahblah)
  (player larry "larry.sprite" blahblah)
)

I would probably go ahead and try to have a stab at doing that.

Also, we don't do feat(XXX) style commits, but it doesn't matter since we squash and rebase anyway and we can change the name there.

Move the hardcoded character list out of CharacterRegistry::initialize_profiles()
and into data/characters.stlst, a (supertux-playerlist ...) s-expr file.
CharacterRegistry now parses this file at startup using ReaderDocument.

This makes it straightforward to add new characters without touching C++ code.

Co-authored-by: Gustavo Alves <gustavoalves@tecnico.ulisboa.pt>
@pevides

pevides commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback! I've moved the character list out of C++ into a new data/characters.stlst s-expr file using a (supertux-playerlist ...) root element. CharacterRegistry now parses it at startup via ReaderDocument, following the same pattern used in addon_manager.cpp. Is this what you meant me to do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants