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

Pages: [1] 2 3 ... 623
You aren't linking SFML itself.

Are you trying to link statically and haven't defined SFML_STATIC?

Network / Re: Player Movement Interpolation / Prediction
« on: Today at 09:58:29 am »
You wouldn't really interpolate between packets, but you'd do a client side physics calculation and move your objects accordingly. Once the server response with a new data point, you set the correct position.

There's no "ideal logic" to this, but it all depends on your code.

Also here's an article that might be interesting to you: https://www.kinematicsoup.com/news/2017/5/30/multiplayerprediction

General discussions / Re: Setting Frame Limit of the project
« on: Today at 09:54:50 am »
SFML already has such a functionality with setFramerateLimit().

You'd sleep the amount of time, that would still make your reach the desired frame time.
Say you want 60fps <=> 16.666ms, now your last frametime was 4ms, so you could in theory sleep 16-4ms = 12ms.
However, sleeping is not a precise action, so you need to consider some slack, if you really want to precise.
(If you want to go crazy, you can also measure the deviation and adjust dynamically)

General / Re: Static linking Linux
« on: Today at 09:50:27 am »
The official Manjaro packages don't contain static libraries.
You'll have to rebuild SFML on your own.

Also static libraries have the suffix -s

Graphics / Re: What is the best way to handle interactive grid?
« on: December 04, 2019, 11:02:00 pm »
You shouldn't forget that you're dealing with a computer here, iterating some 81 rectangles will only bore your CPU. ;)

However since your grid is evenly spaced you don't actually need to iterate anything, but you can calculate within which cell the cursor is.

- Get the mouse position relative to the window
- Subtract the spacing around the grid (if there's any)
- Divide width and height by the width or height of a cell
- Round result down

Now you should end up with something like (0,0) for the top left cell, (0, 1) for the middle left cell, (2, 2) for the bottom right cell, etc.

Java / Re: Is JSFML still being developed?
« on: December 02, 2019, 08:33:37 pm »
Yes, as the website and this thread says, the development has stopped.

Graphics / Re: Assertion Failed when trying to load Texture
« on: December 02, 2019, 08:31:01 pm »
As mentioned on Discord, your LoadTexture function isn't returning anything.

// Method for loading Textures
sf::Texture SpriteLoader::LoadTexture(string name) {
    sf::Texture texture;

    if(!texture.loadFromFile(GetResourceLocation()+"/"+name)) {
        cout << "[ERROR]HE: SpriteLoader: Texture failed to load! (" << name << ")" << endl;

Not even sure how this code is compiling for you.

Network / Re: Sending multiple packets simultaneously UDP
« on: December 02, 2019, 07:38:52 am »
No, but if you want to send the data at once, just pack it all into one Packet.

If you need a reliable protocol, then you'd be better of with TCP, otherwise you'll have to build some protocol on top of UDP yourself (or use a library) which will ACK (or similar) received messages etc

I'm on Win10, and I installed Debian from MS.
Do you mean, you're using the subsystem (WSL)?
No idea if this supports proper GPU access and it's also not really a setup that SFML supports.

The error basically indicates, that you don't have a proper GPU driver installed.

Window / Re: Sprite can't be positioned
« on: November 30, 2019, 11:25:26 am »
The issue is probably somewhere else in your code.

Can you provide a complete and minimal example that reproduces the issue?

Graphics / Re: Updating a Specific Sprite or View
« on: November 26, 2019, 11:45:48 pm »
For large maps, especially if they're changing rarely, you may want to use a render texture and draw the map to it whenever something changes. That way you won't be updating the map as often.

Window / Re: draw on different levels
« on: November 26, 2019, 08:52:30 pm »
You really just want two views.

Set the first view, then render your game world objects.
Then set the second view and render your GUI.

The GUI view should not be modified, except to account for window resizes, and thus your GUI will always remain stationary.
While at the same time, you can move around your game world view, follow the player, zoom in on the action, etc. all while the GUI stays stationary.

See also the official view tutorial or my own view tutorial from a while back.

Graphics / Re: trying to override Drawable::draw() but no effect
« on: November 26, 2019, 08:24:54 pm »
You aren't "displaying" it on the window, but you're making sure the rendered object on the render texture are actually drawn properly. Before you use the texture of a render texture you have to call display().
See also: https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1RenderTexture.php#details

Graphics / Re: trying to override Drawable::draw() but no effect
« on: November 26, 2019, 09:24:33 am »
You're never calling display on the render texture.

Pages: [1] 2 3 ... 623