oTree Forum >

Max number of players for split screen demo

#1 by aamir

Hello, I am creating a multiplayer task where players will be put into groups of 5. However, the split screen functionality only seems to work for a maximum of 3 players, meaning that testing for groups larger than that requires opening up separate tabs for each player.

I find the split screen functionality extremely useful for testing, is it possible to do this for groups greater than 3 players?

Thanks!

#2 by taka (edited )

Hello, you can manually change the limit to allow for more players in split screen mode.
However, please note that this modification is not anticipated by the developers and could potentially introduce unexpected bugs.

To adjust the limit, you’ll need to modify the vars_for_template function in the SessionStartLinks class, located in otree/views/admin.py.
Specifically, update the last part of the function, which looks like this (oTree 5.11.0):

otree/views/admin.py/SessionStartLinks/vars_for_template
----------------------------------------------------------
context.update(
    anonymous_url=anonymous_url,
    num_participants=len(participant_urls),
    splitscreen_mode_on=len(participant_urls) <= 3,
)
return context
-----------------------------------------------------------

The hard-coded value 3 represents the limit for split screen mode.
To remove this limit entirely, you can replace `len(participant_urls) <= 3` with `True`.

I’ve tested this modification with 60 players, and it worked successfully.

Write a reply

Set forum username