Share your repls and programming experiences

← Back to all posts
swordbattle.io
h
CoderGautamYT

Multiplayer Swordbattle.io

Kill Players, Get Huge!

This is my kajam submission. I hope you like it!

How to play?

The game is fairly simple, become the hugest player of them all.

How to get huge?

Well, it's simple, you have to collect coins that are scattered around the map. Coins make you slower, but make you bigger, make your sword longer, and makes your sword more stronger. You can move around the map with WASD or Arrow Keys!

Killing Players

Collecting coins takes so long, that's why each player comes with a ka-sword. Just kill other players by clicking with your mouse and they will drop all their coins!

How to win?

Well you have to get huge. Really huge

Conclusion

Well that's all I have to say about this game, the past 1 week has been amazing. Normally I lose motivation for my projects quickly, but kajam kept me going..

"money can do weird things to people" - @Coder100

Anyways, I hope you enjoy Multiplayer Sword.io, See ya!

Click here to play the game!

EDIT: TYSM FOR TRENDING

EDIT 2: I MADE A DEVLOG, PLEASE WATCH: https://youtu.be/59mjZehbvHA

- CoderGautamYT

Voters
maanavredhu12
Technoverse
SourGrape1024
Arda-and-Roblox
DynamicSquid
rust1no
XdekHaker
JulienRenaud1
GirishV2
LordPvP1234
Comments
hotnewtop
CoderGautamYT

Botting problem!

Hey! There is a big botting issue going on right now. It's being done mostly by @sedated.

List of bots:

Sword.io Bot - Probably the most basic bot, crashes servers by spamming socket connections (PATCHED)

TamperWare - Also crashes servers, but uses a different method and is way more effective (PATCHED)

SedatedAgent - A kinda cool bot if I say so myself.. It uses AI Pathfinding and Combat to automatically collect coins and kill players. (PATCHED)

LagRequester - A bot that spams get requests on the server to cause major lag and disconnections. (PATCHED)

test - A very simple (but annoying) bot that uses a movement exploit to achieve a teleportation effect. (DEVELOPMENT STOPPED)

SedatedAI - Basically SedatedAgent but undetectable and more smart and powerful. (PATCHED)

ReddCrasher - An updated server crasher (PATCHED)

SERVER RESTART - A bot that uses an exploit to crash and restart the servers (DEVELOPMENT STOPPED)

KnotBot - A bot that's able to bypass recaptcha and is able to move around the map randomly (PATCH IMPLEMENTED, NOT CONFIRMED PATCH)

If you see any of these bots, please reply here with a screenshot.

EDIT:

I am so sorry about the amount of downtime this is having. All these people are making bots for my small game and I'm working desperatly to add a anticheat. The game is being spammed with so many requests and getting crashed right as I start it. Please bear with me as I do violence to these hackers.

EDIT 2:

I have implement v1 of my anticheat. This should prevent botters from crashing servers. I am not 100% sure if this method will work, but let's wait and see.

Edit 3:

Ok so the botters have figured a way around this. I am working to implement invisible recaptcha. This means that most botters can be stopped.

Edit 4 - Oct 31, 2021:

Say goodbye to botters! Google's Invisible Recaptcha has been added! This should stop most bots from joining. Let's see how these stupid botters can bypass this!

Edit 5 - November 1, 2021

Let's goooo!

Edit 6 - Nov 18, 2021

Another new bot has been developed, called KnotBot. I am not sure how this bot is able to bypass the captcha, but I am working to figure it out. Sorry for any inconvenience this bot causes.

MushyAvocado

@CoderGautamYT

Does the image show up?

CoderGautamYT
MushyAvocado

@CoderGautamYT There were a ton of sedated bots. Idk why the image won't load.

CoderGautamYT

Ok, I made a deal with @sedated, he said he will not bot my game anymore, so we're safe... for now... @MushyAvocado

india3

I played just now bots are not there. @CoderGautamYT

CoderGautamYT

Yay! Looks like sedated is keeping his word. @india3

hghg81

@CoderGautamYT

tell sedated to delete the repl.

CoderGautamYT

I've done a update to the game. bots should have stopped lets gooo. @hghg81

hghg81

@CoderGautamYT
:) I will check for you

hghg81

@CoderGautamYT

it worked!!!

CoderGautamYT
CoderGautamYT

Nice! @hghg81

HartajPartapPar

@CoderGautamYT Thx for solving issue. Nice game btw :), I also hate it when people just try to ruin your creation for no reason. It sucks man. Keep on going man, you're doing great. BTW, I forked this, and making a few changes to it, if you were fine with that.:)

CoderGautamYT

Yeah, completely fine with it. Make sure to remove the commented code if you want to run the game on replit, right now it redirects to heroku. @HartajPartapPar

HartajPartapPar

@CoderGautamYT Sorry, I have literally no clue what that means. Are you trying to tell me to instead of npm start, use a different kind of thing? And this game is LEGIT, I wish you the best of luck on winning the kajam competition. :)

CoderGautamYT

No, nevermind that. Thanks! @HartajPartapPar

HartajPartapPar

@CoderGautamYT Np, I'm very bad at coding for the most part. Goodbye, and good luck :)

CoderGautamYT

Thanks, good luck to you too! :) @HartajPartapPar

Baconman321

@CoderGautamYT How the do bots even work?

Do they like exploit and one/two shot you (someone did that and their name was "test"), or are they programs that follow players?

The bots seems awfully complex and time-consuming for a game that just came out, or is there some sort of easily exploited vulnerability in your system.

CoderGautamYT

Well the bots work by just sending packets the same way a player does. The current one that's going on (called test) is a movement exploit. To prevent slow movement for players with high ping, I made it so that high ping players can move faster to compensate for the less amount of packets they send. The test bot exploits that and sends a really low amount of packets. This makes it acheive fast movement or a kind of teleportation. There are so many different kinds of bots and I have no idea why people are spending so much time making them but I am trying my best to prevent any game-breaking bots from crashing servers (yes that has happened before) @Baconman321

CoderGautamYT

I would say the test bot isn't that OP or makes the game unfair to normal players. Yes it can be annoying but I think it's not too bad. I will take action if he adds AI Pathfinding or Combat to it. (and also yes AI bots have been made that collect coins and follow and kill players) @Baconman321

CoderGautamYT

Uh oh, @sedated is back with a new bot...

Baconman321

@CoderGautamYT Kind of sad but I'm going to say it.

It's amazing how dedicated people are (and talented) at making bots.

Maybe you could make a test arena and allow bots there, just to spark creativity and problem-solving (although, they might as well make their own game for it).

Also make the test arena accessible to normal players, so they can just see how the bots are interacting (and add a spectator mode). This is all an idea, but maybe it would encourage people to try a place where they are allowed to exploit (to divert attention from the main area. Plus, bots can have better skills and accuracy than humans can, so it would be challenging to make your bot superior to others... kind of a bot competition!).

Honestly though, I am sad that people are wasting their time on doing harm.

Although it does seem fun to program bots like that. Like I said, maybe make a bot competition. If you don't, IG i could make something similar, although my game dev skills are non-existential right now...
CoderGautamYT

Its annoying how a lot of people don't care about making good bots they just like to spam connections to crash the server. @Baconman321

XCode101

@Baconman321 @CoderGautamYT
There is still a botting prob

CoderGautamYT

I know, he's back @XCode101

Baconman321

@CoderGautamYT

that seems fun too. May I commit white hat?

Can you use cloudflare? I think that has DDoS protection, which may help your botting problem.

sedated

@Baconman321 I'm not ddosing anything. All I do is create a socket that connects to the URL, and creates an interval that sends attack and movement packets.

XCode101

@CoderGautamYT You might be able to add an IP ban.

CoderGautamYT

How can I prevent this? @sedated

sedated

@CoderGautamYT Also someone is crashing the server by spamming connections. Read into CORS to fix remote connections.

Baconman321

@sedated I advise you not to do it if it is illegal, these kind of things are very dangerous if pursued wrongly, and can end you up in jail at the very worst (or less life-changing but still frustrating - banned from replit).

As long as it's ok, then sure go ahead. Just be careful and always check the rules (exploiting loopholes is also a nono, most ToS will prevent exploitation of loopholes)

CoderGautamYT
CoderGautamYT

I have a basic version implemented, working to improve it. @XCode101

Baconman321

@sedated So you use pathfinding?

How does that work, and how do you tell where the players are on the map?

Do you program all of this by yourself, because that is a lot for just a couple of days IMO.

sedated

@CoderGautamYT "ReddCrasher" is a skid off "TamperWare". Same thing, you haven't patched it. All it does is cal io(game_url) repeatedly.

sedated

@Baconman321
1. I don't use pathfinding. There are no obstacles on the map, which makes it very, very simple.
2. I read it directly from the players object sent from the server.

3. Yes, I coded it in around 1 day in school because I was bored. (like 1-2 hours)

CoderGautamYT

Amazing!!! Your sooo good at coding [email protected]

CoderGautamYT

yeah watch the anticheat roll out and bam try hack me then LMFAO @sedated

sedated

@CoderGautamYT I'd like to see you patch cheating through the client by using tampermonkey. But if you do, congrats because your game is now much more secure so you don't have to worry about large-scale hacks if your game grows.

Baconman321

@sedated So the game returns the player positions?

Well, I mean kind of obvious.

I assume if you know enough it isn't that hard (i've never tried. But you'd have to know your location as well as the other players, choose a target then calculate how to get to them as well as compensate for updates)...

Sounds simple in concept but hard to put into practice if you don't know what you are doing (like me).

sedated

@Baconman321 The game sends each player's positions, which I store in an object.

I then run "chooseTarget()" until a valid target is found.

I then set an interval (1ms) that first checks if the target is valid (prevent following dead/left server players) then follows them based on the difference between my and their position.
I also set a seperate interval that just spams attack.

124423

@CoderGautamYT Hey, Iv actually been working with @sedated on the bots. We actually decided to create a debug/test server @ https://0276c611-5213-4643-b37e-462194808c4b.id.repl.co/ in hopes to minimize the impact on your game. Just saying were doing this for fun, not to be malicious. I also would like to state that @sedated still insists on testing it on the real game with players once and a while.

CoderGautamYT

Alright, it's fine, just please don't spam the server with people until it crashes. It's fine if you do only 1 or 2 of them. @124423

124423

@CoderGautamYT The way the bot works there is only one player at least in the current version.

Baconman321

@sedated Would be nice if you could make a more complicated algo. I could help, but I don't know much about NodeJS and I'm somewhat busy...

124423

@CoderGautamYT I would also suggest implementing a CORS policy.

CoderGautamYT

Alright, try running your bot thingy, does it bypass? @124423

RepohNiekie

Yay, there are no bots when I tried to play. Seems like your anticheat v1 patch worked! @CoderGautamYT

124423

@CoderGautamYT were working on a bypass right now

CoderGautamYT

good luck idots @124423

FrancisPan

@CoderGautamYT I couldn't get the photo, but a bunch of Freekill :) named players came into the server. Not complaining tho, didn't break the server, just gave free coins.

CoderGautamYT

How many came? @FrancisPan

FrancisPan

@CoderGautamYT 7 of them came and whenever I killed them they rejoined.

CoderGautamYT
CoderGautamYT

Please don't help him.. @Baconman321

Baconman321

@CoderGautamYT If you don't want a bot then ok (I've never really made bots anyways).

It would be fun to have an arena to test bots out with, but your game so your choice.

Baconman321

@sedated As long as you send/receive data from the client your game will always be vulnerable to something.

The best thing you can do @CoderGautamYT is have the game to be an i/o board and only send keystrokes and then have the server process them into instructions, then form an image on the server then send it to canvas (so that the players can't intercept the other player's positions. However, lag will be a big issue because you have to send images over a socket every game tick). A problem with the image though is that the resolution would have to match the screen. You could do this by sending the canvas size to the server and have the server render the image based off of those specs (so the specs would be different for each client). But, people could potentially exploit this by sending absurdly large dimensions so your client would have to work overtime to produce the image thus lagging the game. You could put measures on this by refusing clients sending absurdly large dimensions (dimensions that not even gamers with a 50 inch OLED - yes alienware makes a 50 inch OLED - monitor would have), and/or after a certain point just stop scaling up the resolution and force the client to deal with a lower resolution (will be an annoyance to people because everyone knows lower resolutions are so eye-straining and awful).

Diep.io has an interesting way of warding off bots, by requiring a computation-intensive calculation called POW (proof of work... no diep.io is not mining bitcoin). One client alone works fine; it doesn't lag. But if you run multiple clients it becomes extremely slow and strains your CPU. Also, if you refuse to respond with a POW within 10 seconds you get kicked. Since the bots are hosted on repl and repl naturally has pretty slow computing power you will likely ward off most bots hosted on low computing power platforms.

The source is from reddit, so I cannot verify the truthfulness of the claim, but see for yourself: https://www.reddit.com/r/Diepio/comments/kgyv51/diepio_might_use_your_computer_to_mine/

CoderGautamYT
CoderGautamYT

I agree, once the game is good enough, I'll make a no anticheat test arena. Just dont help them make a hack for the normal servers. @Baconman321

Baconman321

@CoderGautamYT Recaptcha is very hard to be beaten by bots.

Oh wait, nvm a bot already beat it: https://www.youtube.com/watch?v=fsF7enQY8uI XD

Although, like they said they could make multiple tabs and then use an extension like tampermonkey to control the bots once recaptcha has been bypassed by the human (the number of bots is limited to their computer's power as well as how many recaptchas they can work through by hand). Because of this, I recommend you look into the POW concept I gave you.

CoderGautamYT

It's fine lol, bots problem have stopped, im gonna add more features and mechanics to the game so its more fun. Bots and anticheat are the next [email protected]

figglediggle

haha

mollthecoder
CoderGautamYT
CoderGautamYT

was he cheating or botting? @mollthecoder

HrushalNikhare

@CoderGautamYT I am a human GEtting kicked out of the game why?

DanielMarshall6
CoderGautamYT

Slow wifi probably, try refreshing the page. Sometimes it just "does" that. I'm trying to improve it. @HrushalNikhare

CoderGautamYT

What is it saying? @HrushalNikhare

mollthecoder

@CoderGautamYT They just stood there, but occasionally they'd move for a few seconds towards a player while spam attacking. I'm worried that soon they'll start acting like the normal bots again. @sedated is making extrememly complex things and i'm not surprised that he already bypassed the restrictions.

CoderGautamYT

Hmmm, he said he stopped making bots, I have to dig deeper into this, will update you if I find something. @mollthecoder

HrushalNikhare

@CoderGautamYT that i'm a bot or some thing

CoderGautamYT

You probably have a low captcha score. Try logging into google and trying again. (this can improve your captcha score because I'm using Google's recaptcha) @HrushalNikhare

HrushalNikhare
mollthecoder

@CoderGautamYT I want to clarify that "SERVER RESTART" wasn't actually restarting servers, it was just the bot's name, probably to scare players. It acted like a normal bot.

ABirdCoder

@CoderGautamYT It seems like such a big botting problem for such a small game.

Maybe I could help with anticheat?

ABirdCoder

@CoderGautamYT

What the-

Guy gained that in around 2 seconds - top.

CoderGautamYT

Probably killed a big player, players drop their coins when they die. @ABirdCoder

CoderGautamYT

I got things covered for now, I'll let you know if I need any help, thanks! @ABirdCoder

hx55xn-in1t

@CoderGautamYT im not sure?

hx55xn-in1t
hx55xn-in1t

@CoderGautamYT yuh probably

ABirdCoder
mollthecoder
ABirdCoder
fishers14

@CoderGautamYT not true

RixTheTyrunt

How can you make a "bot" for this game?

CoderGautamYT

By sending packets to the server exactly how a normal player would. @RixTheTyrunt

CoderGautamYT

Please open the game in new window for a better experience

india3
Tamilcoder

Nice game but some time i play the hitbox isnt working correctly and i have a bit reach. Fix pls

CoderGautamYT

Yes I know I will fix it later (it's harder than you think) @Tamilcoder

justaperson22

Hmmm its kinda sus how a lot of the upvoters don't have repls

CoderGautamYT

i agree it is kinda odd @justaperson22

PeweAtBomoAds

i am new to coding @justaperson22

india3

me too. i am learning C language @PeweAtBomoAds

BabovaJones

This game should win 100000% #getswordiotrending

PeweAtBomoAds

Updooted @BabovaJones

CoderGautamYT

Thanks @BabovaJones

india3
ruiwenge2

lol if I name myself as devil this is what happens:

CoderGautamYT

yup, it's a little skin test. @ruiwenge2

CoderGautamYT

Achievements!

  • 1,000 Plays: Oct 25, 2021
  • 2,000 Plays: Oct 27, 2021
  • Trending (Talk): Oct 27, 2021
  • Trending (Apps): Oct 28, 2021
  • Amasad Commented!: Oct 28, 2021
  • 100 likes: Oct 30, 2021
  • 5,000 Plays: Oct 31, 2021
  • 100 updoots: Oct 31, 2021 (thanks @p1ckl3)
  • 10k Plays: Nov 4, 2021
  • 20k Plays: Nov 17, 2021
  • 500 Updoots: Nov 24, 2021 (thanks @jpage654)
KocasVlak

Next: 10k Plays @CoderGautamYT

CoderGautamYT

haha yes @KocasVlak

JusticeFriedt

good job its good... no great... no amazing... no THE BEST

CoderGautamYT

thanks lol @JusticeFriedt

india3

no THE BEST GAME EVER @JusticeFriedt

theamazingplant

Very fun

CoderGautamYT
ruiwenge2

nice i reached 1000

ruiwenge2

1262 now with 31 kills

CoderGautamYT

Ayy nice job dude @ruiwenge2

india3

Wow i have only reached 100 max @ruiwenge2

cdCreepArghhh

@india3 Try playing when no one else is online (although that is hard to do...)

CoderGautamYT
PixiGem

@ruiwenge2 pro gamer move
IM BACK TO REPLIT LES GOOOO

CoderGautamYT

Nice @PixiGem

cesof

Nice game cool!

CoderGautamYT

Thanks! @cesof

ruiwenge2

nice

CoderGautamYT

thx, lobbies are empty because its night time, normally there are a few people playing @ruiwenge2

cdCreepArghhh

@CoderGautamYT also timezones

ThomasCole2

errrrrrrrrrrrrrrrrrrrrrrrrrrrr wheres the game

CoderGautamYT

swordbattle.io or just open the repl in a new [email protected]

CoderGautamYT

Nvm the game was broken that time, it is fixed now, sorry about that. @ThomasCole2

GautamSudarshan

Pog

india3

What this mean ? @GautamSudarshan

jihhyuu202

basically "cool" @india3

mollthecoder

@desucode Hi! It's me!

mollthecoder
desucode

@mollthecoder Hey, man!

CoderGautamYT
CoderGautamYT
TakiyapNeel

This is my favorite game in the jam. I mean, goliath was pretty cool, but this still beats it. Pompkin was also nice, but it gets boring quickly, even with bots. The only suggestion I would say is fix the lag, I think that replit may be the culprit, but I'm sure there are ways to optimize your code. Anyways, nice job, had a great experience with this game.

CoderGautamYT

Thank you for the kind comment! @TakiyapNeel

CoderGautamYT

Also nice profile picture lol @TakiyapNeel

MushyAvocado

What is app.use for?

CoderGautamYT

To send files to the client. @MushyAvocado

MushyAvocado

@CoderGautamYT OK, thanks. Do you need the hacker plan to keep your server active constantly?

CoderGautamYT

Probably, if i win the contest, i'm gonna buy it. @MushyAvocado

MushyAvocado

@CoderGautamYT Nice. Can you help with my code? I'm trying to get the server to work, but I'm not sure how to use app.use. I have the package.json file and npm set up correctly.

https://replit.com/@MushyAvocado/online-game2#index.js

CoderGautamYT

Alright, can you invite me to it? @MushyAvocado

MushyAvocado

@CoderGautamYT OK, I invited you. You can message me, but if I'm not online just comment out my wrong code and put in new code with an explanation. That would be very helpful :)

CoderGautamYT
MushyAvocado

@CoderGautamYT Thanks for fixing it! I could've sworn I tried that, but I guess not lol.

CoderGautamYT

Your welcome, I did it in school during lunch while eating a sandwhich lol. @MushyAvocado

MushyAvocado
CoderGautamYT
CyberHacker101

you really tried hard to kill didnt ye? xDD @ruiwenge2

CoderGautamYT
ruiwenge2

@CyberHacker101 lol i was just bored

CyberHacker101

same

i bet you wont even get to touch me xD @ruiwenge2

CyberHacker101

Awesome game
You should change space bar to attack thru @CoderGautamYT

CoderGautamYT

That's on my todo list, will add after kajam @CyberHacker101

CyberHacker101
CoderGautamYT

Thanks! :D I'm happy everything is sorted out. @CyberHacker101

CyberHacker101

You got your 60th updoot ;D @CoderGautamYT

CoderGautamYT

Tysm!!! <3 @CyberHacker101

CyberHacker101
Coder100

nice!

CoderGautamYT

thanks! you helped me a lot lol @Coder100

ruiwenge2

YES

CoderGautamYT

you were s? lol i saw you @ruiwenge2

ruiwenge2

@CoderGautamYT yes i was lol

SomeBoyPlayz

This is like yohoho.io :)

PeweAtBomoAds

Yes but it is with real people so more fun @SomeBoyPlayz

SomeBoyPlayz

@PeweAtBomoAds yohoho.io has real people

CoderGautamYT

actually it doesnt, (try joining a game and disconecting from wifi) @SomeBoyPlayz

PeweAtBomoAds
Pewincodes42

Wow! How did you do this?

CoderGautamYT

thx i used node, phaser and socketio @Pewincodes42

NancyShannon

your game share is very good, i have tried it and love it, now i have more good games to change with https://drifthunters.online

CoderGautamYT

@NancyShannon what uh ok?

fishers14

Nice! I always get the sedated agent around when I kill someone and I am not even able to move lol
I always kill over 10 bots before I die because of the 5th sedated ai I verse is quite strong 💪

CoderGautamYT

Haha nice @fishers14

CoderGautamYT

I’m trying to fix the ai but nice you can kill [email protected]

sedated

@fishers14 Stop the cap LMAO, the bot doesn't even work anymore, I've abandoned the project.

CoderGautamYT

lmao @sedated

fishers14

@sedated I’m not saying ur responsible cause I know that u have stopped. But then why are there bots…?

CoderGautamYT

People copied his code and made bots that bypass my anticheat. @fishers14

fishers14
CoderGautamYT
AnaNolan

Can anyone join and play this game? Give me updates if possible. Thank you so much!

NarmakTwo

@AnaNolan Yes, anyone can join and play this game

CoderGautamYT
Baconman321

maybe make a reload time for clicking, because at this point it's a competition for who has the fastest autoclicker.

CoderGautamYT

yeah, there already is a limit of 7 cps, i should probably lower it. @Baconman321

Baconman321

@CoderGautamYT Someone named Blah prob used an autoclicker (or, like me, just clicks REALLY fast).

The problem is that, when you get bigger it is harder to attack them. Maybe make the small ones significantly faster (or the big ones significantly slower), because they are only vulnerale if you get close, and if they spam clicks you can't do that.

LOL I somehow got stuck in one of the players prob using an autoclicker. He was 3k and I turned on my autoclicker. He left before he died... typical XD

CoderGautamYT
NarmakTwo

Yo this thing has so many comments and now it has 1 more XD

CoderGautamYT
JOELSHAJI1

game not working
this is coming when i try to join

You have been kicked for not joining. This is likely due to slow wifi or a hack.

i dont use bots and this is my first time doing sword.ion and i have a good wifi

CoderGautamYT

Ok let me see if I can fix that, a lot of people are having this issue. @JOELSHAJI1

CoderGautamYT

I fixed it, try to join now. @JOELSHAJI1

ArwenYoung

This is awesome, and really smooth.

CoderGautamYT

Thanks! @ArwenYoung

daCynicalbOi

My personal record

CoderGautamYT

Nice job! The recent highest was 3000. @daCynicalbOi

daCynicalbOi

@CoderGautamYT Damn thats a lot of coins

CoderGautamYT

yup- that dude was playing for hours. @daCynicalbOi

hx55xn-in1t

@CoderGautamYT well done