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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mequint

Pages: [1]
1
General discussions / Re: Help with Book (SFML Game Development By Example)
« on: December 01, 2019, 01:48:51 am »
What you have done looks correct...let me see if this helps...

The Tile Map has no concept of a "position" itself.  It's merely a buffer of Tile Data.  When it is drawn to the screen, there is predefined Sheet data that provides the tile position and tile size to the Sprite when it's drawn.

So here is what I propose:
1. Get the players position via the ECS
2. Determine the players Tile Coordinates based on the Sheet sizes
(You have this so far)

3. Determine the tile you want to move to.
4. Convert that tile to the game position (x * TileSize, y * TileSize)
5. Set a Target for the player to Move To (Implementation is up to you but you will probably need a Component for Targeting, an Entity State to indicate movement is happening (I think it already exist), and an Entity Message to notify the State system that Target Movement is occurring.  The Movement System will need to update the Mover automatically while the Target is set.

Hope this helps.

2
General discussions / Re: SFML Game Development by Example - 4th SFML book
« on: December 01, 2019, 01:30:53 am »
This is still a problem...it doesn't have anything to do with the Shared Context.  Something is wrong with the S_Network...the strange thing is that the Chapter 13 project works fine.

Furthermore, I'm seeing some other problems...there seems to be another error with Rect.inl in the API and this project.  Fortunately, it isn't necessary for the next book but it would be nice to get it implemented successfully.

3
Hey OrderNexus,

Finally finishing up the Networking Portion of the book and I've run into a snag with the Chapter 14 code.  When I compile the code for the Client, I get the following errors everywhere an instance of the Shared Context is referenced.

Output (VS2017)
1>c:\src\sfml-2.4.2\include\sfml\network\sockethandle.hpp(46): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\src\sfml-2.4.2\include\sfml\network\sockethandle.hpp(46): error C2146: syntax error: missing ';' before identifier 'SocketHandle'
1>c:\src\sfml-2.4.2\include\sfml\network\socket.hpp(140): error C3646: 'getHandle': unknown override specifier
1>c:\src\sfml-2.4.2\include\sfml\network\socket.hpp(140): error C2059: syntax error: '('
1>c:\src\sfml-2.4.2\include\sfml\network\socket.hpp(140): error C2238: unexpected token(s) preceding ';'
1>c:\src\sfml-2.4.2\include\sfml\network\socket.hpp(159): error C2061: syntax error: identifier 'SocketHandle'
1>c:\src\sfml-2.4.2\include\sfml\network\socket.hpp(159): error C2535: 'void sf::Socket::create(void)': member function already defined or declared
1>c:\src\sfml-2.4.2\include\sfml\network\socket.hpp(148): note: see declaration of 'sf::Socket::create'
1>c:\src\sfml-2.4.2\include\sfml\network\socket.hpp(177): error C3646: 'm_socket': unknown override specifier
1>c:\src\sfml-2.4.2\include\sfml\network\socket.hpp(177): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

The culprit seems to be in the SocketHandle.hpp (SFML/Networking) with the following line of code:

#if defined(SFML_SYSTEM_WINDOWS)

    typedef UINT_PTR SocketHandle;

#else
 

I've determined that the problem is coming from the Client somewhere, and yet when I run the same code in Chapter 13, it works as intended.  Odd.

I was hoping to finish this chapter before moving onto your next book (Mastering SFML).

Q1: Any ideas how I can fix this?  Are there any changes you are aware of in SFML since 2.4 in Networking?
Q2: Is the Networking module for SFML needed in Mastering SFML?

I'd like to get the code working as intended

Thank you!

4
Feature requests / Re: Force Feedback Support...
« on: October 15, 2018, 06:04:29 pm »
I am interested in this feature as well...looking into it further, it looks like SDL has been able to implement force feedback so looking into that library might be able to give some clues into how it can be done without having to implement Xinput.

5
General discussions / Re: SFML Game Development by Example - 4th SFML book
« on: December 27, 2016, 09:56:30 pm »
I have zipped up the code and sent it your way. 

6
General discussions / Re: SFML Game Development by Example - 4th SFML book
« on: December 22, 2016, 05:54:38 am »
Well, here is the callstack:

>   Game World.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Check_offset(const unsigned int _Off) Line 2271   C++
    Game World.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Right, unsigned int _Roff, unsigned int _Count) Line 1151   C++
    Game World.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Right) Line 783   C++
    Game World.exe!AnimBase::GetName() Line 65   C++
    Game World.exe!Character::Animate() Line 237   C++
    Game World.exe!Character::Update(float dt) Line 195   C++
    Game World.exe!Enemy::Update(float dt) Line 38   C++
    Game World.exe!EntityManager::Update(float dt) Line 73   C++
    Game World.exe!State_Game::Update(const sf::Time & time) Line 72   C++
    Game World.exe!StateManager::Update(const sf::Time & time) Line 46   C++
    Game World.exe!Game::Update() Line 27   C++
    Game World.exe!main() Line 9   C++
    [External Code]   
    [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]   

I at first thought that this could be a loading problem but the resources loaded fine for the rest of the project. 

I'm running through the code one more time just to make sure it wasn't a coding error.

7
General discussions / Re: SFML Game Development by Example - 4th SFML book
« on: December 19, 2016, 09:35:34 pm »
First off, I want to say that this has been one of the best game development books I've come across.  There are a lot of concepts that I had only heard about before that are fully implemented in this book.  That's cool!

I am having a bit of a problem.

Using Visual Studio 2015, I have tried implementing the code in Chapter 7 and I am getting a runtime error in the MainGame_State where the Character class throws an exception when attempting to get the name of the "Idle" animation in the Animate method.   It seems to happen when the AnimBase class calls the GetName() method. 

I tried comparing it to the original source code provided and I'm not seeing any problems in the code.  I also tried creating a new project and adding the complete source so that I could move on to Chapter 8 but that didn't even get past the Intro screen code...

Help!

Pages: [1]
anything