Anti-Cheat with 4Players SCILL

Anti-Cheat with 4Players SCILL

The main purpose of 4Players SCILL is to empower game developers to implement gamification features like daily or weekly challenges, Battle Passes and leaderboards into their games in hours and not weeks.

However, today, we will show how you can leverage 4Players SCILL Events and SCILL Leaderboards to implement anti-cheat-systems into your game with a couple lines of code. The code examples here use Unity with Mirror Networking, but as the concepts are basically the same for all multiplayer games this will also work for you and your game if you don’t use Unity. SCILL also has a SDK for Unreal, so the methods described in this post work basically the same in all game-engines and applications.

Input validation is key

Your server (or host) should validate all input coming from clients to make sure that it has not been hacked.

This is a simple example: We store a float value with the next time that an attack is possible and wait for clients with authority (which own the player object) to press the space key. Then, we call a command on the server to spawn a projectile in the network.

private void Update()
{
  // Make sure this client has authority about this object
  if (!hasAuthority)
    return;

  // Make sure it's time for this client to attack again
  if (Time.time < _nextAttackTime) 
    return;

  if (Input.GetKeyDown(KeyCode.Space))
  {
    // Send a command to the server
    CmdAttack(transform.forward);
    _nextAttackTime = Time.time + 1.0f;
  }
}

[Command]
private void CmdAttack(Vector3 direction)
{
  GameObject go = Instantiate(_projectilePrefab, transform.position, transform.rotation);  
  // Setup projectile....
  // ...
  
  // Spawn the projectile on the server
  NetworkServer.Spawn(go);
}

For cheaters, or cheat programmers, this will be an easy target. They just need to remove the return in line 7. This way, on client side a lot of attack messages per second can be sent to the server and the server will execute it without any further validation.

We need to validate the data. Let’s just see the code to do that validation on server side.

[Command]
private void CmdAttack(Vector3 direction)
{
  if (Time.time < _nextAttackTime)
    return;
 
  GameObject go = Instantiate(_projectilePrefab, transform.position, transform.rotation);  
  // Setup projectile....
  // ...
  
  // Spawn the projectile on the server
  NetworkServer.Spawn(go);
  _nextAttackTime = Time.time + 1.0f;
}

Remember that in a networked game, your Unity scripts (or objects) will exist multiple times: On each client and on the server. Every player has a GameObject with an instance of this script, and on the server a GameObject exists with an instance of this script exists for every player.

Therefore, we can use the same code on client and server side for data validation. And this is what we do: The client validates input, then sends data to the server. A “copy” of this script runs on the server, and here we run the same tests again. But this time, it’s running on the server – a place where your cheaters will not get their dirty hands on so easily. We don’t need to sync values here, as the local time will be different on server and clients, but we only use relative time here, so the absolute values of _nextAttackTime are not important. It’s just important that the same amount of time passed since a projectile has been fired – and as time runs with the same speed on client and server this code will work.

Let’s finalize our code by refactoring it a bit. If we want to increase fire rate, right now we need to change that in two places, which is not good at all and is prone to for errors.

private bool ValidateAttackInput()
{
    // Make sure it's time for this client to attack again
  if (Time.time < _nextAttackTime) 
    return false;

  _nextAttackTime = Time.time + 1.0f;
  return true;
}

private void Update()
{
  // Make sure this client has authority about this object
  if (!hasAuthority)
    return;

  // Make sure it's time for this client to attack again
  if (!ValidateAttackInput())
    return;

  if (Input.GetKeyDown(KeyCode.Space))
  {
    // Send a command to the server
    CmdAttack(transform.forward);
  }
}

[Command]
private void CmdAttack(Vector3 direction)
{
  // Make sure it's time for this client to attack again
  if (!ValidateAttackInput())
    return;

  GameObject go = Instantiate(_projectilePrefab, transform.position, transform.rotation);  
  // Setup projectile....
  // ...
  
  // Spawn the projectile on the server
  NetworkServer.Spawn(go);
}

That’s it. The server validates the input and if attack messages come in faster than they should, they are ignored. Most likely you will have the same pattern implemented (somewhere) in your game.

Anti-cheat with SCILL

Right now, we try to prevent cheats. Cheaters will always start with the easy hacks, like speed hacks shown above. If they are not successful, they will dig deeper, and finally they will find a hole. This is certain. So, how can SCILL help to prevent that?

It’s easy. The idea is this: The server side validation should never trigger, because we already do client side validation. But, if the code triggers a lot, this indicates that this specific user is playing around with your client side code or installed a cheat.

Instead of just returning, we can use that data to “mark” this user. Think of it as putting a sticker on the user if this happens. There might be occasions this happens for users without any speed hacks installed like latency or network packet loss among other reasons. So, here and there we’ll see users with a couple of stickers applied. But if they look like this, something is definitely not right 😃.

This is exactly what SCILL is all about: Storing abstract atomic events attached to your users and to create value out of that data.

Before you can use this code, you’ll need to:

The Unity SCILL SDK exposes the SCILLManager singleton, which you can use on server side to send events for that user. In this simple code example we assume that you use some authenticationData attached to the connection. This can be Steam, Playfab or any other authentication system. SCILL only needs to get a unique (persistent) user id like a SteamID or in simple games it can be the SystemInfo.deviceUniqueIdentifier.

[Command]
private void CmdAttack(Vector3 direction)
{
  // Make sure it's time for this client to attack again
  if (!ValidateAttackInput())
  {
    var userData = (UserData)connectionToClient.authenticationData;
    SCILLManager.Instance?.SendEventForUserIdAsync(userData.userId, "trigger-event", "single", new EventMetaData
    {
      amount = 1,
      event_type = "vf-attack"
    });
  }

  GameObject go = Instantiate(_projectilePrefab, transform.position, transform.rotation);  
  // Setup projectile....
  // ...
  
  // Spawn the projectile on the server
  NetworkServer.Spawn(go);
}

That’s it. By adding a couple of lines of code, you now send events to the SCILL cloud. There are many different events you can send for different things. trigger-event is an all-purpose event that makes sense here. SCILL events can have meta data attached. In this case, we add an event_type info that we will use later. As we might have multiple input validation methods, we can use different event types to understand where validation failed. I used a prefix vf (which means validation failed) and then a name of the place in the code.

More info on events, their structure and available types can be found in our documentation.

Now, whenever a validation input error happens, we place a sticker on that user. As the stickers are persistent, cheaters will be already marked in their early stages.

Next, we use a leaderboard to visualize that data.

Identify cheaters with SCILL Leaderboards

With SCILL, you can create leaderboards listening on specific event types and summing up all events coming in. This way, you can easily create leaderboards for your players with most kills or those guys that never die. But, you can also visualize any other event with leaderboards. In this case, we just create a leaderboard listening on trigger-event events and the vf-attack meta data.

We can do that in the 4Players SCILL Admin Panel:

Please note: In the Admin Panel, you can add multiple leaderboards (depending on your tier) for different event types. But you can also sum up multiple events in one leaderboard. So, instead of just adding vf-attack you could also add another meta data value by setting vf-attack vf-move vf-collect-health to build a leaderboard for all validation events.

That’s it. Now, you have a real-time leaderboard showing the cheaters in your game! You can use our leaderboard web component to add a fully functional leaderboard in your own backend tools, or just use our Playground application to show the leaderboard for this game.

Do you see the Realtime Updates section at the bottom? SCILL offers real-time notifications that your App can respond to in real-time. So, by listening in on those messages you could show the user a warning to stop cheating or else he’ll get banned.

The other way to automate things is to set a Webhook in the SCILL Admin Panel calling a script on your side that you can use to implement business logic for banning users from playing your game, or kicking them from the server. It’s up to you how you handle this:

  • Use SCILL Playground as a User Interface to quickly check if there are cheaters in your game
  • Add SCILL Leaderboard Web Component to your web based backend to have the tool right where your community management is
  • Implement Webhooks to automate things on your side by leveraging data collection and processing on SCILL side.

Next steps

Well, you have implemented the SCILL SDK into your game, and you have set up an account. Why not add leaderboards to your game, or daily or weekly challenges with rewards to your game – it’s done in less than an hour. Even full fledged, fully functional Battle Passes can be added to your game in a rather short period of time. SCILL handles all the heavy lifting and we even provide fully functional, ready-to-use prefabs with user interfaces to get you started quickly.

Interested?

Additional documentation

We have extensive documentation on all these topics we touched on this blog.

Gamify your website with SCILL

Gamify your website with SCILL

Boost interaction, impressions, ad views and registrations

SCILL helps you to increase page and ad impressions, retain visitors longer and convert them into loyal readers. The key to success is called Gamification! 

Humans have an innate need to learn, improve their skills and compete with others. SCILL Gamification helps you to address these needs, increasing motivation, interaction, retention and  monetization of your content and users – in a playful way!

The extra power-layer for your website

SCILL can be integrated seamlessly into your website, without the need of sensitive data.

Backend: Integrate the SCILL SDK, define event triggers to fit your requirements and goals.

Frontend: Decide where and how you want to integrate gamification in your website. SCILL offers easy to integrate web components to get started. Copy & Paste the code and tweak the appearance to fit your brand.

Ready, Stead, Challenge!

Create challenges like “Login every day for 7 days”, use them independently or as a part of task-system like a Battle Pass and reward your users with XP, coins, badges or whatever comes to your mind. Or even create user leaderboards to rank them by XP, to make sure they are incentivized to make purchases, use your content and interact with your app or website. 

Here are some challenge examples:

  • Login in
  • Upload a profile picture
  • Make a purchase
  • Become a premium member
  • Come back 3 times a week
  • Participate in use survey
  • Leave a comment
  • Rate a product
  • Newsletter subscription
  • Find an item / picture
  • Read 10 news

Possibilities are endless and can be as unique as your content. With SCILL you finally can setup user events and engaging content in minutes – no worries if you forgot your company anniversary, Black Friday deals or other occasions you want to celebrate with.

To find out more about website gamification with SCILL, check out our product website.

Start challenge your users and engage with them in a fun way – fast and easy!

4Players – We Are Gaming

4Players – We Are Gaming

It is hard to believe: 4Players just celebrated its 20th anniversary!

A lot happened since its inception in 2000 by four enthusiastic gamers and programmers. We accompanied and shaped gaming on its way into the middle of society. Always at the pulse of time. Across five hardware generations and 15 console launches.

From day 1 we focused on digital content, while most print publishing houses frowned upon us and smiled at us, the naive idealists. 4Players.de is one of the longest running and internationally renowned online magazines for computer and video games in the GSA area.

We acknowledged early that the need for gaming services doesn’t end with the purchase of the game. 4Players was one of the first companies in Germany and Europe that offered game and communication servers. Exclusive partnerships with, among others, Electronic Arts (Battlefield franchise), Activision (Call of Duty 4) or TeamSpeak (official server partner) prove, that 4Players has found its place in the gaming cosmos with its growth potential.

The market is constantly changing. We are changing with it. And we are a relevant influence on it. No matter what the gaming needs are – 4Players has a solution. For gamers, who relish honest opinions. For publishers for whom only the most reliable servers are good enough. For developers, who are banking on innovative community-, retention- or monetization-tools.

The future is in flow, and we will make an important contribution. 20 years of experience, boisterous enthusiasm and creativity are the foundation, on which we will reach our ambitious goals together with the Marquard Group. We will not only accompany, we will shape: How games are developed and how they are consumed. Because we are gaming.

Once again we are pioneers: Our „Gamification as a Service“ project SCILL offers unequalled opportunities. Students will have fun whilst learning. Our products will see to it that we as a society will move more and eat healthier. Games will offer more fun with our solutions. We have a prosperous future ahead of us and couldn’t imagine a better home than the Marquard Group.

Phillip Schuster
CEO 4Players GmbH

4Players launches Gamification as a Service platform

4Players launches Gamification as a Service platform

4Players GmbH announces the launch of its SCILL: Gamification as a Service (Gaas) platform, a free toolset based on features of the well proven engagement and community app SCILL Play.

With GaaS developers can look forward to powerful tools to generate new challenges in their games or apps with minimal effort, integrate monetization options like battle passes with ease or add various layers of retention. Whatever the project, e.g. web or mobile apps, intranets or games of any genre: With the innovative SCILL self-service platform, gamification elements can be integrated seamlessly into existing or coming projects with minimum investment and regardless of what engine or development environment is used. Existing user accounts or payment systems can be connected so users don’t have to leave the ecosystem they are in, while sensitive data is safely stored on the provider’s servers, naturally.

The toolset is flexible, scalable and available in multiple price ranges including a fully functional cost-free option.  During development the focus was developers’ needs, as shown in the comprehensive, clearly arranged documentation or the intuitive UI in the admin panel. Not only here 4Players‘ experience of more than 20 years as a provider of ‚software as a service‘ is evident.

„We are very proud and excited to launch SCILL Gamification as a Service today“, says Phillip Schuster, CEO 4Players GmbH. „Our experience with SCILL Play has shown that we can reduce the required development time for adding user challenges, achievements and fully-fledged Battles Passes significantly. Our new toolset empowers game developers and publishers to leverage the power of our technology directly in their game, app or website. We can’t wait to see the first challenges go live soon and will continue to add more features like tournaments to SCILL GaaS.“

More information on SCILL Gamification as a Service can be found on the official website:
https://www.scillgame.com/

You can also find the full press release in the press section.

Fire at will: New challenges available for World of Warships

Fire at will: New challenges available for World of Warships

4Players GmbH announces that their community and challenge platform SCILL Play now fully supports the naval combat spectacle World of Warships from Wargaming. This means that the tens of thousands of players who duel in explosive battles with historical warships every day can look forward to a continuous stream of fresh challenges and rewards created in direct cooperation with Wargaming.

To take on the new challenges, all the players need to do is link their Wargaming account to the free SCILL Play app, which is available as a web version as well as for iOS and Android systems – after successful verification they will be able to take on further personal challenges in World of Warships based on the familiar game mechanics. Successfully completed challenges are rewarded with SCILL Coins, which can be exchanged for Premium Days and Flag Packs, among other things.

In addition, they can be part of an active cross-game community, easily connect with other gamers from around the world, form alliances and use the video (coming soon), text or voice chat features that are part of the SCILL Play app.

Marc Berekoven, Project Manager SCILL Play and Head of Business Development 4Players: “The World of Warships community is one of the most loyal and quality-conscious of all. We gladly accept the task of adding another challenge layer to the content continuously provided by Wargaming in order to tie gamers even more closely to the game. With a continuous supply of new high-quality tasks for fleet captains of all skill levels, SCILL Play ensures that the exciting naval battles are given an additional level of motivation. We look forward to welcoming World of Warships players to SCILL Play!”

As part of the support within SCILL Play, World of Warships will become an integral part of the regular SCILL Play Community Clash events and the recently launched SCILL Play Cup Series of solo and clan tournaments.

The full press release can be downloaded in the press section.

4Players partners with Boxelware

4Players partners with Boxelware

4Netplayers, the hosting service of 4Players GmbH, and the Erlangen development studio Boxelware have agreed on a partnership for the space sandbox game Avorion. As part of this collaboration, 4Netplayers will provide the official game servers for the space adventure as an exclusive partner. Since its release on Steam at the beginning of March, the game has generated more than 6200 overwhelmingly positive reviews.

Oliver Paul, Project Manager 4Netplayers: “The partnership with Boxelware is a further step for us to consolidate our status as one of the largest European server providers and to expand our business internationally with additional locations in the USA.
We are confident that with our powerful data centers, our years of experience in the server business and our technical expertise, we can help to effectively support Avorion’s online gaming experience. We will ensure that Boxelware’s game vision reaches the gamer without compromise and without lag”.

Felix Schieber, Game Designer of Avorion, adds: “4Netplayers is a very competent partner. The server capacity is worth its weight in gold for us and the advice on efficient usage is also very valuable to us. In addition, it is very advantageous for our community to be able to host their own servers easily at the push of a button”.

The full press release can be downloaded in the press section.