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

Pages: [1] 2
1
Network / Re: Latency
« on: March 03, 2014, 11:46:51 pm »
This is probably what i will do, Thanks!  :)

2
Network / Latency
« on: March 02, 2014, 02:55:34 pm »
Hi everyone. Im currently trying to make a multiplayer action game, and i figured it would be a good thing to measure latency somehow in order to place bulllets for example. Is there a way to measure latency in sfml?

3
SFML projects / Re: SFML Light System - Let There Be Light
« on: December 28, 2013, 03:01:46 am »
Use the same code as above

4
SFML projects / Re: SFML Light System - Let There Be Light
« on: December 21, 2013, 03:39:29 pm »
No, there is no such function. However you can get each point from a sf::Shape by using getPoint(int). Example:

hull->m_vertices.clear();
int count = dRect.rect.getPointCount();
         for (int i = count; i>0 ; i--){
            sf::Vector2f point =  rect.getTransform().transformPoint(rect.getPoint(i));
            hull->m_vertices.push_back(Vec2f(point.x,options.screenHeight-point.y));
         }

You probably have to fit it to your code, but this was how i did it ;)

5
SFML projects / Re: SFML Light System - Let There Be Light
« on: December 02, 2013, 10:27:28 pm »
Okey! Thanks for the quick answer

6
SFML projects / Re: SFML Light System - Let There Be Light
« on: December 02, 2013, 07:32:01 pm »
When im setting the m_intensity to lower than 1.0 no light is shown at all when m_useBloom is true.

The light works when m_useBloom is false, however m_intensity doesnt affect the intensity of the light at all ???

Anyone know why this happens?

7
SFML projects / Re: GLLight2D
« on: November 18, 2013, 10:29:58 pm »
I did post it there (http://en.sfml-dev.org/forums/index.php?topic=6635.255 at the bottom), but it seemed no one else had the same problem and since i saw lolz123 here i wanted to ask if he knew what the problem was.

8
SFML projects / Re: GLLight2D
« on: November 17, 2013, 12:36:37 am »
I have a problem using LTBL with long hulls. The light sometimes goes through the hull, especially if the hull is long in one direction compared to the other direction. Do you (lolz123) or anyone else know why this happen or how i can fix it?

9
SFML projects / Re: SFML Light System - Let There Be Light
« on: September 22, 2013, 02:03:39 am »

I don't know if there is a fix for this, but is there any way to make the shadow fill where it's supposed to fill below the ground rectangle?

Make black texture ? What do you want at all?

As you can see in the picture the light penetrates the hull. This seems to happen when the hulls shape is too long in one direction compared to the other direction, because it works perfect with a square hull. I was wondering if there was a fix for this or if i have to split the hull up into several smaller hulls. The blue part is the hull and there are two lights at the player. Some of the shadow is drawn bellow the hull(the black line directly bellow the hull).

10
Network / Re: Newbie Problem - TCP server lagging. (problems with sending?)
« on: September 21, 2013, 11:27:55 pm »
Happy to help! :)

I did this in the receive loop(right after the code i posted). Havent tested it in a while, but it worked the last time.
if (socket.receive(packet) == sf::Socket::Disconnected)
                        {
                                std::cout<<"Client disconnected"<<std::endl;
                                std::cout<<"list size: "<<clients.size();
                                selector.remove(socket);
                                socket.disconnect();
                                delete *it;
                                it = clients.erase(it);

                                std::cout<<" then: "<<clients.size()<<std::endl;
                        }
                        else
                        {
                                it++;
                        }
 

11
Network / Re: Newbie Problem - TCP server lagging. (problems with sending?)
« on: September 20, 2013, 03:37:34 pm »
Had this same problem myself.

In this piece of code:

 sf::Socket::Status status = clients.at(i).socket->receive(packet);
if (status == sf::Socket::Done)
 {
       receivePacket(&packet,clients.at(i).player, &chatLog);
}

Try this instead:

while (clients.at(i).socket->receive(packet) = sf::Socket::Done){
           receivePacket(&packet,clients.at(i).player, &chatLog);
}

12
SFML projects / Re: SFML Light System - Let There Be Light
« on: September 16, 2013, 01:54:31 am »
You could try render the tiles on top of the shadows

13
SFML projects / Re: SFML Light System - Let There Be Light
« on: September 12, 2013, 12:25:40 am »
Have you tried turning the bloom off?

14
Graphics / Re: View size vs. Window size and pixel clipping.
« on: September 11, 2013, 01:11:28 am »
You have to set the view size to whatever the window size is when the window size changes. Something like this in the event loop:

while (window->pollEvent(event))
{
   }
   if (event.type == sf::Event::Resized)
      view.setSize(event.size.width,event.size.height);      
   }
}

You also probably have to play around with it to get the right results. Maybe scale the view so the whole screen fits to the window(with the same dimensions on x and y axis)

15
SFML projects / Re: SFML Light System - Let There Be Light
« on: September 11, 2013, 12:19:30 am »
I don't know if there is a fix for this, but is there any way to make the shadow fill where it's supposed to fill below the ground rectangle?

Pages: [1] 2
anything