Creating a lobby

Hello, what are the best practices for creating a lobby for a lumberyard game?

I’ve been trying to create my own lobby by using MultiplayerLobbyComponent as an example. Added the gem and dependency for it, all the includes but whenever I try to create MultiplayerLobbyLanServiceWrapper or MultiplayerLobbyServiceWrapper class or use any methods from them i get a link error.

Error LNK2019 unresolved external symbol "public: __cdecl Multiplayer::MultiplayerLobbyServiceWrapper::MultiplayerLobbyServiceWrapper(class AZ::EntityId const &)" (??0MultiplayerLobbyServiceWrapper@Multiplayer@@QEAA@AEBVEntityId@AZ@@@Z) referenced in function "public: void __cdecl Game::LobbyComponent::RegisterServiceWrapper<class Multiplayer::MultiplayerLobbyLANServiceWrapper>(void)" (??$RegisterServiceWrapper@VMultiplayerLobbyLANServiceWrapper@Multiplayer@@@LobbyComponent@Game@@QEAAXXZ) _WAF_ c:\Amazon\Lumberyard\dev\Solutions\LumberyardSDK_vs15.depproj\LobbyScreen.cpp.4878774.obj 1

Looks like compiler does not see the Gem’s code files when accessed from the game but lobby works otherwise. Am i missing a WAF directive?

Hey @Vidas_Maslauskas

Whenever you enable a (code & asset) gem, you have to do the following three steps:

1- rebuild entire engine


lmbr_waf configure
lmbr_waf build_win_x64_vs2017_profile -p all

2- add gem as dependency in your project (optional - if you need that gem in c++ side).

you should add gem in the wscript file inside your project’s directory.

use = [ .... , 'Multiplayer'],

and again

lmbr_waf configure

3- recreate your vs solution (optional - if you work with vs)

lmbr projects create_vs_solution ProjectName

Weird indeed, not you but my recollection- I remember seeing on forum that we had to enable a few things related to stated gems in order to get camera rig component to work to get player character more stable rotation, atm when I rotate around after alt-G, its very hard to control rotation of camera, very jittery. Can you verify there is no other way to fix this issue- might prevent me from having to compile all those gems and the extra ssd space they’ll take up

Please help.

you’re welcome. I’m not sure if it’s a new one. As far as i can remember, it was the same in version 1.17.

Is this a new change ?

Thx

Thx for this info, also just wondering- when I used 1.17, it seems I didnt’ have to compile engine just for enabling camera rig stuff ( input, camera , framework things, a few of them), but now in 1.18 they must be compiled in.****

Sorry, I do not have any idea about camera rig stuff because I did not use them. I only use the Camera gem and i implemented my own camera controlling component in c++.

I tried everything and am still getting the same error when running

lmbr_waf build_win_x64_vs2017_profile -p all


 Creating library c:\Amazon\Lumberyard\dev\Bin64vc141\Gem.Game.d1ba8ca8fdc24a848ed9c4d627a72ff8.v0.1.0.lib and object c:\Amazon\Lumberyard\dev\Bin64vc141\Gem.Game.d1ba8ca8fdc24a848ed9c4d627a72ff8.v0.1.0.exp
LobbyComponent.cpp.4878774.obj : error LNK2019: unresolved external symbol "public: class GridMate::GridSession * __cdecl Multiplayer::MultiplayerLobbyServiceWrapper::CreateServer(class GridMate::IGridMate *,struct GridMate::CarrierDesc &)" (?CreateServer@MultiplayerLobbyServiceWrapper@Multiplayer@@QEAAPEAVGridSession@GridMate@@PEAVIGridMate@4@AEAUCarrierDesc@4@@Z) referenced in function "private: void __cdecl Multiplayer::MultiplayerLobbyComponent::CreateServerForWrappedService(void)" (?CreateServerForWrappedService@MultiplayerLobbyComponent@Multiplayer@@AEAAXXZ)
LobbyComponent.cpp.4878774.obj : error LNK2019: unresolved external symbol "public: class GridMate::GridSearch * __cdecl Multiplayer::MultiplayerLobbyServiceWrapper::ListServers(class GridMate::IGridMate *)" (?ListServers@MultiplayerLobbyServiceWrapper@Multiplayer@@QEAAPEAVGridSearch@GridMate@@PEAVIGridMate@4@@Z) referenced in function "protected: void __cdecl Multiplayer::MultiplayerLobbyComponent::ListServers(void)" (?ListServers@MultiplayerLobbyComponent@Multiplayer@@IEAAXXZ)
LobbyComponent.cpp.4878774.obj : error LNK2019: unresolved external symbol "public: class GridMate::GridSession * __cdecl Multiplayer::MultiplayerLobbyServiceWrapper::JoinSession(class GridMate::IGridMate *,struct GridMate::CarrierDesc &,struct GridMate::SearchInfo const *)" (?JoinSession@MultiplayerLobbyServiceWrapper@Multiplayer@@QEAAPEAVGridSession@GridMate@@PEAVIGridMate@4@AEAUCarrierDesc@4@PEBUSearchInfo@4@@Z) referenced in function "protected: bool __cdecl Multiplayer::MultiplayerLobbyComponent::JoinSession(struct GridMate::SearchInfo const *)" (?JoinSession@MultiplayerLobbyComponent@Multiplayer@@IEAA_NPEBUSearchInfo@GridMate@@@Z)
LobbyComponent.cpp.4878774.obj : error LNK2019: unresolved external symbol "public: __cdecl Multiplayer::MultiplayerLobbyLANServiceWrapper::MultiplayerLobbyLANServiceWrapper(class AZ::EntityId const &)" (??0MultiplayerLobbyLANServiceWrapper@Multiplayer@@QEAA@AEBVEntityId@AZ@@@Z) referenced in function "public: virtual void __cdecl Multiplayer::MultiplayerLobbyComponent::Activate(void)" (?Activate@MultiplayerLobbyComponent@Multiplayer@@UEAAXXZ)
c:\Amazon\Lumberyard\dev\Bin64vc141\Gem.Game.d1ba8ca8fdc24a848ed9c4d627a72ff8.v0.1.0.dll : fatal error LNK1120: 4 unresolved externals

I do have the gem added to the project and default lobby works fine, have dependencies of gamelift, certificateManager and multiplayer added in gems.json, in wscript added

bld.Path('Code/CryEngine/CryNetwork')],

under includes so project could see

#include <GridMate/NetworkGridMate.h>

added all the uses i tough could be useful

use = ['AzGameFramework', 'Multiplayer', 'GridMate'],

What else can I do?

Hmm, this is starting to sound like a different kind of issue: are you directly instantiating MultiplayerLobbyComponent?

In order to use you don’t need to write any C++ code. You need to add that component to an entity in the editor and specify the level to load in its properties.

If you are using this component directly, can you show me how you are using? Generally, Gems do not share components with other gems. Only their EBuses are shared and you would interact with other components through EBuses.

In this case, it would be Multiplayer::MultiplayerLobbyBus

    namespace Multiplayer
{
class MultiplayerLobbyInterface
: public AZ::ComponentBus
{
public:
// EBusTraits
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
// MultiplayerLobbyInterface
virtual int GetGamePort() const = 0;
virtual void ShowError(const char* error) = 0;
virtual void DismissError(bool force = false) = 0;
virtual void ShowBusyScreen() = 0;
virtual void DismissBusyScreen(bool force = false) = 0;
virtual void ConfigureSessionParams(GridMate::SessionParams& sessionParams) = 0; };
using MultiplayerLobbyBus = AZ::EBus<MultiplayerLobbyInterface>;
}

Does that help?

Here is my own sample of creating a lobby without any C++ work on my own github:

https://github.com/Aristo7/LYBook_1.17/compare/ch12_release_builds...ch13_game_lobby

(Looking at the existing replies in this thread) are you still having issues?

To be clear, any time you add or a remove a gem, you DO have to run:

lmbr_waf build_**** -p all

Ok, let me ask this then, if you use walk around a character, are you having trouble with rotation instability,mine is terrible, and this is the only engine wehre I have that trouble.

I’d love to not have to use camera rig and be forced to build tons of 3rd party apps that take up way too much room- so if I can do it your way, I’m all in.

No, I have no problems with the rotation and movement of the camera, and everything goes very well and smoothly.

I am trying to create a lobby or more like modify it but without changing the multiplayer gem. I’ve used the default lobby and it works but that’s not how i want it to look. What I’m trying to do is inherit most of the multiplayer code and change only MultiplayerLobbyComponent.cpp and MultiplayerLobbyComponent.h.

Why therefore, is my camera spastic ?

I’m not kidding, its that bad-is there a setting for camera, somewhere so I can get mine as stable as yours apparently is ?

I"ve checked and there is no DOC for this that I’m aware of.

The reason I thought this was necessary, is someone on forum also had a spastic camera as I do, and said they solved it with use of camera rig, so your verification is odd, but as noted I would love to have a camera like in unrealengine, just works and is ‘stable’.

I’m going to reinstall, hoping something gets fixed, but if not,Ill come back here and see if you can verify you grasp what I"m talking about, regarding horribly shaky unstable camera that I and other have and are seeing.

TY

There is no reply button for your last comment, I think there is a limit to the number of comments!

As i said before, i implemented my own camera controller component and i have no experience with other camera related gems (camera rig stuff) and i can’t help in this. i just manipulate transform component of the camera in c++ and i have no problem with that.

Re-installing is a good idea. I hope your problem will be solved. :slight_smile:

OK ty MRm for respoinding, I wish I had your programming skillls, c++ is an incredible thing to have- one day soon I think, I will head in that direction as I know without it, making a game without doesn’t work real well, or so I"m told and overall I’m sure its true.

TY for resonding, and ya, I reinstalled, and so far , enabling the gems that ‘were’ causing me problems, like the preview render to texture startikng poing camera and camera framework where the rig is, are not telling me with red text undernath, that I must compile, so it was worth uninstalling and installing again it seems.

Cheers

OK so ,all FIXED andI couln’dt be happier to now be going fwd and doing cool things and more with LY engine.

I wish I’d found this sooner, but I finally did a search:

player slice lumberyard howto on bing, that lead me to:

https://docs.aws.amazon.com/lumberyard/latest/gettingstartedguide/placing-character-controller.html , so doing that straight fwd easy tut fixed my camera RIGHT up, and now when I move camera its no loner spastic! -dain what a refreshing change.

I think honestly to make it easier on beginners to this engine and in general, making this SIMPLE change, right out of the box in a installed engine, should be done, bc nobody wants to deal with a spastic camera :slight_smile: ( when other engines, like ue4 as just an example, whic is capable os incredible things as well!) .\

Fwd march.

Btw, while the character is all great and cool, I still have a camera thats way too fast- its hard to control it so the camera doesn’t go flying off in a certain direction–spastic camera :slight_smile:

Is there one best way to fix this or should I just keep reading at doc page noted above as the answer in there somewhere ? :))( I HOPE so)

ty

OK I found the camera RIG how to on DOC page, I’ll get right on it.