Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Slide Them Boxes (2d puzzle-game)  (Read 8959 times)

0 Members and 1 Guest are viewing this topic.

eigen

  • Jr. Member
  • **
  • Posts: 64
  • Brobdingnagian ding dong
    • View Profile
    • Pioneersgame.com
Slide Them Boxes (2d puzzle-game)
« on: February 14, 2012, 09:27:00 am »
Hi, my first post here, which is a good thing, in a sense that I have not needed help on the forum with SFML as its documentation is excellent and the code is self-explanatory :)
Anyway, I wanted to let you know, that I just completed a game. It uses SFML for graphics and sound, and a little bit of libcurl. I like the framework very much, very simple to use and provides enough flexibility. I'm definitely using it for my future projects.

What's it about?

Well, it's kind of an old-school puzzle-game, where you control this little character on screen and he can push or pull colorful boxes. These boxes have to be moved onto a tile of the same color. Do so for all boxes and you complete the level. Sounds simple? Oh, no, not at all. As with games this kind, the further you get, the more difficult levels become. And you'd want to complete the level in as few moves as possible, for the sake of showing off your skill :)

What does it look like?

In a nutshell, like this (click on the thumbnail to see full-size):







Where can I get it?

You can freely get it for Windows and Mac here

What else have you done or what are you working on?

I have a small website, that contains all my past and future projects. You can take a look at it here


That's it I think. Please try it out and let me know what you think :)

Thanks and all the best,
Eigen

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Slide Them Boxes (2d puzzle-game)
« Reply #1 on: February 14, 2012, 06:09:21 pm »
Why oh why did you use SFML 1.6?  :roll:
It's just that I can't run any dynamically linked SFML 1.6 application due to the ATI bug or so. (It just doesn't start, no errors and such.)

The game itself (judging from the screenshots) looks pretty good.
Maybe you could do something about the title screen. I find it hard to read from a closer distant/big size...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

eigen

  • Jr. Member
  • **
  • Posts: 64
  • Brobdingnagian ding dong
    • View Profile
    • Pioneersgame.com
Slide Them Boxes (2d puzzle-game)
« Reply #2 on: February 14, 2012, 06:44:52 pm »
I used 1.6 because I thought that was the latest stable release. Is it not? I didn't think it'd be that bad.

Either way, that explains the behavior of the game on one person's computer where it wouldn't simply start. So I should use 2.0 instead?

mateandmetal

  • Full Member
  • ***
  • Posts: 171
  • The bird is the word
    • View Profile
    • my blog
Slide Them Boxes (2d puzzle-game)
« Reply #3 on: February 15, 2012, 06:04:10 am »
I love this kind of games! .. Downloading now! :D


Quote from: "eigen"
..So I should use 2.0 instead?


Yes  :)
- Mate (beverage) addict
- Heavy metal addict _lml
- SFML 2 addict
- My first (and free) game: BichingISH!

eigen

  • Jr. Member
  • **
  • Posts: 64
  • Brobdingnagian ding dong
    • View Profile
    • Pioneersgame.com
Slide Them Boxes (2d puzzle-game)
« Reply #4 on: February 15, 2012, 09:39:37 am »
Thanks! :)

I managed to compile 2.0 on Windows but I can only access Mac at work and I couldn't get it to work just yet. SFML itself compiles but I can't seem to manage to link it against my project, throws all kinds of undefined symbols. I don't have time to look into this, I only have limited free time at work, sadly. I'd love it, if someone could compile the latest source on Mac and give me the framework files, I think these would be best. Is there a release date on 2.0?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Slide Them Boxes (2d puzzle-game)
« Reply #5 on: February 15, 2012, 01:44:00 pm »
Quote from: "eigen"
...throws all kinds of undefined symbols.

Yes quiet a few functions and classes got renamed or sorted diffrently, so it needs a bit time to adapt the code to SFML 2.0 but I think it's worth the trouble.

Quote from: "eigen"
Is there a release date on 2.0?

Unfortunatly just the often quoted 'soon' from Laurent.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Stupebrett

  • Newbie
  • *
  • Posts: 15
    • View Profile
Slide Them Boxes (2d puzzle-game)
« Reply #6 on: February 16, 2012, 08:44:19 am »
Cool game! I see you're eading the level designs from some .png images. How did you do that?

eigen

  • Jr. Member
  • **
  • Posts: 64
  • Brobdingnagian ding dong
    • View Profile
    • Pioneersgame.com
Slide Them Boxes (2d puzzle-game)
« Reply #7 on: February 18, 2012, 03:46:24 pm »
I updated the Windows version to latest SFML build. Now it should run on those systems that had problems before. I got the Mac version compiling as well but it failed to load any images. I have to look into that one ..

Quote from: "Stupebrett"
Cool game! I see you're eading the level designs from some .png images. How did you do that?

Simple. Each color of pixel represents a different kind of tile in the map. White is a wall, black is walkable area and colors and boxes.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Slide Them Boxes (2d puzzle-game)
« Reply #8 on: February 18, 2012, 06:16:24 pm »
Great game! =)

I'm at level 15 now but will try to get to the 30th level. ;-)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Slide Them Boxes (2d puzzle-game)
« Reply #9 on: February 18, 2012, 08:37:35 pm »
Okay so I've played a bit more and found somethings you could tune a bit.

I see you have an online score list but I don't get how one could get into that list. Is this a feature to come or is there anything I'm doing wrong?

There is a difference between the event based input and the input classes like sf::Keyboard. The first one only works when the window has the focus and the key events get send in the way one would enter text into a text box (with the delay after the first character), the input class on the other hand, handle the keyboard globally, meaning even when the window doesn't have the focus and they work on current state (pressed or not).
In the your game you proccess the input with the input class thus when the window loses the focus one can still move around.
A solution would be to have some pause variable that gets set to true once the event "LostFocus" is called and set to false when "GainedFocus" gets called. You still could draw and update your stuff but block all the input.

In my opinion the tiles could've also been a bit bigger since the maximal size you use is 17 blocks.

The sleep sound it kind funny but if you just let it run in the background because you've to do quickly do something else, it can get pretty annoying. Maybe you should only output the sound if the window has the focus.

I hope this was helpfull.   :wink:
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

eigen

  • Jr. Member
  • **
  • Posts: 64
  • Brobdingnagian ding dong
    • View Profile
    • Pioneersgame.com
Slide Them Boxes (2d puzzle-game)
« Reply #10 on: February 19, 2012, 01:38:36 pm »
Thanks for your comments, they are really helpful.

You get to enter your name into the list once you complete the last level, meaning you complete the game :) There is no "game over" or other failure options, so nowhere to present the user with the score as in many other games, like Tetris. Only when you finish the game.

You're right about the keys, I fixed that. Also, the snoring should go away when the game does not have focus, yes. In fact, I implemented that feature last night using the LostFocus and GainedFocus events, but also came across a bug I think. When you minimize the window, the application gets LostFocus and GainedFocus events right after each other (on Windows XP). It should probably not be like that. As a work around, I added a check - if the gainedfocus event comes in something like 60ms after losing the focus, it's not processed.

The graphical tiles are small because at first I thought the levels would be bigger, before realizing that's not where the difficulty comes from. So the levels stayed smaller. I personally think the smaller visual game area is better because you focus more easily ... I mean you don't have to do much eye movement to see the whole level and you have better overview.

I'll upload the updated version later.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Slide Them Boxes (2d puzzle-game)
« Reply #11 on: February 19, 2012, 06:20:55 pm »
Quote
but also came across a bug I think. When you minimize the window, the application gets LostFocus and GainedFocus events right after each other (on Windows XP).


Create a minimal example and post it to the forum so Laurent can look into it/comment on it.  :wink:

Quote
You get to enter your name into the list once you complete the last level, meaning you complete the game

Yes! I'm the first who got on that list! :P

Btw. can you implement it the way one could also enter numbers as the username? As you can see my username here is eXpl0it3r which makes us of 0 and 3 as numbers...

Thanks for the great game!

The difficulty levels are no constantly progressing which is good, since one really likes to solve a bit an easier one after working for 10+min on just one level. I think the most moves for one level I made was ~1400.  :lol:

Out of curiosity, how does the score get calculated?

Now I'm gonna check out the bonus levels!
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

eigen

  • Jr. Member
  • **
  • Posts: 64
  • Brobdingnagian ding dong
    • View Profile
    • Pioneersgame.com
Slide Them Boxes (2d puzzle-game)
« Reply #12 on: March 19, 2012, 10:07:33 pm »
Version 1.1

+ SFML 2.0
+ Small fixes here and there
+ Got rid of the level password system and replaced it with more traditional level selection screen
+ Internal re-write to ease adding more level-packs in the future
+ 2 new levels, total of 32 now!
+ Native Win/Mac start-up window, where you can choose to play the game or check for updates and download them.
+ Installers for both Windows and Mac. It was interesting, I hadn't really messed with installer scripts and such before.

Not much changes visually. You don't mess with perfection ;)

Downloads and other information

eXpl0it3r, with all the changes and addition of 2 levels, I had to remove your score. I'm sorry. But you can now enter numbers as part of your name :)

I hope you all enjoy it!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Slide Them Boxes (2d puzzle-game)
« Reply #13 on: March 21, 2012, 08:51:38 am »
Quote from: "eigen"
eXpl0it3r, with all the changes and addition of 2 levels, I had to remove your score. I'm sorry. But you can now enter numbers as part of your name :)


No problem, I'll beat it again! :P

But I'm still curious how the score gets calculated...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

eigen

  • Jr. Member
  • **
  • Posts: 64
  • Brobdingnagian ding dong
    • View Profile
    • Pioneersgame.com
Slide Them Boxes (2d puzzle-game)
« Reply #14 on: March 21, 2012, 04:04:36 pm »
Quote from: "eXpl0it3r"
But I'm still curious how the score gets calculated...


Basically there is a set number of moves (so called PAR) for each level and you get points for each move under that. It's simple linear calculation based on the level index (1 .. 32). The PAR = 35 * levelNumber

Other solution would've been to play the levels extensively myself, and find an average number and increase that by a certain factor, but I chose not to, because I don't want players competing with ME, I want them competing with each other.

Eg. if I completed the first level in 4 moves, the difference compared to PAR would be 31, which is rounded down to nearest 5, 30 in this case. This is your total score after completing the first level.

If you were to make 10 moves, you'd have 25 points. If you'd make 35 moves, you'd have 0 points.