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
Heisenberg1276
Apr 13, 2007

Can Of Worms posted:

I spent some time brainstorming some randomized algorithms for generating landmasses and got one that gives some nice looking results. The idea for this one is that it starts with a flat map, then identifies some peaks. Then it raises land by looking at elevated tiles and randomly decides to raise neighboring tiles (i.e. it takes each tile, looks at its neighbors that are lower and raises a percentage of them) and forcibly raising peaks. Then to generate an actual map I just take a slice at a specific height level, so the actual land are the tiles higher than some prescribed height.

It's still pretty primitive, but it made some neat maps. I had the program output text-based graphics for now and the maps are intended to loop around at the boundaries like early RPGs:


Ideally I'd want to use this to code a simple exploration game, so the game would give a randomized map and your just wander around it, possibly with a boat to explore oceans too. :)

On the subject of generating landmasses I'd be very interested if anyone knows a way of generating random landmasses with given a area (e.g., I want two landmasses, one with 40% of the total land area, one with 60%, these % will change though).

What I have been doing so far is using perlin noise to generate a completely random one, counting the pixels, then scaling the image to get as close as I can to the desired size. It's not great though as it's often off by quite a bit.

Does anyone have any better ideas?

Adbot
ADBOT LOVES YOU

xzzy
Mar 5, 2009

Maybe a fractal curve of some kind? That way you could keep track of how much land has been allocated with each step of the function.. add a piece of dirt, subtract it from the budget.

This site has some really intruiging-looking possibilities:

http://www.fractalcurves.com/

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Heisenberg1276 posted:

On the subject of generating landmasses I'd be very interested if anyone knows a way of generating random landmasses with given a area (e.g., I want two landmasses, one with 40% of the total land area, one with 60%, these % will change though).

What I have been doing so far is using perlin noise to generate a completely random one, counting the pixels, then scaling the image to get as close as I can to the desired size. It's not great though as it's often off by quite a bit.

Does anyone have any better ideas?
You could do the perlin noise and count as a start, but then instead of scaling to get your target density, do something like repeatedly picking a random coastal spot and running along it for n-random pixels extending the coast or shaving it down. This way you'll get the exact density you want, with results still approximately the same shape as your perlin noise. (Assuming you like the shapes you're getting from perlin noise.)

You could also do a few batches of perlin noise at first and pick the one closest in density to your target, to begin with, to minimize the chances of a really sparse map having to be expanded to an 80% fill, which would produce horrible results with a naive coast-expanding method.

Edit: you could also do kind of like the guy you quoted, generate a heightmap instead of a landmap, and then simply move your cutoff "land" height (ie. the sea level) to get the area you want.

roomforthetuna fucked around with this message at 17:05 on Nov 4, 2013

xgalaxy
Jan 27, 2004
i write code
Writing C# tools for C++ apps can be interesting with CLR.

code:
engine(C++)
command line tool (C++)
   -> links a dll (C++/CLR)
         -> links a dll (C#)
In the above scenario the C/C++ runtime doesn't know what the gently caress to do and throws a runtime error at you: R6033

What I had to do was move my native DllMain entry point into its own file and mark that file, and only that file has having no CLR support. The rest gets compiled with CLR support.

Crazy voodoo poo poo.

xgalaxy fucked around with this message at 03:37 on Nov 5, 2013

Lork
Oct 15, 2007
Sticks to clorf
I've been trying to develop a melee attack system for a character controller using Mecanim, but it's been frustrating.

My original plan was to use this event system to tie the various tasks (initiating and ending the attacks, adding input buffers, etc) to specific frames in the animations, fighting game style, but it turned out to not be reliable enough for gameplay. Instead, I used it to record the time intervals of the frames I wanted to use for a system using timers in scripting, like so:

code:
private void handleMeleeAttacks()
{
	if(a.GetBool("ComboStep1"))
	{
		if(st.IsTag("Attack1"))
		{
			comboState = 1;
			inputReady = false;
			StopAttackAnimations();
			attackTimer = 0f;
			checkMeleeRange();
		}
	}
	else if(a.GetBool("ComboStep2"))
	{
		if(st.IsTag("Attack2"))
		{
			comboState = 2;
			inputReady = false;
			StopAttackAnimations();
			attackTimer = 0f;
			checkMeleeRange();
		}
	}

[etc...]

if(comboState == 1)
	{
		if(!inputReady)
			if(attackTimer >= 0.25)
			{
				inputReady = true;
			}
			
		if(!attackInitiated)
			if(attackTimer >= 0.1151008)
				BeginAttack(MeleeWeapon);
			
		if(isAttacking)
			if(attackTimer >= 0.3810317)
			{
				isAttacking = false;
				MeleeWeapon.SetActive(false);
			}
	}
	if(comboState == 2)
	{
		if(!inputReady)
			if(attackTimer >= 0.25)
				inputReady = true;
					
		if(!attackInitiated)
			if(attackTimer >= 0.1491603)
				BeginAttack(MeleeWeapon);
			
		if(isAttacking)
			if(attackTimer >= 0.3974534)
			{
				isAttacking = false;
				MeleeWeapon.SetActive(false);
			}
	}

[And so on...]

if(attackTimer >= 0)
	attackTimer += Time.deltaTime;
This works reliably, but it SUCKS. The logic gets extremely hard to follow, which makes adding new attacks or fixing bugs a nightmare, and animation blending is right out because there's no way (that I know of) to tell which two states you're between when in a transition or guarantee that it'll take the same amount of time to get to the important frames.

Please tell me that there's a better way to do this that I'm just not seeing because I'm dumb. Please.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Lork posted:

I've been trying to develop a melee attack system for a character controller using Mecanim, but it's been frustrating.

My original plan was to use this event system to tie the various tasks (initiating and ending the attacks, adding input buffers, etc) to specific frames in the animations, fighting game style, but it turned out to not be reliable enough for gameplay. Instead, I used it to record the time intervals of the frames I wanted to use for a system using timers in scripting, like so:

This works reliably, but it SUCKS. The logic gets extremely hard to follow, which makes adding new attacks or fixing bugs a nightmare, and animation blending is right out because there's no way (that I know of) to tell which two states you're between when in a transition or guarantee that it'll take the same amount of time to get to the important frames.

Please tell me that there's a better way to do this that I'm just not seeing because I'm dumb. Please.
I was going to tell you to use the native event system... which they apparently took out of mecanim :psyduck: (and that precise plugin is the one I would have used past that, so double drat)

Christ, what a mess. No, what you're doing would seem to be the best-ish way right now. You could make it data-driven, based on a list of attack windows, but the code driving it will still be a horrible mess. What about the plugin isn't reliable? Practically speaking, what you're doing is what the plugin SHOULD be doing, more or less.

I continue to be amazed at what a gigantic pile of poo poo Mecanim is, and their seeming lack of interest in even remotely fixing it. :smith:

Shalinor fucked around with this message at 03:14 on Nov 6, 2013

Lork
Oct 15, 2007
Sticks to clorf

Shalinor posted:

What about the plugin isn't reliable? Practically speaking, what you're doing is what the plugin SHOULD be doing, more or less.
Events seem to have a bad habit of not firing if you put them close to the start or end of an animation, and this only gets worse when you add blending to the mix. The documentation also states that there is a possibility of the frame tied to the event being skipped for whatever reason and offers a "critical" option that tries to make sure the event fires no matter what. Unfortunately when I tried using this option it seemed to be suffering from a bug that triggered "false positives", causing the events to fire twice, first when it was supposed to fire and then again after the animation ended. This behavior also seems to indicate that even if it wasn't for the "false positive" bug, the "critical" events only fire after the animation has completed, not ASAP, which would be unacceptable for my purposes.

I could be using it wrong, but I followed the instructions pretty closely and tested it pretty thoroughly, so I don't know.

FuzzySlippers
Feb 6, 2009

Lork posted:

I've been trying to develop a melee attack system for a character controller using Mecanim, but it's been frustrating.

My suggestion is either abandon mecanim or wait for 4.3. I built a complex melee system for mecanim and it was a giant shaky stupid bastard that is hell to debug or balance. It was basically like what you are doing though I had some editor scripts for tweaking at run time (really helpful) and used generic listeners for the animation state that each attack would attach to. I used parts of this when designing my event system.

Maybe a smarter bear could deal with all the stupid poo poo in mecanim and create a good melee system but I threw a lot of time at the problem and it wasn't getting any better. 4.3 may not even fix mecanim but if they add a few basic functions to it like jump to state it might make working with it less crazy.

As it is mecanim's problems kind of killed that project for me as I haven't had the energy to dive in and create a new system. I'm enjoying mixing procedural animations and legacy animations a lot more in my current project but that might not work for your particular needs (it is easy to fake a lot of things in first person).

edit: not event system's dev's fault but mecanim blend transitions can gently caress everything up even trying to work with their own curves. Even trying to run with zero blend transitions you can still get some goofy misfires. You would need to put in checks to make sure when an event fires off it isn't mecanim just being dumb and a valid time for it as well as a timeout check if the event accidentally doesn't fire at all.

FuzzySlippers fucked around with this message at 03:40 on Nov 6, 2013

Lork
Oct 15, 2007
Sticks to clorf
I can see what you guys are saying about not using Mecanim, but retargeting is kind of the thing that makes developing a game even possible for someone like me. That is, someone with no money and no talent for visual art. I guess I'm going to have to just keep banging away at it and hope that Mecanim improves in the near future.

Can Of Worms
Sep 4, 2011

That's not how the Triangle Attack works...

Heisenberg1276 posted:

On the subject of generating landmasses I'd be very interested if anyone knows a way of generating random landmasses with given a area (e.g., I want two landmasses, one with 40% of the total land area, one with 60%, these % will change though).

What I have been doing so far is using perlin noise to generate a completely random one, counting the pixels, then scaling the image to get as close as I can to the desired size. It's not great though as it's often off by quite a bit.

Does anyone have any better ideas?
One idea I'm thinking of implementing in the future (mostly for optimization) is to take a section of the map, and generate an island inside it using a variation of this strategy, then plop it back into the original map. It should be easy to control the size of the island relative to the section, and code some variations on how the hills are placed to get more exotic shapes. This is assuming you want a connected landmass, i.e. a single continent that occupies a % of the map. Otherwise roomforthetuna's heightmap suggestion is what I did.

Related to this, I've added graphical visualization to my generator!

It's awesome. :allears: I also compiled an executable (Windows) if anyone wants to try it out: https://www.dropbox.com/s/hq843vt2hvgfl89/worldgenerator.rar

The program to run is visualizer.exe. The code is still sloppily optimized and it runs in O(Width*Length*Height), so I would not suggest trying to generate maps on the 200x200 scale unless you want to wait a while. Even 100x100 maps takes a while with tall mountains.

The Gripper
Sep 14, 2004
i am winner

Can Of Worms posted:

Related to this, I've added graphical visualization to my generator!

It's awesome. :allears: I also compiled an executable (Windows) if anyone wants to try it out: https://www.dropbox.com/s/hq843vt2hvgfl89/worldgenerator.rar

The program to run is visualizer.exe. The code is still sloppily optimized and it runs in O(Width*Length*Height), so I would not suggest trying to generate maps on the 200x200 scale unless you want to wait a while. Even 100x100 maps takes a while with tall mountains.
Looks great! Terrain gen is something I've never managed to master myself, my results are always rigid, static looking messes.

Also is it just me, or does your terrain generation prefer NW -> SE landmasses? It's more noticeable in 200x200x? sizes http://tinypic.com/r/sp94jb/5

Jewel
May 2, 2009

Can Of Worms posted:

One idea I'm thinking of implementing in the future (mostly for optimization) is to take a section of the map, and generate an island inside it using a variation of this strategy, then plop it back into the original map. It should be easy to control the size of the island relative to the section, and code some variations on how the hills are placed to get more exotic shapes. This is assuming you want a connected landmass, i.e. a single continent that occupies a % of the map. Otherwise roomforthetuna's heightmap suggestion is what I did.

Related to this, I've added graphical visualization to my generator!

It's awesome. :allears: I also compiled an executable (Windows) if anyone wants to try it out: https://www.dropbox.com/s/hq843vt2hvgfl89/worldgenerator.rar

The program to run is visualizer.exe. The code is still sloppily optimized and it runs in O(Width*Length*Height), so I would not suggest trying to generate maps on the 200x200 scale unless you want to wait a while. Even 100x100 maps takes a while with tall mountains.

Looking alright! I think the results from that way are fairly limited, and these days there's some much much cooler techniques that allow things like river-flow and better generation in general.

This is my favorite article on the subject, definitely give it a look http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/

Also I got some nice terrain last year (no heightmaps though) using a cellular-automata method: http://forums.somethingawful.com/showthread.php?action=showpost&postid=410479431

Heisenberg1276
Apr 13, 2007

Can Of Worms posted:

One idea I'm thinking of implementing in the future (mostly for optimization) is to take a section of the map, and generate an island inside it using a variation of this strategy, then plop it back into the original map. It should be easy to control the size of the island relative to the section, and code some variations on how the hills are placed to get more exotic shapes. This is assuming you want a connected landmass, i.e. a single continent that occupies a % of the map. Otherwise roomforthetuna's heightmap suggestion is what I did.

Related to this, I've added graphical visualization to my generator!

It's awesome. :allears: I also compiled an executable (Windows) if anyone wants to try it out: https://www.dropbox.com/s/hq843vt2hvgfl89/worldgenerator.rar

The program to run is visualizer.exe. The code is still sloppily optimized and it runs in O(Width*Length*Height), so I would not suggest trying to generate maps on the 200x200 scale unless you want to wait a while. Even 100x100 maps takes a while with tall mountains.

That looks awesome. Thanks for the suggestions everyone - I have a few projects on the go at the moment so won't be able to try these out for a few weeks - I'll post back if I have any success with this.

a cyberpunk goose
May 21, 2007

I'm popping in to mention that we have a nice little game development community that has grown following the 2013 SAGamedev competition. We have a healthy and humming bustle of gamedev nerds on IRC and our new mumble server.

If y'alls need a place to chat about your issues or just find fellow gamedev nerds, the IRC and mumble info is here: http://goo.gl/fy5Ml4


vvvv: :blush:

a cyberpunk goose fucked around with this message at 21:02 on Nov 6, 2013

ShinAli
May 2, 2003

The Kid better watch his step.

Mido posted:

I'm popping in to mention that we have a nice little game development community that has grown following the 2013 SAGamedev competition. We have a healthy and humming bustle of gamedev nerds on IRC and our new mumble server.

If y'alls need a place to chat about your issues or just find fellow gamedev nerds, the IRC and mumble info is here: http://goo.gl/fy5Ml4

I can verify this information as credible and that Mido is very handsome.

xgalaxy
Jan 27, 2004
i write code
Sharing is caring. So here you go.
In Unity, recently I needed to have an editor script that found all prefabs which had a particular component on it, regardless if it was referenced in the project at all, regardless if it was in the Resources folder or not.

This does the job nicely.
code:
	private T[] FindPrefabsOfType<T>() where T : Object
	{
		List<T> prefabs = new List<T>();
		List<FileInfo> files = FindFilesRecursive(new DirectoryInfo(Application.dataPath), "*.prefab");
		foreach (var file in files)
		{
			if (file.Name.StartsWith("."))
				continue;
			
			var relativePath = file.FullName.Replace(Application.dataPath, "Assets");
			T prefab = (T)AssetDatabase.LoadAssetAtPath(relativePath, typeof(T));
			if (prefab == null)
				continue;
			prefabs.Add(prefab);
		}
		
		return prefabs.ToArray();
	}
	
	private List<FileInfo> FindFilesRecursive(DirectoryInfo dir, string searchFor)
	{   
		List<FileInfo> founditems = dir.GetFiles(searchFor).ToList();

	    DirectoryInfo[] subdirs = dir.GetDirectories();
	    foreach (var di in subdirs) 
	        founditems.AddRange(FindFilesRecursive(di, searchFor));   
 
	    return founditems;
	}
Example usage:
code:
UIAtlas[] atlases = FindPrefabsOfType<UIAtlas>();
// ...

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!
Your recursive Directory search is unnecessary. Use
code:
DirectoryInfo.GetFiles(searchPattern, SearchOption.AllDirectories)
Also, when would prefab ever == null? You cannot cast a null instance to T without throwing an exception, so that would never happen.

One more thing, why do you have a constraint "where T: Object"? That is a redundant constraint, as all C# objects derive from System.Object. If you meant to restrict it to reference types (i.e. not int, double, etc) use:
code:
where T: class

Orzo fucked around with this message at 21:28 on Nov 6, 2013

xgalaxy
Jan 27, 2004
i write code
The constraint is needed because Object is referring to Unity.Object not System.Object. The cast to T needs the constraint because LoadAsset returns Unity.Object.

Prefab can be null because I'm searching for a particular component type on all prefabs and not all prefabs will have the component.
Casting to T will not throw an exception because its a regular style cast. If I said 'as T' then it would be throwing an exception. This way I get a null if the prefab doesn't have the component and can discard it.

Thanks for the tip on AllDirectories.

xgalaxy fucked around with this message at 21:41 on Nov 6, 2013

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!
Why not have the function just return the list it was working with, rather than converting it to an array for the return value? That conversion is potentially a wasted operation, isn't it, if the caller could work just as well with a list? Or is it some sort of expectation/standard for return values?

vvvv That's a fair reason not to change it. Just wanted to check I wasn't missing some great reason for doing it that way. :)

roomforthetuna fucked around with this message at 21:45 on Nov 6, 2013

xgalaxy
Jan 27, 2004
i write code
I could I guess. But I'm not really caring about efficiency since its an Editor only script.

xgalaxy
Jan 27, 2004
i write code

Orzo posted:

Also, when would prefab ever == null? You cannot cast a null instance to T without throwing an exception, so that would never happen.

Actually sorry. You are right. I had (T) and as T backwards. Switching it to as T so I get null assigned.
Thanks.


Here is the updated script if anyone wants it:
code:
	private List<T> FindPrefabsOfType<T>() where T : UnityEngine.Object
	{
		var prefabs = new List<T>();
		var dir = new DirectoryInfo(Application.dataPath);
		FileInfo[] files = dir.GetFiles("*.prefab", SearchOption.AllDirectories);
		foreach (var file in files)
		{
			if (file.Name.StartsWith("."))
				continue;
			
			var relativePath = file.FullName.Replace(Application.dataPath, "Assets");
			T prefab = AssetDatabase.LoadAssetAtPath(relativePath, typeof(T)) as T;
			if (prefab == null)
				continue;
			prefabs.Add(prefab);
		}
		
		return prefabs;
	}
Hurray for code reviews.

xgalaxy fucked around with this message at 22:21 on Nov 6, 2013

Zizi
Jan 7, 2010

xgalaxy posted:

Sharing is caring.

It certainly is, so I'll pay it forward with one of the more useful little code snippets I've written recently.

transform.FindChild() doesn't seem to run down the heirarchy unless you know exactly where what you're looking for is supposed to be. So this is a C# Extension Method that adds a depth-first search down the heirarchy to the Transform class and returns the first child of the requested name it finds, or null if it doesn't find anything.

code:
using UnityEngine;

public static class FBDExtensions
{
	public static Transform FindInHeirarchy(this Transform t, string name)
	{
		for (int c = 0; c < t.childCount; c++)
		{
			Transform temp = t.GetChild(c);
			if (temp.name == name)
				return temp;
			else
			{
				temp = temp.FindInHeirarchy(name);
				if (temp != null)
					return temp;
			}
		}
		
		return null;
	}
}
Usage is simple. Once the code is in your project, you just use transform.FindInHeirarchy("Foo").

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!

xgalaxy posted:

The constraint is needed because Object is referring to Unity.Object not System.Object. The cast to T needs the constraint because LoadAsset returns Unity.Object.
Ah, sorry. Although I am quite surprised that Unity chose to name their base object 'Object', seems pretty confusing for a C# library!

Flownerous
Apr 16, 2012

xgalaxy posted:

Actually sorry. You are right. I had (T) and as T backwards. Switching it to as T so I get null assigned.

T blah = (T)null; doesn't throw as far as I know. The difference with as is that it doesn't throw if the value can't be converted to a reference of type T, so I guess it would avoid an exception if the Unity call is bugged or you accidentally passed in the wrong type, but I'd prefer an exception in either case.

quote:

6.2.4 - Explicit Reference Conversions
...
For an explicit reference conversion to succeed at run-time, the value of the source operand must be null, or the actual type of the object referenced by the source operand must be a type that can be converted to the destination type by an implicit reference conversion (§6.1.6) or boxing conversion (§6.1.7). If an explicit reference conversion fails, a System.InvalidCastException is thrown.
...

Seashell Salesman
Aug 4, 2005

Holy wow! That "Literally A Person" sure is a cool and good poster. He's smart and witty and he smells like a pure mountain stream. I posted in his thread and I got a FANCY NEW AVATAR!!!!
I'm suddenly curious to try Unity and some of the 2D libraries but I can't really find any info on the licensing for 2DToolkit and I'm not that fond of the idea of buying it without having used it or read the license.

Sylink
Apr 17, 2004

The 2D Toolkit FAQ says they don't offer a trial or anything so you are pretty much stuck buying it.

Seashell Salesman
Aug 4, 2005

Holy wow! That "Literally A Person" sure is a cool and good poster. He's smart and witty and he smells like a pure mountain stream. I posted in his thread and I got a FANCY NEW AVATAR!!!!
I must be missing something obvious, who would buy a license for a library without first knowing what the licensing implications are for their own derived software?

Obsurveyor
Jan 10, 2003

Seashell Salesman posted:

I must be missing something obvious, who would buy a license for a library without first knowing what the licensing implications are for their own derived software?

What do you mean? It's pretty standard policy that stuff you buy on the Asset Store can't be redistributed in source form.

I'm not sure what you need to know other than "This extension requires one license per seat" which means everyone using Unity on your team needs a license.

superh
Oct 10, 2007

Touching every treasure
I believe that since it's only sold through the Unity Asset Store it's covered under the Unity Asset Store license which is pretty much "one license per seat"? Have you looked at it in the store?

Seashell Salesman
Aug 4, 2005

Holy wow! That "Literally A Person" sure is a cool and good poster. He's smart and witty and he smells like a pure mountain stream. I posted in his thread and I got a FANCY NEW AVATAR!!!!
^^ I looked at the page on the store that's linked to from their website but it didn't have a license on it that I could see

Obsurveyor posted:

What do you mean? It's pretty standard policy that stuff you buy on the Asset Store can't be redistributed in source form.

I'm not sure what you need to know other than "This extension requires one license per seat" which means everyone using Unity on your team needs a license.

I don't use Unity so I guess the obvious thing I'm missing is some implicit license for asset store stuff. You can't distribute the 2DToolkit source, but they give you source access and you can distribute their binaries? Can you modify their library, compile it, then distribute those binaries? Is this stuff I need to look up on the asset store or some other general Unity thing?

Obsurveyor
Jan 10, 2003

Seashell Salesman posted:

^^ I looked at the page on the store that's linked to from their website but it didn't have a license on it that I could see
Link to the EULA is at the bottom of this page: https://www.assetstore.unity3d.com/

Relevant sections:

Unity Store EULA posted:

3.6 Unless you have been specifically permitted to do so in a separate agreement with Unity and except as permitted under the Unity-EULA, you agree that you will not reproduce, duplicate, copy, sell, trade or resell any Asset that you have acquired from the Unity Asset Store for any purpose.

quote:

4.1 Some components of Assets (whether developed by Unity or third parties) may also be governed by applicable open source software licenses. In the event of a conflict between the Terms, the applicable EULA and any such licenses, the open source software licenses shall prevail with respect to those components.

Basically, you can only distribute the compiled versions of your Unity projects built with Asset Store assets.

Seashell Salesman
Aug 4, 2005

Holy wow! That "Literally A Person" sure is a cool and good poster. He's smart and witty and he smells like a pure mountain stream. I posted in his thread and I got a FANCY NEW AVATAR!!!!

Obsurveyor posted:

Link to the EULA is at the bottom of this page: https://www.assetstore.unity3d.com/

Relevant sections:



Basically, you can only distribute the compiled versions of your Unity projects built with Asset Store assets.

Ah thanks! I guess I need to read up on there about modifying the sources of libraries if that 2DToolkit license gives you source access.

superh
Oct 10, 2007

Touching every treasure
You just get 2dToolkit as source files you add to your project, so yeah. I guess it never even occurred to me that modifying it for use in my own project could be against the rules.

xgalaxy
Jan 27, 2004
i write code
RC3 of Unity 4.3 came out today, and they said they were only going to do 1 RC lol.
Hopefully this is it and it gets released soon.

devilmouse
Mar 26, 2004

It's just like real life.
It's sort of a pain in the butt to give back to Unity. In addition to throwing stuff up on github, we've made a bunch of fixes and improvements to various asset store libraries, but we're just stuck sitting on them or waiting for the original author's to (finally) update their code with our changes. We'd like to publish diffs or something so others can enjoy, but alas!

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch

xgalaxy posted:

RC3 of Unity 4.3 came out today, and they said they were only going to do 1 RC lol.
Hopefully this is it and it gets released soon.

I just want them to fix the constant crashing I'm getting in OSX Mavericks. I know it's pretty much my fault though for ever upgrading anything Mac until after the first point release.

:\

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

xgalaxy posted:

RC3 of Unity 4.3 came out today, and they said they were only going to do 1 RC lol.
Hopefully this is it and it gets released soon.
Any word on if it makes Mecanim less lovely?

That seems like the most broken thing they've got right now. Input is a close second, but Input's been a poo poo system for so long, everyone's long since designed around it.

EDIT: VV events! Thank god!

Shalinor fucked around with this message at 04:20 on Nov 9, 2013

xgalaxy
Jan 27, 2004
i write code

Shalinor posted:

Any word on if it makes Mecanim less lovely?

That seems like the most broken thing they've got right now. Input is a close second, but Input's been a poo poo system for so long, everyone's long since designed around it.

Here you go:
code:
Beta 1:

Mecanim improvements:

- Add a new option "Optimize Game Objects" in ModelImporter inspector. In short, this makes character rigs much faster.
	- When turned on, the game object transform hierarchy of the imported character will be removed and is instead stored
		in the Avatar and Animator component.
	- The SkinnedMeshRenderers of the character will then directly use the Mecanim internal skeleton, so that we can get
		rid of all the Transforms which used to be there, representing all the bones.
	- This option will improve the performance of the animated characters. It is recommended to turn it on for the final
		product. In optimized mode skinned mesh matrix extraction is also multithreaded.
	- When "Optimize Game Objects" is turned on, the user can specify a list of "Extra Transforms to Expose" in ModelImporter
		inspector. For example, if you want to attach a sword to the right hand, this acts as a mount point. The exposed
		transform is flattened in the game object hierarchy, even though it might be somewhere deep in skeleton hierarchy.
- Mecanim supports animating any property including blend shapes properties, camera properties, script float properties,
	lights and most other float properties on components.
- Support for events! Events are created in the animation window for writable Animation Clips attach to an Animator. Can also
	add AnimationEvents directly in the animation importer.
- Various performance optimizations, especially in regards to generic mode.
- Added Animator.GotoState scripting function. This function allow you at runtime to transition to any state in your controller.
- Added AnimationSet, an AnimationSet allow you to override any clip from a controller with another one.
- Loop time vs Loop pose, When an animation clip is already looping, no need to activate Loop Pose, Loop Time will make clip
	looping without modifying the pose.
- Trigger parameter, a trigger is a boolean parameter that is reset by the controller when consumed by a transition.
- AnimatorStateRuntime that allows to modify, at runtime, the speed/ikOnFeet/mirror of a State.

Mecanim fixes:

- When dragging a non-legacy clip on a GameObject, create an Animator + controller
- Refactored AvatarMask use during import. Can now specify an asset on disk.
- Added warning when humanoid transforms have Translation/Scale animation.
- Removed warning message when previewing some objects that have component dependency.


Beta 3:

Mecanim improvements:

- Reduced memory footprint for Animator component.
- Animation clip importer automaticly detect the rig type (generic or humanoid) and setup the mask accordingly.
- Rewrote iOS SIMD math library backend.
- Added new animation compression mode 'optimal' for generic and humanoid rig.

Mecanim fixes:

- Fixes animation set crash when clips are duplicated in controller.
- Avatar created proceduraly should not expose Configure Avatar button.
- User should get an error in the console when they try to create an avatar with duplicate transform in the human mapping.
- Fix various crash with Optimize game object and configure Avatar.
- Fix crash when user configure an existing avatar and try to edit the muscle limit,
- Fix crash when user delete and animator component.
- Fix crash when user set the root node on a generic rig to the top most object in hierarchy.
- Animation Average Velocity was not computed correctly.
- Preview of animation breaks on avatars with different hips orientation.
- Switching from Generic to Humanoid rig when using source Avatar was breaking animation import.
- Support scale of game object at runtime for Animator. Root Motion, IK, Optimize Hierachy.
- Unroll muscle fix.
- Sync editor curve for pre-4.3 duplicated muscle clip and backward compatibility problem with duplicated clips.
- Change default behavior for human clip, do not import position, rotation and scale curve for all human transform.
- StateMachine GraphGUI did not support properly to have its data modified externally.
- Fixes webplayer compatibility for Mecanim bindings.
- ModelImporter multi-edition of root node and expose transform should be disabled when transform from multiple file doesn't match.


Beta 4:

Mecanim changes:

- AnimationSet renamed AnimatorOverrideController and derives from RuntimeAnimatorController.
- Removed AnimationSet property from the Animator Component. AnimatorOverrideController derives from RuntimeAnimator it can be asigned
	directly to the Controller property of the Animator.
- Root motion can now be affected by Animation Clip from any controller's layer. Before only the first layer could affect the root motion.

Macanim improvements:

- [Optimize game objects] Add support for dynamically attaching a SkinnedMeshRenderer to an existing character (like wearing glove).
	As long as the SkinnedMeshRenderer and the character have the same rig, they don't need to come from the same FBX file.
- [Optimize game objects] Add support for exposing a Transform without reimport. Just create a new game object as a child of the root
	game object, and rename it to be exactly the same as the bone you want to expose.
- [Optimize game objects] Optimize and de-optimize game objects at runtime with: void OptimizeTransformHierarchy(GameObject go)
and DeoptimizeTransformHierarchy(GameObject go)
- [Optimize game objects] Work better with prefab now. De-optimizing the imported model will not break the existing prefabs.
- Added a popup menu in animation clip model importer to select/deselect all nodes in the mask inspector.
- AnimationController is created without file dialog when 1st animation is added to GO.
- Curve editing in Animation window should be faster for controller with many clip
- When draging a clip on a GO that already has an AnimationController, simply add the clip instead of creating a new controller.

Mecanim fixes:

- Fixed cannot configure a human avatar when optimize is ON.
- Fixed crash when calling Animator.GetBoneTransform on Avatar with Optimize Game object On.
- Fixed crashes when editing humanoid animation applied to a primitive object.
- Fixed drag'n drop of State/StateMachine.
- Fixed Optimize GameObject in import settings breaks preview window of Skinned Mesh,
- Fixed preview of a transition on a layer with a mask, previewer was not using the mask to playback the transition.
- Fixed root motion masking for all layer.
- Fixed the crash which happened when we reimport the FBX file in play mode.
- Fixed transitions bool parameter being overriden when creating the 1st Trigger parameter.
- Hide "Optimize Game Objects" if Avatar Definition is "Copy From Other Avatar".
- Proper clamping of start/stop times when importing an Animation clip.
- Update Controller's clip duration when an AnimationClip is substituted by AnimationOverrideController.


Beta 5:

Mecanim fixes:

- Model importer meta file shouldn't get dirty anymore when importing a file with a Humanoid rig.


Beta 6:

Mecanim changes:

- Moved Optimized transform hierarchy button from inspector to the context menu

Mecanim fixes:

- Fix crash when previewing transition between empty states
- Fix object hierarchy not being animated correctly in some cases
- Fix remove State/StateMachine code that caused bad object access  
- Fixed crash when trying to configure an Avatar with a mesh not yet skinned.


RC 1:

Mecanim fixes:

- Fixed add clips keeping importer events and importer curves from previous clip
- Fixed first added importer event edition is not persisted
- Fixed importer events at 1.0f not being editable.


RC 3:

Mecanim fixes:

- Fix loading of .anim files generated in 4.0/4.1/4.2
- Fix memory spill when using Layers
- Fix regression causing agents moving on terrain to have wrong height (y-position) when "Height Mesh" bake option is enabled

ZombieApostate
Mar 13, 2011
Sorry, I didn't read your post.

I'm too busy replying to what I wish you said

:allears:
I'm making a hockey game, but not being all that familiar with Unity, I'm having a little trouble with keeping the puck from phasing through walls. The docs seem to suggest that Continuous and Continuous Dynamic modes don't work for mesh colliders. They also suggest the sweep test functions don't work with mesh colliders. I can't really just change it to a capsule because it just turns into a sphere and rolls across the ground. I've made the walls thicker and made sure they don't meet just at the corners, which has helped, but doesn't completely eliminate the problem. I also made the puck bigger than it "should be", which I don't mind since it needed to happen to make it easier to see anyway.

I have two options I'm considering. First is to using a capsule to collide with the walls and the mesh to collide with the ice. It shouldn't ever get moving fast enough vertically to go through that way and I can make the ice as thick as I want without it affecting anything else. Not ideal and could probably have some artifacts to the physics, but it might work well enough. Second is to write my own cylinder collision tests, which will probably take a lot more time and be a pain.

Does anybody more experienced with Unity's physics have any better ideas?

Oh, and have a gif from the post screenshots thread which totally doesn't show off the problem because marketing or something:

Adbot
ADBOT LOVES YOU

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

ZombieApostate posted:

I'm making a hockey game, but not being all that familiar with Unity, I'm having a little trouble with keeping the puck from phasing through walls. The docs seem to suggest that Continuous and Continuous Dynamic modes don't work for mesh colliders. They also suggest the sweep test functions don't work with mesh colliders. I can't really just change it to a capsule because it just turns into a sphere and rolls across the ground. I've made the walls thicker and made sure they don't meet just at the corners, which has helped, but doesn't completely eliminate the problem. I also made the puck bigger than it "should be", which I don't mind since it needed to happen to make it easier to see anyway.

I have two options I'm considering. First is to using a capsule to collide with the walls and the mesh to collide with the ice. It shouldn't ever get moving fast enough vertically to go through that way and I can make the ice as thick as I want without it affecting anything else. Not ideal and could probably have some artifacts to the physics, but it might work well enough. Second is to write my own cylinder collision tests, which will probably take a lot more time and be a pain.

Does anybody more experienced with Unity's physics have any better ideas?

Oh, and have a gif from the post screenshots thread which totally doesn't show off the problem because marketing or something:


Make sure the walls have no rigidbodies but do have colliders. This makes them static colliders. Make your puck have rigidbody and collider. I just went through the same headache last night and once I had static environment pieces with JUST colliders no rigidbodies, it fixed every issue I had all at once.

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