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

Author Topic: SFML Game Development by Example - 4th SFML book  (Read 183176 times)

0 Members and 2 Guests are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML Game Development by Example - 4th SFML book
« Reply #150 on: October 15, 2016, 08:48:18 pm »
Quote
    union
    {
        int mCode;
        GUI_Event gui;
    };
That union looks wrong. Once the owner EventInfo instance is initialized, how do you know which member of the union is used? And when "gui" is used, is it always correctly constructed first?

And these old-style strings with manual memory management... ???
Laurent Gomila - SFML developer

OrderNexus

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: SFML Game Development by Example - 4th SFML book
« Reply #151 on: October 15, 2016, 09:37:40 pm »
The usage of the appropriate union member is left up to a different structure that keeps track of the type of event as well. The older style strings stuck around because of content length limitations. I was already penalized for exceeding the projected length of the book, and things like this added up quickly, believe it or not. I've already updated the code on my end to use std::string and custom construction/move semantics. I'm just waiting for a chance to revise the book now.

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: SFML Game Development by Example - 4th SFML book
« Reply #152 on: October 16, 2016, 09:28:01 am »
Wait, they don't allow your book to get longer even if it  helps the overall goal of the book? Those profit margins can't be that low.

OrderNexus

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: SFML Game Development by Example - 4th SFML book
« Reply #153 on: October 16, 2016, 09:52:58 am »
Wait, they don't allow your book to get longer even if it  helps the overall goal of the book? Those profit margins can't be that low.
Originally, it was supposed to be around 320-380 pages max. That number was left in the dust somewhere around the halfway point. During the final stages, I was asked to cut out roughly 30-50 pages, which gave it the final length of 522 pages. Apparently there is a sweet-spot as far as the length and price of the book goes. The individual lengths of each chapter also couldn't have been exceeded, so some chapters ended up being split into two as well. During the planning stages there were supposed to be only 10 chapters, yet the final product has 14.

Bryan Pope

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: SFML Game Development by Example - 4th SFML book
« Reply #154 on: October 27, 2016, 01:43:37 am »
I for one would pay more for a second edition that was longer and had even more well-written information.  I personally really like this book more for the C++ and great discussion of creating a basic game engine using the Entity Component System design pattern and less about the SFML.  Maybe use... errr... I don't know..,,  bgfx in your next book?

Cheers,

Bryan

OrderNexus

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: SFML Game Development by Example - 4th SFML book
« Reply #155 on: October 28, 2016, 04:56:37 am »
You know what? Thanks for saying that! It gets kind of frustrating and overwhelming when there's a bunch of other people, all with their own ideas and principles, trying to tweak and manage something like this. It can lose the essence of what it originally aimed to be fairly quickly that way.

As far as the next book, I can't really say too much, but it's close to being done now. Although it doesn't focus on bgfx, I'm still trying to keep it as close to what it should be as possible. All of the feedback from this thread really helped me fix a bunch of things and use a more modern approach. Hopefully everyone will be happier with it than they were with the first one. :)

HoodedSpectre

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: SFML Game Development by Example - 4th SFML book
« Reply #156 on: November 10, 2016, 02:33:08 am »
I have just one question, I have been working with this book for quite some time. I am attempting to run your source code for the final chapter so I can see what it looks like before I actually start reading. It will not work at all, when I launch the server.exe it just goes through the tile ids saying was not found then it hits map loaded and does nothing more. Do I need to just follow the entire book and code it myself? There are quite a few differences between the source code you provided and the book.

Aside from those questions, you are really helping me understand the parts of game development I don't think people really touch on. Being able to see how the client and server are structured exactly will really help in my personal studies. Thank you for the great book.
« Last Edit: November 10, 2016, 03:31:31 am by lurkerz »

OrderNexus

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: SFML Game Development by Example - 4th SFML book
« Reply #157 on: November 10, 2016, 05:10:07 am »
I have just one question, I have been working with this book for quite some time. I am attempting to run your source code for the final chapter so I can see what it looks like before I actually start reading. It will not work at all, when I launch the server.exe it just goes through the tile ids saying was not found then it hits map loaded and does nothing more. Do I need to just follow the entire book and code it myself? There are quite a few differences between the source code you provided and the book.

Aside from those questions, you are really helping me understand the parts of game development I don't think people really touch on. Being able to see how the client and server are structured exactly will really help in my personal studies. Thank you for the great book.
Hello, lurkerz. First of all, I'd like to thank you for reading the book! I'm really glad it helped you out.

The actual server itself simply loads the map and listens for incoming connections, so that they can be handled. The console itself spits out four lines of text when everything is fine, which are the port information, a notification that it began listening for connections, the loading map line, and "Map Loaded!" line. If you're getting tile IDs that weren't found, your tiles.cfg file is probably missing or misplaced. It's as simple as that.

Please let me know if you have any further problems down the line. I hope I was of any assistance. :)

HoodedSpectre

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: SFML Game Development by Example - 4th SFML book
« Reply #158 on: November 10, 2016, 10:54:48 pm »
Awesome, I was able to get it to work. I guess my working directory was setup weird so I made the change and now it works. Thanks for your help.

HoodedSpectre

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: SFML Game Development by Example - 4th SFML book
« Reply #159 on: December 15, 2016, 01:47:37 am »
Is there currently a way to create a map in tiled and export it into a format that would work with this engine? Or would I need to figure that out myself?

Also what is the purpose of the following keys?
Key_P 5:15 -
Key_T 5:19 -
Key_K 5:10 -
Key_O 5:14 - Enables debug mode
Key_X 5:23 -
« Last Edit: December 15, 2016, 02:00:41 am by lurkerz »

OrderNexus

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: SFML Game Development by Example - 4th SFML book
« Reply #160 on: December 15, 2016, 07:10:08 am »
Is there currently a way to create a map in tiled and export it into a format that would work with this engine? Or would I need to figure that out myself?

Also what is the purpose of the following keys?
Key_P 5:15 -
Key_T 5:19 -
Key_K 5:10 -
Key_O 5:14 - Enables debug mode
Key_X 5:23 -
Not that I'm aware of, sorry. I'm sure that it wouldn't be that hard to parse existing tiled maps and convert them to the format used in the book, although that format is completely arbitrary. You could simply roll your own, or adapt the map class to store information exactly the same way tiled does, provided it follows the same principles of layering and rendering.

As far as the keys go, some of them aren't used. They just exist in the key config file because of previous testing, and I may have forgotten to take them out. If you search the code around for the strings of these keys, you should be able to easily figure out which ones are still being used.

HoodedSpectre

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: SFML Game Development by Example - 4th SFML book
« Reply #161 on: December 15, 2016, 11:55:51 pm »
Hey thanks for all the help, I'm still in school so I'm trying to absorb as much as I can from your book. It has been the most helpful of any book I've read. I noticed you mentioned you are working on another book, I know you can't say much about it but I'm excited to see it. I will definitely be purchasing it when it comes out, can you tell me a time frame of when you expect it may be out? Or at least announced?

OrderNexus

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: SFML Game Development by Example - 4th SFML book
« Reply #162 on: December 16, 2016, 04:47:55 am »
Hey thanks for all the help, I'm still in school so I'm trying to absorb as much as I can from your book. It has been the most helpful of any book I've read. I noticed you mentioned you are working on another book, I know you can't say much about it but I'm excited to see it. I will definitely be purchasing it when it comes out, can you tell me a time frame of when you expect it may be out? Or at least announced?
Sure, don't mention it. :) Yes, I'm currently working on another book, and it's almost done. I should be done with the last two chapters this weekend, and it should be out in a couple of weeks. It has already been announced on the Packt website. I'd link to it, but their site seems to be down at the moment. :D

Edit: It's back up now: https://www.packtpub.com/game-development/mastering-sfml-game-development
The description doesn't include this, but the last couple of chapters focus on advanced lighting, shadows, and optimizations.
« Last Edit: December 16, 2016, 05:19:50 am by OrderNexus »

jamesL

  • Full Member
  • ***
  • Posts: 124
    • View Profile
Re: SFML Game Development by Example - 4th SFML book
« Reply #163 on: December 16, 2016, 12:44:14 pm »
...Yes, I'm currently working on another book, and it's almost done. I should be done with the last two chapters this weekend, and it should be out in a couple of weeks. It has already been announced on the Packt website. I'd link to it, but their site seems to be down at the moment. :D

Edit: It's back up now: https://www.packtpub.com/game-development/mastering-sfml-game-development
The description doesn't include this, but the last couple of chapters focus on advanced lighting, shadows, and optimizations.

I hope this doesn't adversely affect your income, but the ebook version of that book is currently on sale for 5 dollars



OrderNexus

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: SFML Game Development by Example - 4th SFML book
« Reply #164 on: December 16, 2016, 05:33:07 pm »
...Yes, I'm currently working on another book, and it's almost done. I should be done with the last two chapters this weekend, and it should be out in a couple of weeks. It has already been announced on the Packt website. I'd link to it, but their site seems to be down at the moment. :D

Edit: It's back up now: https://www.packtpub.com/game-development/mastering-sfml-game-development
The description doesn't include this, but the last couple of chapters focus on advanced lighting, shadows, and optimizations.

I hope this doesn't adversely affect your income, but the ebook version of that book is currently on sale for 5 dollars
I'm just happy as long as my work is useful to someone. The revenue is just a cherry on top. :)