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

Author Topic: SFML Game Development -- A book on SFML  (Read 264694 times)

0 Members and 1 Guest are viewing this topic.

timo777

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: SFML Game Development -- A book on SFML
« Reply #75 on: July 18, 2013, 01:24:41 pm »
For as far as I've read it, I like it. English is not my main language too, but I could easily understand it. I didn't see much mistakes, probably because I just read over them or they were too minor.

I think a lot of the negative things said already are true, but irrelevant. This book isn't about teaching you perfect English, but about teaching you how to create a game using C++.

Also, I don't think this book is only good for adults. The practical way of the book is pretty good and most non-adults like me don't like too much information that looks irrelevant at first sight.

By the way, how far are you with letting it work with VS 2012? Oracle VirtualBox crashed with LMDE when I tried to play the example already...
« Last Edit: July 18, 2013, 01:26:32 pm by timo777 »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: SFML Game Development -- A book on SFML
« Reply #76 on: July 18, 2013, 07:22:07 pm »
Lo-X: Generally, you can link the physical objects to their scene node counterparts, e.g. Aircraft (or Entity if it applies to all entities). A world object could be kept in World; if the entities need pointers to it, you can pass them in the constructor or later via one-time commands. Unfortunately, I don't know Box2D well enough to give more concrete advice. There are certainly people who are experienced with it, and since it's a design discussion, you might want to open your own thread ;)

timo777: The VS 2012 errors should be fixed. Check the next section:


Code on GitHub

Concerning the code base accompanying the book, there was some confusion with its distribution and license, which we intend to clarify by making the code available in a GitHub repository owned by Laurent:
https://github.com/SFML/SFML-Game-Development-Book

Upon request from several users, we added a license that allows you to use the code freely (it only forbids commercial use). Therefore, don't hesitate to extend it and build your own projects :)
« Last Edit: July 18, 2013, 07:26:00 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

timo777

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: SFML Game Development -- A book on SFML
« Reply #77 on: July 18, 2013, 08:20:38 pm »
I'm just curious, why prevent commercial use of the demo code? Isn't it still allowed to write your game yourself using the examples from the book, which will probably look like the final demo code, and use it commercially? Then it would be a bit strange in my opinion, but I'm probably seeing something not good. :)

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: SFML Game Development -- A book on SFML
« Reply #78 on: July 18, 2013, 08:54:59 pm »
Thank's for both the answers, about Box2d and the license !

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10895
    • View Profile
    • development blog
    • Email
Re: SFML Game Development -- A book on SFML
« Reply #79 on: July 18, 2013, 09:01:16 pm »
Code on GitHub

Concerning the code base accompanying the book, there was some confusion with its distribution and license, which we intend to clarify by making the code available in a GitHub repository owned by Laurent:
https://github.com/SFML/SFML-Game-Development-Book

Upon request from several users, we added a license that allows you to use the code freely (it only forbids commercial use). Therefore, don't hesitate to extend it and build your own projects :)
Nice, thank you! :)

I'm just curious, why prevent commercial use of the demo code? Isn't it still allowed to write your game yourself using the examples from the book, which will probably look like the final demo code, and use it commercially? Then it would be a bit strange in my opinion, but I'm probably seeing something not good. :)
It's most probably not something that the authors could decide, but it's what the publisher told them. ;)
But yeah it's not that nice, especially since the provided code is often quite generic C++ & SFML code... :-\
« Last Edit: July 18, 2013, 09:10:16 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: SFML Game Development -- A book on SFML
« Reply #80 on: July 18, 2013, 09:31:55 pm »
Isn't it still allowed to write your game yourself using the examples from the book, which will probably look like the final demo code, and use it commercially?
But yeah it's not that nice, especially since the provided code is often quite generic C++ & SFML code... :-\
I think you understand the limitation in a wrong way. Of course you can use the concepts and ideas and let yourself inspire by our code; after all, we want to teach you something you can use in your own projects. What the license inhibits is copying our code, i.e. marketing our game. In most cases it won't restrict your freedom at all.

To clarify: It is no problem if you use features like the command system in your game, we do not own the patent on these ideas :)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

timo777

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: SFML Game Development -- A book on SFML
« Reply #81 on: July 18, 2013, 09:56:45 pm »
Isn't it still allowed to write your game yourself using the examples from the book, which will probably look like the final demo code, and use it commercially?
But yeah it's not that nice, especially since the provided code is often quite generic C++ & SFML code... :-\
I think you understand the limitation in a wrong way. Of course you can use the concepts and ideas and let yourself inspire by our code; after all, we want to teach you something you can use in your own projects. What the license inhibits is copying our code, i.e. marketing our game. In most cases it won't restrict your freedom at all.

To clarify: It is no problem if you use features like the command system in your game, we do not own the patent on these ideas :)
Thank you for clarifying that!

timo777

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: SFML Game Development -- A book on SFML
« Reply #82 on: July 19, 2013, 10:42:58 am »
@Nexus, I tried compiling again.

But at 07, 08, 09 and 10 I get errors again. First two for every project, now one:

Error   1       error C2100: illegal indirection        C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\functional       1269    1       07_Gameplay

I get the same exact error for the last four projects. Visual Studio says the error is coming from:

_VARIADIC_EXPAND_0X(_CLASS_PMF_WRAP, , , , ) //Here
#undef _CLASS_PMF_WRAP

C2100 means dereferencing a non-pointer, but it doesn't point to a project file... Can you help?

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: SFML Game Development -- A book on SFML
« Reply #83 on: July 19, 2013, 10:52:53 am »
This problem is what I mentioned earlier, a bug in the new compiler from Microsoft. I did some fixes and got it to compile I'm gonna check what happened, could be that those fixes disappeared along the way somehow.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

timo777

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: SFML Game Development -- A book on SFML
« Reply #84 on: July 19, 2013, 11:32:16 am »
This problem is what I mentioned earlier, a bug in the new compiler from Microsoft. I did some fixes and got it to compile I'm gonna check what happened, could be that those fixes disappeared along the way somehow.
I thought you were talking about the first error that's now fixed. Could you please tell us if you can find how you fixed it?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: SFML Game Development -- A book on SFML
« Reply #85 on: July 19, 2013, 11:38:40 am »
It's not really possible to fix it, since there is a compiler bug with std::bind(). As a workaround, we replaced the problematic std::bind() calls with lambda expressions.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

timo777

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: SFML Game Development -- A book on SFML
« Reply #86 on: July 19, 2013, 11:57:32 am »
It's not really possible to fix it, since there is a compiler bug with std::bind(). As a workaround, we replaced the problematic std::bind() calls with lambda expressions.
Wasn't that the first error? I don't think the second error has anything to do with this bug. Since you get this bug even with the Git repository.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: SFML Game Development -- A book on SFML
« Reply #87 on: July 19, 2013, 12:01:23 pm »
They are related from what I remember.

Looking from the source in Laurents repository, something must have gone wrong because I can't find the fix in the code. When I get home I'll check where it went. In any case, fixed version will be up today.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

timo777

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: SFML Game Development -- A book on SFML
« Reply #88 on: July 19, 2013, 09:16:11 pm »
I was wrong(, like always).

The error was indeed due the bug with the bind function in:
data[Pickup::HealthRefill].action = std::bind(&Aircraft::repair, _1, 25);

After looking at the other binds, that didn't gave an error, the difference is Aircraft::repair is actually from the "parent" class Entity. Visual Studio seems to have a bug it can't handle functions pointing to a function that's inhereted from a parent. So you will have to implement the same function at Aircraft::repair to let it work.

Could someone do a pull request with this pretty stupid fix? Or at least put a warning there for Visual Studio 2012 and how to fix it.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: SFML Game Development -- A book on SFML
« Reply #89 on: July 20, 2013, 01:10:51 pm »
I've done a commit now, let me know if this works. Sorry it took such time but I was on the train and didn't reach my destination until midnight.

doing an proxy function in the sub-class Aircraft is more unclean fix and is more or less forcing your class to work with the tools rather than have the tools fit the task at hand. Kind of like using a screwdriver to hammer in a nail. So instead it's swapped for a boring lambda function:

Code: [Select]
data[Pickup::HealthRefill].action = [] (Aircraft& a) { a.repair(25); };It doesn't look as good as the std::bind function and it's kind of hackish, but it is the better of the two.

Also fixed the dumb warnings for VC++11 when you have a switch-statement and cover all possible results.
« Last Edit: July 20, 2013, 01:18:32 pm by Groogy »
Developer and Maker of rbSFML and Programmer at Paradox Development Studio