Etherlinker for UE4 - interact with Ethereum blockchain from Unreal Engine 4

UE 4.22 support has been added.

Its good to see this is still getting development attention.

At the moment I have one issue I am not quite sure that is supported.
Since I want to develop games that do not require a trusted third party to be involved the only way I know this can work is if I utilize some kind of checksum value that is passed to the smart contract. That way people are forced to play the game rather than just spam smart contract commands with bots. IE the client is the only thing that knows how to send the correct checksums that will not be rejected by the smart contracts.

Do you have any kind of functionality setup to support this kind of setup? As far as I can tell its the bare bones minimum to do a game that really uses this kind of tech outside of forcing everyone to use dedicated servers ect.

Sorry for the late response, I didn’t see that you updated your message. No, I didn’t implement that in smart contracts.
To be honest, I didn’t even think about it, because buying virtual items/subscriptions, making donations, etc via third-party clients is not a huge problem. As for more unique operations with smart contracts - it depends on the project itself. I’m offering some basic protection for integration server itself to protect it from spam requests and from non-UE4 clients (client still can be faked though).
As for contract protection - I can’t publish any unique key generators (something like unique promo codes system) for smart contracts via open source, because then any third-party can use the same method. If you only want to read values from the smart contract without a third party, then maybe you can constrain contract to work with only selected addresses (which will be yours) and process requests from UE4 client to the integration server and use your own wallets for such read-only operations.

For most types of games that are truly decentralized I think having some kind of checksum functionality is needed. Any kind of game where playing the game involves destroying or rewarding of blockchain goods its going to need some kind of dynamic password system in order for those items to hold real world value. Its a fundamental aspect that simply cannot be excluded. You can open source this functionality because how the password is generated can be up to the developer working on the game. Generating these passwords will have to involve special unique functionality.

Buy and selling of goods is perfectly fine though. But any kind of game where you earn or destroy items based on what you do simply cannot function in a decentralized way without this kind of functionality.

With that said though, I have decided to toy around with making a decentralized VR social media app based on your plugin. The assets of value will be avatars and worlds along with a method of delegated censorship where people can choose what Avatars they can see using white lists. I am not sure how this can be done super smoothly but I imagine everything would have to be stored via IPFS.

Ill keep you posted as I think this can almost work right out of the box using very rudimentary functionality provided by your plugin.
I cannot tell you how much I appreciate your work on this project by the way. This is amazing!

If I understood you correctly, the problem is in getting items or other rewards without paying ETH, just by doing some actions in games.
Such actions shouldn’t be executed by players wallets. As I said before, you can use special admin wallets for such operations and implement the special method on integration server that will receive a request from UE4 server, verify it and execute an operation with admin wallet on contract to give a certain item to the player. I will try to implement an example for that as soon as I get enough time for that. This is more secure than checking that request comes from a valid UE4 client, because such things sooner or later can be faked.

The problem is that you wont even need to play the actual game and thus nothing you do in the game even matters. The only solution is to make doing this extremely risky and a generally a waste of time. We need to have ways to know that the player was running around in the games world, dodging attacks, wasn’t dead or teleporting around at high speed while in god mode as well. The admin wallet is still needed regardless. But a playable video game that is not 100% on chain and is not using a trusted third party (100% centralized) requires additional measures to make sure the game is even being played at all.

Once ETH goes proof of stake then it will be possible to run even more complex smart contracts that employ more complex systems as well. These kinds of checks are just going to become more necisary and more complex as things progress. If we want to get a properly decentralized gaming setup then we need to make the client a literal mine field of checks that nobody wants to fuck with to prevent cheating ect.

Oh and by the way I am already making pretty decent headway on the VRChat style project. I am calling it UnrealChat right now. I just figured out how to properly support full body ect. I just need Voice come and a server browser and it will be time to get Ethereum functionality in play for account information as well as avatar and world ownership.

I guess this is not a problem for multiplayer games (or for single player games with client-server architecture, where server can be used for only certain purposes, like leaderboards), because you can make it possible to send such requests to integration server only from UE4 dedicated server authority, which can be trusted, because all actions, which are matters (like movement, quest completion, etc), happens only on server.

Dedicated servers still wont solve the problem because if you allow for an open community to host them then there will be no way to know if those people are using proper servers. They can then spam a bunch of commands to generate items and ruin the economy. Dedicated servers where the developers are the only ones allowed to control the servers are centralized and thus there was no point in using cryptocurrency at that point. There wont be an economy because nobody will be willing to value the game items as they know the developers have full control over everything.

Dedicated servers will still require the kind of functionality I explained above.

People don’t care too much about the fact that developers can control everything in traditional MMO games. But I agree, there might be use cases when you can’t use centralized servers. But in this case you can’t really fight with cheating, because everything can be faked on the client side and if your protection only relies on fact that only UE4 client can send commands to smart contracts by using some authentication method via some passphrase/API key/etc, then it won’t give you too much security. In this case, you really need to make a lot of custom security methods, which may be unique for each project and still may not give you universal protection from everything.

My understanding is that its really the only true way a game like this can work unless every single action in the game is on chain. Coins like EOS or TRX can do that but ETH has transaction fees at this time.

I have a question. One of the things I want is for this to have a kind of Twitter functionality built into the game.
What transaction type would I use for doing things like social media posts?
Would each post be a token of some sort? Then I can input the text for the body the post ect?

My thinking is that account info, Avatars and social media posts would all be ERC721 tokens. Is that optimal for doing stuff like that… Its weird to think that people can trade ownership of social media posts though. Maybe I am thinking about this wrong?

I can’t recommend you anything specific, but in my opinion, I guess it’s better to add integration for existing social networks and put efforts on something else.

Wait a moment, are ERC721 tokens unable to save a string of text?.. If that’s the case then it greatly limits what can be done using this tech. :confused:
Hell I cant even assign ownership over a IPFS hash so the game knows who owns what files in the game…

edit : I know its possible to save text on a transaction though.
So like, for example the name of an account someone is using.
IPFS hashes for things like ownership of worlds and Avatars.
The ability to post short messages as well.

being able to post text has a lot of uses for sure.

2 questions:

  1. Im using custom build (spatialos ue4) and I need just the erc721 integration… How hard is it to drop the VR and other functionalities? Also the nature of the server infrastructure means that the server should only read values from blockchain and client make the cntracts calls and store the keys.
  2. Can I connect to private chain? Is it anyway customizable in an easy way? Im hosting ethereum as a service on Azure.
    I had a blockchain functiojnality in mind… can make a solidity contract outside of ue4 but I had no idea how to make the functionality possible.
  1. I guess it’s not hard to drop or ignore other functionality - just read comments and remove all that you don’t need, or leave everything as is in case if in future you will need it. You can use this project in a UE4 client/server multiplayer project or singleplayer project (in this case, the integration server will be installed on end-user PC). Java-based integration server doing all job to interact with Ethereum network and UE4 only sends requests to integration server (so it’s possible to use this project with other game engines if you write request wrapper). Read more in the documentation.

  2. You can via Geth/Parity.

I’m hoping to eventually use Cardano for my game, their smart contracts are not ready yet but lots of potential imo. I’m sure you could get help with funding from Emurgo to build dev tools for Cardano blockchain.

I would also suggest releasing something Etherlinker related on the marketplace, even if it’s just a random addon type thing. I don’t know how I originally found out about Etherlinker but most people on the marketplace prob don’t know it exists.We definitely need some blockchain integrations for Unreal Engine and game dev in general.

FYI I mentioned Etherlinker in the Cardano dev telegram Telegram: Contact @CardanoDevelopersOfficial
They mentioned to point you to their accelerator program if you’re interested,

I thought about publishing project on Marketplace, but it’s hard to do because the project has Java code, which you can’t place with marketplace projects. I also doubt that the marketplace team allows me to publish just UE4-related part because in this case project won’t be able to run out of box. The only real way to promote this project via the marketplace is to add support of it into my existing project, which is a good idea but will require time, which I don’t have at this moment (hope later I will do that).

One possible option would be to just release the HUD / widgets ( e.g. Etherlink - Ethereum Blockchain Crypto Wallet Kit ) and then you can point to plugin stuff to make the widgets functional

I decided to take a risk and tried to publish it on Marketplace as a code plugin with links to Example Project, Integration Server and documentation. Now it’s all depends on the Marketplace team decision (as I said before, there is a high risk of being rejected). I think that widgets only will be even worse to publish because with a compiled plugin, downloaded from Epic Games Launcher you don’t need to recompile it on your own (lots of users have troubles with it), so in case of widgets-only, it would be unusable for many inexperienced users. Hope I won’t get a lot of hate about cryptocurrencies in comments in case if it will be published :smiley: