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
Mr Underhill
Feb 14, 2012

Not picking that up.
So I made this left-right walk cycle and it seemed to glitch all over the place when the character moved, but when I played the sprite animation without moving it it was fine.

Turns out the character had a little extra side bobbing to its head and shoulders, and Unity crapped its pants 'cause it had to render two different horizontal movements simultaneously.
So my character will have to stricly bob up and down vertically as he's walking just so it doesn't look like the video card is taking its last stuttering breath when he walks around.

Unityyy!!! :argh:

Adbot
ADBOT LOVES YOU

Shoehead
Sep 28, 2005

Wassup, Choom?
Ya need sumthin'?

KRILLIN IN THE NAME posted:

This is the coolest box art.

Someone suggested on the IRC (Everdraed?) that I add some screen shake to collisions to make impacts feel "meatier."

No idea how I did this...


I have to go, my planet needs me.

Background died on the way back to his home planet.

Catgirl Al Capone
Dec 15, 2007

Oh precious katana posted:

We have been doing all kinds of things with Stupid Survivor since last time I posted something.

One of the main complaints people seemed to have was that the fire looked boring, so our art guy redrew that. We have also started filling out all the empty rooms that we had with furniture and some details. Turns out that the game looks best on a mobile phone! Here's a new screenshot:



We have also added the firewoman that I asked opinions on earlier. This is what she'll (probably) look like in the game:



We're now also on greenlight!

http://steamcommunity.com/sharedfiles/filedetails/?id=279235506

Here's our greenlight page image:



Not bad, it looks pretty good when everything comes together.

A suggestion; change up the visual of the UI element on the far right (victims remaining/saved?), it looks a tad squashed. If the victims have distinct faces, maybe just use those?

The room still looks a little bare in some places. I think all it really needs though is baseboard/skirting to help contrast the walls and the floor.

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice
My artist sent me this as an example of the art style he's going for. I'm smitten.

Zaphod42
Sep 13, 2012

If there's anything more important than my ego around, I want it caught and shot now.

KRILLIN IN THE NAME posted:

This is the coolest box art.

Someone suggested on the IRC (Everdraed?) that I add some screen shake to collisions to make impacts feel "meatier."

No idea how I did this...


https://www.youtube.com/watch?v=imamcajBEJs

wayfinder
Jul 7, 2003
I think that's a really, REALLY good way to change level gfx/progress to the next level, actually

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

KRILLIN IN THE NAME posted:

This is the coolest box art.

Someone suggested on the IRC (Everdraed?) that I add some screen shake to collisions to make impacts feel "meatier."

No idea how I did this...

This is super slick. Since you're using parallax layers anyways, it'd probably be worth dumping a layer back there that's normally invisible, but on that "fade up," acts like a... drape? It's basically just there to lag a bit behind the other layers and blend the transition to the next stage. Could just be a white polygon that fades to the bottom, but you could go sexier than that.

(which would cause a small amount of pointless perf cost / make sure you render it last to take advantage of quick z rejection and not overdraw, assuming you're on mobile - or just toggle it off when not in a transition state)

Locus
Feb 28, 2004

But you were dead a thousand times. Hopeless encounters successfully won.

Omi no Kami posted:

Speaking of graphics, where the heck do you get started? I've been trying to take games I like and consciously break down what was accomplished with textures versus shading versus lighting and so forth, and 90% of the time I have absolutely no idea what I'm looking at. Is there any kind of generalized guide in the form of "Here is every basic graphics element that modern games use, here's how most people use them to complement each other, here are several dozen books on advanced usage"?

You could try loading up some free assets in Unity (something that just uses a regular specular/bump map I'd say), try seeing how it looks when you turn off the diffuse or normal elements, then open up their texture files in a 2D program and have a look, edit them, etc. Then you can re-import the edited stuff into Unity, play around more, and get an intuitive feel for things.

Normal maps don't make a lot of sense if you look at them outright, until you isolate the RGB channels. Regardless of that, Normals are usually created by a software program (Wings 3D + XNormal is a good free combo to play with) and are rarely painted on a lot.

Then just Wikipedia/Google everything.


*edit* Oh, duh, this page is a brilliant resource: http://simonschreibt.de/game-art-tricks/

Locus fucked around with this message at 18:53 on Feb 17, 2015

Angry_Ed
Mar 30, 2010




Grimey Drawer
For normal maps I typically used GIMP in conjunction with a normal map plugin someone made for it (located here), that's served me ok for the most part.

Speaking of plugins, I've decided to take a crack at taking an older game of mine that I made a couple years back as a prototype (my vertical shooter, Ablation) and turning it into something full-fledged for PC and other platforms (namely Android and Fire TV). I've mostly just been doing rough prototyping of stuff, trying to get a handle on the way Unity does its 2D stuff as well as how that looks on mobile platforms. I've seen in various places some people say that 2D Toolkit is still a good investment for 2D Unity development even with Unity's native 2D integration, because of things like tile maps and such. Before I go and spend money on 2D Toolkit though, I do have a couple questions.

One of the inspirations for my game, among other vertical shooters, was the Raiden series. Raiden II had this interesting little touch where ground elements could get damaged by enemies falling to the ground, bombs, boss enemies stepping on things, etc, as seen here (timg, click for big).


My question is if it's possible to do something like this in Unity using tile maps (be it 2D Toolkit or another method), perhaps by layering one on top of another, or if I should consider a different way of constructing my levels.

My second question is whether or not 2D Toolkit or something like it has methods for scaling things properly with different screen resolutions and possibly aspect ratios. This one isn't as important, since I seem to have an implementation that works, but it feels a bit janky at times.

The Cheshire Cat
Jun 10, 2008

Fun Shoe

Mr Underhill posted:

So I made this left-right walk cycle and it seemed to glitch all over the place when the character moved, but when I played the sprite animation without moving it it was fine.

Turns out the character had a little extra side bobbing to its head and shoulders, and Unity crapped its pants 'cause it had to render two different horizontal movements simultaneously.
So my character will have to stricly bob up and down vertically as he's walking just so it doesn't look like the video card is taking its last stuttering breath when he walks around.

Unityyy!!! :argh:

I think you should be able to fix this by unchecking "apply root motion" in the animator on your character. When you have that selected (which I think it does by default), it takes into account changes in position caused by the animation and applies that as movement, so if you've got your own movement happening it'll conflict.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch

Locus posted:

*edit* Oh, duh, this page is a brilliant resource: http://simonschreibt.de/game-art-tricks/

This is an extremely good website.

Catgirl Al Capone
Dec 15, 2007

Angry_Ed posted:

For normal maps I typically used GIMP in conjunction with a normal map plugin someone made for it (located here), that's served me ok for the most part.

Speaking of plugins, I've decided to take a crack at taking an older game of mine that I made a couple years back as a prototype (my vertical shooter, Ablation) and turning it into something full-fledged for PC and other platforms (namely Android and Fire TV). I've mostly just been doing rough prototyping of stuff, trying to get a handle on the way Unity does its 2D stuff as well as how that looks on mobile platforms. I've seen in various places some people say that 2D Toolkit is still a good investment for 2D Unity development even with Unity's native 2D integration, because of things like tile maps and such. Before I go and spend money on 2D Toolkit though, I do have a couple questions.

One of the inspirations for my game, among other vertical shooters, was the Raiden series. Raiden II had this interesting little touch where ground elements could get damaged by enemies falling to the ground, bombs, boss enemies stepping on things, etc, as seen here (timg, click for big).


My question is if it's possible to do something like this in Unity using tile maps (be it 2D Toolkit or another method), perhaps by layering one on top of another, or if I should consider a different way of constructing my levels.

My second question is whether or not 2D Toolkit or something like it has methods for scaling things properly with different screen resolutions and possibly aspect ratios. This one isn't as important, since I seem to have an implementation that works, but it feels a bit janky at times.

I'm not very familiar with Unity so I don't know if there's a simpler way but I accomplish stuff like this (i.e. jumping in a Zelda-like) in 2D games by giving everything that interacts in the map a "Z-level" variable. It's like a little cheat that simulates 3D space on a 2D plane.

Say you fire a bomb, for example. For this, our player plane's default z-level is 500. The bomb can initialize with a z-level slightly below that, such as 475, and you can code it to decline at an accelerating rate until it intercepts something in its bounding box that is also within its z-level with a margin of +/- 20. If there's a building in your line of fire and you determine its height (and hence z-level) is 50, the bomb will fall until it reaches a z-level of 70 and from there you can initialize an explosive collision and reduce the building's health or outright destroy it.

Of course this example relies on the building affected being capable of object-oriented manipulation, and while I don't know 2D toolkit at all it seems unlikely that tiles have that property.

Mr Underhill
Feb 14, 2012

Not picking that up.

The Cheshire Cat posted:

I think you should be able to fix this by unchecking "apply root motion" in the animator on your character. When you have that selected (which I think it does by default), it takes into account changes in position caused by the animation and applies that as movement, so if you've got your own movement happening it'll conflict.

Thanks for that! Gonna pester our programmer with that first thing in the morning.

Angry_Ed
Mar 30, 2010




Grimey Drawer

a medical mystery posted:

I'm not very familiar with Unity so I don't know if there's a simpler way but I accomplish stuff like this (i.e. jumping in a Zelda-like) in 2D games by giving everything that interacts in the map a "Z-level" variable. It's like a little cheat that simulates 3D space on a 2D plane.

Say you fire a bomb, for example. For this, our player plane's default z-level is 500. The bomb can initialize with a z-level slightly below that, such as 475, and you can code it to decline at an accelerating rate until it intercepts something in its bounding box that is also within its z-level with a margin of +/- 20. If there's a building in your line of fire and you determine its height (and hence z-level) is 50, the bomb will fall until it reaches a z-level of 70 and from there you can initialize an explosive collision and reduce the building's health or outright destroy it.

Of course this example relies on the building affected being capable of object-oriented manipulation, and while I don't know 2D toolkit at all it seems unlikely that tiles have that property.

Yeah I wasn't thinking of something quite as complex, mostly just replacing sprites with other sprites (i.e. having a "healthy" building tile and a "destroyed" building tile for each building part). Though yeah if I can't really have tiles be manipulated on an object-oriented basis then I'm going to need a different approach.

demota
Aug 12, 2003

I could read between the lines. They wanted to see the alien.
I'm pounding my head against a wall in Unity.

I'm trying to make a bar that oscillates and hitting a button causes the bar to freeze and an object to be launched with power based on how full the bar is. I've got the oscillation and the freezing down, but the object just isn't being launched.

Relevant bits:

public class BarScript : MonoBehaviour

{
public GameObject busPrefab; // Public bus prefab
public float speed = 20f; //Speed of the bar
bool isMoving = true;
Vector2 targetPosition;
public float barMax = 5f;
public float barMin = -5f;

float fullForce = 2f;
Vector2 barNow;
Vector2 targetMax;
Vector2 targetMin;

void Start ()
{
targetMax = new Vector2 (barMax, transform.position.y);
targetMin = new Vector2 (barMin, transform.position.y);

targetPosition = targetMax;
}

void Update ()
{
//The bar moves towards its target.
if (isMoving == true)
{
transform.position = Vector2.MoveTowards (transform.position, targetPosition, speed * Time.deltaTime);
}

//If it hits the rightmost x position, start moving it left.
if (transform.position.x >= targetPosition.x)
{
targetPosition = new Vector2 (targetMin.x, targetMin.y);
}

//If it hits the leftmost x position, start moving it right.
if (transform.position.x <= targetPosition.x)
{
targetPosition = new Vector2 (targetMax.x, targetMax.y);
}

//If it's moving and a button is pushed, stop the bar and apply force to the bus.
if (Input.GetButtonDown("Fire1") && isMoving)
{
// Stop movement
isMoving = false;

//Create force by multiplying maximum force by the percentage along the bar.
Vector3 pushForce = new Vector3 ((fullForce * (barNow.x/(targetMax.x - targetMin.x))), 0, 0);

//Apply the final force to the bus.

Rigidbody2D busBody = busPrefab.GetComponent<Rigidbody2D>();
busBody.velocity = Vector3.zero;
busBody.AddForce (pushForce);


}
}
}


The bus just sits there. I have a feeling I'm probably missing something really obvious. :nyoron:

The bus Prefab is definitely plugged in.

dreamless
Dec 18, 2013



demota posted:

The bus just sits there. I have a feeling I'm probably missing something really obvious. :nyoron:

The bus Prefab is definitely plugged in.

I don't see you setting barNow anywhere.

Zaphod42
Sep 13, 2012

If there's anything more important than my ego around, I want it caught and shot now.
You copied a whole ton of code that isn't really needed. Magic happens here:

code:
//Create force by multiplying maximum force by the percentage along the bar.
Vector3 pushForce = new Vector3 ((fullForce * (barNow.x/(targetMax.x - targetMin.x))), 0, 0);

//Apply the final force to the bus.
Rigidbody2D busBody = busPrefab.GetComponent<Rigidbody2D>();
busBody.velocity = Vector3.zero;
busBody.AddForce (pushForce);
Can you add a Console.print(...) or a Logger.log(...) or something to simply spit out the X value of that pushForce vec3 to make sure its non-zero?

Debug! Work your way through, eliminate possible problems.

If pushForce is zero, then the problem is that fullForce or barNow.x or (targetMax.x - targetMin.x) is zero.
If pushForce is non-zero, then something is wrong with Vector3.zero or .addForce on busBody.

Also, its nitpicky but its bothering me; the two if conditions for moving left and right should probably be an if-elseif :eng101:

Zaphod42 fucked around with this message at 20:18 on Feb 17, 2015

Pi Mu Rho
Apr 25, 2007

College Slice
Unintentional bugs become features:

Implemented banking when my fighter turns, but the return to level flight sometimes goes the long way round, leading to a kind of aileron roll. With the addition of the engine trails, I think it works pretty well.

demota
Aug 12, 2003

I could read between the lines. They wanted to see the alien.
Will do! I am super rusty at this. :downs:

Set barNow. pushForce is non-zero (though not the numbers I'm expecting, so that'll need some tweaking), so it's gotta be in velocity or addForce. AddForce and velocity work fine as written if I put them directly in the bus script, so something isn't getting passed...

demota fucked around with this message at 22:46 on Feb 17, 2015

Zaphod42
Sep 13, 2012

If there's anything more important than my ego around, I want it caught and shot now.

Pi Mu Rho posted:

Unintentional bugs become features:

Implemented banking when my fighter turns, but the return to level flight sometimes goes the long way round, leading to a kind of aileron roll. With the addition of the engine trails, I think it works pretty well.



:colbert: That's a barrel roll and you know it.

Somfin
Oct 25, 2010

In my🦚 experience🛠️ the big things🌑 don't teach you anything🤷‍♀️.

Nap Ghost

Zaphod42 posted:

:colbert: That's a barrel roll and you know it.

:c00lbert: It's only a proper barrel roll if it deflects enemy projectiles.

Pi Mu Rho
Apr 25, 2007

College Slice
I'm going to have to make the player able to do barrel rolls now, aren't I?
Actually, my original design doc when it was more space-sim like called for being able to roll to the side with a double-tap, so it's still close.

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice
You should look to maybe mimic the effect from Luftrausers where the plane turns on it's side depending on which way it's flying. Not sure how it would work in space but worth a look.

http://luftrausers.com/

HiriseSoftware
Dec 3, 2004

Two tips for the wise:
1. Buy an AK-97 assault rifle.
2. If there's someone hanging around your neighborhood you don't know, shoot him.
Galak-Z has the same effect. That game needs to come out yesterday.




HiriseSoftware fucked around with this message at 00:25 on Feb 18, 2015

Pi Mu Rho
Apr 25, 2007

College Slice

poemdexter posted:

You should look to maybe mimic the effect from Luftrausers where the plane turns on it's side depending on which way it's flying. Not sure how it would work in space but worth a look.

http://luftrausers.com/

I think that's more suited to a side-on view, but it's certainly do-able.

KiddieGrinder
Nov 15, 2005

HELP ME

Locus posted:

*edit* Oh, duh, this page is a brilliant resource: http://simonschreibt.de/game-art-tricks/

Thanks for that also from me, great reading.

Nition
Feb 25, 2006

You really want to know?

poemdexter posted:

You should look to maybe mimic the effect from Luftrausers where the plane turns on it's side depending on which way it's flying. Not sure how it would work in space but worth a look.

http://luftrausers.com/

Fun fact: The plane sprite never actually rotates on that axis at all. Only the wings change.

KRILLIN IN THE NAME
Mar 25, 2006

:ssj:goku i won't do what u tell me:ssj:


Hello. Can I interest you in 5 counts of Skeleton Immunity



(I'm really happy with the little swing effect when the skele gets near)

FraudulentEconomics
Oct 14, 2007

Pst...

KRILLIN IN THE NAME posted:

Hello. Can I interest you in 5 counts of Skeleton Immunity



(I'm really happy with the little swing effect when the skele gets near)

Add a followthrough swoosh and a random 80s style POW BIFF BAM and you have a winner.

al-azad
May 28, 2009



There is a little swoosh but it's not very prominent. I think it would visually look better if the swoosh was the same color as the shield. I think in animation it's called a smear.

Mercury_Storm
Jun 12, 2003

*chomp chomp chomp*
I'm working on a real-time roguelike in unity which uses text and tiles, and right now I'm using Strings to display the tiles, but I've found that editing all the tiles in one big string is SUPER slow, and takes a ton of processing time to update it (even only when necessary like when the character moves) and it also triggers garbage collection a lot. It only uses one draw call to display the big block of text, but the character moves around quickly so it bogs down the CPU just making the gigantic string. With the huge string method it's faster while the player is standing still (because there's only one draw call), but I have to grab all of the lines from the world map data and do something like displayedTiles += worldMapData[yPosition].SubString(xPosition, screenWidth); for each line to make the big string that gets displayed. This ends up being super slow because it has to be updated frequently while moving and causes hitches.

I found it's actually faster to split the string up into separate strings by each line and update each line individually, BUT there are now a TON of extra draw calls to just display each individual line of text on the screen. Is there a better way to do this though? If there was some way I could grab all of the tiles I needed in just a couple String edits while using just one draw call that would be much better.

Mercury_Storm fucked around with this message at 07:00 on Feb 18, 2015

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

HiriseSoftware posted:

Galak-Z has the same effect. That game needs to come out yesterday.





Played the hell out of a build during Fantastic Arcade last year and good god were the controls just impossible. It's one of those games that are going to take you a few hours to master.

Vitreous Rumor
Oct 21, 2004

Mercury_Storm posted:

I'm working on a real-time roguelike in unity which uses text and tiles, and right now I'm using Strings to display the tiles, but I've found that displaying all the tiles in one big string is SUPER slow, and takes a ton of processing time to update it (even only when necessary like when the character moves) and it also triggers garbage collection a lot. It only uses one draw call to display the big block of text, but the character moves around quickly so it bogs down the CPU just making the gigantic string. With the huge string method it's faster while the player is standing still because there's only one draw call, but I have to grab all of the lines from the world map data and do something like displayedTiles += worldMapData[yPosition].SubString(xPosition, screenWidth), which ends up being super slow because it has to be updated frequently while moving and causes hitches.

So I found it's actually faster to split the string up by each line, and update each line individually, which while having a TON of extra draw calls to just display each individual line of text on the screen is still much faster. Is there a better way to do this though? If there was some way I could grab all of the tiles I needed in just a couple String edits while using just one draw call that would be much better.

Strings are immutable and what you are doing is utterly insane. You're getting awful hitching because of all that text; While it's fun and nice to have a single draw call, the garbage collector is absolutely demolishing any benefit you're seeing from one draw per enormous string. Use a sprite sheet with all of the letters your monsters, treasures, and walls need - they'll be batched and you won't have to worry about losing frames. Plop down some gameobjects to represent your levels instead of generating the character-count of War and Peace every second. Instantiating is Satan or whatever, but you're way better off generating 80x25 objects once to emulate the dos prompt than trashing a massive string every few miliseconds.

Cirrial
Oct 24, 2012
Is there anything I can use for 2D games these days where I can mess around with the screen buffer/shaders without needing to drop $1500 on a pro version of the tools? It's looking and feeling like Javascript is my only option here. Argh.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

poemdexter posted:

Played the hell out of a build during Fantastic Arcade last year and good god were the controls just impossible. It's one of those games that are going to take you a few hours to master.
This was my feeling too (PAX Prime). I actually got "ok"-ish with it, but it took a while, and even then, it was... man, rough. The game is going to live or die by how well they scale and ramp difficulty - if THAT'S what they sit players down with by default, kinda think they're going to have a lot of thrown controllers.

Somfin
Oct 25, 2010

In my🦚 experience🛠️ the big things🌑 don't teach you anything🤷‍♀️.

Nap Ghost

al-azad posted:

There is a little swoosh but it's not very prominent. I think it would visually look better if the swoosh was the same color as the shield. I think in animation it's called a smear.

Smearing is the right term. It's usually used as a way to explain a large motion from point A to point B that wouldn't work without something in the middle and is just too fast for an actual movement.

The thing to remember with swooshing, particularly in games, is to sell the everloving gently caress out of them. It is easy to dial back on an overdone animation, but difficult to actually overdo them.

This link has a great interactive bit showing all of the parts of an attack. Personally I think this is overdone for the scale they're working at, but it'd probably look pretty okay zoomed out.

http://benruiz.net/aztez/impacteffects_poc.html

KiddieGrinder
Nov 15, 2005

HELP ME

KRILLIN IN THE NAME posted:

Hello. Can I interest you in 5 counts of Skeleton Immunity

I like it and it's really cute (as is the whole game), but I did a little tweak:

Your version as it is:



My slightly tweaked version:



I added the shield swung effect right at the frame when the skele makes contact, so it's more of a baseball like feel with the shield connecting with the skele, rather than the original which looks like she's swinging the shield away after the skeles gone flying.

I also added a couple frames of tweening for the shield 'stowed' and 'shield ready' states.

Pi Mu Rho
Apr 25, 2007

College Slice
Rotating camera and dynamic trails.
https://www.youtube.com/watch?v=SQy1re1SwOk

Next up: things to get shot by

KRILLIN IN THE NAME
Mar 25, 2006

:ssj:goku i won't do what u tell me:ssj:


KiddieGrinder posted:

My slightly tweaked version:



I added the shield swung effect right at the frame when the skele makes contact, so it's more of a baseball like feel with the shield connecting with the skele, rather than the original which looks like she's swinging the shield away after the skeles gone flying.

I also added a couple frames of tweening for the shield 'stowed' and 'shield ready' states.

That's really slick, thanks for the tip! Tricky part will be figuring out how to implement this - Fusion 2.5 has a limited number of reference co-ordinates (2 per sprite), one used for the base sprite itself and one used for the hat(s).

The shield lowered is a separate sprite with it's x/y position 'baked' into the animation and synced up with the player's left hand, while the shield stowed is a different version of the player sprite. Having the swing sync up with the player motion will probably take some tinkering. (I actually added the subtle animation smear in to kind of give the illusion of a swing as a workaround.)

Adbot
ADBOT LOVES YOU

wayfinder
Jul 7, 2003
I think it would also make sense to think about having her dash through the skeleton instead of taking a hit and getting back up to speed, ie move her forward instead of backward.

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