• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

GAF Indie Game Development Thread 2: High Res Work for Low Res Pay

Status
Not open for further replies.
BIkgh2t.gif

After changing character design for the 1231294th time, I finished the ground attack combo animation and made a quick control/attack script, and there are still millions of thing I need to do ;_;

The screen capture looks choppy for some reasons, but whatever, I will look into it when I have time.
 
Still very much heads down at the moment, so haven't posted in here for quite a while. Here's a recent shot from the game. Please insert your own crate puns here:

I'm so excited for this game. I don't know why no one else has tried a stealth metroidvania before but it sounds brilliant. Plus it helps that the game looks so pretty! ❤️

Crates are tried and true. Can't hate on crates.
 

kiguel182

Member
The new mechanic I'm working on involves levels with several floors and have you fall from one to the other. Currently there's only one hole but you might have to fall in a certain direction or the direction you fall into will change the experience in the second floor. I might experiment with more holes in the future too.

This is the latest level that I've implemented today!

ajkl7Of.gif
 

Timeaisis

Member
I'm using InControl right now and love it. You barely have to do anything and it just works.

Rewired is currently the best, in my opinion. It basically does everything you could ever need, and is the most cross-platform as it supports the various input types (XInput, etc.).

It's not free, but honestly the time saved is well worth $45. I have no complaints. I can even control the lightbar on a DS4 (on PC) if I wanted to (without a specific driver).

Sweet, I'll look into both of these. Thanks.

Haven't used it myself yet but I've heard good things about rewired?

Hmm...alright. Out of curiosity, are you using any special input wrapper for Advance? Multiplayer gamepad input has been a pain in my ass so far, with inconsistent player numbers and things swapping around randomly on builds. But maybe their some secret sauce I'm not doing in Unity.
 

hampig

Member


Got Hollow Bliss up on Greenlight, a game I'm hoping to release on Halloween.


Appreciate anyone who takes a moment to look at it, I want to get this game greenlit before Halloween to release then, but if not I'll release in November. Original soundtrack by me, has full voice acting, number of the 3D models are by me, has a branching story, and has been my Halloween project this year.

The trailer currently up was a bit quickly done since I needed to post it on Greenlight around now to hopefully get it Greenlit by Halloween, but there is more and much better gameplay videos coming to the page soon, I just made that one quickly as I've been focused working on the game first off Steam and now on Steam.





I'll post some more about it in this topic as we get closer to Halloween, I've been experimenting with a lot of engines recently, and this is one of the results of it. I like doing a Halloween project each year to try out new things, and this is this years.

What do you think of the Smile engine? How versatile is it? Could somebody make a basic Animal Crossing-like game in it?
 

Makai

Member
I didn't get that special script to work and I probably wouldn't have added it anyway - pretty janky to add a fake swept collision on top of PhysX. But thanks for lettijng me know it worked for you guys. However, I am nearly-certain I have determined what is causing the problem. I move my VR hands around with Rigidbody.MovePosition, as they should be. But when I pick up an object, I child it under my hands. I realized that probably behind the scenes, Unity uses transform.localPosition to move children. So yeah, my bad - especially since I watched a whole talk where devs explained how they used joints for grabbing objects in Job Simulator.
 

PirateHearts

Neo Member
Been a while since I posted anything here, but I'm still plugging away at the roguelike half of the Gunmetal Arcadia cycle. Today I've been working on background deco for the forest level. There are two layers of leaf canopies that can drop from the top of the screen. They conform to the shape of any solid geometry in the room, plus they have some random height variations, and the near canopy layer cannot exceed the bounds of the far layer.



For comparison, here's a handdrawn scene from Gunmetal Arcadia Zero with a similar two-layer canopy. This is the sort of decorative element I'm trying to generalize and recreate procedurally. I'll probably take a stab at randomly placing trees and distant tree silhouettes next.

 

PirateHearts

Neo Member
Is this an upcoming game? Ready to buy

Mine? Yep, it's two upcoming games to be specific! The first part, Gunmetal Arcadia Zero, was released as a timed exclusive through Humble Monthly back in May, and it'll be out on other storefronts before long. That one's a more linear Castlevania 1 sort of game, with a set of handcrafted levels, each with an end boss, etc. It also serves as a prequel to the second part, the roguelike/lite Gunmetal Arcadia, which will be out February 7, 2017. That's the one I'm working on now, trying to procedurally generate content that roughly approximates the sort of levels I'd build by hand.
 

Makai

Member
Mine? Yep, it's two upcoming games to be specific! The first part, Gunmetal Arcadia Zero, was released as a timed exclusive through Humble Monthly back in May, and it'll be out on other storefronts before long. That one's a more linear Castlevania 1 sort of game, with a set of handcrafted levels, each with an end boss, etc. It also serves as a prequel to the second part, the roguelike/lite Gunmetal Arcadia, which will be out February 7, 2017. That's the one I'm working on now, trying to procedurally generate content that roughly approximates the sort of levels I'd build by hand.
Oh, looks like I already have it then.
 
Been a while since I posted anything here, but I'm still plugging away at the roguelike half of the Gunmetal Arcadia cycle. Today I've been working on background deco for the forest level. There are two layers of leaf canopies that can drop from the top of the screen. They conform to the shape of any solid geometry in the room, plus they have some random height variations, and the near canopy layer cannot exceed the bounds of the far layer.



For comparison, here's a handdrawn scene from Gunmetal Arcadia Zero with a similar two-layer canopy. This is the sort of decorative element I'm trying to generalize and recreate procedurally. I'll probably take a stab at randomly placing trees and distant tree silhouettes next.


This is cool! It gives me the impression that the black space is thick with forest, rather than an open void.
 
I am working on a game for the Commodore Amiga (OCS Chipset, so will hopefully run on an unexpanded A500) made in 68000 Assembler plus the Amiga Customchips in action.

7ROp1s7.png


The whole thing started as a design exercise for myself, I wanted to create a space shooter level with only 8 colours for everything in the foreground. I think I did a good job, and after implementing I noticed I still have some things were I can have more colours now, playfield 2 and attached sprites for instance..


Stuff already implemented:
* blitting tiles into a level which I created using the Tiled Editor.
* one way Scrolling (uses two screen method, but after learning about the "aminet scrolling trick" I will soon switch over to that method. You can never have enough chipram left...
* Dual playfield mode (still with a static pf2 background, though).
* 16 color attached 48px wide Sprite. Want to "multiplex" that to have more action.



My next steps:
* implementing the "scrolling trick method"
* blitting the players ship and enemies into the playfield.
* doing some kind of level progression scripting. what stuff happens at which position, etc.
* Boss fight design

Well, that will keep me busy for the next months, I guess...

Hopefully I can finish this into something playable...
 
After changing character design for the 1231294th time, I finished the ground attack combo animation and made a quick control/attack script, and there are still millions of thing I need to do ;_;

The screen capture looks choppy for some reasons, but whatever, I will look into it when I have time.
Pretty! I get a Odin's sphere vibe from it :D

Hmm...alright. Out of curiosity, are you using any special input wrapper for Advance? Multiplayer gamepad input has been a pain in my ass so far, with inconsistent player numbers and things swapping around randomly on builds. But maybe their some secret sauce I'm not doing in Unity.
I kind of went the silly route and coded my own sort of interface layered over the top of the unity input system. I wouldn't go so far as to call it a wrapper though :3
At the start of the game I ask players to set their controls and use that to generate a list of actions and buttons. Then from there I just poll GetKey and GetKeyDown stuff based on what they set :D Due to ignoring the actual binding system that Unity uses I don't seem to run into most of the issues people mention, heck my game doesn't even care which pad is which :p

Been a while since I posted anything here, but I'm still plugging away at the roguelike half of the Gunmetal Arcadia cycle. Today I've been working on background deco for the forest level. There are two layers of leaf canopies that can drop from the top of the screen. They conform to the shape of any solid geometry in the room, plus they have some random height variations, and the near canopy layer cannot exceed the bounds of the far layer.



For comparison, here's a handdrawn scene from Gunmetal Arcadia Zero with a similar two-layer canopy. This is the sort of decorative element I'm trying to generalize and recreate procedurally. I'll probably take a stab at randomly placing trees and distant tree silhouettes next.

Cool! Always interested in what people get up to with procedural stuff and your game still looks neat with that whole NES aesthetic :D
 

Dusk Golem

A 21st Century Rockefeller
I'm not an expert modeller but been trying to make a sort of cubey horror game I posted a few days back. Making more progress, and here's a few more screens from it:


It's my Halloween project, it's coming along certainly.

What do you think of the Smile engine? How versatile is it? Could somebody make a basic Animal Crossing-like game in it?

It has a lot of promise but needs more time in the oven in features and they need to allow scripting (which the engine doesn't currently support). However, it has a strong foundation that can be built upon, and they have been releasing an update a week or so with some pretty good additions. If they keep that up, it can be a serious market competitor.

I was testing with a lot of engines, everything from Unity, Ledworks, Clickteam Fusion, Game Maker, etc., over the last few months. Decided for my Halloween project to work with SMILE firstly since I want to try and make the first 'serious' game in the engine, and I can sort of rapidly produce with my limited skills then. I know a bit of 3D modelling (though SMILE has very specific 3D model requirements, they're actually very similar to Ledworks, require them to be in .fbx, 0.01 scale in Blender, only one mesh and it has to be a .png texture, etc.), but if you can work within the limitations it can do a lot. One thing they need is more eventing camera control, the player gets a pretty versatile camera they can control, but with eventing I can only do default 'RPG' view, or first-person view.

So it's basically "It has a lot of promise, but it needs more features, which they thankfully are doing so they hopefully keep at it." If they can keep at it, it might be something special in a year. The layout is VERY similar to RPG Maker, if you know RPG Maker, you basically can figure out SMILE pretty easily, but it's like a more bare-bones version of that. And then in contrast, making 3D models for SMILE is much harder than making sprites for RPG Maker (obviously), so while it's new user friendly, if you want to make something (as the current default assets are a bit too few for the moment), you sort of need to know 3D (though they do allow 2D-3D images, which is how I did the cornfield in the above image).

While I'm using it for this project, I actually wouldn't say to go all in until they update it more, unless you want to be ambitious like me and try something in it. Sometimes you'll have to fight the engine to do what you want, but with cleverness you can overcome limitations. For an example, doing a harvest moon farming system is possible, just tricky. You'd have to use specific models, timers, switches, etc.
 

hampig

Member
While I'm using it for this project, I actually wouldn't say to go all in until they update it more, unless you want to be ambitious like me and try something in it. Sometimes you'll have to fight the engine to do what you want, but with cleverness you can overcome limitations. For an example, doing a harvest moon farming system is possible, just tricky. You'd have to use specific models, timers, switches, etc.

Cool, thank you!
 

Timeaisis

Member
I kind of went the silly route and coded my own sort of interface layered over the top of the unity input system. I wouldn't go so far as to call it a wrapper though :3
At the start of the game I ask players to set their controls and use that to generate a list of actions and buttons. Then from there I just poll GetKey and GetKeyDown stuff based on what they set :D Due to ignoring the actual binding system that Unity uses I don't seem to run into most of the issues people mention, heck my game doesn't even care which pad is which :p
D

Haha, nice. Not really silly at all, that's the best way to do it honestly. Maybe I should just bite the bullet and go that route as well.
 

JP_

Banned
https://www.youtube.com/watch?v=m1ayDMPHq8g

Finally getting back into making development videos. They take a long time to produce but hopefully they're worth it.

Up until now, the map has been identical on both the friendly and enemy sides. The geometry is still symmetrical for balance, but I created a system that lets me assign a gradient to geometry via vertex colors so that each area can have a different color scheme and change gradually -- and because this stuff isn't baked into the art assets, I can still have everything be relative to the local player.

s4D7tWm.png


So both players are in the bottom player's home base, but it looks completely different. No matter which team you're on, your base will always look friendly and the enemy base will always look.. less friendly. When you switch teams, the colors swap. I might use this system for other effects in the future, but it does have limitations.

ZeVx1D1.gif

(for some reason imgur's mp4/webm is cut off... gif is fine tho)

To compliment this, I've also made a shader that lets me shift the skybox gradient depending on player position to help give different areas a more distinct feel.

3p29Cgl.png


Also added a new medium sized building asset -- nothing fancy, but better than the placeholder box I had before. As I add more details like this, I hope to do a better job communicating the player scale -- they're piloting a mech that's about 3 stories tall.

l7Uizhw.png


Also replaced the placeholder bridges with this energy bridge thing. That gradient is driven by the shader -- a bit more expensive to render, but it means I don't have to spend time creating different texture assets for different sized bridges. Later I'll probably try to create a system to export the result into an actual texture to save on that runtime rendering time, but in the meantime I'm trying to optimize my workload more than the game itself.

BkffQYx.png


These new team-based force fields use a similar shader effect. Because I'm designing everything -- the maps, weapons, equipment etc -- around the custom progressive CTF game mode, I think these turned out pretty neat. When the enemy's flag is off the flag stand, your forcefields go offline and this opens up some pretty neat possibilities.

DeNa8Bi.png


Big changes came to the magnet surfaces -- special surfaces that exist in zero gravity that you can land on and stick to, move around, jump off of, etc. I have it so that your mouselook is oriented to your particular magnet surface's up direction -- because zero gravity lacks conventional reference points (trees, sky, etc), this can make it hard to aim effectively. So now I have the skybox gradient dynamically change to help with that. There's a gradient that's oriented to that surface's up direction, darker near bottom, lighter at top, even some horizontal lines that line up with mouse movement. I got into more details in the video so I suggest watching that (starts around 1:30), but this is one of the many challenges I've come up across trying to make a game with mixed gravity and I'm glad to finally have a workable solution for this particular issue :)
 
Haha, nice. Not really silly at all, that's the best way to do it honestly. Maybe I should just bite the bullet and go that route as well.
Good Luck if you do go that route XD

Just in case I may as well warn you of a few things:
a) never, EVER, use 'joystick0ButtonX' nor 'JoystickButtonX' for anything as it's a 'shared' joystick which will cause you all kinds of problems. Stick to the unique joysticks 1 onwards which are pad specific (e.g. 'Joystick1ButtonX').
b) unfortunately there's no way to avoid the input system when you're doing axises. You'll have to bind all possibly entries yourself in the input settings (e.g. Joystick1Axis1 with type set to 'joystick axis', axis set to 'x axis' and joystick set to 'joystick 1') and preferably turn off the control binding window that unity usually pops up if you haven't already so players don't accidentally mess them up :p
c) whenever you do make binding settings be sure to change the 'Joy Num' entry to corresponding joystickx number. If you leave it on 'get from all joysticks' then you're going to run into all kinds of hellish problems, just like joystick0 :p

To give you a rough idea, here's the initialisation I use for my 'inputslot' structures:
Code:
public InputSlot(InputMaster _master, int _joystickNumber, int _buttonQuantity, int _axisQuantity){
	iM = _master;

	if (_joystickNumber >= 0) {
		string joystickName = string.Format ("Joystick{0}", _joystickNumber + 1);
		string buttonName = "Joystick1Button0";
		for (int button=0; button<_buttonQuantity; button++) {
			buttonName = string.Format ("{0}Button{1}", joystickName, button);
			buttons.Add ((KeyCode)System.Enum.Parse (typeof(KeyCode), buttonName));
			buttonBinds.Add (buttonAction.None);
		}
		for (int axis=0; axis<_axisQuantity; axis++) {
			axises.Add (string.Format ("{0}Axis{1}", joystickName, axis + 1));
			axisBinds.Add (buttonAction.None);
			axisInversion.Add (false);
		}
	} 
	else {
		if(_joystickNumber==-1) keyboardUser = true;
		else aiPlayer = true;
	}

	idleLimit = _master.idleLimit;

	ResetUnboundHeldDuration(-1);
}
Most of my input code is a horrible spaghetti mess though and very specific to the game. I could talk about how next game I'd probably clean it up and make it more universal, etc, but to be honest I can see myself just trying out rewired or incontrol for 'game 2' :p
Letting players select their own controls when they start playing is a total nightmare when you take it to events...

you: "so to do this hold your action button"
them: "which button is the action button?"
you: "I don't know, what did you set as your action button?"
them: "I don't remember :eek:"

For extra fun, be aware that the button numbers aren't even consistent across OSes so be sure to check out stuff like this page to realise the full nightmare if you're working on multiple platforms: http://wiki.unity3d.com/index.php?title=Xbox360Controller
Oh and xbox 360 controllers? For whatever reason, microsoft made the left and right triggers count as a single axis (left is negative, right is positive) so they cancel each other out. E.g. if you hold left and right triggers fully down the axis reads as '0'; exactly the same as what you'd get if neither is held down at all :3 I don't know, how but unity added some extra axises to read these as seperate ones but it means you'll be getting values from both axis 3 and axis 9/10 when people try to use them so you need to make it ignore whichever is the shared axis if you want them to work properly :p

edit: Ah! Almost forgot! One extra bit of fun is when working out what button a player pressed on the keyboard to bind it. On pads you can just poll quickly through the buttons which is no big deal because they're all just joystickXbuttonY so you can just do a nice lil loop to replace X and Y for you, but on a keyboard? Well, keycodes are a different matter so in order to know what to poll, you'll need to make a ginormous list of every single possible key that unity knows the codes for, approximately 131 entries long :p
There's nowhere to pull this from as far as I know so you have to do it manually. I just added a public Keycode[] list and used the dropdowns in the inspector to work them out and populate them, but it's incredibly monotonous work doing that 131 times :/

Oh and if, for any reason, you instead decide to try and avoid all this cosmic horror and use the unity binding system that pops up when you start the game and the 'button entries' there? You can't change those in-game :p
As you can see... there's a reason most people dislike the unity input system and why Unity is making a new one XD Heck knows when the new one will come though.

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

Finally getting back into making development videos. They take a long time to produce but hopefully they're worth it.

Up until now, the map has been identical on both the friendly and enemy sides. The geometry is still symmetrical for balance, but I created a system that lets me assign a gradient to geometry via vertex colors so that each area can have a different color scheme and change gradually -- and because this stuff isn't baked into the art assets, I can still have everything be relative to the local player.

IMG

So both players are in the bottom player's home base, but it looks completely different. No matter which team you're on, your base will always look friendly and the enemy base will always look.. less friendly. When you switch teams, the colors swap. I might use this system for other effects in the future, but it does have limitations.

IMG
(for some reason imgur's mp4/webm is cut off... gif is fine tho)

To compliment this, I've also made a shader that lets me shift the skybox gradient depending on player position to help give different areas a more distinct feel.

IMG

Also added a new medium sized building asset -- nothing fancy, but better than the placeholder box I had before. As I add more details like this, I hope to do a better job communicating the player scale -- they're piloting a mech that's about 3 stories tall.

IMG

Also replaced the placeholder bridges with this energy bridge thing. That gradient is driven by the shader -- a bit more expensive to render, but it means I don't have to spend time creating different texture assets for different sized bridges. Later I'll probably try to create a system to export the result into an actual texture to save on that runtime rendering time, but in the meantime I'm trying to optimize my workload more than the game itself.

IMG

These new team-based force fields use a similar shader effect. Because I'm designing everything -- the maps, weapons, equipment etc -- around the custom progressive CTF game mode, I think these turned out pretty neat. When the enemy's flag is off the flag stand, your forcefields go offline and this opens up some pretty neat possibilities.

IMG

Big changes came to the magnet surfaces -- special surfaces that exist in zero gravity that you can land on and stick to, move around, jump off of, etc. I have it so that your mouselook is oriented to your particular magnet surface's up direction -- because zero gravity lacks conventional reference points (trees, sky, etc), this can make it hard to aim effectively. So now I have the skybox gradient dynamically change to help with that. There's a gradient that's oriented to that surface's up direction, darker near bottom, lighter at top, even some horizontal lines that line up with mouse movement. I got into more details in the video so I suggest watching that (starts around 1:30), but this is one of the many challenges I've come up across trying to make a game with mixed gravity and I'm glad to finally have a workable solution for this particular issue :)
Looking good :D
I always enjoy watching people's devving videos as it's interesting to get an inside view on the process behind someone's game and how they ended up with certain mechanics or content in them :3
 

Jintor

Member
After changing character design for the 1231294th time, I finished the ground attack combo animation and made a quick control/attack script, and there are still millions of thing I need to do ;_;

The screen capture looks choppy for some reasons, but whatever, I will look into it when I have time.

hnggghhhh
 

Gin-Shiio

Member
Seeing you guys hard at work is inspiring! I've been meaning to make use of Steam Greenlight myself soon, so I'd like to ask what programs you use to take screenshots and film video, as I'll be in need of both. There are a lot of options, but what's worked out best for you?
 

Dusk Golem

A 21st Century Rockefeller
Seeing you guys hard at work is inspiring! I've been meaning to make use of Steam Greenlight myself soon, so I'd like to ask what programs you use to take screenshots and film video, as I'll be in need of both. There are a lot of options, but what's worked out best for you?

For videos, I just record with OBS. It's made for video streaming and it's free, but it can be used as a really confident game recorder. For screenshot grabbing, I just print screen and edit out or use Gyazo.
 
Seeing you guys hard at work is inspiring! I've been meaning to make use of Steam Greenlight myself soon, so I'd like to ask what programs you use to take screenshots and film video, as I'll be in need of both. There are a lot of options, but what's worked out best for you?
Are you using unity out of interest?
For those who are, it actually has an in-built screenshot capability, allowing you to take screenshots at resolutions even higher than you're actually displaying :D

From my own game I have this:
Code:
#if UNITY_EDITOR
	if(Input.GetKeyUp(KeyCode.F12)){
		Application.CaptureScreenshot(string.Format("Screenshot{0}.png",screenshotNumber),4);
		Debug.Log(string.Format("Screenshot {0} taken!",screenshotNumber));
		screenshotNumber++;
	}
#endif

This takes a screenshot at a resolution 4 times larger than the display :3
You can read more about it here: https://docs.unity3d.com/ScriptReference/Application.CaptureScreenshot.html
 

JP_

Banned
Seeing you guys hard at work is inspiring! I've been meaning to make use of Steam Greenlight myself soon, so I'd like to ask what programs you use to take screenshots and film video, as I'll be in need of both. There are a lot of options, but what's worked out best for you?

I use a capture card so I can record video without additional strain on the computer running the game -- Elgato HD is what I have, though I'm considering upgrading to the HD60. Sometimes I'll use OBS or quicktime to record for quick gifs. For screenshots, check Geminosity's post -- other engines may have something similar.
 

Gin-Shiio

Member

On paper this is a great program and really easy to use, but it's given me countless errors for the past hour. I'll have to see if there is any fixing that.
For videos, I just record with OBS. It's made for video streaming and it's free, but it can be used as a really confident game recorder. For screenshot grabbing, I just print screen and edit out or use Gyazo.

I did a 2-hour long recording session with OBS before, only to realize it skipped frames all over the place later. It was my own fault for not using a fixed bitrate, so I'll definitely try again having seen your recordings.
I use a capture card so I can record video without additional strain on the computer running the game -- Elgato HD is what I have, though I'm considering upgrading to the HD60. Sometimes I'll use OBS or quicktime to record for quick gifs. For screenshots, check Geminosity's post -- other engines may have something similar.

I'll be sure to look into that. I feel my computer can't keep up with the recording at times, so that sounds very good.
Are you using unity out of interest?
For those who are, it actually has an in-built screenshot capability, allowing you to take screenshots at resolutions even higher than you're actually displaying :D

No Unity. I'm just one of those lowly RPG Maker people, I'm afraid. It's making me feel bad to even post here. Haha. Thanks for the kind suggestions, you guys!
 
No Unity. I'm just one of those lowly RPG Maker people, I'm afraid. It's making me feel bad to even post here. Haha. Thanks for the kind suggestions, you guys!
There's no judgement here: use whatever engine works best for you and to hell with any haters :D The game is what's important, not the tools used to make it :3

Are you using windows? If so you can hold Alt and press the print screen button, it will save a screenie of the currently active application which you can then paste into any image editing software (or if you're using windows 10 I believe it lets you save the picture as a file in your onedrive as an option)
Failing that there's a sort of snipping tool built into windows too: https://support.microsoft.com/en-us/help/13776/windows-use-snipping-tool-to-capture-screenshots

Hope that helps a bit more :eek:
 

Minamu

Member
Could use some help with my audiomanager in Unity. I've been following this guy, video 25 and 26 specifically. Problem is, we're making a 3D third person game and his audiomanager is for a small 2D game, with all sounds being 2D, which won't work for us. He's also front loading ALL sound files onto his audiomanager and scans a Sound[] each time he wants to play any sound or music. Our load times are taking a pretty big hit with this system and we only have like 14 audio clips so far.

I've been making some changes such as splitting the sound files into three arrays, so I can have different settings based on the type of sound (no need for pitch randomness in the background music for instance). I'm also gonna adapt a previous music system for fading music in and out. But while I've managed to replace my older code and almost all sounds are back in place, the 3D aspect and positioning in the game world is tricky. I previously had each object control its own sound with an attached audio source but I wanted to move away from that and let the manager start and stop sound effects through code instead.

I assume that even though each object now use an audiomanager instance to play the sound effect, the fact that the audio object is attached to the audiomanager prefab, is what screws up the 3D effect? The audio manager is located at 0,0,0 though, yet it still sounds like the sounds are in your face regardless of position :/ I must be missing some rolloffmode settings in my code or something? I'm also thinking of instantiating the correct sound clip without scanning an array in the Start() function of each object and there set the correct parent, if that matters?

By 3D I of course mean stuff like footsteps emanating from the player's feet or fire torches playing a fire effect when you're standing close to them.
 

Vanguard

Member
I assume that even though each object now use an audiomanager instance to play the sound effect, the fact that the audio object is attached to the audiomanager prefab, is what screws up the 3D effect? The audio manager is located at 0,0,0 though, yet it still sounds like the sounds are in your face regardless of position :/

That seems like the Spatial Blend is on the 2D side of things, if you look at the AudioSource there's a slider for that in the inspector and it's 2D - 3D with 1 being 3D. This can also be changed in code for the audioSource by making .spatialBlend = 1f;

If you don't want to have audio sources on objects, then one way I can think of doing it is having your AudioManager have an object pool of AudioSources so that when you want to play a clip, you find one that's not currently being used, give it the clip and then change its position to where you want it to play at, then calling .Play();
The other way you can do it is to do:
Code:
AudioSource.PlayClipAtPoint( audioClip, worldPosition, volume);
But this creates a new GameObject at the location which is then destroyed when finished, which could be problematic for garbage collection which is why I suggest using an object pool so you can reuse stuff.
This would be ideal for one off sounds (gunshots, explosions etc), but would be tricky for static objects in the scenes such as say fire torches, which would be better to have the audio source attached to them. Things like footsteps I'd have an audio source located at the feet of the character and then having an event fire off in the animation curve into the script so I can play the ideal footstep audio clip.

If you have any more questions then don't hesitate to ask, I feel like I may have thrown quite a bit extra at you, which if that's the case then sorry! D:
 

Minamu

Member
That seems like the Spatial Blend is on the 2D side of things, if you look at the AudioSource there's a slider for that in the inspector and it's 2D - 3D with 1 being 3D. This can also be changed in code for the audioSource by making .spatialBlend = 1f;

If you don't want to have audio sources on objects, then one way I can think of doing it is having your AudioManager have an object pool of AudioSources so that when you want to play a clip, you find one that's not currently being used, give it the clip and then change its position to where you want it to play at, then calling .Play();
The other way you can do it is to do:
Code:
AudioSource.PlayClipAtPoint( audioClip, worldPosition, volume);
But this creates a new GameObject at the location which is then destroyed when finished, which could be problematic for garbage collection which is why I suggest using an object pool so you can reuse stuff.
This would be ideal for one off sounds (gunshots, explosions etc), but would be tricky for static objects in the scenes such as say fire torches, which would be better to have the audio source attached to them. Things like footsteps I'd have an audio source located at the feet of the character and then having an event fire off in the animation curve into the script so I can play the ideal footstep audio clip.

If you have any more questions then don't hesitate to ask, I feel like I may have thrown quite a bit extra at you, which if that's the case then sorry! D:
Thanks, I'll try that spatial blend, that's probably also why my min/max distance and rolloffmodes don't seem to have any effect. Got any tips on good rolloff settings? :)

I did use normal audio sources attached to prefabs and objects before but I wanted finer control over how and where to trigger sounds. But maybe static objects would be better off with the attached sources? I just figured that there isn't much point in having an audio manager if it doesn't manage the audio :D I was under the impression that it's difficult/impossible to use code to trigger audio sources unless they're created with code, perhaps that's completely wrong?

Let's take my static torches for example, they have an audio source that loops but is not "play on awake" (I guess they could be, they used to), can I somehow use a Play() command on that sound to start it? If so, maybe it's better to just skip an audio manager altogether and use this technique on each separate object.

Currently, my manager is supposed to handle music transitions during events and level changes, and it also deals with saving audio level settings in the main menu. I'm not sure what method is the smartest to be honest. All I need is for music to change depending on what level is playing and when certain events happen during gameplay, along with objects to have sound effects, like you mentioned, like bullets etc. I did have all of that in 3D but it felt a bit hacky code standard wise. I'm the least experienced programmer on the team :lol Two basic courses compared to 6 years that my team mates sit on.

Edit: Thus, some of the code you mentioned went slightly over my head but I get the principle of having a pool, it seems dumb to spawn in a new explosion sound each time it's required, if every event can use the same sound file over and over. I guess that's kinda what my manager does right now, but it seems also a bit dumb to front load 5 music tracks and about 10 sound effects while in the main menu, when only one song is played at a time.

On that note, would it be smart performance wise to just turn off sounds when they're too far away for anyone to hear them? Seems dumb to have audio playing if nobody can hear it, but maybe the rolloffmode takes care of that automatically? Now we're getting deep though :lol

Long post is long.
 
I'm a little late to the Unity Input wrapper party, but I thought this might be of interest to some of you. When I first wrote my own input system, I wrote up a little tutorial that might help some folk interested in creating their own.

Although it says it in the tutorial, I'll re-iterate anyway. This is just the method I am using, and not necessarily the best way to do it. It works fine for the purposes of my project anyway.

Also, It's slightly out of date. It uses some "foreach" which I have now replaced, and also has some features missing (Such as the process of creating user binds at run-time) but it should provide an overview of what to do and might be of some help to somebody. I might update it one day when my game is a bit more "done" :p

Anyway, here it is if anyone is interested.
 

Vanguard

Member
Thanks, I'll try that spatial blend, that's probably also why my min/max distance and rolloffmodes don't seem to have any effect. Got any tips on good rolloff settings? :)

I did use normal audio sources attached to prefabs and objects before but I wanted finer control over how and where to trigger sounds. But maybe static objects would be better off with the attached sources? I just figured that there isn't much point in having an audio manager if it doesn't manage the audio :D I was under the impression that it's difficult/impossible to use code to trigger audio sources unless they're created with code, perhaps that's completely wrong?

Let's take my static torches for example, they have an audio source that loops but is not "play on awake" (I guess they could be, they used to), can I somehow use a Play() command on that sound to start it? If so, maybe it's better to just skip an audio manager altogether and use this technique on each separate object.

Currently, my manager is supposed to handle music transitions during events and level changes, and it also deals with saving audio level settings in the main menu. I'm not sure what method is the smartest to be honest. All I need is for music to change depending on what level is playing and when certain events happen during gameplay, along with objects to have sound effects, like you mentioned, like bullets etc. I did have all of that in 3D but it felt a bit hacky code standard wise. I'm the least experienced programmer on the team :lol Two basic courses compared to 6 years that my team mates sit on.

Edit: Thus, some of the code you mentioned went slightly over my head but I get the principle of having a pool, it seems dumb to spawn in a new explosion sound each time it's required, if every event can use the same sound file over and over. I guess that's kinda what my manager does right now, but it seems also a bit dumb to front load 5 music tracks and about 10 sound effects while in the main menu, when only one song is played at a time.

On that note, would it be smart performance wise to just turn off sounds when they're too far away for anyone to hear them? Seems dumb to have audio playing if nobody can hear it, but maybe the rolloffmode takes care of that automatically? Now we're getting deep though :lol

Long post is long.

Unfortunatly audio is prob the one area I've spent least on in Unity so not sure if I can provide many tips. I find myself tweaking a lot of sounds individually to find ideal settings but end up leaving them at default cause I move onto other things. The max distance on rolloff by default is very high with a very steep curve which I think for quiter sounds that you would only hear close up was a bit much though.

An AudioManager is good for dealing with dynamic audio and music, but using it for everything is probably not ideal as personally I'd feel you're creating more work for yourself as a lot of it Unity will handle for you.

Kind of curious why you don't want the torches playing audio on awake? Is it because the rolloff was not working? Or because they were not lit? The rolloff should fix the issue of hearing them across the map because they are too far away for example so they should happily just play on awake in that case. If the latter, then you could have a script on the torch that when it's lit, it has a reference of the audio source on the torch and you can just call Play() on that audio source, or Stop() when it's suddenly unlit.

So something like this would be ok
Code:
public class Torch 
{
	[SerializeField]
	private AudioSource _audioSource;
	
	public void OnLit()
	{
		_audioSource.Play();	
	}

	public void PutOut()
	{
		_audioSource.Stop();
	}
}


I recently wrote a basic music manager in my game which I'm still messing about with, but it has two audio source components with one of them being the "active" one.
When I want to change music, I make the inactive one take the new music clip, I then have the current ones volume go down to 0 while the new ones volume go up to 1 (in a coroutine), so there's some cross fading going on. It's very simple but works very well imo.

But yes I would not have all music loaded for every scene in one scene, this MusicManager would live throughout every scene (via DontDestroyOnLoad), and when a scene loads that has different music, it will tell the MusicManager to change the music (either by MusicManager being a Singleton or via Events or some other means)

Not sure about the last bit about performance, but as you mentioned, I'd hope Unity would handle this in the background via the rolloff :p
 
I'm no audio expert so I'll just leave you two to chat about it, but I just slapped audio sources on stuff i wanted to make noises with and made a central audio manager with a track for SFX and one for Music then associated the audio listeners with whichever of the two was relevant so the user can turn the volume of them up/down as they please :p

I'm a little late to the Unity Input wrapper party, but I thought this might be of interest to some of you. When I first wrote my own input system, I wrote up a little tutorial that might help some folk interested in creating their own.

Although it says it in the tutorial, I'll re-iterate anyway. This is just the method I am using, and not necessarily the best way to do it. It works fine for the purposes of my project anyway.

Also, It's slightly out of date. It uses some "foreach" which I have now replaced, and also has some features missing (Such as the process of creating user binds at run-time) but it should provide an overview of what to do and might be of some help to somebody. I might update it one day when my game is a bit more "done" :p

Anyway, here it is if anyone is interested.

Interesting at the parallels with some of how I did mine XD

Few tips though:
* I use the Input.anyKey check to prevent unnecessary button polling when nothing is being pressed by anyone at all. If any button anywhere is pressed it then jumps into the main polling loop :D This doesn't help with avoiding axis polling though :p
* while defining the axises in the input settings is unavoidable, you don't have to do the buttons: they can all be accessed via the method in my code I posted earlier using the naming convention of "joystickXbuttonY" with X and Y corresponding with the pad and button numbers :3

edit: something you didn't try but anyone dabbling with multiple controllers might attempt is to reduce polling by checking a 'general' version of the button before polling all the pads to find out which one it actually was such as follows (somewhat extrapolated out a bit more than it would be so you can see what's going on):
Code:
Keycode GeneralButton1 = (KeyCode)System.Enum.Parse (typeof(KeyCode), "JoystickButton1"));
Keycode Pad1Button1 = (KeyCode)System.Enum.Parse (typeof(KeyCode), "Joystick1Button1"));
Keycode Pad2Button1 = (KeyCode)System.Enum.Parse (typeof(KeyCode), "Joystick2Button1"));
Keycode Pad3Button1 = (KeyCode)System.Enum.Parse (typeof(KeyCode), "Joystick3Button1"));
Keycode Pad4Button1 = (KeyCode)System.Enum.Parse (typeof(KeyCode), "Joystick4Button1"));

if(Input.GetKey(GeneralButton1){
	if(Input.GetKey(Pad1Button1) DoButtonThingy(joystick1,button1);
	if(Input.GetKey(Pad2Button1) DoButtonThingy(joystick2,button1);
	if(Input.GetKey(Pad3Button1) DoButtonThingy(joystick3,button1);
	if(Input.GetKey(Pad4Button1) DoButtonThingy(joystick4,button1);
}

In theory this is a pretty solid idea. In practice, it unfortunately will cause some weirdness that means it should be avoided. The weirdness in question? If someone is holding button 1 on their pad when someone lets go of the same button on another pad, then joystickButton1 returns false as if they'd both let go and will continue to until someone presses button 1 again on any of the pads, despite the first example person still holding it down the whole time :eek:
No idea what causes it but worth knowing for anyone dabbling with this stuff.
 

Minamu

Member
Unfortunatly audio is prob the one area I've spent least on in Unity so not sure if I can provide many tips. I find myself tweaking a lot of sounds individually to find ideal settings but end up leaving them at default cause I move onto other things. The max distance on rolloff by default is very high with a very steep curve which I think for quiter sounds that you would only hear close up was a bit much though.

An AudioManager is good for dealing with dynamic audio and music, but using it for everything is probably not ideal as personally I'd feel you're creating more work for yourself as a lot of it Unity will handle for you.

Kind of curious why you don't want the torches playing audio on awake? Is it because the rolloff was not working? Or because they were not lit? The rolloff should fix the issue of hearing them across the map because they are too far away for example so they should happily just play on awake in that case. If the latter, then you could have a script on the torch that when it's lit, it has a reference of the audio source on the torch and you can just call Play() on that audio source, or Stop() when it's suddenly unlit.

So something like this would be ok
Code:
public class Torch 
{
	[SerializeField]
	private AudioSource _audioSource;
	
	public void OnLit()
	{
		_audioSource.Play();	
	}

	public void PutOut()
	{
		_audioSource.Stop();
	}
}


I recently wrote a basic music manager in my game which I'm still messing about with, but it has two audio source components with one of them being the "active" one.
When I want to change music, I make the inactive one take the new music clip, I then have the current ones volume go down to 0 while the new ones volume go up to 1 (in a coroutine), so there's some cross fading going on. It's very simple but works very well imo.

But yes I would not have all music loaded for every scene in one scene, this MusicManager would live throughout every scene (via DontDestroyOnLoad), and when a scene loads that has different music, it will tell the MusicManager to change the music (either by MusicManager being a Singleton or via Events or some other means)

Not sure about the last bit about performance, but as you mentioned, I'd hope Unity would handle this in the background via the rolloff :p
Sounds like my original setup was much better overall :lol The biggest reason for the change was clean-up, and to make a 2D background music switch to another 3D-based music track, during an event the game triggers. So if I make a reference to an audio clip on a prefab, I can easily start that track with a built-in .Play() function like above? I just need to re-implement my cross fader system I've currently commented out :)

Sounds like I should keep my audio manager for certain things like the dynamic gunshots and ability effects, but remove static things like the torches. The torches were just an example, really, they were perfectly fine before. I was just under the impression that it was a bit weird to have a manager which doesn't manage everything audio related.

What I don't get though, is how do I reference an already created audio source component? If I make the script above with the SerializeField, wouldn't that create another entry box in the editor for me to place an audio clip in, and that would create a duplicate sound for no reason? Can't I just reference the already attached audio source? I'm a bit lost at this Unity quirkyness.

Given the weird rolloff numbers, it's probably easier to just place audio clips on objects and from there modify its values.
 

Vanguard

Member
Sounds like my original setup was much better overall :lol The biggest reason for the change was clean-up, and to make a 2D background music switch to another 3D-based music track, during an event the game triggers. So if I make a reference to an audio clip on a prefab, I can easily start that track with a built-in .Play() function like above? I just need to re-implement my cross fader system I've currently commented out :)

Sounds like I should keep my audio manager for certain things like the dynamic gunshots and ability effects, but remove static things like the torches. The torches were just an example, really, they were perfectly fine before. I was just under the impression that it was a bit weird to have a manager which doesn't manage everything audio related.

What I don't get though, is how do I reference an already created audio source component? If I make the script above with the SerializeField, wouldn't that create another entry box in the editor for me to place an audio clip in, and that would create a duplicate sound for no reason? Can't I just reference the already attached audio source? I'm a bit lost at this Unity quirkyness.

Given the weird rolloff numbers, it's probably easier to just place audio clips on objects and from there modify its values.

You can change what clip an AudioSource has with its .clip field. I think you may have to Stop() it though first and then Play() again for it to play the different clip though.

The SerializeField will create another box in the editor yes (like public does, but just with private variables). It will be null however until you put something in it in the editor, so yes just drag the AudioSource on that object into that box.
 

Minamu

Member
You can change what clip an AudioSource has with its .clip field. I think you may have to Stop() it though first and then Play() again for it to play the different clip though.

The SerializeField will create another box in the editor yes (like public does, but just with private variables). It will be null however until you put something in it in the editor, so yes just drag the AudioSource on that object into that box.
I'll have to check this out somehow, thanks for the help, I'll return if I run into trouble or when it's all done.
 
So... all this talk of inputs got me curious so I've done some digging seeing as I'll have to deal with it all over again when I get to my next game and the general jist from peeps is that InControl is a little outdated and not ultimately as powerful as Rewired but the upside is that it's easier to pick up (plus it's about $5 cheaper). That said, it sounds like I'll be going the Rewired route unless unity's new input system is particularly interesting (I think you can grab the experimental version of it now? Not checked as I'm several builds behind) :p

Outside of options requiring monies I've noted http://unitylist.com/project/unity-xbox-ctrlr-input-4N-i is a thing, though this specifically tries to tackle the horrors of 360 pad so I don't know how well it plays with other stuff. I've not tried it myself yet and it's not really a proper substitute for something like rewired but if you want something free that lets you use the triggers independently without the crazy that comes with default input system this might do you :3

I'd not actually got around to implementing the separate 9 and 10 axis triggers for the 360 controller in my own solution so I gave it a go for fun and... yeah. don't :p
It actually works in standalone if you only have 1 controller plugged in, but the minute you add more it goes to hell in a handbasket pretty quickly with triggers being activated by the ones on completely different controllers. I couldn't even get it to detect axis 9 and 10 in the editor either so testing it was annoying too :s
As such I'm going back to my old solution of only reading up to the 8th axis for PC. hopefully nobody is rocking a controller that requires more than 8 axises or has particularly strong feelings about mapping a seperate action to each trigger for my game :p
 

Makai

Member
Nice, what was the solution? Mismatched Rigidbody/Transform move operations, or something else?
I was using Rigidbody.MovePosition() to move everything, as I should be. But to grab an object, I childed it under my hand - which uses transform.localPosition to move the child behind the scenes. Used a joint to connect them instead - Fixed Joint for now - Spring Joint or similar after I figure out knocking stuff out of my hand.
 
Thanks everyone! :)

That is total indulgence but when she kicks her shield back into her hand it would be awesome if it could hit/stun close enemies along the way :D

Ooh, maybe. I'll play around and see how that feels. She kicks the shield up when you let go of either movement or shield input, so I'm not sure how good it'll feel trying to time that, but I'll definitely experiment with it. Thanks for the suggestion! &#9829;
 
Status
Not open for further replies.
Top Bottom