C++ Client API for Unreal Engine 4

Post here your questions about the C++ API for SFS2X

Moderators: Lapo, Bax, MBagnati

User avatar
rafaelbr
Posts: 1
Joined: 22 Jul 2014, 19:39

C++ Client API for Unreal Engine 4

Postby rafaelbr » 23 Jul 2014, 18:37

Hi to all,

I'm new here but I have used SFS2X with unity for a while. Now I'm trying to get C++ client working with UE4. This is the first time I get the c++ api and for now I'm trying to build exemples and trying to figure out dependencies in order to get them on UE4. My goal is to use it on PC and Android project, so, I'll need to figure out how it can be compiled with Android NDK. I don't know if I'll need to recompile UE4 source code but I willing to, if needed. If anyone are trying to get SFS2X working on UE4, I'll glad to know and also, I can ttry to help too.

Thanks
gbarnes
Posts: 16
Joined: 08 Apr 2014, 13:12

Re: C++ Client API for Unreal Engine 4

Postby gbarnes » 09 Aug 2014, 03:37

Hey,

I've successfully linked the API into Unreal today. I'm now starting to setup Blueprint connections and to implement a high level interface in oder to access the smartfox api. I created it as a plugin so it's easy to package and distribut it. Currently it only compiles in for Windows in 64 Bit.
User avatar
Lapo
Site Admin
Posts: 23007
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: C++ Client API for Unreal Engine 4

Postby Lapo » 09 Aug 2014, 11:04

Thanks for your feedback. Would you be willing to explain the steps you have used? Is it complicated?
Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
gbarnes
Posts: 16
Joined: 08 Apr 2014, 13:12

Re: C++ Client API for Unreal Engine 4

Postby gbarnes » 10 Aug 2014, 01:20

Sure,

as soon as I verified that everything works out the way I planned I will post a description of how to compile and link the library with Unreal 4. I'll make the plugin available sometime in the future as soon as I've integrated basic functionality.
gbarnes
Posts: 16
Joined: 08 Apr 2014, 13:12

Re: C++ Client API for Unreal Engine 4

Postby gbarnes » 10 Aug 2014, 23:57

Sorry for the double post, but currently I've a problem that I can't solve without touching the source code of the API (I guess, I'm no expert in C++).

1>c:\projects\depot3\project\engine\engine\plugins\smartfoxclient\source\private\api\include\util\../SmartFox.h(766): error C2872: 'LogLevel': Mehrdeutiges Symbol
1> kann 'c:\projects\depot3\project\engine\engine\source\runtime\engine\public\Engine.h(115) sein: FLogCategoryLogLevel LogLevel'
1> oder "c:\projects\depot3\project\engine\engine\plugins\smartfoxclient\source\private\api\include\logging\LogLevel.h(10) : Sfs2X::Logging::LogLevel"
1>c:\projects\depot3\project\engine\engine\plugins\smartfoxclient\source\private\api\include\util\../SmartFox.h(766): error C2061: Syntaxfehler: Bezeichner 'LogLevel'

It basically tells me that the symbol is Ambiguous. Is there any solution without modifying the source code?
MBagnati
Posts: 126
Joined: 12 Feb 2013, 10:57

Re: C++ Client API for Unreal Engine 4

Postby MBagnati » 12 Aug 2014, 14:55

Hi,
Seems that LogLevel symbol is ambiguous because it is defined twice: in SmartFox.h and in FLogCategoryLogLevel.

A way to solve the problem could be the usage of namespace.
The LogLevel defined by API is contained into Sfs2X::Logging namespace, on the other hand I suppose that LogLevel declared in FLogCategoryLogLevel has a
different namespace (it should have a different namespace).

Unfortunately API LogLevel is used in SmartFox.h file without the declaration of the namespace that owns it.

So, at the moment I think that there are two possibilities to solve the issue:
  • In your source files you must include FLogCategoryLogLevel LogLevel after the include of SmartFox.h
    In this way when the statement
    #include "SmartFox.h"
    is processed, the system knows only the API LogLevel because FLogCategoryLogLevel is not yet declared.
    In other places where you want to use the FLogCategoryLogLevel symbol, you must add it with its namespace

    ... but this is not a smart solution because is based on the file inclusion order ...
  • The next API release will solve this problem adding the namespace Sfs2X::Logging everywhere is used LogLevel in SmartFox.h file.
    In this way SmartFox.h does not have ambiguity to select the appropriate LogLevel...I think that this is a smart solution
    So, I suggest you to anticipate what there will be in the next version of the library:

    in SmartFox.h file
    replace
    void AddLogListener(LogLevel logLevel, boost::shared_ptr<EventListenerDelegate> eventListener);
    with
    void AddLogListener(Sfs2X::Logging::LogLevel logLevel, boost::shared_ptr<EventListenerDelegate> eventListener);


    and in SmartFox.cpp file
    replace
    void SmartFox::AddLogListener(LogLevel logLevel, boost::shared_ptr<EventListenerDelegate> eventListener)
    with
    void SmartFox::AddLogListener(Sfs2X::Logging::LogLevel logLevel, boost::shared_ptr<EventListenerDelegate> eventListener)

I hope that this solves the issue
gbarnes
Posts: 16
Joined: 08 Apr 2014, 13:12

Re: C++ Client API for Unreal Engine 4

Postby gbarnes » 15 Aug 2014, 19:08

Hey,

thanks for the help. I choosed the second solution since that was what I had in mind but wanted to check first with you guys before I just change the api since this would mean that I couldn't update the api anymore. After some talks to some of the Epic Guys today at gamescom my plugin now works. I want to ask the Epic guys some more questions before I post a workflow here since I have some more changes todo.

I'll keep you updated! Sorry for the delay in my answer, but I had some busy days at gamescom.
gbarnes
Posts: 16
Joined: 08 Apr 2014, 13:12

Re: C++ Client API for Unreal Engine 4

Postby gbarnes » 03 Sep 2014, 14:30

Hey,

I'm still working on the plugin and managed to port it over to the newest version of UE4. I still try to figure out the best way to implement it with the blueprint system and a new UE4 feature called UGameInstance. So still will take some weeks since I'm currently very busy with university and work.

Is it allowed to make double posts? If not I will edit my first post if that is possible.
User avatar
Lapo
Site Admin
Posts: 23007
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: C++ Client API for Unreal Engine 4

Postby Lapo » 03 Sep 2014, 15:23

Thanks for the update.
Lapo

--

gotoAndPlay()

...addicted to flash games
Shadowfax
Posts: 4
Joined: 02 Jun 2015, 07:56

Re: C++ Client API for Unreal Engine 4

Postby Shadowfax » 25 Jun 2015, 08:05

Any updates?
User avatar
Lapo
Site Admin
Posts: 23007
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: C++ Client API for Unreal Engine 4

Postby Lapo » 25 Jun 2015, 08:56

We're going to publish an example of usage for UE4 in the next days.

Stay tuned.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23007
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: C++ Client API for Unreal Engine 4

Postby Lapo » 30 Jun 2015, 16:19

UPDATE: the Unreal example is out. Read all the details here:
viewtopic.php?f=34&t=17969
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X C++ API”

Who is online

Users browsing this forum: No registered users and 10 guests