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

Pages: 1 [2] 3 4
Graphics / Re: Delete sprite from vector
« on: September 14, 2018, 02:09:24 am »
eXpl0it3r told you what you're doing wrong:

If you erase an element from a vector you're iterating over, you need to account for that.

Code: [Select]
i = pociski.erase(i);

It is quite an advanced topic. Unfortunately, TCP hole-punching is by far the most complicated. TCP hole-punch generally involves both parties to perform a series of connection attempts that have the intent to fail but result in leaving the desired ports open.

Generally a third server is involved to help co-ordinate these connections.

Are you using UDP or TCP for networking?

Ports are required to be open to connect from one PC to another outside of the network; however, you can get around the manual process of opening these ports (port forwarding) by performing a hole-punch which will temporarily open the ports desired.

TCP hole-punch: https://en.wikipedia.org/wiki/TCP_hole_punching
UDP hole-punch: https://en.wikipedia.org/wiki/UDP_hole_punching

Most games do not require you to port forward by using a central server (that already has its ports open) to either:
  • Inform the game host of an in-coming connection from the IP address: xxx and port: yyy. Both the server and client begin conveying messages to one another to temporarily open their ports (see hole-punching links above).
  • Use the central server to sync game data.

As for your last question regarding changes to your actual code; you may possibly run into latency issues depending on how you've implemented syncing data, as a LAN connection has little to no latency in comparison to a connection outside of the network.

Network / Re: Online games using UDP and making clients port forward
« on: June 05, 2018, 04:21:16 am »
Check out UDP hole-punching.

Network / Re: Port-Forwarding with LAN
« on: May 10, 2018, 12:40:19 am »
You don't need to port-forward for a LAN connection. You may choose which ever non-reserved port you like.
List of reserved ports: https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

Network / Re: UDP packets queuing instead of skipping
« on: May 07, 2018, 05:09:25 am »
Check the timestamp of each packet in the queue & only process the most recent one perhaps?

Network / Re: UDP packets queuing instead of skipping
« on: May 05, 2018, 03:20:15 am »
Forgive me if I'm wrong, but I think you are after time stamping your packets & disregarding the older packets that are queued?

Graphics / Re: bug whith Text class
« on: April 10, 2018, 08:52:22 am »
In your first example, text is in the same scope as the font, both being re-created on every draw call. In your second example, text is now a class member; therefore, it's on a different scope level compared to the font.

I'm thinking that this must be the problem. As the font goes out of scope (therefore destroyed), the text would still have a reference to it. I believe the general rule is, to keep an object alive for as long as it is being referenced / pointed to. So in your case, you would want to make font a class member also - I'd also recommend loading the font before you render it (you're currently loading the font every draw call).

General / Re: Visual Studio ignores ELSE IF
« on: January 07, 2018, 11:54:24 pm »
Code works as expected on my end. What do you want the code to do?

Network / Re: Receiving data
« on: December 21, 2017, 11:44:50 pm »
I think I understand what you're saying now.

The connection between the client and server works. The issue is:
The client cannot send data to the server without the server first sending data?

Network / Re: Receiving data
« on: December 20, 2017, 11:55:53 pm »
What do you mean by it "won't work" unless you send data? You can't send data over TCP without a connection, so that must be working fine for you.

DotNet / Re: SFML.NET 2.4 Update
« on: December 20, 2017, 11:52:33 pm »
Go to the SFML bindings page and download the C binaries and then put them in the location of your .NET DLLs.

Or, a much similar solution is to just use nuget and add SFML.NET 2.4 to your project, it comes with the CSFML binaries - so it should work off the bat with no extra steps.

DotNet / Re: SFML.NET 2.4 Update
« on: December 04, 2017, 11:34:44 pm »
You should have 2 sets of DLL's in the same directory; the .NET DLL's and the CSFML DLL's.

While admittedly; I have only used JSFML on windows, I believe there is a package which only includes the windows libraries and then there is a version that includes the libraries for all 3 platforms (windows, mac & linux). Open the .jar file as an archive to check if your SFML.jar is missing the linux libraries; if so, go download the package which includes them all.

General / Re: Now to the ram "issues"
« on: October 27, 2017, 12:56:51 am »
Just because you're attempting to re-make a game in C++/SFML from a game engine doesn't guarentee improved performance. A lot of these popular engines have invested a lot of resources (time, money etc..) into development and I'd imagine in a lot of cases out perform a lot of home-brew engines.

Anther thing to note, Game Maker does convert the "textures" into texture pages which can reduce the impact the texture sizes loaded in memory.

Probably my fault, i assumed true the "game maker has bad performance" statement you can see everywhere around, maybe it's just not that true after all.
Isn't a texture page just a bigger texture with more textures in it opposed to having multiple smaller textures?

I think you should really look further into why Game Maker has "bad performance" and where. I'm not saying it isn't true; but my point being, a company who has a huge amount of resources going into this engine versus a hobby programmer new to C++. Not to say it's impossible, but you should really get a better understanding of:

  • Where GM lacks performance and why.
  • What you actually want to achieve.
  • C++ and SFML (if this is the right library for your task).
  • Profiling.

Also, regarding the texture pages; they remove a lot of "empty space" and compact the textures, pretty much a texture atlas. The point of the texture page is indeed to have 1 texture instead of many - for sprite batching.

Pages: 1 [2] 3 4