Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sorting]

The tag has no usage guidance.

0
votes
0answers
143 views

How to sort cards' on-screen positions by their suit?

I have a 13 cards and sort button. When I click that button, I want all the cards of each suit to be grouped-together on screen. So if I have 4 diamond cards in my 13-card hand, all 4 diamonds must ...
1
vote
1answer
59 views

Sorting sprites based on Z index

I am working on a 2D game engine in C# using OpenGL. I am trying to find a collection to satisfy my needs for sprite ordering, and I can't seem to find the combination of performance and functionality....
0
votes
0answers
27 views

walking up/down slowed by z coordinate layering

I am making a 2D topdown sprite game. I got myself a controller script that handles input and makes the character move/attack etc. I eventually added objects you could walk in front of or behind, like ...
0
votes
1answer
234 views

How can I sort vertices efficiently in a specific direction (CW/CCW)?

I am trying to triangulate a set of points using a very simple approach where a base vertex is chosen, and then every other vertex is joined to its neighbouring vertex and then back to the base vertex,...
0
votes
1answer
45 views

Array with multiple linked objects in Unity

This might be too primitive, but for my use case, I need to maintain an array in which two attributes are linked to each other... For example - If I want to do Score gathering... Then I need an array ...
0
votes
1answer
219 views

How to manage changing Z-Index in an Entity-Component-System?

If got an Entity Component System based game-project (like classic zelda). The Player as well as Enemys are Entities with sprite- and tranform-components. The Weapons are also Entities with sprite- ...
2
votes
1answer
699 views

In Unity, why do I get a “does not implement right interface” error when trying to sort my list of objects?

I am trying to create a crafting panel that sorts the list of items you can make alphabetically, yet I cannot figure out why .Sort() is not working. What I have ...
0
votes
1answer
258 views

How to sort entities order by nearest entity distance?

I have created a comparator class called DistanceSquaredComparator and implements it with Comparator<Entity>. Then in the ...
0
votes
0answers
135 views

Using Sorting Layers with 3-d meshes

I have 3 layers of objects in a game that I am working on. The layers are the "map" layer (Background), "UI" layer (Labels, etc), and the "Object" layer (Movable objects). I am working on a 2-D game, ...
0
votes
1answer
223 views

Did they remove Sprite sorting layers from Unity?

I can't figure out how to set it. I thought it was a setting on the sprite renderer but it doesn't seem to be there? Google isn't turning up any results.
0
votes
1answer
3k views

Why is my TextMesh always on top?

I have a 2-d game that I am making, using 3-d assets, including TextMeshes for text. I have decided that in some instances, I would like to have the TextMesh appear behind objects in the foreground. ...
8
votes
1answer
287 views

Optimal batching for 2D objects with transparency

I have a collection of 2d objects with transparency. Each object has a depth value to determine draw order and a material. I'm trying to batch them in an optimal way to minimize draw calls. Assume ...
3
votes
1answer
564 views

Reorder a set of points in order to draw a triangle fan (example)

I'm doing a light engine (c++, using sfml), and to connect the light vertices, I thought about drawing a triangle fan. Here is a representation of a triangle fan (sfml documentation): The points HAVE ...
3
votes
1answer
321 views

Transparency sorting in 3D world with different render types

I am rendering a world, object, and models from an older game format. The world is presented in a BSP tree so I can quickly iterate through. The opaque surfaces are rendered front to back. Then ...
1
vote
1answer
343 views

Drawing order of 2D tiles with 3D bounding volume

I'm wondering which algorithm was used to draw the sprites of the video game Commandos in the correct order. Each sprite has a 3D bounding volume (either a polygon or a cylinder), this is how the ...
4
votes
1answer
84 views

What is a viable way of finding the minimum swaps to sort numbers in pyramid?

I have made a game that consists of a pyramid of hexagons with numbers from 00 to 99 randomly positioned in groups of 6, 10 or 15 elements. Now, I'm working to create an auto-solver but for the last 2 ...
5
votes
2answers
5k views

How do I determine the draw order of isometric 2D objects occupying multiple tiles?

My current sorting method works only for objects that occupy 1 tile and fails for multi-tile objects. For examle, the bed in the above picture occupies 1×2 tiles, and the sorting fails. Also that bed ...
1
vote
1answer
211 views

Texture Packer - Any way to make it combine intelligently

I am making a Pokemon Clone, using libgdx. I have the different types of sprites: e.g. Back, front, back shiny, and front shiny. The current way the Texture Packer combines the textures seems to be ...
2
votes
1answer
96 views

Why do the order of uniforms gets changed by the compiler?

I have the following shader, everything works fine when setting the value of one of the matrices but I've discovered that getting a value back is incorrect for View ...
0
votes
2answers
359 views

How to control which polygons get rendered first in a batch (e.g. to draw leaves)?

Sorting transparent objects is a well-known problem. If you send a bunch of transparent polygons (e. g. leaves and branches on a tree) into the GPU and render them with alpha blending enabled, the GPU ...