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 ... 721
1
Graphics / Re: Tile-based graphic using Sprites.. right?
« on: May 09, 2024, 09:51:46 am »
When talking about tiling it's mostly thought of as a flat 2D space. Isometric rendering requires a lot of special rules, that on a 2D grid doesn't necessarily apply, thus my suggestion to search more around the term isometric.

Searching online i've found this https://www.sfml-dev.org/tutorials/2.4/graphics-vertex-array.php , i think is exctly what i was looking for probably, rigt?
Yes, this shows you how to utilize a vertex array.

This might also be useful: https://www.binpress.com/creating-city-building-game-with-sfml/

2
Graphics / Re: Tile-based graphic using Sprites.. right?
« on: May 08, 2024, 08:18:31 am »
The term you're looking for is "isometric".

You can use sprites, but you may run into performance issues down the line, so you may consider starting off with vertex arrays.

The difficult part is correctly calculating which tile needs to be rendered on top of what other tile, depending if something is below or above or infront.

3
SFML projects / Re: VALA-vapi binding sfml
« on: May 07, 2024, 07:55:05 am »
I've never used Vala, but looks quite similar to the C languages.

If you want, you could open a PR to add it to the binding page: https://github.com/SFML/SFML-Website

4
Graphics / Re: How do I disable font smoothing?
« on: May 03, 2024, 07:19:09 am »
Also make sure you're rendering text only on integer position and choose the fitting font size, i.e. never scaling the text.

5
System / Re: Fail to Build Project
« on: May 02, 2024, 04:23:27 pm »
Make sure your configuration is for the correct compiler architecture (Win32 vs x64) and config (Debug vs Release). Note how no SFML libraries are listed above.

Also don't delete %(AdditionalLibraryDirectories) from the Additional Library Directory, otherwise the linker might fail to find system libraries.

6
System / Re: Fail to Build Project
« on: May 02, 2024, 03:51:13 pm »
Double check the config with the tutorial, you must have done some mistake somewhere to get the shown error output.

Provide the verbose build output, so we can see the complete configuration: https://www.sfml-dev.org/faq.php#tr-grl-verbose-ide

7
System / Re: Fail to Build Project
« on: May 02, 2024, 03:06:19 pm »
How are you linking SFML?

8
System / Re: Fail to Build Project
« on: May 02, 2024, 02:55:20 pm »
Are you #include-ing the lib file instead of a header file?

You need to provide more information on what you're doing in order for us to help and not just make random guesses.

9
It's recommended to use the SFML CMake template, which integrates the downloading and building of SFML, thus you don't have to worry about not matching configurations.

If it can't find the shared libraries, then it's either not been built as shared libraries, the path specified to SFML is wrong, or the CMake config for SFML hasn't been updated.

10
General / Re: Randomizing the movement of the Sprites
« on: April 30, 2024, 01:59:04 pm »
You'll need to wrap your sprite in an entity, so it can hold a different velocity.
Then you can use <random> to generate random numbers and assign a random velocity to each of your entities.

In the update function, use a delta time step and the set velocity to move your sprites/entities one at a time a bit every frame.

11
General / Re: AABB collision resolution not working as expected
« on: April 29, 2024, 09:00:16 pm »
Hehe ;D

The debugger can be a valuable tool for finding our own mistakes :D

12
General / Re: Smooth character movement with Arrow keys
« on: April 29, 2024, 01:04:14 pm »
Using events over isKeyPressed isn't a "reformatting", you're changing the underlying code. Formatting usually refers to code styling change that don't affect the semantics and usually also not the syntax.

The event that you're getting from the pollEvent() call already carries all the necessary information, as such it's for one redundant to again ask the system/device what the keyboard state of a specific key is, in relation to an event. Meaning if the event is of type KeyPressed (event.type == sf::Event::KeyPressed), then you know that a key has been pressed, you don't have to query again if the key is pressed.
In the worst case you might miss the key press, although you process the event, the key might have already been let go. Meaning you get a KeyPressed event that happened like 0.5ms ago, but then you ask the device again if at this moment right now the key is pressed, but you've let go in that time frame, thus the input isn't processed. Granted this is quite an edge case, but it does happen and can lead to frustrations for players/users.
And finally, real-time input checks are slightly more expensive, as you have to query device information, while the event has already gathered that information, and on some systems (e.g. macOS), you'll need additional permissions for the function to return anything at all.

The "new" recommendation is to use events whenever possible, but also never mix events and real-time checks for the same event occurrence. ;)

13
General / Re: How can I use stbi writing functions?
« on: April 29, 2024, 09:50:25 am »
As a side note: While SFML does use stbi, it shouldn't leak outside the SFML bounds

14
Graphics / Re: What is the best way to animate large frames?
« on: April 29, 2024, 08:38:16 am »
At what point would it make sense to use a video format instead of trying to manually create an animation of images? ;)

On one hand make sure you're measuring the "performance" in release mode.
Then to make sure you're optimizing for the right bottleneck use profiling tools to find the hot paths.

Assuming it's the reading from disk part, there isn't much you can do, as you'll have to read the image data into memory at one point.
You could perform the reading in a separate thread, so you don't block your "UI" thread, but make sure to only do this for the disk reading part (i.e. sf::Image) and not to try to do any OpenGL calls in a separate thread.

Pages: [1] 2 3 ... 721
anything