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 - model76

Pages: [1] 2 3 ... 16
1
General / Re: Lethn's Programming Questions Thread
« on: September 13, 2013, 03:00:53 am »
Well, not all of us learn equally well from a book alone, so why not try gameinstitute?
That way you will have an instructor and tests to see if you understood the material well enough.

They have 2 courses on C++, and all the examples are game related in some way.
You can safely quit the 2nd course when it gets to the Microsoft specific stuff. You won't need that for SFML.

Worked well enough for me 6 years ago, so perhaps it will work for you now.

2
General discussions / Re: Let's Create an sf::Pig!
« on: December 20, 2012, 06:07:54 am »
No no no. This is much too specific to be included in a multimedia library.

What I would suggest is that you change the active parameter from bool to float. That way the users could control how active the pig should be.

3
SFML projects / Re: Pioneers
« on: December 12, 2012, 06:49:00 pm »
You downloaded it from the link provided here in the forum, right?
That is correct.

So, you clicked "go explore", the screen transitioned into the other game mode where you could still move around and you then clicked on the ship? Oh joy, I just love bugs I can't reproduce ...  :)
Pretty much.
If I can make time, I will try to play around with it later. Maybe there is some sort of method to the madness. ;)

4
SFML projects / Re: Pioneers
« on: December 12, 2012, 05:36:31 pm »
Hello again good sir.

I just tried the new build 4, and unfortunately, it crashed.

It happened after I clicked "go explore" after crashing into an island. I hadn't done anything, except moving the camera around with ASDW, and clicking around on the screen because I had forgotten how to play the game. The last click was on the ship, and that is when the crashed happened.

I am using Windows 7, and an nVidia graphics card.
Visual Studio 2010, Firefox, LibreOffice Writer, and Thunderbird were running at the time.
Also, I was running the game in full screen mode.

5
Feature requests / Re: Relative Mouse Movement (Mouse Capture)
« on: October 11, 2012, 02:40:27 am »
Sure but like you said somewhere and that doesn't have anything to do with SFML. ;)
I never said it did.

Wrong sf::Mouse and the window event system don't have anything in common. Note events are triggered by the OS and sent to the window, while sf::Mouse access the device itself. ;)
So are you saying that calling sf::Mouse::setPosition does not cause an sf::EventMouseMoved event to happen?
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window( sf::VideoMode( 800, 600 ), "SFML" );

    while( window.isOpen() )
    {
        sf::Event event;
        while( window.pollEvent( event ) )
        {
            sf::Mouse::setPosition( sf::Vector2i( 400, 300 ), window );

            if( event.type == sf::Event::Closed )
                window.close();
        }

        window.clear();
        window.display();
    }
}
 
On my system, this program gets stuck in the event loop, and the window is never cleared.

Sure I can get reproduce the problem.
I checked, and it seems to be the case. By moving the mouse quickly and pressing a button, it is possible to make the window loose focus. It will be interesting to hear what Laurent has to say about it.

Btw you're implementation has twice sf::Event event; declared.
It certainly did. Must have happened when I was replacing the TAB characters with spaces. Anyway, it is now corrected.

And since you're checking sf::Mouse::getPosition() inside the event loop it probably doesn't event reset the position for all the possible interations... ;)
I am not sure it matters, since I believe that the global inputs and events are synchronized in SFML 2. I haven't checked the documentation or done any tests, though. It was just something I talked to Laurent about long ago in 1.x where they were not synchronized.

6
Feature requests / Re: Relative Mouse Movement (Mouse Capture)
« on: October 10, 2012, 08:36:18 pm »
This has nothing to do with events. Events are bound to the window but the cursor isn't. ;)
Well surely, you would have to cause an event somewhere in order for the window to loose focus, would you not? ;)

I implemented the solution myself, and it seems that 2 things have changed since SFML 1.x:
  • sf::Mouse::setPosition now causes an sf::EventMouseMoved. To get around that, check if the mouse cursor is already in the center of the window before setting it. Otherwise you will have an endless loop.
  • Moving the mouse cursor outside the window will cause the SFML window to stop producing MouseMoved events. To get around this one, simply also check for sf::Event::MouseLeft.

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window( sf::VideoMode( 800, 600 ), "SFML" );
    window.setVerticalSyncEnabled( true );

    const sf::Vector2i windowCenter( 400, 300 );

    // Set the mouse cursor's position to the center of the screen.
    sf::Mouse::setPosition( windowCenter, window );

    while( window.isOpen() )
    {
        sf::Event event;
        while( window.pollEvent( event ) )
        {
            if( event.type == sf::Event::Closed )
                window.close();
            else if( ( event.type == sf::Event::MouseLeft || event.type == sf::Event::MouseMoved ) &&
                     sf::Mouse::getPosition( window ) != windowCenter )
            {
                // Whenever the mouse is moved or leaves the window, simply calculate the offset
                // and reset cursor's position to the center of the screen.
                // For this test I am not going to calculate the offset.
                sf::Mouse::setPosition( windowCenter, window );
            }
        }

        window.clear();
        window.display();
    }
}
 

Can you make the window loose focus with the mouse with this solution? If you can, then perhaps Laurent should take a look at it.

7
This can be achieved in two ways:
  • Spawn a thread that runs your logic. Be aware that it can be more difficult to work with than it looks.
  • Use one loop, but only perform tasks at the wanted intervals.

I found this article helpful, although it is focused around game loops, which may not be what you are looking for:
http://www.koonsolo.com/news/dewitters-gameloop/

8
Feature requests / Re: Relative Mouse Movement (Mouse Capture)
« on: October 10, 2012, 03:36:59 pm »
I suppose if you were able to move the cursor outside the window and also produce a mouse down event, within the same update cycle, maybe a problem could arise.
But this is all very theoretical, and a lot of ifs and maybes, so I would like to know if you are actually able to produce an error like this in practice?

I have successfully used this method in the past with no problems, but it was a long time ago, and I think with SFML 1.x.

9
Feature requests / Re: Relative Mouse Movement (Mouse Capture)
« on: October 10, 2012, 01:22:57 pm »
Now the big problem with that is when you click, in the instance the mouse is outside the window
That should not be possible with the method I described.

10
Feature requests / Re: Relative Mouse Movement (Mouse Capture)
« on: October 10, 2012, 05:11:14 am »
This is possible with the current API. Here is how to do it:

Set the mouse cursor's position to the center of the screen. Whenever the mouse is moved, simply calculate the offset and reset cursor's position to the center of the screen.

11
Graphics / Re: Possible bug in sf::Text
« on: September 27, 2012, 12:20:19 am »
Yep, it's a stupid bug. I'll fix it this evening.

Thanks for your help :)
Then we were both helpful in this case, and I am glad for both of us. ;)

Thank you for all your wonderful work on SFML - it is my most used and favorite library!

12
Graphics / Possible bug in sf::Text
« on: September 26, 2012, 04:42:32 pm »
Hi Laurent,

I am experiencing some unexpected behavior with sf::Text. The easiest way to explain is with an example:
#include <SFML/Graphics.hpp>
#include <iostream>

int main()
{
        sf::RenderWindow window( sf::VideoMode( 800, 600 ), "SFML" );
        window.setVerticalSyncEnabled( true );

        sf::Font font;
        font.loadFromFile( "arial.ttf" );

        sf::Text text( "M", font );
        std::cout << "text width: " << text.getLocalBounds().width << std::endl;

        text.setString( sf::String( "" ) );
        std::cout << "text width: " << text.getLocalBounds().width << std::endl;

        while( window.isOpen() )
        {
                sf::Event event;
                while( window.pollEvent( event ) )
                        if( event.type == sf::Event::Closed )
                                window.close();

                window.clear();
                window.display();
        }
}
 

Here is what the program outputs in my case:
text width: 23
text width: 23
 

This is the output I was expecting:
text width: 23
text width: 0
 

It seems that the bounding box data isn't always updated when the string is changed.

I hope this is clear enough!

13
Graphics / Re: How to do transparency? shaders?
« on: September 25, 2012, 12:32:42 am »
I would advise you to write your software first, as simply and straight forward as you can, and then look at optimizing it later. Otherwise you could easily be spending your time optimizing the wrong thing, and complicating your code unnecessarily.

14
SFML projects / Re: Pioneers
« on: September 24, 2012, 11:15:01 am »
About the crash, is it reproducible? Sounds bad. How do you disembark? Do you choose the action from the sidebar or right-click the terrain? Would you mind help me debug this? I'd send you a couple of exes and see which one at which point crashes since I can't reproduce it on any of my systems.
I haven't tried to reproduce it yet, but it seemed random. I had been disembarking a number of times in the same fashion.
I chose the action from the sidebar and left-clicked the terrain. That is when the crash happened.
This week is looking to be pretty hectic at the moment, but if you send me the files, I will see if I can make time.

You can actually switch between characters using the TAB key. This should be indicated somewhere other than the help window which usually gets little attention :)
There is a help window?! :)

They don't have to be days but since there are seasons (each of which lasts 90 days), time has to advance in rather measurable steps. Or do you mean simply replace 'day' with 'turn'?
I simply mean replace one word with the other. It removes questions like "Why did my guy just eat 3 kilos of dried meat and sleep for 5 days?"
But now I see that you already made that change. Nice!

About the town. Yes, it's basically just a menu right now. I would love to add more interactivity to it but I didn't want to take on any big developments as it would've postponed the release even more. It's definitely on my TODO list.
I didn't mean to say that you should focus on that right now. It was more of a narrative of what I was thinking while playing the game. I was simply having ideas pop up because I got inspired.

15
SFML projects / Re: Pioneers
« on: September 24, 2012, 01:12:39 am »
... I'm hoping this could sell a few copies. That's the plan for the future. I'm not really thinking about that right now because the game needs to be made first and that's what I enjoy doing.
Oh, I think it could sell more than a few copies, if it turns out as good as I think it could.
But you are right: This is not the time to think about that. Thinking about money is not going to produce a good game. Putting love, care, and hard work into making an enjoyable and coherent experience will. Or at least it should.

Anyway, I did some testing, and here are my notes:

Many places in the game, tool tips would be really handy.

It would also be nice if you could skip the intro by hitting space, enter, escape, mouse click, or all of the above.

In the town:
  • It should be better indicated in the starting tutorial that the town is basically a menu. I spent some time wondering how I could move my character.
    You could also think about making the town not a menu.
    I was thinking that it would be fun if you could walk around and do stuff. It shouldn't be turn based, but work more like a single turn with endless moves. You should also keep the menu, so it would not slow the game down further. Exit the tavern after entering with the menu, and your character is now magically standing at the tavern entrance.
    Then I had the thought that if you tried to cut down a tree or harvest someones crops, your movement would freeze, and the town guard would come running and warn you that it was illegal, and if you did it, say, 3 times in a row, he would kill you on the spot. Game over. Sort of a fun little gimmick, but one that would bring immersion.
    You could even expand it further by adding the ability to buy property, once you have the status and resources to do so. Property could give small resource bonuses.
  • You should make it so that the first ship is paid for, and subtract the expense from the starting funds. On my first play, I went shopaholic in the supply store, thinking that I had plenty of funds, only to find out that I could not purchase a ship, and there was no way to progress.
  • You could think about omitting the die roll on the character creation for the first character, since you always get the same total amount of skill points. Having predefined 'good' values for each character class would serve as extra documentation for new players.
    I get that you probably have the randomness to encourage variation, but I think that limiting control over other party members stats would serve that purpose better. What if you had a limited selection of companions at the tavern, with little or no influence on stats?
  • I noticed that the item selection in the supply store menu sometimes acted strangely when switching between categories. Some times, but not always, a different item would be selected when switching category and then back again.
    The easy fix would be to make sure nothing is selected when switching to a new category.

During the expedition:
  • Are you sure it is wise to refer to the turns as days? It leaves a lot of questions that wouldn't come up if you simply call them turns. For me, it takes away from the immersion.
  • I would like an easier way to select characters. It is a lot of clicking to get to the next guy.
  • Next and previous item should be cyclic. It would also be nice with a list to select the item.
  • The 'walk-to' marker is invisible when it is in the fog of war.
  • When eating and drinking, it would be practical with 'eat/drink until full' buttons.
  • When picking up things such as herbs and berries, it would be nice with 'take all' and 'take all I can carry' buttons.
  • And then the game crashed when I was disembarking.

The style and coherency is still the strongest point of the game. It doesn't matter if it's pretty. That is a matter of taste, anyway. As long as it knows what it wants, it will have the ability to engage players. And with its distinct style, this game does so with abundance. I really wanted to explore that world further.

The interface is generally very fiddly, and a lot of my notes are about that. It is a lot of clickety-click, and it gets tiring fairly quickly.
This is probably the weakest area of the game, and what I think you should focus most on improving.
The games style is probably one of the things that makes it hard to get this just right, so be sure that you don't make any compromises here that takes away from that wonderfully coherent style.

You certainly made a lot of progress since that first release, and I thoroughly enjoyed revisiting and playing with the new features.

I hope you can use my notes! :)

Pages: [1] 2 3 ... 16