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
nolen
Apr 4, 2004

butts.
I'll throw in my opinion and say go with AS3. Flex Builder has a fantastic debugger and you have other multiplayer options with the huge plethora of socket servers offered to the Flash Player.

Though now that I think about it, Flex Builder is running on Eclipse. I guess the debugging might not be so different if you ended up going with Java.

Adbot
ADBOT LOVES YOU

nolen
Apr 4, 2004

butts.
I was curious if anyone knew of the most efficient way to spawn an arbitrary number of bullets from a specified point in a "fan" type pattern.

This image should help illustrate what I mean:




So if I spawn one bullet, it more or less goes straight down, two bullets is split left and right, three has a left, a center, and a right, and so on.

It sort of makes me think of drawing a circle out of multiple points, but even that is a bit beyond me.

nolen
Apr 4, 2004

butts.
Thanks Dijkstracula and Avenging Dentist. The theory behind it was my stumbling block.

I think I have a better idea how I want to handle this now.

nolen
Apr 4, 2004

butts.

Strumpy posted:

Unity 3d is the best indie game engine out there in my opinion. You have to do things their way, but the documentation and 'free' stuff you get make it totally worth it. As far as I am aware you do not need the Pro version for iPhone support unless you want the networking ect. The best thing about unity is that you don't have to worry about any low level stuff and can just make a game. All the collision objects and stuff are great the GUI layer is nice ect.

RE Disgaea ect: Unity is an engine that doesn't really like working with 'grid' based games. You can code it over the top but it gets a little messy (I tried this and made a little block pushing tech test - http://blog.strumpy.net/?p=3). The game I made is purely grid based. If you want to do something that isn't grid based, but 'emulates' grid based gameplay that would be much nicer. By this I mean that each movement is a 'specific' distance and that grid data is captured in some higher level game object or as volumes placed in the level.

I think it's almost time for a Unity3D megathread. Wouldn't you agree?

nolen
Apr 4, 2004

butts.

Bastard posted:

Unity3d is still 3d only right? That is to say, you can emulate 2d by placing the camera in a fixed position/angle, but you still need 3d models for everything?

I've used this for my 2D work in Unity and it seems to be popular within the community as well:

http://www.anbsoft.com/middleware/sm2/

nolen
Apr 4, 2004

butts.

ping posted:

Unity looks excellent. Does anyone have any experience with the web-based side of it, with the web player and such? I'm thinking about using it for a project I have brewing, but it'd be nice to hear some firsthand experiences.

What questions do you have? The web player performs the same as the standalone "player", really.

nolen
Apr 4, 2004

butts.

Hanpan posted:

I've tried Torque2d, which is terrible, as well as attempting to modify Unity which isn't really engineered with 2D games in mind (it's annoying having to model 3d objects for a simple platform.)

I use this for 2D game development in Unity3D:

http://www.anbsoft.com/middleware/sm2/

Just create empty GameObjects with BoxColliders and attach a Sprite to them. Tada!

nolen
Apr 4, 2004

butts.
Seeing a lot of Git talk and no mention of Tower:

http://www.git-tower.com/


It's unfortunately Mac only and not free, but it was worth every penny during their last sale.

nolen
Apr 4, 2004

butts.

Corla Plankun posted:

I literally just heard of tower for the first time 3 minutes ago when I read your post but I have two guesses with regards to why nobody gives a poo poo about it...

Yeah. It's an easy decision when your job chooses your platform and pays for the software, I guess.

nolen
Apr 4, 2004

butts.
I'm just jumping into 2D Unity development and have been learning the ins and outs of the Animation system. Everything is fairly straightforward, but I have a question about adding Colliders to an Animation.


What is the best way to handle animating/adding/transforming Colliders during a frame by frame animation? For example, hitboxes during the attack frames of a fighting game character.


Kinda like this:



Does anyone have a point of reference or a best practice for this type of thing?

nolen
Apr 4, 2004

butts.

nolen posted:

I'm just jumping into 2D Unity development and have been learning the ins and outs of the Animation system. Everything is fairly straightforward, but I have a question about adding Colliders to an Animation.


What is the best way to handle animating/adding/transforming Colliders during a frame by frame animation? For example, hitboxes during the attack frames of a fighting game character.


Kinda like this:



Does anyone have a point of reference or a best practice for this type of thing?



Figured this out on my own, mostly. I made a "hitbox" prefab that contains a Collider and make multiple instances of those as children of my Player. In the Animation window, I create a curve for each scenario where I want to disable/enable/transform each individual "hitbox" prefab. This seems to work okay, though isn't as smooth of a workflow as I had hoped.

Is there any way to draw Colliders in the Animation window? That would probably speed this process up tremendously.

nolen
Apr 4, 2004

butts.

Rocko Bonaparte posted:

Responding to myself because I'm starting to question all this. I guess in game design, generally characters completely disobey physics in order to improve the feel of gameplay, so usually the player's character is not constrained by regular physics. I wanted to know how people mix physics with player control. It looks like some of them will nix physics on the player and implement all the effects by scratch. Others will incorporate physics and zero out everything they don't want. That's apparently what I did.

Some of this is contextual; a ship in a game of asteroids would normally be completely constrained by the physics engine. I'm particularly interested in 3rd-person, click-to-move kind of stuff.

I think what worries me the most is dropping physics completely, and having to deal with the character moving through the world, and resolving all collisions, without having situations where the player seemingly teleported through it. I think it was roomforthetuna the previously mentioned casting rays between points for projectiles. Is this problem broached in roughly the same way?

This series is okay-ish and shows how you can accomplish character collisions using raycasts and the like:
https://www.youtube.com/watch?v=yxmxW6eYnV8

nolen
Apr 4, 2004

butts.
Edit: Nevermind. Totally figured this out as soon as I posted the question.

nolen fucked around with this message at 20:47 on Dec 4, 2014

nolen
Apr 4, 2004

butts.

Obsurveyor posted:

You could use the inverse of the direction the player last moved with the magnitude being the distance you want the character to stay from the player. Add this to the current position of the player to get the position to move to.

Yep. This is basically what I just realized haha. Thanks though!

nolen
Apr 4, 2004

butts.

SnowblindFatal posted:

Why did you delete your question? Might benefit someone!

Sorry. I was asking about the best method for making an NPC follow a player, similar to parties in an RPG (Earthbound being the example).

nolen
Apr 4, 2004

butts.

Pollyanna posted:

Is there a particular "approach" to drawing up a game idea? I kinda feel like there should be some sort of science or art behind making a simple yet fun-to-play game. As far as I tell, the idea is to come up with a basic mechanic, and build on it from there. How are games "thought up"?

What we have done is all sit down with a word generator app and plow through as many two word combinations as we can, throwing out gameplay ideas based off the phrases.


Then we pick the ones we like, the ones we think are feasible, and then the ones worth doing.


There is no one true way to come up with a game idea though. It's all about research and development as the actual process.

nolen
Apr 4, 2004

butts.

Yodzilla posted:

Monodevelop sucks balls. Use Visual Studio with UnityVS when you're on Windows and standalone Xamarin when you're on OSX and have no other choice.

To be fair, there isn't much difference between Xamarin and MonoDevelop on a Mac since Xamarin started assisting with MonoDevelop.

It's too bad, because Visual Studio with UnityVS is pretty baller.

nolen
Apr 4, 2004

butts.
For those who don't like Handmade Hero, how do you feel about Reconstructing Cave Story?


It's basically a series along the same vein, where one dude tries to build something "from scratch" as a learning exercise for everyone else, though he's using SDL and similar libraries.

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

nolen
Apr 4, 2004

butts.
Everyone in here recommending HOTween needs to upgrade to DOTween: http://dotween.demigiant.com/


It's the same developer and everything.

nolen
Apr 4, 2004

butts.
Ugh. I'm stuck with an older version of Unity (I think I can't say why because of NDA reasons?) that doesn't have rigidbody2d.MovePosition(). It has all the 2D physics stuff but just not all the updated helper methods.



Does anyone have suggestions on some alternatives to .MovePosition that will also take into account the physics of the rigidbody2d object? Transform.translate obviously won't work as a viable solution.

nolen
Apr 4, 2004

butts.

nolen posted:

Ugh. I'm stuck with an older version of Unity (I think I can't say why because of NDA reasons?) that doesn't have rigidbody2d.MovePosition(). It has all the 2D physics stuff but just not all the updated helper methods.



Does anyone have suggestions on some alternatives to .MovePosition that will also take into account the physics of the rigidbody2d object? Transform.translate obviously won't work as a viable solution.


To answer my own question, I just switched everything out for the 3D physics system (regular Rigidbodies and Colliders without the 2D suffix). Not a huge headache and minimal code changes.

nolen
Apr 4, 2004

butts.

Yodzilla posted:

Congrats on making a Wii U game :wink:

:wink:



I'm just really hoping they pull their heads out of their asses and update to Unity 5 in a timely manner once the standard version is made public.


I'll be at the Unity 5 Roadshow this weekend in Orange County and plan on asking some of the reps there about timelines-- though I'm sure I'll be stonewalled.

nolen
Apr 4, 2004

butts.
Does anyone have any information regarding font licensing for games?

I'm assuming it's all relevant per font used but I am just trying to cover our bases legally.


Any good open-license fonts that indie devs can use without fear of litigation?

nolen
Apr 4, 2004

butts.
Ooo Unity on the New 3DS. Now we're talking. I wonder if Unreal will follow shortly? Probably not.

http://unity3d.com/company/public-relations/news/unity-support-new-nintendo-3ds-and-new-nintendo-3ds-xl

nolen
Apr 4, 2004

butts.

Spek posted:

Anyone know anything about how one would get their software on the 3ds with this? Is it something that would be essentially inaccessible to a hobbyist?


It will probably end up being something similar to this:

https://wiiu-developers.nintendo.com/

nolen
Apr 4, 2004

butts.
Anyone have some insight into 2D Toolkit and/or transparent shaders in Unity?

I'm using an oblique camera setup for our game and my character sprite perpendicular to the ground sprites in 3D space:




Using the default BlendVertexColor shader that 2DToolkit provides, I get problems with depth such as this:




From my research, I've seen that the problem sorta has to do with transparent shaders not writing to the Z buffer.

But if I go into the BlendVertexColor shader and set ZWrite to "On", I get this:




Playing around with other Transparent shaders gives me similar issues. Cutout shaders seems to fix most of the problem, but then I don't have my smooth edges anymore on my rounded corner sprites.


Any insight?


(images are my hosting)

nolen
Apr 4, 2004

butts.

superh posted:

In my experience you can't rely on z-depth if you're not in an orthographic camera, due to billboarding issues. It looks like that's what you've got going on? The only reliable way around it that I've found, if you're not going to be able to go orthographic, is to force rendering orders with sorting layers and sorting numbers.

It's interesting because if I change the camera to be Orthographic instead of Perspective, it actually exacerbates the problem. Without ZWrite, the overlap is worse and with ZWrite, the boxing is larger in Orthographic.

The player will be able to drop down a level and go in front and behind the ground elements, so my ideal scenario is something that acts like a true 3D object.



I should note that I attempted to just model out my ground tiles in 3D space but I can't use antialiasing on the platform I'm developing for (not at 1080 at least), which made my curved tiles all super jagged, so I started looking into other solutions.


roomforthetuna posted:

Both of these would be remedied with render order alone, but fixing the sprite or shader so z-buffer writes happen for translucent but not for transparent pixels would also be an improvement.


How do I go about "fixing the sprite/shader" to only write translucent but not transparent pixels? This stuff is a bit foreign to me, so forgive my ignorance.

Is there any way for me to have a cutout shader that's not so...rough?

nolen fucked around with this message at 22:38 on May 16, 2015

nolen
Apr 4, 2004

butts.
goddamnit double post.

nolen
Apr 4, 2004

butts.
Thanks for the suggestions, everyone.


The cutout shader-transparent-translucent talk led me down a nice road to victory.


I modified the shader found here: http://wiki.unity3d.com/index.php/Transparent_Cutout_Soft_Edge_Unlit_Texture_Blend to suit my needs a bit more and it seems to fix the z-depth issue while also letting me keep a level of smoothness to my textures.


code:
Shader "Custom/TransparentCutoutSoftEdgeUnlit" { 
Properties {
	_Cutoff ("Base Alpha cutoff", Range (0,.9)) = .5
	_Texture1 ("Texture 1", 2D) = "" 
}

SubShader {
	Tags { "Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout" }
	Lighting off
	
	// Render both front and back facing polygons.
	Cull Off
	
	// first pass:
	//   render any pixels that are more than [_Cutoff] opaque
	Pass {  
		CGPROGRAM
			#pragma vertex vert
			#pragma fragment frag
			
			#include "UnityCG.cginc"

			struct appdata_t {
				float4 vertex : POSITION;
				float2 texcoord : TEXCOORD0;
			};

			struct v2f {
				float4 vertex : POSITION;
				float2 texcoord : TEXCOORD0;
			};

			sampler2D _Texture1;
			float4 _Texture1_ST;
			float _Cutoff;
			
			v2f vert (appdata_t v)
			{
				v2f o;
				o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
				o.texcoord = TRANSFORM_TEX(v.texcoord, _Texture1);
				return o;
			}
			
			float4 _Color;
			half4 frag (v2f i) : COLOR
			{
				half4 col = tex2D(_Texture1, i.texcoord);
				clip(col.a - _Cutoff);
				return col;
			}
		ENDCG
	}

	// Second pass:
	//   render the semitransparent details.
	Pass {
		Tags { "RequireOption" = "SoftVegetation" }
		
		// Dont write to the depth buffer
		ZWrite off
		
		// Set up alpha blending
		Blend SrcAlpha OneMinusSrcAlpha
		
		CGPROGRAM
			#pragma vertex vert
			#pragma fragment frag
			
			#include "UnityCG.cginc"

			struct appdata_t {
				float4 vertex : POSITION;
				float2 texcoord : TEXCOORD0;
			};

			struct v2f {
				float4 vertex : POSITION;
				float2 texcoord : TEXCOORD0;
			};

			sampler2D _Texture1;
			float4 _Texture1_ST;
			float _Cutoff;

			v2f vert (appdata_t v)
			{
				v2f o;
				o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
				o.texcoord = TRANSFORM_TEX(v.texcoord, _Texture1);
				return o;
			}
			
			float4 _Color;
			half4 frag (v2f i) : COLOR
			{
				half4 col = tex2D(_Texture1, i.texcoord);
				clip(-(col.a - _Cutoff));
				return col;
			}
		ENDCG
	}
}

SubShader {
	Tags { "IgnoreProjector"="True" "RenderType"="TransparentCutout" }
	Lighting off
	
	// Render both front and back facing polygons.
	Cull Off
	
	// first pass:
	//   render any pixels that are more than [_Cutoff] opaque
	Pass {  
		AlphaTest Greater [_Cutoff]
		SetTexture [_Texture1] {
			combine texture * constant, texture * constant 
		}
	}

	// Second pass:
	//   render the semitransparent details.
	Pass {
		Tags { "RequireOption" = "SoftVegetation" }
		
		// Dont write to the depth buffer
		ZWrite off
		
		// Only render pixels less or equal to the value
		AlphaTest LEqual [_Cutoff]
		
		// Set up alpha blending
		Blend SrcAlpha OneMinusSrcAlpha
		
		SetTexture [_Texture1] {
			Combine texture * constant, texture * constant 
		}
	}
}

}

Since it's doing a double pass in the shader, I was worried about draw calls but realized everything using this shader in our game is eligible for static batching anyway.

nolen
Apr 4, 2004

butts.

hedgecore posted:

Totally getting started here, just ran through a few Unity tutorials, and now I'm ready to experiment a bit with more than just basic geometric shapes.

What's a good primer on how 3d modeling / animation works in conjunction with gaming? Specifically I'm looking at pairing Blender and Unity. I'm a programmer, so I accept that this is a huge field all its own, and I'll have to outsource the actual model design if I want to really make something worth publishing, but I'd like to at least get a clue of how this stuff works together.

Like do I trigger certain animations on models in code? Would I create the animations in Blender and then trigger them from Unity? How would I switch from a walk to a run seamlessly without having a jarring transition to frame 1 of the next animation? What if I want to have multiple models tied together, like a guy on a skateboard? Would I animate them separately or together?

I have a Safari Books Online subscription if anyone has good book recommendations. Thanks!

This book is actually a fairly decent introduction of a Blender->Unity workflow: http://www.amazon.com/Practical-Game-Development-Unity-Blender-ebook/dp/B00L3G5CZ8

nolen
Apr 4, 2004

butts.
In Unity, is it considered "better" to:

A) have one OnTriggerEnter function on the player, that then compares tags to determine functionality (stepping on a switch, picking up an item, crossing a goal post, etc.)

OR

B) have an OnTriggerEnter for each component that then has their specific functionality in that definition

???


As I type this out, I am inclined to say that B is probably the smarter solution in the long run, as it keeps differing functionality compartmentalized and easy to reuse, but I guess I'm more curious if A is somehow less overhead on the engine?

nolen
Apr 4, 2004

butts.

roomforthetuna posted:

Contrary to the other two responses, I think this one is probably better for performance too. Option A requires you to do a switch or something to figure out what to do with the trigger, after it's already gone through the "find an OnTriggerEvent function and run it" step. With option B you still do the "find an OnTriggerEvent function and run it" step, but then you get the code path selection for free.
Just make sure you set the trigger layers to only be triggered by the player, if that's your intent, because that saves a lot of unnecessary collision detections.

This was my reasoning for going with Option B as well. Glad to see I went with the majority rule on this one.

Thanks for the insight everyone!

nolen
Apr 4, 2004

butts.
I have an architectural conundrum while building a UI component in Unity.


My goal is to create a selector component similar to this,



where users can toggle between selections with the left and right arrows.

Let's say the data for an instance of this component is just a collection of key value pairs, with the key being represented on the screen.

My problem is that I want the value to be of varying types. So maybe one instance has data using an enum similar to:

code:
	{"Single Player", GameMode.SINGLE},
	{"Teams", GameMode.TEAM},
	{"Battle", GameMode.BATTLE}
and perhaps another instance has data using ints, floats, or even another enum type:

code:
	{"Stock", ScoreMode.STOCK},
	{"Time", ScoreMode.TIME}
I feel like this is a great use case for generics but Unity + the Inspector + generics = A Bad Time™.


Does anyone have a suggestion on how to build something like this while keeping it robust? I'd rather not just create derived classes of the component for every data type I want to use.

nolen
Apr 4, 2004

butts.

Zaphod42 posted:

Eh, Actors in games is just VO work for the most part, (barring a very rare few motion capture performances like LA Noire, MGS5 or Force Awakens) which isn't really any different from VO work on cartoons or CG movies.

People recognize those actors as much as they recognize them for Pixar movie roles.

That is part of the problem, with games the actors know much much much less about the work so they can't go on shows talking about it much. And there's way more programmers and designers and artists on a game than there are directors at a movie. Sometimes you lead game dev or 'game director' to go on a talk show or something, but most of them aren't super charismatic like movie stars are, and they're D-list celebs at best.

What about scenarios like Kiefer Sutherland in MGS V? I'd be down to listen to him chat about all the crazy things Kojima had him recite for the game or at least his experiences during production.

nolen
Apr 4, 2004

butts.

Yodzilla posted:

Added a gif recorder to Hastilude :toot: https://github.com/Chman/Moments



This is so rad.

nolen
Apr 4, 2004

butts.
It's late and my brain doesn't want to math properly.

Given this lovely diagram:



where:

x = some value
y = x/3
z = some other value between 0 and x, inclusive


How in the fart can I round z UP to the nearest y?

Using the diagram as an example, z would be rounded up to 3y. If you were to reduce z by let's say half, you would round it up to 2y, and so forth.

nolen
Apr 4, 2004

butts.

Praseodymi posted:

ceiling(z/y)*y?

This was perfect. THANK YOU.

nolen
Apr 4, 2004

butts.
Does anyone here have recommendations on an attorney who could look over an agreement before I sign it? Perhaps someone who specializes in intellectual property?

I'm posting in this thread because I would like to talk to a legal mind who can help me protect any ideas I create for my own games/software LLC while also working for this other games/software company.

nolen fucked around with this message at 19:04 on Mar 9, 2016

nolen
Apr 4, 2004

butts.

22 Eargesplitten posted:

I'm doing a sort of parkour obstacle course in Unity. My goal is to eventually be able to adapt what I make to a larger game, so I don't want to just trigger actions by being on a trigger location and pressing space, like a lot of the people I see googling around do. But I'm still planning on keeping it fairly simple, for now.

What I'm thinking is that if you're moving at a run and x distance from an object, when you hit space, the script looks for the appropriate vault/climb to do. The problem I'm running into is that I don't know how to find whether there is an object in the direction. I've been trying to figure out how to do it with the transform, but I'm not getting anywhere and it's getting late and I can't think straight anymore. If anyone can help me, point me in the direction of the class or method I need, or anything, I'd really appreciate it.

On Space pressed, cast a ray out from the player that is x distance in length and use that hit information accordingly?

Adbot
ADBOT LOVES YOU

nolen
Apr 4, 2004

butts.

Knifegrab posted:

So now I am really scratching my head:

I have a canvas/text element in the world space, I am using it for VR GUI. I have tried to set the "Dynamic Pixels Per Unit" value higher than 1, because at 1 it is very very blurry.

However when I instantiate an object whose prefab has a higher "Dynamic Pixels Per Unit" Value it still appears as though it has a value of 1 despite having a much higher value, say 5. However if I click on it in the inspector while the scene is running, it shows that the value is a 5.

But it gets weird. If I change the value in the inspector while the scene is running, and then change it back to 5 suddenly my text is incredibly sharp like I wanted. So setting it to 5 doesn't seem to do anything unless I change the value from 5 and then back to 5 in the inspector at runtime.

But it gets stranger still! I have tried changing the value via scripting and no matter what I change it to, the text remains blurry until I change the value in the inspector while the scene is running.

This is very confusing.

Shot in the dark, but have you tried calling

code:
Canvas.ForceUpdateCanvases();
after updating the value? I know that has helped me with some weird invalidation of the GUI stuff.

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