Code Monkey home page Code Monkey logo

speedblocks's Introduction

SpeedBlocks

This game tries to be the unofficial successor of Cultris II since the development of this awesome game seems to be dead for many years. If you want to help us, please read the "How to contribute" section below.

Requirements

  • SFML Version 2.4.2 is used by this project and it's highly recommended not to use an older version.

  • TGUI Version 0.7.4 or a higher 0.7.x version is required.

  • curl

  • cmake This project is using cmake as a build system.

Remarks

The ResourcePath.mm/hpp is only for Mac builds to be able to access the game resources. Window/Linux uses EmptyResourcePath.h/cpp to replace it with a NULL function to make source able to compile as-is on any OS.

Building

Please see the Wiki for additional instructions.

How to contribute

Please read the following before you start working on something.

  • If you are willing to contribute to this project but you don't have an idea where to start, have a look at the issue tracker.

  • An issue which is labeled with "help wanted" either needs your opinion or an implementation/fix.

  • Our line endings are linux style. Please configure your editor or git to respect these. We won't merge pull requests with windows style line breaks.

  • If you start writing code for a specific issue it is a good idea to mention this in the issue so that other contributors can see that you are working on this.

  • If you are implementing a new feature, please create a new branch for this. If you don't do this, it is possible that we won't merge this.

  • All ongoing development is done in the develop branch and will be merged into master when it's stable.

  • If you need help with some implementation details, feel free to ask by opening a new issue. But please note that we can not give support for vendor specific questions like "how to use library X" or basic questions about c++.

  • It is also a moving target to increase the code quality of this project so any help in refactoring code to make it more readable and maintainable is very appreciated.

Server

You can find the server here

The server is running on a VPS in Stockholm. To play with an account sign up on the forum and use the username and password in the game client.

Donation

We are currently collecting money for a VPS server solution. This costs around €50-100 per year.

Donate

speedblocks's People

Contributors

chinatsu avatar kroyee avatar noir- avatar rmcat avatar texus avatar v0ltumna avatar zyphdoz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

speedblocks's Issues

[FN][Network] Timeout not working for non responding adresses

Steps to reproduce

  1. Enter for example 1.2.3.4 as IP adress
  2. Click on Join

Expected result

Game gives a message that we was unable to connect

Actual result

Game hangs

Code that is probably affected ( debugged it )
sf::Socket::Status status = tcpSock.connect(serverAdd, tcpPort); will retry forever

network.cpp

sf::Socket::Status network::connect() {
tcpSock.setBlocking(true);
sf::Socket::Status status = tcpSock.connect(serverAdd, tcpPort);
tcpSock.setBlocking(false);
return status;
}

[TN] Ghost user problem

Watch the video: https://youtu.be/PrDhoIEQvaM
Apparently the server didn't notice that sicknote got kicked (that's why sicknote's field is empty and sick did relogin). This can bee seen at the beginning of the video.

Furthermore the server doesn't recognize that sick left the game. This is noticable at the beginning of the video. This can bee seen at the end of the video.

Execution failes on Linux

Hi!

I managed to successfully build the executable with the following steps:

Cloning my fork

git clone https://github.com/Noir-/SpeedBlocks.git

Grabbing, extracting SFML

http://www.sfml-dev.org/files/SFML-2.4.2-linux-gcc-64-bit.tar.gz && tar xf SFML-2.4.2-linux-gcc-64-bit.tar.gz

Grabbing, extracting Boost (This step is not really reproducible because of fucked up URL and filename)

wget https://downloads.sourceforge.net/project/boost/boost/1.63.0/boost_1_63_0.tar.bz2?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2F%3Fsource%3Dtyp_redirect&ts=1489832574&use_mirror=netcologne boost_1_63_1.tar.bz2 && tar xf boost_1_63_0.tar.bz2\?r\=https\:%2F%2Fsourceforge.net%2Fprojects%2Fboost%2F\?source\=typ_redirect boost_1_63_0.tar.bz2

Grabbing, extracting TGUI

https://github.com/texus/TGUI/archive/0.7.3.zip && unzip 0.7.3.zip

Building TGUI

env SFML_ROOT=../SFML-2.4.2 cmake ./

Then I modified the Makefile to fix includes and linking like this (Quick & dirty search & replace):
https://gist.github.com/Noir-/636890e01646a8a485920ecacc88c9ab

Building succeeds.

As last step I added the shared library locations to LD_LIBRARY_PATH
LD_LIBRARY_PATH="TGUI-0.7.3/lib/;SFML-2.4.2/lib/" && export LD_LIBRARY_PATH

Now when I try ./sfml i get the following error:

loadOptions failed, setting default options
terminate called after throwing an instance of 'std::regex_error'
what(): regex_error
Aborted (core dumped)

Before I start digging deeper into this issue I just wanted to know if I did anything wrong.


Here are some system specs just in case:

uname -a
Linux noir-workstation 4.4.49-16-default SMP Sun Feb 19 17:40:35 UTC 2017 (70e9954) x86_64 x86_64 x86_64 GNU/Linux

g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.8/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.8 --enable-ssp --disable-libssp --disable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --enable-linker-build-id --enable-linux-futex --program-suffix=-4.8 --without-system-libunwind --with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux
Thread model: posix
gcc version 4.8.5 (SUSE Linux)`

[Discussion] Usage of SFML

I want to know: What leads to the decision that SFML is used in this project?


Disclaimer: Please don't hate me, questioning things is part of my job and my life philosophy. :x I also cant appreciate enough supers engagement to actually DO something while it seems that he has the exact same vision of the next gen Cultris that I have.

The background:
For me it seems like there are not that much games developed in SFML while TGUI seems to be a One-Man-Show at the moment. When I'm looking at the history of the Cultris II project, the used libraries are a important factor which leads to the current state of the project. In particular, some features like multi-byte input support for your Asian friends could not be implemented without a major version change of LWJGL. Apparently this would have broken a lot of code so Simon was not willing to do it. In my opinion this had impact on the user base of Cultris II. This led me to the question how much we can rely on these relatively small projects. Also, couldn't we make our life easier by using a game engine? At this point I realized that I need to know why SFML was chosen. I could imagine that super already thought about such things.

[BUG] Multiple equal guest names are possible

Steps to reproduce:

start multiple games and connect to the server with the same guest name

Expected result:
Notification that the name is already taken so that the user has to change it
or
automatically adding a counter at the end of the guest name

Actual Result

The same guest name can be used several times, so that distinguishing players is impossible especially in the chat

Re-entering training does not restart the mode after a game over

Steps to reproduce:

  1. Go into training
  2. Lose on purpose
  3. Exit training mode
  4. Enter training mode again

Expected result:
The game mode starts

Actual result:
Game over screen

You can keep exiting the mode and re-enter, it will keep telling you game over. It is possible to play again if enter is pressed on the game over screen, as per normal current behaviour.

[FN] Randomizer starting with Z or S piece

I believe in the end this will be up to the discretion of super but in c2 it is impossible to start any game with a Z or S piece. This is only for the first piece and seems to function in isolation for the rest of the randomizer.

I am not sure if you would like this implemented in SpeedBlocks, but seeing as its a cultris clone, I thought I would bring it up.

TODO list

  • Make code generic for Windows/Mac/Linux
  • Implement ranking for players with "Hero rank"
  • Set up webhost for the forum/ranking

Make the code generic
With regards to MacOS finding the right path to resources a resourcePath() function has been implemented to deal with it. Compiling under Windows or Linux gives a NULL function to replace it.
Added alternative to to_string() and stoi() for MingW users. Compiling with other compiler uses standard functions.
This is considered complete as of now.

Implement ranking for players with "Hero rank"
Ranking system is divided in 2 part, first you rank up from 25 to 1 and last Hero Rank. As of now that part works. To be added is ELO ranking between players who has reached Hero Rank.

Set up webhost for the forum/ranking
A webhost that can host the forum and the ranking stats. Forum to be used is SMF. Ideally the host will also have the game-server running on it.

[Discussion] Server Architecture

I'm moving the discussion about architecture from #27 to here.
The idea is to have multiple services which are handling different aspects of the game functionality like game logic, authentication, ranking etc. This shall prevent coupling the game with community functions to make them easy exchangeable and extendable in the future.

A first draft of the architecture for a better understanding is attached to this post.
speedblocks_deployment

[FN] Crash / Strange behavior of the UI while playing online / going back

Steps to reproduce

  1. Start the game and put 83.254.154.180 in the Server IP
  2. Choose no name and enter some mode - leave reenter another , play a bit
  3. disconnect and login as user now
  4. choose some lobby / leave

Note: Latest build is done - i did clean and completely rebuild it.

Expected result

No crash (did not happen the second time now)
UI is robust.

Actual result

At first it crashed, second it gives me no option to play anymore...

URL

https://youtu.be/w2lWPt8GaIc

[FN] If Fullscreen and Screen Resolution to high - > Game is inaccessible

Steps to reproduce

  1. Make sure you have a very high Screen Resolution (in my case i use the DSR factors)
  2. Tick Fullscreen
  3. Click Apply
  4. Open Cultris II Fullscreen Game with another resolution than the game has
  5. Alt Tab to the game

Expected result

I can set options use the sliders and so on

Actual result

I need very large distance in order to change settings.
Users who have DSR Factors activated can't set another settings properly.

[BUG] Weird afk/not afk behaviour

Please watch the video: https://youtu.be/L8C6xtTaL_Y

Pay attention to the drawing of the playfield (old piece is shown, "game over" and "away" in different ways)
Also the timer behaves wierd.

Steps to reproduce:
Play alone online and press F4 then drop the piece and press F4 again

Desired behaviour:
1.Press F4->"away" and "game over" should be presented
2.Press F4 again->field should be instantly clear with the timer starting with 3
3.Press F4 for going afk again->1. starts

[DISCUSSION][NEW FEATURE]Costumizable gridlines of the playfield

Hey guys, what do you think about having the option for costumizing the gridlines of the background.(regarding horizontal lines so one can subdevide his own playfield into visual parts)
DEF said, therefore the field background image should be generated.

[UX]Indicate that an opponent is afk

Steps to reproduce:
Play online ffa vs. an opponent and let the opponent go afk.

Desired behaviour
Either the playfield shows a message that this player is afk
or his playfield is hidden (preferred).

Actual behaviour
The playfield of the opponent is empty (so that the player isn't able to say if the game is going to start or the player is afk)

[Discussion] Ranking system

My ideas for the ranking system is to make something similar to Hearthstone, it works like this:

All players start with a ranking of 25. Every game the player gets an adjustment to his/hes points depending on performance. If the player reaches 1000 points, rank goes down by 1. If the player reaches -1000 points, rank goes up by one (not higher then 25). In both cases points are reset to 0.

For each rank gained the amounts of points gained or lost is modified by a factor of 0.x to effectively make the span longer between higher rank. Climbing from 1 to 0 requires 5 times the amount of points then climbing from 25 to 24, the same goes for falling back down to 2.

When a player reaches 0, they get Hero rank. Once you reach Hero rank you can not fall back down to 1. In addition to this you also get access to a Hero room where you can play against other player of Hero rank. Here ELO is implemented (or something else) to determine an exact ranking between the players.

The first day of the month, the ranking would reset and give way for a new monthly season.
The result from each season would then be used to give you a rating for the whole year, and possibly a lifetime span aswell.

I have made an algorithm for the first stage, ranking from 25 to 0, and ran it through some simple simulations to adjust it a bit. It's not very well commented, but you can see it here.

I could also note that a player of Hero ranking can still play with everyone else, but he would then be treated as a guest. Meaning that he would not gain or loose any points and his position would be irrelevant to the other players points adjustments.

That's my idea.

[UX]Add feature - "X won the previous round"

It is currently hard to tell who won the previous round. In fact when two players are near the top of their field and one wins - its almost impossible to tell which one of them one.

A simple write to the chat for the room would resolve this. or drawing a graphic on the game field

[UX]Behavior of the chat history

Steps to repoduce:
Login and then write something in the chat and relogin again.

Expected result (when manually logged off)
The history of the chat was cleared.

Actual result (when manually logged off)
The historical chat is still shown in the chat

For Discussion:
Maybe having the chat not cleared under certain cirqumstances isn't that bad.
For example after a disconnection.

Idea:
Having the chat cleared when the user does a relogin after a certain amount of time.

[UX]Observing the other playfields first possible after joining the round

Steps to reproduce:
Login to ffa when there are players already playing

Expected result:
The playfields of the other players show recent information (afk or the actual game with moving pieces)

Actual result:
The playfields of the other players are empty and do not show any information

Video 1of2 shows my first login:
https://youtu.be/frhrVLCCR8U

Video 2of2 shows my second login (for reproducing the bug):
https://youtu.be/PtMdZfX85SM

[UX] IF player has a high stack and does a soft drop - harddrop / insta drop of next and current piece occurs

Steps to reproduce

  1. Do some decent stack
  2. Do some sort of Soft drop while your stack is somewhat high

Expected result

There are no additional Harddrops ocurring, Stack is controllable and I won't get like an insta death

Acutal Result

High stack is not controllable when you soft drop really often.
We saw this also ocurring on many players already.

Here is a frame by Frame Video - First slow and after that some footage of the situation.

https://www.youtube.com/watch?v=YQa6RPQ5qOs
If you need also to know which keys are being held or pressed i could search for a good key sniffer...

Client = latest
Server = latest

[Discussion] Piece Colors

At the moment colors of the pieces are not saved and are (as far as I saw) implemented in a way that make it hard to give every opponent their own colors. I suppose to change the implemantation by adding an array colormap[7] like piecerotation[7] in class optionSet in which a connection between every piece number from 1 to 7 with a color (in rgb values) is made.
Such an array should also be added to the class obsField so that it can be different for every opponent.
This would lead to some changes in gui.cpp for the options menu and so on, before I dig into this any further I wanted to discuss it.

[Improvement][UX] Flexible game starting behavior

(Could we have assignable labels like I did with [] somehow?)

We could implement a more flexible game start mechanism which behaves like the following:

  1. the game ends
  2. countdown of X seconds starts
  3. if the user takes a certain action (keyboard or button press), interrupt the countdown and go to 4.
  4. the game starts

In multiplayer mode, the countdown would only be interrupted when all active players have taken the specific action.

This would solve the waiting issue when a game quickly ends like in cheese mode or when a player tops out with the initial stack in 1 on 1.

[Discussion] Public Beta milestone

I suggest that a first milestone named "public beta" or something like 0.1b1 is created.

What does @kroyee want to see in it? What do others think? Please create a separate issue and reference it here if things go very detailed.

IMO:
The goal could be to provide executables for every platform and giving users some possibilities to provide feedback. I would not even want a ranking or a forum in 0.1b1 (As kroyee mentioned in the ToDo list).
In my opinion both are rather complex features. A ranking needs a database, a algorithm, user accounts etc. Especially the user account feature might be a tough decision (Do we want to end like Cultris 2 where the whole game is tied to a shitty CMS?). A forum is also not really needed at this point since it needs some grade of moderation. (Do we really want 674893 threads like "cann u plz impl3ment tspin?????? thx") Of course we need feedback and bug reports and I have a idea how we can handle feedback which I elaborate here #28 .

[BUG] Data in the Score tab not updated properly

  1. Round (only me and expl. are playing):
    speed 2017-03-25 19-57-04-383

    1. Problem: no data in cmb, spm, sent, blocked on Expl.'s part.
    2. Problem: Def is afk the whole time
      then I went afk.
  2. Round:
    speed 2017-03-25 20-01-20-004
    Notice that my data from the first round is still presented and also the data from Def who is still afk.

[Discussion] Combo Timer length

So I am unsure if you wish the combo timer to be unique to SpeedBlocks and different from C2 but this is something I thought worth bringing up.

In Cultris 2, when you are mid-combo, blocks that you place that FAIL to clear a line will SUBTRACT combo time remaining from your timer (In addition to the time it takes to drop that place). I think that the time subtracted is higher proportional to how large your combo count is at -- i.e. more time is subtracted for this mistake at a 7 combo than a 3 combo.

So for example, I'm at a 3 combo with 4 seconds left on my timer. I place a piece without clearing a line. Then I have 3.5 seconds left on my timer (.2 seconds to place the piece and .3 seconds subtracted as a penalty for not clearing the line). These numbers are random but I hope my point about this nuance of the timer system from C2 is understood.

Right now it is very simple/easy to achieve 20+ combos because of how "static" the combo timer is. There is no added penalty for failing to clear lines and "building" your stack as long as you clear lines at a certain interval.

[UX] One assignment per key

Steps to reproduce:

Assign a key

Expected result:

The assigned key is locked and cannot be assigned multiple times

Actual Result

The assigned key isn't locked

[BUG] Missing resource folders makes the game hang/crash

How to reproduce

Remove/move/rename the sounds and media folder and execute the game.

Current behavior

The game hangs.

Expected behavior

When the folders don't exist, it should show a error message and maybe the hint to re-install the game.

[FN] VS2015 Functions needs a return value (list)

"UI::login": Muss einen Wert zurückgeben Projekt2 d:\dev\speedblocks-master (3)\speedblocks-master\gui.cpp 812

"optionSet::saveOptions": Muss einen Wert zurückgeben Projekt2 d:\dev\speedblocks-master (3)\speedblocks-master\optionset.cpp 152

"optionSet::loadOptions": Muss einen Wert zurückgeben Projekt2 d:\dev\speedblocks-master (3)\speedblocks-master\optionset.cpp 114

[TN] FrameRate incorrect under Windows

Steps to reproduce:

  1. Set Framerate to 300
  2. Set Frametime to 1000

Expected Result:

Frame Rate is 300

Actual Result:

Frame Rate is 333

  1. Set Framerate to 600
  2. Set Frametime to 1000

Expected Result:

Frame Time is 600

Actual Result:

Frame Rate is 999

[Discussion] [UX] Minimalist in-game bug reporting

I have the following idea to give users the opportunity to report bugs.

There could be a "Report" button in the bottom corner of the game which is always visible. If the user clicks on it, a dialog would open where are a few text fields and labels like:

Please report in Swedish, English or German. We can not handle your report otherwise. Alternatively you can open an issue here [github link]

  1. Tell us what happened
  2. What did you expected to happen instead?
  3. What do we need to do to see what you are seeing?
  4. How can we contact you when we have questions?

This message could be posted to a simple backend with a database (this is coded in a short time, I'd do that) where we (or some of us) can read it back through a simple HTML interface. We could then manually create an Issue when its relevant. Of course it could use the Github API for automatic issue creation but this could lead to a lot of low quality issues in the repo here.

What do you think?

Advanced possible features:

  • Hook this reporting into crash handlers
  • Automatically collect and append some technical data about the game state and the target system

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.