Skip to main content
10 votes
Accepted

In Bevy ECS, what is a good way to have entities reference each other?

You shouldn't have to "loop through" all instances of a query. Query lookups are typically implemented in such a way that they are fast -- often constant or logarithmic time complexity. Bevy ...
Joshua Hyatt's user avatar
5 votes
Accepted

Rust lang and Cheaters

When people claim "Rust is secure", then what they mean is that Rust makes it very difficult for developers to create bugs which could result in security vulnerabilities like buffer ...
Philipp's user avatar
  • 120k
2 votes

Should a server run all maps in one loop, or a thread/game loop per map?

To ensure you don't schedule too much work in a single thread, I'd recommend using a server-side thread pool for this. Otherwise you may overrun your time budget per "tick". Threads in the ...
Engineer's user avatar
  • 30k
2 votes
Accepted

What could be causing my texture in ash Vulkan to render lighter?

Special thanks to a comment by DMGregory! The issue is caused because my Texture ImageView and my texture were using different formats. One was set to R8G8B8A_UNORM, and the other to R8G8B8A_SRGB. ...
Joseph Vargas's user avatar
2 votes
Accepted

How to identify the visible tiles and select them for rendering?

I'm not really familiar with this code, so bear with me. If I understand correctly you use this line to draw the player character - or something akin to that - at the center of the screen, right? <...
Theraot's user avatar
  • 27.2k
2 votes
Accepted

How to write Perlin Noise generated data to a vector in Rust?

Perlin Noise You should be able to query the Perlin noise with some 2D coordinates. If you are using this Peril: noise::Perlin, then you can call get with a Point2. ...
Theraot's user avatar
  • 27.2k
2 votes
Accepted

Render moveable entities into 3D isometric world?

You need a container to hold a reference to each object in the current tile/block. If your map is made of tiles Each tile has a height (as in games like Roller Coaster Tycoon or Transport Tycoon). ...
Ferreira da Selva's user avatar
1 vote
Accepted

Why might performance of a Rust-sdl2 project be better while profiling?

Per the Flamegraph README, it runs using the release profile by default: # defaults to profiling cargo run --release cargo flamegraph So you must also run using ...
C Snover's user avatar
  • 126
1 vote

How to implement movement with move speed in a multiplayer game?

Typically in a server authoritative game simulation the server would send or replicate the state of the object and the client would simulate to achieve that state. So for example here might be some ...
Ian Pilipski's user avatar
1 vote
Accepted

How to fix texture atlas border bleeding?

The texture size usually does not match the screen area, so it needs to be enlarger or reduced. That means that the border of your tiles are blended with the transparent border between tiles. And it ...
gotanod's user avatar
  • 341
1 vote
Accepted

How can I implement the player being able to place tiles on a 1d array grid?

If the tile width size is 32 pixels, the inner area will be between 0-31 0..31 0..31 0..31 0..31 So you change the tile index (player_index) in two situations: player_index_counter_x > 31 ...
gotanod's user avatar
  • 341
1 vote
Accepted

How to properly handle hundreds of layers of tiles

For the loading time... Why not chunks? CHUNKS! You don't need to render 400 layers. You only need to render the top one for each tile. That is, for each visible tile iterate over the layers, top to ...
Theraot's user avatar
  • 27.2k
1 vote
Accepted

Having a Logic Error in my tile rendering code

I think the code is doing what you are asking it to do. However, I have some idea of what you want. I might be wrong but… Well, you try and tell me. We have 1D data is ...
Theraot's user avatar
  • 27.2k
1 vote

How would I go about preparing my skybox for a z-up world orientation?

Assuming the skybox faces are loaded in the following order: front, back, up, down, right, left, and the skybox texture is a cubemap rather than 6 individual faces, you can reorient it for z-up by ...
Maximus Minimus's user avatar
1 vote
Accepted

How would I go about preparing my skybox for a z-up world orientation?

From what I can tell, Ash isn't a rendering engine, just a wrapper around the Vulkan API. Therefore you are presumably using your own engine and shaders to actually render everything. So, just modify ...
Jherico's user avatar
  • 201
1 vote

Ponderate dijkstra relative to previous position

Once I created this algorithm. You need to increase weight in diagonal paths: you will use the value 10 for non diagonal, and value 14 for diagonal. This value is the distance between squares; 10 is ...
Morvy's user avatar
  • 11
1 vote

SetFullscreenState not returning

I figured out the issue. Before returning, SetFullscreenState sends a WM_MOVE then a WM_SIZE ...
cwhakes's user avatar
  • 31
1 vote

Black texture when manually creating from image

Finally figured it out. Rather than DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_UNORM is required. Fixing this fixed the ...
cwhakes's user avatar
  • 31

Only top scored, non community-wiki answers of a minimum length are eligible