RPG Game NodeJS

So recently I’ve created this thread: http://forum.freecodecamp.org/t/is-this-worth-it-php-game/230942

Long story short I started making this game using Laravel but lost motivation. After somewhere half year few people gave me motivation to finish this game and I’ve made it with NodeJS and socket.io

You can check this out here: https://mystery-of-dungeons.herokuapp.com/

It’s probably unlimited possibilities how can I improve this game. But be real it’s really tedious to create this kind of game all alone atleast for me. So I hope you will like it! :slight_smile: It’s the first time I’ve created a game. :slight_smile:

5 Likes

Love it. Just cant play Offline for maintenance. Pls fix it and i want to do my first battle!

1 Like

Sorry someone just managed to do some kind of injection and find a way to get how much gold he wants. So I’m searching for solution… at the moment… Don’t know how it’s possible to change the js code itself in the game

Haha now I know he was running function in console in chrome tools. But I don’t get it how to prevent that?

1 Like

Sounds bad. I think there is no way to prevent commands from console. :frowning: Need to figure out somehow like do it in NODE JS side so the user cant inject how to add gold.

1 Like

So I just tweaked a little bit of code and made gold, exp etc on serverside more than it was before. Go try it out now: https://mystery-of-dungeons.herokuapp.com

2 Likes

Well is awesome start! But offline again :slight_smile: But dont worry somehow you will figure out as you made it!

1 Like

Bring your game back online mate!

1 Like

I’m at my job currently. Need to fix a little bit of code and I’ll release it. :slight_smile:

1 Like

Do you need a hand with fixing it?

1 Like

+1

If you are keen to make it open source and put a repo on github, I would likely make some contributions

1 Like

Now it’s less cheatable but can’t figure out how to prevent socket emits per second. Let’s say if user in fight sends more than 20 emits of attacking another user per second than like freeze account for 5 min or show some captcha.

1 Like

I want to give it a try. Please make it online

2 Likes

It will be soon probably :slight_smile: Don’t have much time because I have a full time job :slight_smile:

1 Like

it would be nice if you could leave the game live.

Then you can clear the leaderboards to give everyone a fair start once you have fixed the bugs :slight_smile:

2 Likes

https://mystery-of-dungeons.herokuapp.com/game ok it’s live again for testing :slight_smile: Also probably will change website theme to more stylish in the future :slight_smile:

1 Like

It looks awesome friend :smiley: Are you planning to keep updating the game?

1 Like

Yeah probably. Will shut it down later. And change all the styles to make it non classic but more todays version. Also will add guilds, forum etc

1 Like

Hey there! I haven’t posted here in ages, but here it comes!
@MadIce In essence the server / app should be the only source of truth for the game core functionality and any resources that the players are to own.
As for the solution to limiting the number or requests I think you can rate limit by the number of triggers per any given timeframe on the server as well. You can run your sockets almost like a middleware on node where you return if the current player shouldn’t be able to take any actions.

In essence all the game logic should run on the server.

A relatively easy way of preventing unfair socket flooding without kicking the player is implementing a Finite state machine, eg. each character has several states say [‘ready’, ‘resting’] to simplify. For each attach you check the condition on the server - which is the only source of truth and voila - even if someone sends a 100 requests you can just kindly reply not to cheat, or even punish them!

So, if there is some reward generation - do it on the server.
If there is some damage calculation - do it on the server.
And so on and so forth! : )

Put it back live, I would love to check it out!: )

1 Like

Hey @jadczakd TY for reply! I made a little different approach with attacking. At first when user finds another user to fight there is new temporary fight created in database. And in that collection can’t be more than one the same user at the time. So you always have to pick user at first to start a fight. :slight_smile: Also added that after attack there’s one second delay and then you can attack again. And yeah everything is now in on serverside :wink: Just fixing few more bugs and I’ll run it again :slight_smile:

1 Like

https://mysteriousdungeons.herokuapp.com/game game is alive again :slight_smile:

1 Like