Spritestacks - Pygame Tutorial

Ғылым және технология

Spritestacking is a simple technique for making layers of 2D artwork appear 3D! Spritestacking is quite easy to implement in Pygame, but any scalable implementations will probably require that you implement caching.
Tutorial Reference Code:
dafluffypotato.com/static/spr...
Grass Tutorial:
• I simulated 40K blades...
Centered Rotations Tutorial:
• Centering Images & Cle...
Patreon:
/ dafluffypotato
My Discord:
/ discord
Potato Tier Patrons:
Agent Effe
Eivind Teig
fatcake
RyDawgE
Sam Cork
GaryTMSFruitcake
Dale Topley
Jb mandri
tbf135
#python #pygame #gamedev

Пікірлер: 56

  • @DaFluffyPotato
    @DaFluffyPotato11 ай бұрын

    accidentally recorded with my gain too high. oops.

  • @eboatwright_
    @eboatwright_11 ай бұрын

    This effect never gets old! It's so charming

  • @onebigsnowball

    @onebigsnowball

    11 ай бұрын

    bruh you again

  • @eboatwright_

    @eboatwright_

    11 ай бұрын

    @@onebigsnowball 😳

  • @solstice_enigma
    @solstice_enigma11 ай бұрын

    That is a super neat and simple little trick! I guess the hardest part of all of this is just making everything consistent.

  • @maybe_tankerguy05
    @maybe_tankerguy0511 ай бұрын

    This is a pretty cool effect. When I get to a point where I am able to make my dream project, I might add in spritestacking to give it a bit more of a unique look than a standard, 2d top down game.

  • @matheus5806
    @matheus580611 ай бұрын

    Nice to see you exploring other genres. I really liked the aesthetics in this video, good shit

  • @Dailyfiver
    @Dailyfiver8 ай бұрын

    Duuuuude this is amazing! I never knew what it was called but I accidentally did a lower form of this for my first game ever! We also had drawn all the maps with regular flat “brightness” and then added a “shadows” layer over top of the entire game so that the shadows looked like they covered moving objects dynamically lol.

  • @sbd2639
    @sbd263911 ай бұрын

    I tried to make a car racing game before and used a free asset from itch but didn't realize the asset was meant to be used as spritestacks and just took the upper layer of the car and added rotation to make it turn which ended up looking very bad. I gave it a try after watching this video and sure enough, it looks 100x better :)

  • @quantum_hg3299
    @quantum_hg329911 ай бұрын

    Really cool concept

  • @QUASAR098
    @QUASAR09811 ай бұрын

    damn this looks great! i really want to try out this racing game when it is finished

  • @dslower7578
    @dslower757811 ай бұрын

    I love how it looks, you allways find ways of making better looking games with pygame, it's awesome. Btw, how did all end with pygame and pygame-ce??

  • @DaFluffyPotato

    @DaFluffyPotato

    11 ай бұрын

    There is no end

  • @zvisger
    @zvisger11 ай бұрын

    :O I can't wait to watch this tonight!

  • @zvisger

    @zvisger

    11 ай бұрын

    Ok so I watched it and this is awesome... idk why I never thought of this. Thanks Fluuff

  • @PaulHindt
    @PaulHindt11 ай бұрын

    Your racing game reminds me of Codemasters' NES racing game called "Micro Machines", based on the toy cars from the 1990s of the same name. Have you ever seen that game? They rotate the car sprites in a way that looks very similar, albeit without sprite stacks. Also, your rotating background looks awesome, and is something that was not done in Micro Machines.

  • @DaFluffyPotato

    @DaFluffyPotato

    11 ай бұрын

    I only know the name because someone else said the same thing.

  • @emperor8716
    @emperor871611 ай бұрын

    this is crazy

  • @rowanw5912
    @rowanw591211 ай бұрын

    In a game like this with a locked isometric perspective it seems more efficient to just do the spritework in 3d to begin with, that way you're not wasting performance on pixels that will never be rendered (the inside of the car for example). Even for the backgrounds since you're not using parallax the result will be identical to predrawn sprites with a clever tiling system. Spritestacking only seems worthwhile if you're trying to do 3D with perspective.

  • @DaFluffyPotato

    @DaFluffyPotato

    11 ай бұрын

    You don't waste anything on the middle if you cache.

  • @novialriptide
    @novialriptide11 ай бұрын

    5:24 looks trippy.. wow

  • @carrotsandcats
    @carrotsandcats11 ай бұрын

    Thanks, thats so cool, i’ve try this before but it was slow af.

  • @fmailscammer
    @fmailscammer10 ай бұрын

    What did you use to render the environment? is it just a huge version of spritestacking as well? it looks so good as well

  • @DaFluffyPotato

    @DaFluffyPotato

    10 ай бұрын

    It's just a big flat image (aside from fences, which are also spritestacked)

  • @fmailscammer

    @fmailscammer

    10 ай бұрын

    @@DaFluffyPotato thanks so much. I was about to start another game in Godot (which my only motivation for came from watching your "I make fast gaem" video and wanting to create a movement-based melee combat platformer) but now I really want to try and make something like this in pygame as a placeholder until I can come up with a real premise.

  • @howezae6338
    @howezae633811 ай бұрын

    Interesting concept! May I ask if you will ever be developing using a more efficient platform, say using C# or Java?

  • @DaFluffyPotato

    @DaFluffyPotato

    11 ай бұрын

    I have no reason to at the moment

  • @simonjones90
    @simonjones9011 ай бұрын

    I'd love to know what base resolution you are setting with your games?

  • @DaFluffyPotato

    @DaFluffyPotato

    11 ай бұрын

    it varies. you can just run the games and check

  • @doyoureallyneedahandle
    @doyoureallyneedahandle11 ай бұрын

    Can you do a tutorial about top down sprite rendering I have problems at ordering them correctly

  • @DaFluffyPotato

    @DaFluffyPotato

    11 ай бұрын

    Sort by Y of the base

  • @doyoureallyneedahandle

    @doyoureallyneedahandle

    11 ай бұрын

    @@DaFluffyPotato thx

  • @metgaming9545
    @metgaming95459 ай бұрын

    Is there a trick to caching? Or do you just add layers you’ve already generated to a dictionary or array

  • @DaFluffyPotato

    @DaFluffyPotato

    9 ай бұрын

    I actually prerender the whole stack and store it based on angle

  • @red-52
    @red-524 ай бұрын

    I use pg.RESIZABLE and pg.SCALED is there a reason why the other method is better?

  • @DaFluffyPotato

    @DaFluffyPotato

    4 ай бұрын

    SCALED is faster but is more difficult to make work nicely with RESIZABLE. Also, I started using that technique before SCALED was even a thing.

  • @blunderingfool
    @blunderingfool7 ай бұрын

    I was wondering when someone would make a game with 2KliksPhillip's "dolly mixture" method. :D It looks great!

  • @smosa605
    @smosa60511 ай бұрын

    for a bigger game wouldn't this be very cpu intensive rendering all of these images for a 3d model because if they're multiple different 3d sprites in a game it could be a lot?

  • @DaFluffyPotato

    @DaFluffyPotato

    11 ай бұрын

    No, it's as fast as rendering a 2D tile if you cache properly.

  • @smosa605

    @smosa605

    11 ай бұрын

    @@DaFluffyPotato by cache do you mean iterations?

  • @Fezezen
    @Fezezen9 ай бұрын

    I think I first saw this on a 2kliksphillip video where he called them "dolley mixtures"

  • @bloctans_4
    @bloctans_410 ай бұрын

    pygame is a wrapper for sdl2, i dont understand why people hate pygame but love sdl2

  • @bobyjoegames2
    @bobyjoegames25 ай бұрын

    Are the fences in this scene sprite stacked too?

  • @DaFluffyPotato

    @DaFluffyPotato

    5 ай бұрын

    yes

  • @__Rizzler__
    @__Rizzler__9 ай бұрын

    CUMAZINGGGGGGGGG!!!!!!!!!!

  • @OtateriheemEdRiemLav
    @OtateriheemEdRiemLav10 ай бұрын

    It looks like the spinning 3D rat meme xD

  • @user-eo1es6vz6s
    @user-eo1es6vz6s11 ай бұрын

    coder space made the similiar stuf likes you but he used magica voxel to make stacked sprites))

  • @knut-olaihelgesen3608
    @knut-olaihelgesen360811 ай бұрын

    Have you developed your own framework when using Pygame?

  • @DaFluffyPotato

    @DaFluffyPotato

    11 ай бұрын

    yes

  • @RiveBlakBerry
    @RiveBlakBerry11 ай бұрын

    i been working on a same thing

  • @kevinkim9309
    @kevinkim930911 ай бұрын

    Hey dude, I have learnt way too much from you for free. Do you have a separate payment link? I'd like to donate some cash privately, without commission being taken off. Any cashapp would do.

  • @DaFluffyPotato

    @DaFluffyPotato

    11 ай бұрын

    Patreon takes a pretty small cut (

  • @Ansino558
    @Ansino55811 ай бұрын

    Hi there guys

  • @rapha4220
    @rapha422011 ай бұрын

    tutorial for caching!!

  • @plexus2000
    @plexus200011 ай бұрын

    wsg

  • @majomajo36
    @majomajo3611 ай бұрын

    wait its online or its ai?

Келесі