How you can render your sprites like in Stardew Valley!

  Рет қаралды 1,380

Chris_PHP

Chris_PHP

3 ай бұрын

Render your sprites like in stardew valley so sprites appear behind certain objects like trees.
Bibliography:
Painters algorithm:
en.wikipedia.org/wiki/Painter...
Sorting algorithms geeks for geeks:
www.geeksforgeeks.org/sorting...
Sprite textures used:
opengameart.org/content/lpc-c...
opengameart.org/content/lpc-t...

Пікірлер: 6
@NyanCoder
@NyanCoder 3 ай бұрын
Meh, depth buffer is not necessarily OpenGL/Direct3D/Vulkan/Metal/WebGPU exclusive thing. It's not even that CPU-hard work either. All you need is additional buffer for depth-check and your own sprite_copy function, that would check depth buffer and write to it if pixel is going to be written
@chris_php
@chris_php 3 ай бұрын
Ah I didn't know that thanks!
@NyanCoder
@NyanCoder 3 ай бұрын
@@chris_php It's just already made solutions in those graphics libraries (in OGL it enables with single line of code even), so because of that some people could feel like it's hardware stuff or library exclusive thing, but in fact a lot of techniques (even raytracing) were made in application-side first (and in case of raytracing there are even specialized commands now to boost compute time in exact this case so modern gpus could keep up in reasonable framerate)
@onebigsnowball
@onebigsnowball 3 ай бұрын
I was just working on something like this. I didn't even think about using a depth buffer... instead I used an approach that will only work for tile based games. It's not very flexible, but very fast for the CPU. I think stardew valley does something similar
@chris_php
@chris_php 3 ай бұрын
Ah nice what solution did you use to solve this problem?
@onebigsnowball
@onebigsnowball 3 ай бұрын
​@@chris_phpIn stardew there are like 4 different layers. Some of those layers make tiles appear in front of entities if they're behind it and the other way around. The other layers are the floor and tiles that always appear above or below the entities. My version is a bit different but that's just because it's more specialized for my game's usecase
Why Stardew Valley’s Creator Hated His Game
20:17
Nello
Рет қаралды 468 М.
Making a difficult game about fitting in - Acerola Jam 0
19:17
jess::codes
Рет қаралды 193 М.
100❤️
00:20
Nonomen ノノメン
Рет қаралды 73 МЛН
We Got Expelled From Scholl After This...
00:10
Jojo Sim
Рет қаралды 41 МЛН
Just try to use a cool gadget 😍
00:33
123 GO! SHORTS
Рет қаралды 76 МЛН
I Built a Shelter House For myself and Сat🐱📦🏠
00:35
TooTool
Рет қаралды 35 МЛН
I Made a Neural Network with just Redstone!
17:23
mattbatwings
Рет қаралды 577 М.
What does a Game Engine actually do?
16:45
Ellie Rasmussen
Рет қаралды 138 М.
4 Godot 4 Devs Make 4 Games in 44 Hours
25:19
DevLogLogan
Рет қаралды 467 М.
Why I Like Programming in C.
3:16
Francisco Jinto Fox
Рет қаралды 24 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,4 МЛН
Architectural Designer Creates a Pixel Art Town
17:43
Pixel Architect
Рет қаралды 840 М.
Factorio teaches you software engineering, seriously.
21:27
Tony Zhu
Рет қаралды 1,3 МЛН
I Made a Table Soccer Robot, and It's Better Than You Are
14:34
From Scratch
Рет қаралды 359 М.
AI Learns to Play Tag (and breaks the game)
10:29
AI Warehouse
Рет қаралды 1,3 МЛН
How Games Have Worked for 30 Years to Do Less Work
23:40
SimonDev
Рет қаралды 1,2 МЛН
🔥Идеальный чехол для iPhone! 📱 #apple #iphone
0:36
Разряженный iPhone может больше Android
0:34
Samsung S24 Ultra professional shooting kit #shorts
0:12
Photographer Army
Рет қаралды 22 МЛН
Купил этот ваш VR.
37:21
Ремонтяш
Рет қаралды 251 М.