# Auto Host/Join Advanced Session Based on Player Count

**URL:** <https://forums.unrealengine.com/t/auto-host-join-advanced-session-based-on-player-count/471504>\
**Category:** Blueprint\
**Tags:** host, unreal-engine, search, question\
**Created:** [September 17, 2020, 6:13pm UTC](https://forums.unrealengine.com/t/auto-host-join-advanced-session-based-on-player-count/471504 "2020-09-17T18:13:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ridiculousfx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ridiculousfx](https://forums.unrealengine.com/u/ridiculousfx)\
**Post date:** [September 17, 2020, 6:13pm UTC](https://forums.unrealengine.com/t/auto-host-join-advanced-session-based-on-player-count/471504/1 "2020-09-17T18:13:02Z")

</div>

Hello!

I’m trying to make my game auto host/join a session based one whether or not there are any sessions with less than the maximum players allowed in the session upon entering the game. I basically am trying to create a game with no Main Menu. Just throws you right into the game upon opening.

Example:  
If there is a session with less than 50 (max) players I want it to automatically join that session.  
BUT if there are only full sessions, then I want it to auto create a session. This has to be possible, but every time I test the game, it only creates a new session; never joins one.

Thanks!

Also, here is my blueprint:

 ![314055-blueprint-auto-join-host-session.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/d/ccdda2f7cd831ac524988abf76c77fa4d594c753.png)

---

<div class="post-metadata">

**Author:** ![ridiculousfx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ridiculousfx](https://forums.unrealengine.com/u/ridiculousfx)\
**Post date:** [September 18, 2020, 5:12pm UTC](https://forums.unrealengine.com/t/auto-host-join-advanced-session-based-on-player-count/471504/2 "2020-09-18T17:12:11Z")

</div>

UPDATE:

I had the “Default Map” set to the level that you would play on, not the opening level that sends you to the playing level. Now it won’t create a session at all. I also realized according to my BP that if no session existed, then it would not create one so I updated that but I still can’t get it to work.

 ![314203-blueprint-auto-join-host-session-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/c/c/1cc1ecf892a081e9726a26de421731d0dad81b59.png)

---

<div class="post-metadata">

**Author:** ![ridiculousfx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ridiculousfx](https://forums.unrealengine.com/u/ridiculousfx)\
**Post date:** [September 21, 2020, 1:40am UTC](https://forums.unrealengine.com/t/auto-host-join-advanced-session-based-on-player-count/471504/3 "2020-09-21T01:40:41Z")

</div>

Figured it out.

---

<div class="post-metadata">

**Author:** ![ridiculousfx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ridiculousfx](https://forums.unrealengine.com/u/ridiculousfx)\
**Post date:** [September 21, 2020, 1:42am UTC](https://forums.unrealengine.com/t/auto-host-join-advanced-session-based-on-player-count/471504/4 "2020-09-21T01:42:24Z")

</div>

Also, I had to change my DefaultEngine.ini to look like this:

[/Script/EngineSettings.GameMapsSettings]  
GameDefaultMap=/Game/Levels/MainMenu/MainMenu.MainMenu  
EditorStartupMap=/Game/Levels/MainMenu/MainMenu.MainMenu  
GlobalDefaultGameMode=/Game/Blueprints/GameModes/MainMenuGameMode.MainMenuGameMode\_C  
GameInstanceClass=/Game/Blueprints/GameInstances/MainGameInstance.MainGameInstance\_C

[/Script/IOSRuntimeSettings.IOSRuntimeSettings]  
MinimumiOSVersion=IOS\_11

[/Script/HardwareTargeting.HardwareTargetingSettings]  
TargetedHardwareClass=Desktop  
AppliedTargetedHardwareClass=Desktop  
DefaultGraphicsPerformance=Maximum  
AppliedDefaultGraphicsPerformance=Maximum

[/Script/Engine.GameEngine]  
+NetDriverDefinitions=(DefName=“GameNetDriver”,DriverClassName=“OnlineSubsystemSteam.SteamNetDriver”,DriverClassNameFallback=“OnlineSubsystemUtils.IpNetDriver”)

[OnlineSubsystem]  
DefaultPlatformService=Null

[/Script/WindowsTargetPlatform.WindowsTargetSettings]  
DefaultGraphicsRHI=DefaultGraphicsRHI\_DX12

[/Script/Engine.RendererSettings]  
r.SkinCache.CompileShaders=True  
r.RayTracing=True

[/Script/Engine.Engine]  
+ActiveGameNameRedirects=(OldGameName=“TP\_ThirdPerson”,NewGameName="/Script/BattlesOfOlaranV2")  
+ActiveGameNameRedirects=(OldGameName="/Script/TP\_ThirdPerson",NewGameName="/Script/BattlesOfOlaranV2")  
+ActiveClassRedirects=(OldClassName=“TP\_ThirdPersonGameMode”,NewClassName=“BattlesOfOlaranV2GameMode”)  
+ActiveClassRedirects=(OldClassName=“TP\_ThirdPersonCharacter”,NewClassName=“BattlesOfOlaranV2Character”)

 ![314399-blueprint-auto-join-host-session-3.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/b/29ba9cb1d6c780b7e30f55d5af44b565dbac3618.png)

---

<div class="post-metadata">

**Author:** ![x2lovi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@x2lovi](https://forums.unrealengine.com/u/x2lovi)\
**Post date:** [January 1, 2023, 9:11am UTC](https://forums.unrealengine.com/t/auto-host-join-advanced-session-based-on-player-count/471504/5 "2023-01-01T09:11:06Z")

</div>

Hi , i am trying to do as you do like one button " Play " if there is a space you can join with friends if not create another one but its not working always create a new session what do i do i cant copy your Engineini code since it has some related to your project will not work with me

---

<div class="post-metadata">

**Author:** ![ridiculousfx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ridiculousfx](https://forums.unrealengine.com/u/ridiculousfx)\
**Post date:** [March 26, 2024, 6:16pm UTC](https://forums.unrealengine.com/t/auto-host-join-advanced-session-based-on-player-count/471504/6 "2024-03-26T18:16:16Z")

</div>

Hi x2lovi! I actually realized my answer was wrong for my implementation.

Here’s my solution in EOS Integration Kit instead of Advanced Sessions, but it should still work the same way:

I created a “Custom Event” for host session, and made it “Host Session”  
Then I made one single button where “on clicked” it attempted to find sessions. If none were found, I call the Custom Event from earlier in the same blueprint and after a Branch node that looks for any sessions.

 ![Screenshot 2024-03-26 141457](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/0/3608b77bd3a35acf9bc22cc6fa8ad6c8958d5c63.png)  
 ![Screenshot 2024-03-26 141553](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/9/f/09f783214f480461d85e9bc6c533446dca42de0c.png)  
 ![Screenshot 2024-03-26 141604](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/6/9/7690676046dc268d4d7c595b69c4911823fae131.png)
