Тёмный

How to make a GLOBAL LEADERBOARD system for your game 

The Cherno
Подписаться 647 тыс.
Просмотров 24 тыс.
50% 1

Check out Hostinger's AMAZING BLACK FRIDAY SALE (ends Dec 5, and don't forget to use coupon code CHERNO for a bigger discount!) ► hostinger.com/cherno
Patreon ► / thecherno
Instagram ► / thecherno
Twitter ► / thecherno
Discord ► / discord
This video is sponsored by Hostinger.

Опубликовано:

 

23 ноя 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 99   
@TheCherno
@TheCherno Год назад
Hope you guys enjoyed this slightly different style of video! ALSO Hostinger's amazing Black Friday sale ends December 5, so make sure you check it out before then if you need web hosting! Use coupon code CHERNO to get a bigger discount: hostinger.com/cherno
@richardbloemenkamp8532
@richardbloemenkamp8532 Год назад
Great to have some videos like this with more humor and a bit less technical depth. I hope you also liked to make it. I would not make all videos like this, but from time to time a lighter video like this would be really fun.
@OneMeanDragon
@OneMeanDragon Год назад
Idea to add to that cheat scenario have the game logic server side. cloud gaming, though i guess that probably wouldn't be cheap on the server selection then if its overly popular.
@dumbcat
@dumbcat Год назад
what made space invaders exciting was the 'heart beat' sound that sped up as the creatures moved faster and faster. plus the smooth left-right only action of the ship made playing the game really straight forward. you just moved left or right and fired. so simple but so effective
@Thebreak1
@Thebreak1 Год назад
This is just a genius video, talking about a complicated topic in a really simple, yet kinda detailed way. Wish Universities would break their stuff down like this before going into detail.
@Ahelhot
@Ahelhot Год назад
in simple games like this, all logic can be fully deterministic. Game can send to server not total score, but list of actions (move left, move right, shot, etc..). And then simulate all this actions on server side in simplified game version (without rendering, sounds, etc.., just logic steps). But anyway this is not ease for complex games, and overkill for simple games. This only way to make scoreboard 100% real and accurate.
@b4ttlemast0r
@b4ttlemast0r Год назад
That's not only for simple games tho, fighting games for example also just send the inputs instead of their results (though in that case there is no server simulating the game, it's peer to peer). In the case of a single player game with a highscore leaderboard though, you could still cheat by using tools such as macros, playing in slo mo and recording the inputs or just manually fabricating the inputs, and then sending them to the server, basically all the things that TASes do.
@372leonard
@372leonard Год назад
i like this idea, however if the games get really long and you generate 60 actions per second you'll have to send enormous packets to the server. (maybe you can do something smart with data compression? packets would still be pretty big though) and you'll have to simulate the game server side aswell which might be tricky to get running.
@fxfighter
@fxfighter Год назад
@@372leonard It's player input actions and not FPS, so it'd never be 60 per second. This is already done in quite a few games, see trackmania for example. These are full replay/demo files you can watch yourself and can be verified independently. I think what you might be thinking of is recording tick event data like what CSGO does for its demo files, but that's a different approach altogether. Not something I'm particularly familiar with. Edit: I think my previous message got deleted because I linked to the trackmania replay file website.
@jblock9675
@jblock9675 Год назад
Great idea, and with some good compression seems completely feasible, (eg. Huffman coding and maybe fourier transform similar to lossless image/audio compression) but a cheater could still create a bot to play perfectly and get very high scores. This or modify the game to play itself using all the data it has in ram like exactly where each piece is and so on. These are the kinds of cheats most games have a hard time with detecting.
@372leonard
@372leonard Год назад
@@fxfighter you're right, would have to include timestamps or frameindex on the actions. but it suddenly does sound a lot more manageable, still big though. maybe if you remove the files/data from the database after a few months it will work this way.
@grig517
@grig517 Год назад
I love these series, keep doing the good work!
@AlienFreak69
@AlienFreak69 Год назад
What if you have an exception that shows cheated scores only to known cheaters. That would fool them into thinking the cheat is working even though globally that score isn't visible by legitimate players. Another thing you could do is separate the leaderboards into cheated and non-cheated. I think Steam does that where in some games, if you're VAC banned, you can still play multiplayer but the games will generally matchmake you with other VAC banned players and prevent you from playing with legitimate users.
@holtthedolt
@holtthedolt Год назад
The scriptwriter deserves a bit of a raise here!!
@VioletGiraffe
@VioletGiraffe Год назад
Great video, much more interesting than the first couple minutes suggested! Caught a glimpse of your take on Space Invaders, looks amazing. Wish I could either design or implement such beautiful graphics.
@Dustyy01
@Dustyy01 Год назад
That dream reference😂
@fallenflame8678
@fallenflame8678 Год назад
Congrats on 500k subscribers!
@andreimclive
@andreimclive Год назад
I like this style of video its more like how Fireship does it, and its great. Saves time and gets to the point.
@user-zi8jn1go8k
@user-zi8jn1go8k Год назад
I think it would be cool to have high scores local to your country/city/whatever. Because for most people looking at world leaderboard they would be like just "meh, I wouldn't compete with world champions anyway, so why bother"
@CreativeSteve69
@CreativeSteve69 Год назад
I like this new style of video Cherno. It's really refreshing to see some dev stuff like this as well as your regular game engine series. This is a real nice welcome and hope it turns into a new series in rotation cherno.
@LHInstrumentals
@LHInstrumentals Год назад
Great video as always
@zmania101
@zmania101 Год назад
In addition to the controls you mentioned, I would personally have the game client request a nonce from the server, and add it to the payload of the POST request. The server then would hash the parameters and confirm integrity, like a CRC. Or, during the game installation process, generate a RSA keypair, and register the public key on the server. Then sign your POST requests client side with the private key, and confirm integrity server side with the known public key.
@LiEnby
@LiEnby Год назад
Literally all of this would be suspectable to the most simple attack of just editing the score in memory and having the game submit it for them.
@TheAlison1456
@TheAlison1456 Год назад
a nonce?!
@LiEnby
@LiEnby Год назад
@@TheAlison1456 a randomly generated number. used one time in a message, usually to prevent replay attacks. In alot of countries the term "nonce" doesn't really have that *other* meaning your thinking of.
@Kazyek
@Kazyek Год назад
With a fully authoritative server model, it's really easy to rule out anything that's not within the game's boundaries. The only issue left is how to deal with people faking/automating valid game actions. That part heavily depends on the game's gameplay and is why cheaters/"hackers" are almost a non-issue in MOBA like League of Legends but are rampant in FPS games for example. You can try to validate if actions are humanly possible by validating the actions speed/accuracy/jitter, but if the bot stay within reasonable boundaries then it's not very effective. You can try to monitor/control what's on the player's system, but that's ultimately a fool's errand. Some people often say it's a "cat-and-mice" problem where devs find way to detect X stuff then cheaters switch to Y stuff not detected and so on. But ultimately, the player's computer is an untrusted platform on which you do not have physical control, so there's a wide range of stuff you simply cannot control or monitor. For example, if a cheater's bot is driven by an external system that's just a generic HID device reporting being a keyboard/mouse with some Razer mice hardware ID (which you have absolutely no software way to verify if the external HID device is "actually" a razer mice or just "saying" it is), then there's no actual way to detect or block that from any kind of anti-cheat.
@LiEnby
@LiEnby Год назад
Lol if you create a "replay" system where you send all actions to the server. Your essentially just challenging cheaters to make the best tool assisted speedrun
@iTsBadboyJay
@iTsBadboyJay Год назад
you get my like for the shot at ea😂
@marknefedov
@marknefedov Год назад
TBH, this needed to be liveoverflow collab or something.
@jmac217x
@jmac217x Год назад
In the real world you would want to use an SSO to authenticate and go the extra step to load balance your server traffic before it hits your databases. for the case of explaining the concept this gets the point across. There's no way you your leaderboard doesn't get hacked so you might as well build it as well as you can and see what happens.
@ar2000
@ar2000 Год назад
Collecting IP is not a good idea at all. IP are often dynamic and change ever day/week. Also because there is not enough IPv4, some ISP share one IP between multiple clients.
@ben-kd9dr
@ben-kd9dr Год назад
Hey Cherno, thanks for the video. Could we discuss vcpkg (the dep manager from windows) in the C++ chanel please?
@saeedmahmoodi7211
@saeedmahmoodi7211 Год назад
I had ida open while he was talking about that "1 guy" 😅
@Test-iv4pm
@Test-iv4pm Год назад
Can you please make a technical series for creating a steam game?
@cheako91155
@cheako91155 Год назад
The post data should include the RNG seeds and a doom demo file so anyone can "replay" the game. Trackmania has used this to great effect when catching cheats.
@LiEnby
@LiEnby Год назад
1- download top player replay 2- submit to the server as your own 3- profit
@cheako91155
@cheako91155 Год назад
@@LiEnby Should be easy enough to guard against, it would be like fixing an item dup glitch.
@raq1024
@raq1024 Год назад
now I want to see CodeBullet attempt at cheating in Cherno's games
@noobdev4181
@noobdev4181 8 месяцев назад
It's a very informative video. Like. Thanks for this information.
@nepp9574
@nepp9574 Год назад
Love the joke about EA / Microtransactions. 🤣
@jahmovementempaya1084
@jahmovementempaya1084 Год назад
Hello The Cherno, I want to build a system that receives sensory video, processes them frame by frame, stores those frames in selected areas, while sending the sensory video to the screen. I just started learning C++, and don't know what areas are most important for this kind of project.
@VORASTRA
@VORASTRA Год назад
"making cheating as hard as possible" GTA Online devs: i sleep
@featherless656
@featherless656 Год назад
The cherno: or, OR, we can get Tim to do it
@darioabbece3948
@darioabbece3948 Год назад
You could have used the three way handshake to catch cheating. Example: I want to submit my score. I click submit. The server lands me an ephemeral key. It encrypts and sends the results. Once the packet arrives the key decays. To verify the integrity the server re-computes the checksum(hash)
@john2001plus
@john2001plus Год назад
Space invaders didn’t have a leader board. Just a high score.
@mmd-wt5eq
@mmd-wt5eq Год назад
You missed out on the guy who would use the api and post his own score.. You should use encryption like RSA, i think, to get over it. Another thing is to make the score itself like a key, like the score shouldn't be a prime, or it should be divided by 6 but not 5, etc.. You could ban anyone using cheat engine, or at least warn them. There are more ways if you think about it. Hope this helps.
@TheAlison1456
@TheAlison1456 Год назад
how would you detect that someone used cheat engine?
@mmd-wt5eq
@mmd-wt5eq Год назад
@Unknow0059 i really don't know the process, but I know a game named Growtopia that warns you and kick you out of the game if CheatEngine is detected in use, also I heard that one game bans you if CheatEngine is detected. For the first game, there were patches of CheatEngine changed by some nerds so that the game Growtopia doesn't detect it. I'm just saying to let you know that it is still possible but much more difficult.
@Wal5797
@Wal5797 Год назад
hey man can you please do a video on C++ Funtors and its use case, thanks in advance.
@infernolum
@infernolum Год назад
And yet this video is barely scratching the surface. Protecting your software from exploitation is an incredibly hard task that some may even deem impossible. It's ultimately a cat and mouse game and the security of your software/app structure is dependent on how much time you are willing to spend researching ways to make it harder for curious individuals to break your game apart. Some things that devs, tackling the problems and topics discussed in this video, can do are: encryption of strings ( plenty of sources available out there ), simple obfuscation and control flow manipulation ( this one is a bit harder to pull off but there are a few papers that can definitely nudge you in the right direction ), debugger detection, common reverse engineering tools detection. Lastly I'd like to say a few words from the point of view of a person that deals with breaking software on a daily basis: It's not so much about trying to be malicious or being a bad actor for the sake of it, it's more about exploring what's possible within the constraints set by anti-cheat / anti-tamper measures. I as well as so many other people find great enjoyment in exploring the intricate systems that make everything work, and of course eventually trying to modify them in a way that achieves a particular goal set by the "bad actor".
@ToniPlays_
@ToniPlays_ Год назад
4:30 We were joking about Hostinger throwing free servers at Yan with Peter. Turns out it's absolutely true. Also I think Peter needs one, just saying.
@gitishsandhu
@gitishsandhu Год назад
10:28 ahem ahem 😂
@gwch3481
@gwch3481 Год назад
Game tip #1: Humans like rising numbers *Except for golf, for some reason*
@avtem
@avtem Год назад
Idea for reverse engineering protection (it came to me when i was reverse engineering): just don't call function addNewScore() immediately. Put it in some queue that will wait for 1-3 seconds and only then call the function.
@Zvend
@Zvend Год назад
what woudl it change? you can still trace down from the send method to where the packet is not encrypted and then hook it. It doesnt matter where or when it gets called. A good way is to have smth like a security code made way earlier in the game. it sends both data and the security code is made to verify every single number. Splitting up the packets may also result in much more work. There are tons of way more ways i could think of. But queueing functions is none of them
@avtem
@avtem Год назад
​@@Zvend How do you trace a method when you don't know when it's executed? You might just put ptr to function in some kind of vector that calls functions in it every so often
@LiEnby
@LiEnby Год назад
@@avtem um breakpoint?
@avtem
@avtem Год назад
@@LiEnby Where would you set it?
@LiEnby
@LiEnby Год назад
@@avtem addNewScore.
@guruware8612
@guruware8612 Год назад
firing 5 bullets and a score of 100++ IS possible, never watched star wars ? one random shot, 10 troopers down
@JanVerny
@JanVerny Год назад
How about capturing all inputs and then "simulating" the game on the server, and calculating the score from that? You can still do computer assisted runs or whatever, but at that point, I'd say they deserve the highscore.
@anon_y_mousse
@anon_y_mousse Год назад
As long as the game has focus that's actually not a bad idea, but you always have to worry about keyloggers.
@LiEnby
@LiEnby Год назад
@@anon_y_mousse it obviously wouldn't globally log all keystrokes while the game is open. Just the ones that actually result in something happening in the game. It'd be basically a TAS
@anon_y_mousse
@anon_y_mousse Год назад
@@LiEnby Depends on the security of your system. It's not like a program can't do it, it's just a matter of whether your settings are right to prevent it.
@LiEnby
@LiEnby Год назад
@@anon_y_mousse it probably makes more sense to send like actual events like maybe the player position. When they shoot etc. Rather than just capturing inputs lol
@anon_y_mousse
@anon_y_mousse Год назад
@@LiEnby Por que no dos.
@throwaway6288
@throwaway6288 Год назад
In theory, couldn't someone use machine learning to recognize what a high score game looks like. Then compare that to the new high score and determine if its sketchy or not and send for manual evaluation?
@luz_reyes_676
@luz_reyes_676 Год назад
You would need data. A lot of data. And what ML/AI are you going to use? Is it any good? False positives for someone really talented? What is its cost?
@throwaway6288
@throwaway6288 Год назад
@@luz_reyes_676 I have no idea lol thats why I'm asking
@LiEnby
@LiEnby Год назад
Players who are just really good and outliers in your ML data would get missed probably
@luz_reyes_676
@luz_reyes_676 Год назад
@@LiEnby I have no stakes in ML lol I was just offering food for thought to OP
@qx-jd9mh
@qx-jd9mh Год назад
​@@luz_reyes_676implying game devs understand statistics well enough to pull this off
@guilherme5094
@guilherme5094 Год назад
Nice👍.
@Test-iv4pm
@Test-iv4pm Год назад
$2b in quarters weighs 100 million pounds
@Basel-ll8fj
@Basel-ll8fj Год назад
2:00 😂😂😂😂😂😂😂😂😂😂😂😂
@TheAlison1456
@TheAlison1456 Год назад
2:30-2:40 this actually doesn't work anymore due to the catastrophic (?) way in which society relates with itself nowadays I bet that most people who see leaderboards get instantly discouraged by the global leader who does nothing but play the game, and who they don't even know because it's not a small local arcade. Sad...
@b.blokzijl1189
@b.blokzijl1189 Год назад
whhaahaha loved every second
@cheako91155
@cheako91155 Год назад
I don't like the idea that the creators of the game are the only ones able to host the server portion, it would be better if the solution was a p2p network... so even if the initial devs abandon the project the community is less likely to follow.
@anon_y_mousse
@anon_y_mousse Год назад
Agreed there, and it would make it so any server operator could determine the best method for them to prevent cheating or just outright disable the leaderboards.
@LiEnby
@LiEnby Год назад
Then you have the classic p2p problem of how to find peers
@cheako91155
@cheako91155 Год назад
@@LiEnby I'm working on that now, I think the solution is to connect to an existing network and participate in resource sharing with it.
@klaesregis7487
@klaesregis7487 Год назад
Lol, the webdev comment hit home. I don't like it as well. I rather do anything else.
@anon_y_mousse
@anon_y_mousse Год назад
I think this is a good argument for not having global leaderboards or tracking high scores at all.
@TheAlison1456
@TheAlison1456 Год назад
I expected something about ranking algorithms... I'm disappointed.
@somepineaple572
@somepineaple572 Год назад
It kinda sounds like ur challenging people to find a way to cheat here.
@agent-33
@agent-33 7 месяцев назад
Get to the topic. WTF
@peter1745dev
@peter1745dev Год назад
Ah yes, I'm the cheater here xD
@ax13h
@ax13h Год назад
Ease up on the f-stop. Less is more.
@ChrisM541
@ChrisM541 Год назад
"We can't really stop cheating" --> WRONG!! THINK about the game code, and, data you're sending to the Leaderboard server. You need to continually validate the score in-game AND at upload time...obviously...but you need to use some of that non-internet critical thinking that was an absolute must in the past. You need unique, dynamic(!!) validation (including positional) included in that uploaded data, and, ffs, everything strongly encrypted - WireShark, CheatEngine etc shouldn't even feature in any discussion. I am stunned cheating is STILL an issue.
@LiEnby
@LiEnby Год назад
Well at the end of the day your computer that you control. Sends the thing to the server. Most of his suggestions were server side logic which is good
@ChrisM541
@ChrisM541 Год назад
@@LiEnby Those writing the game are also writing the server code ;)
Далее
What Makes A Game Replayable?
20:20
Просмотров 463 тыс.
MY FIRST EVER GAME! // Code Review
46:50
Просмотров 76 тыс.
I solved Unreal Engine's Package Size Problem...
14:35
3 services for online leaderboards in Godot
7:12
Просмотров 3,8 тыс.
Using AI to Create the Perfect Keyboard
12:05
Просмотров 1,4 млн
Harder Than It Seems? 5 Minute Timer in C++
20:10
Просмотров 156 тыс.
I made an EVEN BETTER Minecraft
12:30
Просмотров 322 тыс.
20 Advanced Coding Tips For Big Unity Projects
22:23
Просмотров 164 тыс.
How to Code (almost) Any Feature
9:48
Просмотров 663 тыс.