Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Chev
Jul 19, 2010
Switchblade Switcharoo

anothergod posted:

I did spend a few hours watching tutorials trying to learn how to make Shadergraph work, but I couldn't figure out how to properly do shadows. The way my algorhthm would work is I'd have a second image that i'd place shadows on, but I'd be checking each pixel's depth value against up to 4 other pixels' depth values... and then I realized I have no idea how to do if statements and plot onto textures via shadergraph. I think I need to get into the shader mentality bc when I asked around people said "If" statements are big no-nos, so... yeah


It's not an ironclad no-no, but due to how pixel shaders work you can assume that both branches are always gonna be executed, then the appropriate result is gonna be used based on the condition. That's unlike most normal programs where only the branch that matches the condition would be executed. Basically, you've gotta picture it like image compositing, photoshop layers. Each branch is one image, then the condition is the mask that mixes them, white when true and black when false. No matter what the mask contents are, both pictures still fully exist.

Although I'm not familiar with Unity's shader graph this is mentioned in the branch node's doc, for reference: https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Branch-Node.html
Presumably comparison nodes would be used in tandem.

So, performance is lower than without branches, but unless you're doing a lot of really, really fancy calculations on par with PBR or what have you on a ton of polygons, which is unlikely with 2D pixel art stuff, you can get away with some branches.

Chev fucked around with this message at 01:21 on Jul 26, 2020

Adbot
ADBOT LOVES YOU

Kazinsal
Dec 13, 2011
I keep looking at Shader Graph and thinking I could probably do some neat stuff with it but when looking at the two main scriptable render pipelines it totally looks like neither of them are quite there yet despite being the one that all the new features use.

megane
Jun 20, 2008




That looks great! Much easier to read.

Tann
Apr 1, 2009

Chev posted:

both branches are always gonna be executed, then the appropriate result is gonna be used based on the condition.

lol oops.
I heard about "branches no" and just did that to avoid branches which means it was pointless.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Chev posted:

It's not an ironclad no-no, but due to how pixel shaders work you can assume that both branches are always gonna be executed, then the appropriate result is gonna be used based on the condition. That's unlike most normal programs where only the branch that matches the condition would be executed. Basically, you've gotta picture it like image compositing, photoshop layers. Each branch is one image, then the condition is the mask that mixes them, white when true and black when false. No matter what the mask contents are, both pictures still fully exist.

Although I'm not familiar with Unity's shader graph this is mentioned in the branch node's doc, for reference: https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Branch-Node.html
Presumably comparison nodes would be used in tandem.

So, performance is lower than without branches, but unless you're doing a lot of really, really fancy calculations on par with PBR or what have you on a ton of polygons, which is unlikely with 2D pixel art stuff, you can get away with some branches.

With modern pipelines, you may execute both branches of CPU code if the branch predictor guesses wrong, too. Also the cost of flushing the pipeline. Branches aren't great for perf in any context.

Chev
Jul 19, 2010
Switchblade Switcharoo

leper khan posted:

With modern pipelines, you may execute both branches of CPU code if the branch predictor guesses wrong, too. Also the cost of flushing the pipeline. Branches aren't great for perf in any context.
Yeah, but it's "may" vs "will", and no one would expect you to write a normal program without branches if that's even feasible, while for a shader it's pretty standard. The performance implications are completely different for a program that may run anywhere from a couple seconds to several months, compared to a shader that's expected to take microseconds.

Polo-Rican
Jul 4, 2004

emptyquote my posts or die
Does anyone know if it's possible to capture "floating" windows in Unity using Windows's "Game Bar?" I'm trying to record a detached, maximized Game window, but every time I record it records the Unity editor behind the Game window. Super annoying because I tested this yesterday and it was working perfectly.

(For context: I'm just trying to record gameplay as fullscreen as possible without needing to export actual builds from Unity for every element I want to capture. The Unity editor doesn't seem to allow for true, edge-to-edge fullscreen... the closest you can get is dragging the Game view into a floating window and then maximizing that)

Peewi
Nov 8, 2012

Polo-Rican posted:

Does anyone know if it's possible to capture "floating" windows in Unity using Windows's "Game Bar?" I'm trying to record a detached, maximized Game window, but every time I record it records the Unity editor behind the Game window. Super annoying because I tested this yesterday and it was working perfectly.

(For context: I'm just trying to record gameplay as fullscreen as possible without needing to export actual builds from Unity for every element I want to capture. The Unity editor doesn't seem to allow for true, edge-to-edge fullscreen... the closest you can get is dragging the Game view into a floating window and then maximizing that)

Does it have to be with the game bar? OBS gives more control of exactly what is captured at the cost of needing more manual setup.

Polo-Rican
Jul 4, 2004

emptyquote my posts or die

Peewi posted:

Does it have to be with the game bar? OBS gives more control of exactly what is captured at the cost of needing more manual setup.

You know, for some reason I had a lot of trouble in the past getting OBS to record 1080p / 60fps footage that was sharp... but it's possible I had an old version, or was a moron back then, because I took another look and am getting great results. Thanks!

Doctor_Fruitbat
Jun 2, 2013


Set OBS to use low CPU usage capture if you have trouble, that seems to be the most reliable way of getting it to capture at a consistent 1080p/60fps.

Shoehead
Sep 28, 2005

Wassup, Choom?
Ya need sumthin'?
I went and prettied up that brawler I was messing with



Whaddya think?

anothergod
Apr 11, 2016

Shoehead posted:

Whaddya think?

As always the spritework is great. To be critical, I think it's a little distracting. The backgrounds are high saturation and high contrast which is very distracting from the character. If you look at NES era brawlers there's a lot of high color/brightness in the environments, but most of them are also flatter than other NES games just to keep your eyes on the prize. The characters are pretty cool. Walking animation is great. I think it's hard to differentiate the jabs, and the uppercut looks a little awkward. I'm thinking it might need a keyframe of anticipation -- maybe windup her torso more or duck a bit to get some leg power? Not sure. The enemy's being-juggled animation is cool, and I like that ground bounce. Also, the small details are really great.

CitizenKeen
Nov 13, 2003

easygoing pedant
Just finished my very first game (a stripped down version of Number Munchers, which tells you how little how I know). Only posting so that (hopefully) in three or four years when I'm actually contributing things I'm proud of to jams or whatever, I can point back to a line in the sand and say "This is where I started".

King of False Promises
Jul 31, 2000



CitizenKeen posted:

Just finished my very first game (a stripped down version of Number Munchers, which tells you how little how I know). Only posting so that (hopefully) in three or four years when I'm actually contributing things I'm proud of to jams or whatever, I can point back to a line in the sand and say "This is where I started".

My gifted-in-the-late-80s-and-early-90s self would play an updated version of Number Munchers.

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

Number munchers is plenty to tackle for a first game, nice work

CitizenKeen
Nov 13, 2003

easygoing pedant

King of False Promises posted:

My gifted-in-the-late-80s-and-early-90s self would play an updated version of Number Munchers.

We are the same age.

Falcon2001
Oct 10, 2004

Eat your hamburgers, Apollo.
Pillbug
Have any of you commissioned art on a small project? I have some questions about it.

  • How is payment normally handled? Do artists typically want a cut of ongoing profits or just payment per sheet?
  • How much does it matter if you're asking for private work where it isn't for redistribution or work that you're open to being resold?
  • What's a general ballpark for sprite work in terms of cost, for say, 12 16x16 sprites with some permutations?

Tunicate
May 15, 2012

Falcon2001 posted:

Have any of you commissioned art on a small project? I have some questions about it.

  • How is payment normally handled? Do artists typically want a cut of ongoing profits or just payment per sheet?
  • How much does it matter if you're asking for private work where it isn't for redistribution or work that you're open to being resold?
  • What's a general ballpark for sprite work in terms of cost, for say, 12 16x16 sprites with some permutations?

Usually its an hourly rate, exact rate depends on artist but if you want something decent $25/hr is a good start.

Rsellable stuff *can* be cheaper, but generally only if its things that people would actually want on Itch.io or wherever. Some people might give a little discount if you want it to be cc-by or some other open license, depending on their ideology.

As for time estimate, too many variables there to have something concrete.

anothergod
Apr 11, 2016

As a person who has been commissioned for art I generally ask for the amount of work they want done, estimate how long it'd take me, and charge a fee accordingly. If it's a large amount of money, I set up payment options like half up front and half on final delivery, but that's easy to negotiate. It's best to work with people who have done art before so that this is professional, and also you should be professional yourself. A lot of times when dealing w/ people that I don't already have rapport with or don't have a professional demeanor, I end up charging more to buffer for the inevitable, "the colors aren't right" or "can you make this 2x as big".

Re: "private work" vs "redistribution" it's really up to you and the artist what the value of the art is after the "licenses" are handled. I added quotations around "licenses" because you're asking on somethingawful and it makes me think that this stuff is going to be pretty loose.

And general ballpark for 12 16x16 sprites with permuations? Depending on what the sprites are and what "some permutations" means it could mean a lot of things. As an artist I'd probably respond with $200 if someone asked me to do this. I've also done stuff like this for $100 because the person was really clear with what they wanted. So, there's that.

Falcon2001
Oct 10, 2004

Eat your hamburgers, Apollo.
Pillbug
Thanks to the both of you - it's really helpful since I'm mostly just looking for context before I go accidentally make an rear end of myself. In this case I'm actually going to message someone who's already on itch.io with some asset packs and offer to pay for an expansion to one of their packs.



And since I mentioned about posting, here's the game I've been working on. Using GMS2, and starting with a simple 'there's islands, you unlock new plots, then plant stuff on them' setup. I've spent almost all my time so far refactoring code (which is to say, not a lot of time, since I only work on this a few hours at a time)after digging more into efficient usage and realizing I need to make things scalable, so I think I'm about to start doing more features.

Goal is to make each resource useful for something different, and the limited plots mean you're making some level of decisions on what you're growing. Haven't gone much farther than that yet.

TIP
Mar 21, 2006

Your move, creep.



Falcon2001 posted:

Thanks to the both of you - it's really helpful since I'm mostly just looking for context before I go accidentally make an rear end of myself. In this case I'm actually going to message someone who's already on itch.io with some asset packs and offer to pay for an expansion to one of their packs.

If you're not worried about other games using the art/the art isn't too specific to your game you might be able to get a better deal by letting him retain the rights to the art. I figure you're already using art packs so it's probably not a big deal to you if he sells this stuff too.

Imaginary Friend
Jan 27, 2010

Your Best Friend
So I got myself some way too expensive VST's so that I could make me some epic music. If anybody wants a pompous title song, I'll be available in a few years when I've learned what the hell all the instrumental abbrevations mean and, uh how to actually orchestrate?

Here's my first dip into this rabbit hole. Please tell me if it sounds epic enough.
https://soundcloud.com/fourtalkingwalls/the-flute-prince

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
I have come to the belated realization that when there's lots of ships onscreen, my triangle count skyrockets, even if those ships are a long way away. Like, I'm at a bit over 100k tris with just the playership onscreen (obviously this depends on how detailed the playership is), but each enemy ship on top of that adds 50-100k tris.

I don't really want to deal with manually modeling low-rez versions of all my ships/models. What's the easiest fix, assuming this is a problem?

xzzy
Mar 5, 2009

Blender has a decimate modifier that you could use. Or whatever 3d modeler you're using, they all should have one. It might produce a total mess but it might also be usable.

It's less manual from a modeling perspective, but still pretty manual because you gotta do it for every one of your models. I guess you could script it if you want to put in that work (or maybe google can find you one).

al-azad
May 28, 2009



TooMuchAbstraction posted:

I have come to the belated realization that when there's lots of ships onscreen, my triangle count skyrockets, even if those ships are a long way away. Like, I'm at a bit over 100k tris with just the playership onscreen (obviously this depends on how detailed the playership is), but each enemy ship on top of that adds 50-100k tris.

I don't really want to deal with manually modeling low-rez versions of all my ships/models. What's the easiest fix, assuming this is a problem?

Considering your models are geometrically simple you can just run the decimate modifier over all of them and get good results. Unity handles LOD very smoothly, you basically follow their naming scheme and the engine handles the rest.

On a lower scale you can turn up the fog to match a closer camera clipping and bake occlusion culling.

KillHour
Oct 28, 2007


Imaginary Friend posted:

So I got myself some way too expensive VST's so that I could make me some epic music. If anybody wants a pompous title song, I'll be available in a few years when I've learned what the hell all the instrumental abbrevations mean and, uh how to actually orchestrate?

Here's my first dip into this rabbit hole. Please tell me if it sounds epic enough.
https://soundcloud.com/fourtalkingwalls/the-flute-prince

This is really good and I want to see the cutscene that goes along with it.

Polio Vax Scene
Apr 5, 2009



Imaginary Friend posted:

So I got myself some way too expensive VST's so that I could make me some epic music. If anybody wants a pompous title song, I'll be available in a few years when I've learned what the hell all the instrumental abbrevations mean and, uh how to actually orchestrate?

Here's my first dip into this rabbit hole. Please tell me if it sounds epic enough.
https://soundcloud.com/fourtalkingwalls/the-flute-prince

I dig this a lot, sounds very professional!

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

xzzy posted:

Blender has a decimate modifier that you could use. Or whatever 3d modeler you're using, they all should have one. It might produce a total mess but it might also be usable.

It's less manual from a modeling perspective, but still pretty manual because you gotta do it for every one of your models. I guess you could script it if you want to put in that work (or maybe google can find you one).

Yeah, I was hoping for something that I could do entirely from within Unity. Just, like, "here's my models, please simplify them and swap them in as appropriate based on amount of screen space occupied".

I have 243 models so far, so yeah, not gonna want to do those manually. I've already written a script to export stuff from Blender to Unity, so if doing it "manually" is the only option then I guess I have to upgrade that script. But I can easily see that taking a couple days' worth of effort at least, so if I can drop $50 on a polished automatic solution I'd rather do that.

al-azad
May 28, 2009



I know I've seen plugins that will do it in-engine, I just couldn't name any off the top of my head. I would suggest looking up "Unity imposter" or something like that because smart LOD solutions are usually bundled with the feature to automatically turn objects into a 2D sprite billboard at far enough distances.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
Yeah, I'm looking at Automatic LOD, and while it's a bit more pricey than I'd like it does seem like it has the right set of tools. It hopefully wouldn't be too hard for me to tweak my asset postprocessor to slap a component onto each model, tweak its LOD settings, and generate the LODs. Then I could just reimport all of my models and be done with it. ...assuming it works of course.

Impostors are an interesting alternative...possibly more accurate for most of my stuff since I rely heavily on carefully-placed materials and mesh data to create "texture" instead of using UVs. Something that bakes all that down to a sprite would (I think) preserve detail better than decimating, as decimating might disrupt sharp lines between two different materials or otherwise create visual oddities. But I'm inclined to suspect that LODs will work fine and probably be less likely to cause weird issues, since it's still a 3D model instead of having a qualitative shift when the object gets far enough away.

Ultimately though this is a topic I don't know a whole lot about.

Chev
Jul 19, 2010
Switchblade Switcharoo
Maybe this could be helpful, impostor-wise:

https://github.com/xraxra/IMP

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
Thanks, will check it out!

Turns out that Automatic LOD asset is abandoned, by the way. I'm definitely not gonna drop $90 on an asset that's not supported any more.

Ruffian Price
Sep 17, 2016

Imaginary Friend posted:

So I got myself some way too expensive VST's so that I could make me some epic music. If anybody wants a pompous title song, I'll be available in a few years when I've learned what the hell all the instrumental abbrevations mean and, uh how to actually orchestrate?

Here's my first dip into this rabbit hole. Please tell me if it sounds epic enough.
https://soundcloud.com/fourtalkingwalls/the-flute-prince

That is real good and Nucleus is a great first choice. Only nitpick I'd have is that you seem to have changed a legato line to tremolo without fixing the note overlap :v:

CitizenKeen
Nov 13, 2003

easygoing pedant
So I've been working through this code, because node-based level design (a la Diablo) seems best for my roguelike. I design the rooms, then they're all randomly generated.

https://ondra.nepozitek.cz/blog/42/dungeon-generator-part-1-node-based-approach/

However, there's a gap (in my knowledge) between getting a map, and converting it into the individual rooms. Are there any other good algorithms for taking a node-map and converting it into rooms?

I've seen this tutorial/algorithm:

http://www.roguebasin.com/index.php?title=Dungeon-Building_Algorithm

But it just randomly creates levels, meaning the boss room might be right next to the starting room, etc. Any better choices if I want to control the flow?

Chev
Jul 19, 2010
Switchblade Switcharoo
You'll find the principle of that algorithm works fine in principle if you change step 3 ("Pick a wall of any room"): only add a new feature adjacent to a room or feature that's its direct parent on the graph. That way a graph that's A->B->C translate in the room plan A-B-C, and so if your boss room is 3 nodes deep on the graph your player will have to go through at least 3 rooms to reach it. After that it's mostly about bookkeeping (to know what squares are part of which node) and shuffling/resizing stuff when you run out of space to add a new feature.

Chev fucked around with this message at 17:44 on Jul 29, 2020

al-azad
May 28, 2009



What would be the best way to go about building a node based dungeon in 3D? Would it be more efficient to create a set of pre-built rooms or to do a traditional ASCII roguelike thing where you wedge modular pieces together to generate custom rooms at real time?

Call Your Grandma
Jan 17, 2010

TooMuchAbstraction posted:

But yeah, I need a bigger explosion, ideally one that says "this happened underwater". I haven't figured out a good solution for that.

I hesitate to suggest this because it could definitely be a pain in the rear end to implement, but the strongest selling point for an underwater explosion is going to be a bigass wake going through the water itself as a big void is created and filled in a matter of seconds.

Unrelated:

That "don't waste players' time" article was neat and helped me articulate why I think some games (Immortal Planet) are really cool and I totally want to play them but I know that I am never going to come back to them/it.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Call Your Grandma posted:

I hesitate to suggest this because it could definitely be a pain in the rear end to implement, but the strongest selling point for an underwater explosion is going to be a bigass wake going through the water itself as a big void is created and filled in a matter of seconds.

That is an excellent point and fortunately should not be too hard to implement! I already have a system for wakes on ships which should be versatile enough to create waves near underwater explosions. The primary downside is that they're only visible when you're really quite close to the explosion; pretty much, if the player ship gets hit, or they hit a target point-blank, then it'll be visible, otherwise it won't be.

On the subject of LODs: turns out that it's relatively straightforward in Unity to create a mesh with LODs. Just bundle multiple copies of the mesh in your file, named foo_LOD0, foo_LOD1, etc. and Unity will automatically set up the LOD system for you. Of course, I've had to do some fine-tuning, and writing the initial script was a pain, but now I have it. It saved maybe 10% of my tri budget though; turns out a lot of the tris were going to rendering terrain. That I fixed by increasing the pixel error on the terrain, which has a negligible impact on its visual quality but cuts the tri count by a factor of 2.

Unfortunately, reducing tris isn't actually speeding up the game much. :( With deep profiling on, about 40% of my frame is spent in Camera.Render, which seems nuts to me for the amount of stuff I'm drawing. I have three different Camera.Render calls that are eating most of my performance: the main display, short-range radar, and long-range radar. The latter two don't have to update every frame, but I don't understand why rendering would take so long (~4ms and ~2ms respectively) given that all they're doing is drawing <100 textured quads apiece, using Graphics.DrawMeshInstanced. That's just time spent in Camera.Render, not the script setup stuff.

Tangentially related, any ideas why this script would consistently report an FPS count that's about 10FPS lower than the Stats tab in the game view?
code:
public class FPSDisplay : MonoBehaviour {
    public TMP_Text text;

    private int frameCount;
    private float accumTime = 0;
    private float nextResetTime = 0;

    void Update() {
        frameCount++;
        accumTime += Time.unscaledDeltaTime;
        if (Time.unscaledTime - nextResetTime > 0) {
            Debug.Log($"Accumulated {frameCount} over {accumTime}");
            text.text = $"FPS: {frameCount / accumTime:0.00}";
            nextResetTime = Time.unscaledTime + 1;
            accumTime = 0;
            frameCount = 0;
        }
    }
}
EDIT: significantly improved render performance by putting all of my ships at the root of the scene hierarchy, instead of tucking them away under an empty. :shepface:

TooMuchAbstraction fucked around with this message at 18:25 on Jul 29, 2020

CitizenKeen
Nov 13, 2003

easygoing pedant

Chev posted:

You'll find the principle of that algorithm works fine in principle if you change step 3 ("Pick a wall of any room"): only add a new feature adjacent to a room or feature that's its direct parent on the graph. That way a graph that's A->B->C translate in the room plan A-B-C, and so if your boss room is 3 nodes deep on the graph your player will have to go through at least 3 rooms to reach it. After that it's mostlx about bookkeeping (to know what sqaures are part of which node) and shuffling/resizing stuff when you run out of space to add a new feature.

Ooh, that's not too bad. I can't control the whole flow of the level, which sucks, but, if the boss room is Nth level child of all major branches on the graph... You'll get a couple forks early on, but eventually every map has to terminate in the boss.

The bookkeeping is the hard part - that's why the first algorithm didn't work for me, because I don't just need to know the size of the room, but what its source is so I can "paint" it with features, but I think I'm on the right track. Thank you!

Adbot
ADBOT LOVES YOU

Chev
Jul 19, 2010
Switchblade Switcharoo
Flow control is something that's done at the graph level in the first place, yeah. Once you've got the basic graph working you can try locks, ie your graph is a tree and a node can have a locked door for which you need a key, as long as the key is in a room outside of that branch (and any branch whose key is in that branch, and so on recursively).

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply