Giter Club home page Giter Club logo

blobsgame's Introduction

blobs game

This repository contains the source code of the browser game "blobs"
Note: This game is still in development. It may not work yet.

There is currently a rewrite going on. The code that is running on production can be found under the master branch. Any pull requests depending on that branch will be ignored.

Selfhosting notes

If you plan on hosting this on your own, you will need to compile the source code using the Go compiler. The frontend part of the game is written in TypeScript, so you will also need to install TypeScript to transpile it.
For convenience, we've written a Makefile which you can use to compile everything that's required.

$ make all

What is this?

A: Blobs is a work-in-progress multiplayer game that involves blob characters (you may know these from Android) that “nom” players in order to gain blob rating, which shows how skilled you are at the game.

Where can I play this game?

A: As stated above, this game is still a WIP and may not work yet. Its interface (login, registration and main menu) does exist and can be accessed through the internet by anybody and all other pages should work well, means that you can register and login without any problems. The game should work fine, too, but there is not much yet.

Any ETA when this game is ready?

A: The game is playable, but it's lacking features. We are working on it to get it done as soon as possible. We do not know when this game is ready, but you can expect the first version to be ready in 2019.

Can I donate for this project?

A: No, there is no way to donate for now. Thank you for caring.

I found a bug, where/how do I submit it?

A: There are plenty of ways to submit issues/bugs. The best one is to create an issue on this repository by clicking the "Issues" tab at the top of this page or here. We will get to it as fast as possible.

blobsgame's People

Contributors

codacy-badger avatar invoxiplaygames avatar nightcaat avatar y21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

blobsgame's Issues

Session identifiers don't expire

Session IDs (shorthand for session identifiers) should expire after 15 minutes, because - for sure - there will be some people who accidentally share their session ids (by copy-pasting the url maybe (?)).
Another idea would be that session ids expire once someone logs in with them (which should directly happen when logging in) but also store them in a map or in an array so that the user can still use it as long as they don't disconnect. We should also delete the session id/socket id pair from array/map once the disconnect event gets emitted.

Mobile Controller Buttons

Is your feature request related to a problem? Please describe.
The game is completely unplayable on mobile.

Describe the solution you'd like
I want there to be four directional buttons in the bottom-left corner, and the nom button in the bottom-right corner.

Proposal for blobs.io

Hello! @blobs-io

I'm a graphic designer and I like to support your project because I believe a good logo that reflects your project at its best can help the project publicity and trustability, also i'm an open source enthusiast. I would like to design a logo for your project if you interested, I will be happy to work with you! :)

Best Regards

Leonardo Deroy

Graphic Designer

Don't emit blob coordinates every few milliseconds

Is your feature request related to a problem? Please describe.
It is heavily inefficient to emit the blob coordinates every few milliseconds and also causes the webserver to be slow and take lots of RAM + data for the client. It should not be a problem, but once there are 10 or more people playing, it could lead to issues.

Describe the solution you'd like
Instead the client should only emit when the blob changes its direction. This should decrease the amount of requests by far.
When implementing this, we will need to let the server keep track of the amount of pixels the blob has moved in a different way than updating the coordinates on each request. It would also terminate a lot of ways to cheat (if the client does not do any of those calculations).

Implement function for better prompts

Is your feature request related to a problem? Please describe.
The default prompt() function does not really fit into the design of blobs.io as it relies on the browser and also there's only a text box so can't input more than that.

Describe the solution you'd like
Instead it would be cool if we had a function that adds a centered HTML element that overrides all other HTML elements (z-index).

Username is case-sensitive

I can't log in as "nightcat" and I assume that someone would be able to register as "nightcat" so please fix that!

Track travelled distance

Is your feature request related to a problem? Please describe.

The "distance travelled" label in the main menu is just a placeholder in its current state and the game actually does not track the pixels you moved.

Describe the solution you'd like

The server should count the pixels you move, but instead of updating the database every pixel (which would be very inefficient and bad) it should update every 100 pixels. SQLites integer type has a limit and since the distance could get very high, we should rather divide it by 1000 before storing.

Not enough ways to get blobcoins

Is your feature request related to a problem? Please describe.
The only way to gain blobcoins is by requesting the daily reward, which only gives 20 blobcoins.

Describe the solution you'd like
There should be more ways to get blobcoins:

  • Nomming others (reward depends on whether the opponents' tier is lower/higher)
  • Hiding behind Y walls for X seconds (small reward, 5 for every 20 times?)
  • Move Z pixels (for every 10K = 75?)

Describe alternatives you've considered

  • Reward less/more blobcoins for the daily bonus.

Handle disconnect event properly

Describe the bug
Disconnects happen quite often in a short time and it could become annoying.

To Reproduce
Steps to reproduce the behavior:

  1. Login
  2. Have a bad connection and wait for it to disconnect

Expected behavior
It should try to reconnect to the server.

Lick my paws!

I want my paws licked. After all, I'm a night cat.

Nom-safe area in maps

Is your feature request related to a problem? Please describe.
Besides hiding behind walls (which is not implemented yet) there is no safe place where people can't nom you.

Describe the solution you'd like
If you just want to mess around or need to be AFK for a short time it would be great to have an area (or an object in maps) where nomming is disabled. It might be a bad idea because it would even be easier to escape from others but keep in mind that if you disconnect, nothing will happen either, so people would rather disconnect from the game than "running" away.

Describe alternatives you've considered

  • Limit the maximum time a user can be in such an area.

Optimize guest handling

Describe the bug
There's pretty much no reason to play as a guest since you can't nom other people nor can you get nommed.

To Reproduce
Steps to reproduce the behavior:

  1. Hit "Play as a guest"
  2. Try to nom someone
  3. Nothing happens

Expected behavior
We should remove the BR label next to the name so that they don't have BR. They, however, should be able to nom other blobs but opponents shouldn't lose anything.

Set default BR value higher than 0

Is your feature request related to a problem? Please describe.
Currently the default BR value (blob rating you start with) is 0 and it would take way too long to get to silver even if you are very good at the game.

Describe the solution you'd like
Let users start with 1000 BR so if you're good enough you can easily get to silver with a few noms.

Describe alternatives you've considered
We could set the default BR lower or higher than 1000, but 0 is definitely too low.

Guests don’t show up in ‘x online’

Describe the bug
When a guest is playing, they don’t count in the “x online” on the login page.

To Reproduce
Steps to reproduce the behavior:

  1. Go to http://blobs-io.glitch.me/login/
  2. Click on “Play as guest” to start playing
  3. Go to http://blobs-io.glitch.me/login/ on a new tab or another device
  4. The “x online” will be the same

Expected behavior
When a guest is playing, the “x online” counter should increase by 1.

Smartphone (please complete the following information):

  • Device: iPhone X
  • OS: iOS 11.2.1
  • Browser: DuckDuckGo Privacy Browser
  • Version: 7.12.0 (uses WebKit 604.4.7)

Show nom "history" for recent noms

Is your feature request related to a problem? Please describe.
There's no way to see if and when someone got nommed.

Describe the solution you'd like
I want some sort of box to be in the top left corner that shows the last x noms in that room. It should include BR of both blobs, usernames and when the target got nommed. Wouldn't it be great to give attention to people who nom other ones?

Describe alternatives you've considered

  • Only show recent noms that happened since the user joined the room

No linebreaks for users in leaderboard

Describe the bug
It looks like there are no linebreaks after each user entry in the leaderboard.

To Reproduce
Steps to reproduce the behavior:

  1. Click 'Play as a guest' or login and hit 'Play' in main menu
  2. Open another tab and join FFA

Expected behavior
There should be a linebreak after every user.

Screenshots
2018-12-02-145441_1680x1050_scrot
(Excuse the command prompt on the bottom right)

Desktop:

  • OS: Raspbian (Kernel: 4.14)
  • Browser: Raspbian Chromium/65.0.3325.181
  • User Agent: Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Raspbian Chromium/65.0.3325.181 Chrome/65.0.3325.181 Safari/537.36
  • Version: 65.0.3325.181

Smartphone:

  • Device: Samsung Galaxy S4
  • OS: Android 5.0.1
  • Browser: Google Chrome
  • Version: 70.0.3538.110

Vectorize blobs

Vectorizing the blobs would make the game look quite better, especially if the blob intends to get scaled at some point. After doing a lot of tests, Vector Magic seems to be the only software that is able to properly vectorize the blob with absolutely no issues. However, contrary to popular belief, the best things in life aren’t free, and Vector Magic is no exception, costing $9.95/month and $295 for a one time charge. You would think that you should just purchase the monthly plan, but this game is still in development and more blobs are going to be added as time goes on.

Missing "source" button

A button that redirects to the blob source page was added a while ago but for some reason it's gone? Maybe a contributor removed it.

Server sometimes spawns blob in negative coordinates

Describe the bug
Sometimes you spawn or are able to move to negative coordinates.
To Reproduce
Steps to reproduce the behavior:

  1. Login into the game
  2. Click on Multiplayer
  3. Get nommed

Expected behavior
You should spawn somewhere in the actual playing area.

Screenshots
image

Blurple Blobs

Is your feature request related to a problem? Please describe.
Blobs are cute and all, but how about we add blurple blobs too?

Describe the solution you'd like
When purchasing blob skins from the shop, there is a 1/1452 chance that it will be a blurple blob skin instead. This is permanent.
For team modes, we're just gonna have red, blue, yellow, and green blobs instead of yellow vs. blurple blobs.

Describe alternatives you've considered

  1. When you spawn, there's a 1/1452 chance that your blob will spawn as a blurple blob in FFA. As long as there is at least one blurple blob in the room, blurple brick walls for blurple blobs to hide behind will appear.
  2. Blurple blob skin variants can be purchased at 4x the price.

Additional context
We're gonna need to make a lot of blurple blobs in the future...

Singleplayer mode

Is your feature request related to a problem? Please describe.
You can only play multiplayer with other people at the moment and since there are not many people playing (or even knowing) the game, it gets boring and really hard to gain BR (blob rating).

Describe the solution you'd like
Having a singleplayer mode where you play against AIs could fix this problem.
The skill level of AIs should rely on its blob rating, means that if their blob rating is let's say at 9000, they should have good strategies and should nom faster than if they were at 1000.

Blob Abilities

Is your feature request related to a problem? Please describe.
Blobs can't do much. Right now, they can only nom other blobs. They're also planned to be able to hide and peek out of brick walls to charge a speed boost, but that doesn't add too much to the game.

Describe the solution you'd like
Blobs should have abilities. There would be two types of abilities: blob abilities without a cooldown and are automatic, called passive abilities, and blob abilities with a cooldown and are triggered on use (like with a
button or a key), called user abilities.

For example, blobowo's passive ability could be that it doesn't have to wait as long to leave a brick wall after peeking out of it, because it's the blob that appears in blobpeek. Some blobs could also have teamwork abilities in team modes; for example, what if blobreach and blobpats make each other invulnerable for a few seconds by standing next to each other because they're being comforted?

Blurple variants of blobs (if they're added [#31]) would have an additional passive ability in non-team modes, where brick walls change to a blurple color as long as they're hiding behind them.

Describe alternatives you've considered
We could give all blobs a full moveset of abilities instead of giving certain blobs certain abilities.

Proper loading screen

Is your feature request related to a problem? Please describe.
Obviously socket.io takes some time to connect to the server and since member data of the BlobObj instance ownBlob isn't set, it prints "undefined" as player name.

Describe the solution you'd like
Instead it should display a loading screen and show the canvas when it's connected.

Add CSS and rich preview tags to the sources page

The sources page is missing CSS, rich preview tags, and a favicon. This makes the page look bland.
image
Adding CSS and rich preview tags would make the page fit in better with the other pages on the website.
Additionally, partyblob's width and height should be changed to 30 to match the other blob images on the page.

Let tooltip slide out to the left when hovering over nom button (desktop-only)

Is your feature request related to a problem? Please describe.

Kaiser Yesterday at 10:13 PM
when you hover over the blob button, the button grows and this slides out to the left

Basically what should happen is when you hover over the nom button in the bottom right, a small box should appear with an animation with caption Press "N" to nom! (as you can see in the screenshot below).

Describe alternatives you've considered

  • Maybe only let the nom button grow when hovering over it?

Additional context
Here's how it should look like at the end (picture by Kaiser):
unknown

Don't abuse WebKit by modifying div#leaderboard every few milliseconds

Is your feature request related to a problem? Please describe.
Right now the game sets the inner HTML of div#leaderboard to "" (empty string) and readds all users to it which is very ineffective.

Describe the solution you'd like
Instead it should only update itself if:

  1. A blob entered/left the game (would end up in inserting the user into the leaderboard)
  2. A blob nommed another one (would change BR of both opponent and blob who nommed)

Describe alternatives you've considered

  • Don't remove its content and re-append all child elements but only change the affected blobs.

Additional context
priority: high label because it causes bad devices not being able to play the game (e.g. my Raspberry Pi) because of the lag.

Unclutter the News section

Is your feature request related to a problem? Please describe.
The only news on the page currently takes up a lot of space.
cluttered news

Describe the solution you'd like
Add an unordered list that contains links to the news. This could just be a popup or take you to another page.

Describe alternatives you've considered
You could move the news into a button that displays a popup with all of the news.

Additional context
uncluttered news

executeSQL API logging

Is your feature request related to a problem? Please describe.
When querying SQL statements using the main menu there is no way to re-track who did that.

Describe the solution you'd like
There should be a file where the server appends a line including information about the query.

Describe alternatives you've considered
A dedicated table in database but you could theoretically modify the table.

Dedicated route and subdirectory for API

For now there is only one endpoint for the API (/ffap) which gives an array of users (blobs) that are connected to FFA. It would probably be better to change it to /api/ffa/users or similar and having it in a dedicated subdirectory instead of somewhere in the server.js file.

success-notif element doesn't show

File: register/index.html / sockets.js

When the failure-notif element (child of auth element) exists (for example if the username already exists) and the user then successfully creates an account, the success-notif element wont show up.

Custom rooms

Is your feature request related to a problem? Please describe.
Right now there is only one room/gamemode: FFA. There is no real way to only play with friends, you will always end up in the same room and there will always be other players.

Describe the solution you'd like
I would like to let users be able to join rooms by using a GET parameter (?gameid). If a room with that ID does not exist, it will be created.
In the main menu we could add a button that allows users to create rooms or join a specific one or a random one. If no gameid GET parameter was provided, they will end in a "main" room.

Describe alternatives you've considered

  • Limit rooms so there can't be tons of rooms which could potentially kill the server.

Additional context
Other .io games have a similar feature which you may recognize as a "party". It's a special room where you can play with other people you know.

Giveaway System

Is your feature request related to a problem? Please describe.
The news feed could be lacking in content sometimes. A giveaway system would be perfect for getting player retention and populating the news section.

Describe the solution you'd like
Once every week, a giveaway will be created that will give away coins, blobs, and more to a set amount of players. Players can enter by pressing an "Enter Giveaway" button on the same article. (Example: Random Blurple Blob and 1000 blob-coins giveaway with 3 winners.)

Describe alternatives you've considered

  1. It could be done daily or monthly.
  2. It could have a separate section for it on the main menu.
  3. The giveaways could be entered by RT'ing a post on the Blobs.io twitter account.

Use transitions instead of :hover (css)

Describe the bug
The animations in the main menu are nice, but once your mouse leaves the button, the element will jump to its default rules.

To Reproduce
Steps to reproduce the behavior:

  1. Login
  2. Hover over any button that has animations
  3. Leave it with your mouse

Expected behavior
It shouldn't immediately "jump" to its previous rules but have an animation.

Screenshots
image

Tier additions/changes

Is your feature request related to a problem? Please describe.
Recently we had a conversation on the Discord server regarding another Tier and a Tier name update. By comparing Silver to other Tiers you'll notice that it's very hard to pass. Other Tiers have a range between 1.5K and 2K BR but Silver is from 1499 BR to 4999 BR. Also the "Master" Tier seems to sound a bit off since all other Tiers are based on materials.

fresh kitty Today at 8:26 PM
master seems out of place

Describe the solution you'd like
Another Tier between Silver and Gold: Platinum (3000 BR - 4999 BR)
It would only affect BR values of Silver (1499-4999 -> 1499-2999).
We could rename Master to Jadeite.

Describe alternatives you've considered

  • Rename Master Tier to Painite (idea by fresh kitty)

API documentation

Is your feature request related to a problem? Please describe.
API endpoints/HTTP methods are not explained anywhere and the only way to find out is by checking the source code of the API (also undocumented).

Describe the solution you'd like
We should add a simple page explaining all endpoints and its GET parameters / POST data / headers and whatsoever.
Also I want it to be automated, so we would need to store each endpoints' information. Adding a static getter to each module that returns an object with required information should do its job.

Describe alternatives you've considered

  • Document manually by hand

Clans

Is your feature request related to a problem? Please describe.
blobs.io is (unsurprisingly) an online game that involves competition. But being a lonely blob isn't fun.

Describe the solution you'd like
Clans are a solution that encourages more competition without ruining the game.

Clans have two settings: invite only and free to join.

  • In an invite only clan, you need to be invited by the clan owner or someone with invitation permissions.
  • In a free to join clan, anyone can join.

Clans also have a permissions system.

  • Whoever owns the clan has permission to promote, demote, kick, ban, and invite users.
  • Co-owners (determined by the owner) also have these permissions.
    You can also “mark” any user that’s below you. It’s up to the clan to decide what the mark is for- only for the best players, IRL friends, that sort of stuff.

Clan names can be up to 20 characters. This is used as the full name of the clan. Clan tags can be up to 4 characters and appear in-game before the player's name.

Describe alternatives you've considered
Well, we could always just let the game die out instead.

News section goes past border

Describe the bug
The text in the news section is longer than the actual box and goes through it, which looks bad.

To Reproduce
Steps to reproduce the behavior:

  1. Login
  2. Look at the top right

Expected behavior
Text should break once it reaches the white border.

Screenshots
image

Device doesn't matter, it happens on every device where it is shown.

Implement the InstantClick library

InstantClick is a JavaScript library that dramatically speeds up your website, making navigation effectively instant in most cases.
Latency is inevitable with today’s internet architecture, so InstantClick cheats by preloading links you are likely to click on.
You can view its repository here.

This would be helpful because it means that the loading page would be seen less often, and obviously make navigation faster.

Maps and object system

Is your feature request related to a problem? Please describe.
The "game" (which consists of only one gamemode right now) looks empty without "objects".

Describe the solution you'd like
We should add objects that you (may) interact with:

  • Brick walls (interacting ends up in hiding behind them which charges a boost)
  • Nom-free area (? #54)
  • Items (speed, invincibility, ...)
    Items should occur at random positions and shouldn't be fixed; will disappear after time.
    We also need a system for different maps and a map editor. They should be stored in a dedicated folder ("./maps/").
    Maps differ by having fixed objects (like walls) at different positions.

API endpoint to get information about a specific user

Is your feature request related to a problem? Please describe.
When sending a request to /api/players it only gives you the top 25 players (ordered by BR value), so if you want to get information about a specific player and they aren't in there, you won't get what you need.

Describe the solution you'd like
Sending a GET request to /api/player/{player.username} returns an object with information like BR, account creating etc.

Additional context
This is needed for the bot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.