[QUOTE=DarKSunrise;44787454]how is the performance on that?
does it use unity's terrain objects or is the terrain just a mesh?[/QUOTE]
It uses Unity's terrain. I use the terrain toolkit to randomly generate the terrain and apply the textures, then just used mass place trees with a few stock assets and some trees i made.
As far as performance the first one ran like crap cause i bumped up the shadow distance and tree billboard distance for the picture. The second one gets a solid 60 fps on views like that screenshot, but on ground level it drops to around 45-50. But this is on a laptop after all (with a GeForce 630M 1GB and i7 2.6GHz in case you're curious)
[QUOTE=amgoz1;44784409]added more weapons and a less shitty level
[/QUOTE]
I feel really weird the camera, maybe the fov, the speed, the angle lag?
It's amazing, but maybe the bots are too hard or it's too hard to shoot anyone
Here's a n00b question.. what's the fastest way to make a tick function? So you can go..
AddTick( 0.1f, MyFunction )
and it'll call the function every 0.1 seconds. What's the fastest way to handle that back-end - so you can have 100,000 ticks?
Can anyone thing of a way to achieve a spring like effect with an object?
The one think i can think of is to have 2 colliders, one that just senses when the object cant fall anymore, ie once its space has hit the ground
And another that is the actual objects collider
To illustrate:
[img]http://i.imgur.com/ZB8qViF.png[/img]
So the yellow circle would be 1 collider, and the blue is the second/the object. the red lines are just to represent the center of the outer sphere.
So in hte first image it would be freefloating without gravity or any other force
in the next 3 the object falls, so it moves up from the center, hits the floor, sinks down to the bottom, and then bounces off the floor.
In the bottom 3 images its just moving along the floor and thus bouncing around
[QUOTE=garry;44795638]Here's a n00b question.. what's the fastest way to make a tick function? So you can go..
AddTick( 0.1f, MyFunction )
and it'll call the function every 0.1 seconds. What's the fastest way to handle that back-end - so you can have 100,000 ticks?[/QUOTE]
Use InvokeRepeating and in the function add to a count that calls CancelInvoke after x amount?
Or do you mean 100,000 tick function calls at the same time?
[QUOTE=garry;44795638]Here's a n00b question.. what's the fastest way to make a tick function? So you can go..
AddTick( 0.1f, MyFunction )
and it'll call the function every 0.1 seconds. What's the fastest way to handle that back-end - so you can have 100,000 ticks?[/QUOTE]
Definitely delegates and calling them directly... though how exactly you do that depends on whether you want to avoid quantization (for running higher tick rates than the engine tick rate), whether they can run in parallel and on whether/how you want to correct for jitter from clock mismatch.
If you just need them to be called sequentially put them in multicast delegates (+ operator on delegates of the [U]same[/U] type) according to multiples of frame time. That will leak time though, as the rate won't be quite correct. (You can correct in the called function though, I suppose.)
A different option would be to use constant re-queueing, but that's definitely slower for regular events. You can do this elegantly and garbageless by writing a custom back-end for C#'s async feature (using a struct awaiter/awaitable). The upside is that it's precise and not quantising, e.g. you can run ticks in the correct order at a higher rate than what your engine tick rate is, and also supports variable rates.
Another option would be to just put everything into some collection as delegate, tick rate and time left till next tick, which can centrally avoid leaking time and handle high rates, but doesn't preserve event order during engine frames, only between them. (This is also the option that can run in parallel most easily.)
The absolute fastest way to call them would probably be to compile the whole list as static calls into a method, but that obviously has prohibitively high set-up cost :v:
[editline]13th May 2014[/editline]
It's quite possible that InvokeRepeating does it one of these ways though, it seems to have a pretty high efficiency already.
Maybe something like this? Pass any parameters through a lambda.
[code]
using System.Collections.Generic;
using UnityEngine;
class Tick : MonoBehaviour
{
public delegate void Del();
private readonly List<TickTask> taskList = new List<TickTask>();
private int totalticks = 0;
public void Update()
{
for(int i = taskList.Count - 1; i >= 0; i--)
{
if (totalticks < taskList[i].time) continue;
taskList[i].del.Invoke();
taskList.RemoveAt(i);
}
totalticks++;
}
public void AddTick(Del d, float t)
{
TickTask task = new TickTask { del = d, time = t + totalticks };
taskList.Add(task);
}
}
class TickTask
{
public Tick.Del del;
public float time;
}
[/code]
Probably best to wait for someone else to answer.
[editline]13th May 2014[/editline]
Which Tamschi seems to have provided.
[QUOTE=reevezy67;44796630]Maybe something like this? Pass any parameters through a lambda.
[code]
using System.Collections.Generic;
using UnityEngine;
class Tick : MonoBehaviour
{
public delegate void Del();
private readonly List<TickTask> taskList = new List<TickTask>();
private int totalticks = 0;
public void Update()
{
for(int i = taskList.Count - 1; i >= 0; i--)
{
if (totalticks < taskList[i].time) continue;
taskList[i].del.Invoke();
taskList.RemoveAt(i);
}
totalticks++;
}
public void AddTick(Del d, float t)
{
TickTask task = new TickTask { del = d, time = t + totalticks };
taskList.Add(task);
}
}
class TickTask
{
public Tick.Del del;
public float time;
}
[/code]
Probably best to wait for someone else to answer.
[editline]13th May 2014[/editline]
Which Tamschi seems to have provided.[/QUOTE]
The List<> kills performance if you queue tasks with different delays or from a task, even if you iterate in reverse.
That's what I do right now. The issue is that every frame you're going through 100,000 tasks - even though you're only calling 7 tick functions :/
[QUOTE=garry;44796735]That's what I do right now. The issue is that every frame you're going through 100,000 tasks - even though you're only calling 7 tick functions :/[/QUOTE]
If the number of calls is that low have a look at this: [URL="https://bitbucket.org/Tamschi/attachedanimations/src/2e5a7c0c8795c024f2b4596689be464a58d9fe05/DelayDispatcher.cs?at=default"]DelayDispatcher.cs[/URL]
(I have no idea how my unlicensed code works with your commercial project though. If you want to be safe you maybe shouldn't look at it right now :v:
Here's the gist: Insert sort the tasks on adding them to a linked list and store only relative delays. Then you can invoke them without iterating the list, and queueing new ones only takes time relative to how many shorter ones there are.)
It also works with Task async, even without garbage if you do frame waiting. (Using a custom awaiter.)
(Timed delays are safe, so they have to store the leftover time somehow. It's possible to do unsafe delays that must be processed immediately though.)
If you use Task async you also have the benefit of only creating the callback delegate instance once per async method and can just loop to repeat.
With this method the async loop has to carry the timing mistake into the next iteration to avoid leaking it. You can just use the async result and a parameter to do this though.
[editline]edit[/editline]
You could in theory also do safe (not immediately retrieved) delays with no garbage, but that would require putting a reference on the heap, which you can only do using pointers or [URL="https://stackoverflow.com/questions/1711393/practical-uses-of-typedreference"]undocumented features[/URL] in C#.
(In reality it's not a reference to the stack but a field pointer to the async method's state machine object, but you can't access that statically since before compilation it doesn't exist.
You can do some voodoo with expression lambdas to get accessors though, which should be faster than other options if you do it once and then loop a lot, and also doesn't require pinning.)
[editline]edit[/editline]
I might implement that just for fun, actually. Not today though.
[QUOTE=Richy19;44796419]Can anyone thing of a way to achieve a spring like effect with an object?
The one think i can think of is to have 2 colliders, one that just senses when the object cant fall anymore, ie once its space has hit the ground
And another that is the actual objects collider
To illustrate:
[img]http://i.imgur.com/ZB8qViF.png[/img]
So the yellow circle would be 1 collider, and the blue is the second/the object. the red lines are just to represent the center of the outer sphere.
So in hte first image it would be freefloating without gravity or any other force
in the next 3 the object falls, so it moves up from the center, hits the floor, sinks down to the bottom, and then bounces off the floor.
In the bottom 3 images its just moving along the floor and thus bouncing around[/QUOTE]
Just to get it out of the way, I assume your use case requires that you do not use the built in physics engine and its elastic physics material properties?
[QUOTE=Richy19;44796419]Can anyone thing of a way to achieve a spring like effect with an object?
The one think i can think of is to have 2 colliders, one that just senses when the object cant fall anymore, ie once its space has hit the ground
And another that is the actual objects collider
To illustrate:
[img]http://i.imgur.com/ZB8qViF.png[/img]
So the yellow circle would be 1 collider, and the blue is the second/the object. the red lines are just to represent the center of the outer sphere.
So in hte first image it would be freefloating without gravity or any other force
in the next 3 the object falls, so it moves up from the center, hits the floor, sinks down to the bottom, and then bounces off the floor.
In the bottom 3 images its just moving along the floor and thus bouncing around[/QUOTE]
This is almost exactly how a simple spring system with two objects will behave if you let the player drive the inner one and only process collisions for the outer one.
The only difference is that it won't displace against each other in simple gravity like in image 2.
Just make sure you set the damping on the outer/colliding one to infinity so it doesn't bounce on initial contact.
It could wobble a bit during jumps, so you should render it at the centre of mass and flatten in in the direction of displacement to keep collisions lined up.
Not 100% perfect, but it should hide any discrepancies in 90% of cases.
[editline]13th May 2014[/editline]
Basically, implement some kind of cross between
[img]http://ecx.images-amazon.com/images/I/41cDU-XbhSL._SY300_.jpg[/img] (with springs) and [img]http://www.plottersyservicioshdz.com/products/Zorb%20Ball/zorb%20ball.jpg[/img]
More progress on NoiseLab. I've rewritten some of the components so that they're not as horribly coded and done a few optimizations to make the whole thing run a bit faster. I also added the option to open the editor in a utility window mode (non-dockable) if that's your thing.
[t]http://i.imgur.com/C7eevYx.jpg[/t]
I want to add the ability to zoom in and out of the node-graph, which works fine except the bounds of the scrollview. Does anybody know how to stop the GUI from clipping the drawing when modifying the matrix to zoom everything out?
[t]http://i.imgur.com/J0y5u8p.jpg[/t][t]http://i.imgur.com/CYfawQN.jpg[/t]
[QUOTE=BackwardSpy;44797945]Just to get it out of the way, I assume your use case requires that you do not use the built in physics engine and its elastic physics material properties?[/QUOTE]
No, im fine using built n stuff, I just wasnt aware it/what existed and how to use it
[editline]13th May 2014[/editline]
[QUOTE=Tamschi;44797996]This is almost exactly how a simple spring system with two objects will behave if you let the player drive the inner one and only process collisions for the outer one.
[B]The only difference is that it won't displace against each other in simple gravity like in image 2[/B].[/QUOTE]
TBH thats fine, its only when its against the floor that it really matters
Since I'm making a game for the Oculus Rift, I don't want to have a HUD in it and I would rather have stuff displayed to the player.
For the health system I was thinking about desaturating the screen or making the screen darker when the player is closer to death.
Which do you guys think is better? Or do you have a better idea? How can I go about doing these methods
Also need some help with accessing a script. I want to access the DepthOfFieldScatter script to change the Aperature from another script. I made a function in it called SetAperature. I don't know javascript so I'm not sure how it works but for some reason from my other Health Script I can't seem to access the DOF one.
I tried this:
public DepthOfFieldScatter dofScript;
It say DepthOfFieldScatter doesn't exist. How do I find it?
[QUOTE=Richy19;44798460]No, im fine using built n stuff, I just wasnt aware it/what existed and how to use it[/QUOTE]
[url]http://docs.unity3d.com/Documentation/Components/class-PhysicMaterial.html[/url]
Where can I get a free animated character?
I only need run,jump,walk,idle.
[QUOTE=BoowmanTech;44806381]Where can I get a free animated character?
I only need run,jump,walk,idle.[/QUOTE]
Unity has one if you import the Character Controller package
Yay pillars
Boo unity default shaders
[IMG]https://dl.dropboxusercontent.com/u/33714868/cols.jpg[/IMG]
I'm sure this has been asked a million times, but which one's the better shader pack for unity? There's quite a few...
[QUOTE=pinecleandog;44806841]I'm sure this has been asked a million times, but which one's the better shader pack for unity? There's quite a few...[/QUOTE]
unity 5 is coming out soon with physically based rendering
if you can wait, you probably should
[QUOTE=DarKSunrise;44807050]unity 5 is coming out soon with physically based rendering
if you can wait, you probably should[/QUOTE]
Or use [url=http://forum.unity3d.com/threads/221985-Lux-%96-an-open-source-physically-based-shading-framework]Lux[/url] if you really PBS want it now.
Anybody know how I could gradually make the colours desaturate to black and white? I want that to be a health indicator but don't know how to do it
[QUOTE=Over-Run;44807303]Anybody know how I could gradually make the colours desaturate to black and white? I want that to be a health indicator but don't know how to do it[/QUOTE]
[code]
something.renderer.color = Color.Lerp( DeathColor, AliveColor, CurrentHealth / MaxHealth );
[/code]
[QUOTE=Asgard;44807641][code]
something.renderer.color = Color.Lerp( DeathColor, AliveColor, CurrentHealth / MaxHealth );
[/code][/QUOTE]
Sorry to be dumb but could you go a bit more indepth on the something.renderer part?
Like do I have to attach anything to the camera? Also what should DeathColor and AliveColor be?
I just want the DeathColor to be black and White and the AliveColor be the normal look of the screen.
[Img]https://dl.dropboxusercontent.com/u/3975474/vectorfieldtool.JPG[/Img]
[Img]https://dl.dropboxusercontent.com/u/3975474/vel_.47.jpg[/Img]
I made a tool in unity that can read files that Unreal Engine 4 uses to represent vector fields to drive sexy particle forces. And it then turns it into a 3D texture.
Now I just gotta figure out how to manipulate particles. Hmm too bad unity doesn't have built-in GPU particles so I don't think I can have too many of
them anyways without huge performance hits.
[QUOTE=Over-Run;44807742]Sorry to be dumb but could you go a bit more indepth on the something.renderer part?
Like do I have to attach anything to the camera? Also what should DeathColor and AliveColor be?
I just want the DeathColor to be black and White and the AliveColor be the normal look of the screen.[/QUOTE]
Oh, I'm sorry I just read that you want the colors to desaturate. Do you have pro? The only way I can think of is to use a image effect shader.
[QUOTE=Asgard;44807893]Oh, I'm sorry I just read that you want the colors to desaturate. Do you have pro? The only way I can think of is to use a image effect shader.[/QUOTE]
What did the code you post do?
Yeah I have pro. I tried adding on the Colour Correction Saturation thing but it just made the entire camera gray and I'm not sure how to fix/use it.
Wee, I got a community Learn module published :)
[url]http://unity3d.com/learn/tutorials/modules/intermediate/scripting/coding-practices[/url]
[QUOTE=Over-Run;44808114]What did the code you post do?
Yeah I have pro. I tried adding on the Colour Correction Saturation thing but it just made the entire camera gray and I'm not sure how to fix/use it.[/QUOTE]
What I posted would lerp between two colours, so if your health was 100% it would choose 100% the alive color, no mix. If your health was 0%, it would've chosen the death color without mixing. 50% would mix between the two, etc.
If you have pro you could use:
[url]http://docs.unity3d.com/Documentation/Components/script-GrayscaleEffect.html[/url]
But I'm not sure if you can choose the amount of grayscale with that.
[QUOTE=crazymonkay;44786254]Terrain Toolkit is awesome
[IMG_thumb]http://imgur.com/lXEu3dy.jpg[/IMG_thumb]
For being 100% randomly generated having mediocre assets, and made in 10 minutes it doesn't look half bad. I was actually in the Appalachian mountains this weekend and it looks almost exactly like that.
[img_thumb]http://imgur.com/zBnZ9Hc.jpg[/img_thumb]
I've come a long way from pretty much the first thing I made in Unity just over a year ago:
[IMG_thumb]http://imgur.com/Wew8z5w.png[/IMG_thumb][/QUOTE]
I live in the foothills of the Appalachian mountains, that actually reminds me good deal of home in terms of topography and overall shape and size. More so than most "mountains" you see in an engine.
Sorry, you need to Log In to post a reply to this thread.