Been busy with work and uni stuff for a long time, uni stuff isn't interesting, and work stuff I can't show off at the moment, but I worked on NoiseLab some more today because I'm avoiding doing assignments.
[t]http://i.imgur.com/ShvXOCW.png[/t]
Added a gradient selector for the output node, and added the ability to minimize nodes down to just their inputs and outputs so you can minimize nodes which take up a ton of space and only maximize them again if you need to edit them.
[t]http://i.imgur.com/Uq3QXuk.png[/t][t]http://i.imgur.com/mSH0BcV.png[/t]
Also added the ability to use custom gradients with the output, and made it so you can export the image with the resolution specified to an image our your choosing. Unity doesn't give you access to the gradient editor normally, so I made a hacky way to work around that and let me put it in the node window. At the moment I'm using a serialized object on a custom MonoBehaviour which gets the gradient property and allows me to show the gradient editor for that property. When it gets changed, the gradient property gets applied to the gradient in the node, and the MonoBehaviour gets cleaned up so it doesn't stick around in the scene, surely there's a better way to do this?
And well done Layla and Ziks! (garry can i have a job too? :v:)
Would be cool in Unity if you could add imageeffects to child objects on a camera instead of piling them all on one camera. We have 25 effects on our camera in Rust, some are only enabled when in water etc.
[QUOTE=garry;45676643]Would be cool in Unity if you could add imageeffects to child objects on a camera instead of piling them all on one camera. We have 25 effects on our camera in Rust, some are only enabled when in water etc.[/QUOTE]
Probably not worth it, but what about a script that copies all components in its gameobject to the camera and then deletes its own gameobject when the game starts?
I've never used imageeffects, so I don't know if that's even possible.
[QUOTE=garry;45676643]Would be cool in Unity if you could add imageeffects to child objects on a camera instead of piling them all on one camera. We have 25 effects on our camera in Rust, some are only enabled when in water etc.[/QUOTE]
I've not used it with any super complicated imageeffects, but couldn't you use a class to forward Unity's camera OnRenderImage to an event. Then have the effects in the child objects look for the parent camera, grab the MonoBehaviour, and listen to the event when they get enabled. Maybe something like that could work or would using events be too slow?
ImageEffectsCamera.cs - Goes on the camera
[code]
using UnityEngine;
using System.Collections;
[RequireComponent( typeof( Camera ) )]
public class ImageEffectsCamera : MonoBehaviour {
public event System.Action<RenderTexture, RenderTexture> OnCameraRenderImage;
void OnRenderImage( RenderTexture source, RenderTexture destination ) {
if ( OnCameraRenderImage != null ) {
OnCameraRenderImage( source, destination );
}
}
}
[/code]
ImageEffectsTwirl.cs - Goes on a child object
[code]
using UnityEngine;
using System.Collections;
public class ImageEffectTwirl : ImageEffectBase {
Camera parentCamera;
ImageEffectsCamera cameraImageEffects;
public Vector2 radius = new Vector2( 0.3F, 0.3F );
public float angle = 50;
public Vector2 center = new Vector2( 0.5F, 0.5F );
protected void OnEnable() {
Transform parent = transform.parent;
while ( parent != null ) {
cameraImageEffects = parent.GetComponent<ImageEffectsCamera>();
if ( cameraImageEffects != null ) {
parentCamera = parent.camera;
cameraImageEffects.OnCameraRenderImage += HandleOnRenderImage;
break;
}
parent = parent.parent;
}
}
protected override void OnDisable() {
base.OnDisable();
if ( cameraImageEffects != null ) {
cameraImageEffects.OnCameraRenderImage -= HandleOnRenderImage;
}
}
void HandleOnRenderImage( RenderTexture source, RenderTexture destination ) {
ImageEffects.RenderDistortion( material, source, destination, angle, center, radius );
}
}
[/code]
Remove this line from ImageEffectsBase.cs
[code]
[RequireComponent (typeof(Camera))]
[/code]
e:
I fixed it Legend, thanks for pointing it out
[QUOTE=Z_guy;45677096][url=http://docs.unity3d.com/ScriptReference/Component.GetComponentInParent.html]GetComponentInParent()[/url] ;)[/QUOTE]
I rarely ever need them, so I always forget the other GetComponent functions exist. That also works though.
[QUOTE=garry;45676643]Would be cool in Unity if you could add imageeffects to child objects on a camera instead of piling them all on one camera. We have 25 effects on our camera in Rust, some are only enabled when in water etc.[/QUOTE]
Wasn't adding shader effect on a plane in front of a camera not an option for client end machine?
Also something I did, a little animation test on the ghost I was working on.
[video=youtube;dctyX8Yl6O0]http://www.youtube.com/watch?v=dctyX8Yl6O0[/video]
What's the most efficient way to save a snapshot of scene state? In my level editor I need to revert the scene back to the original edited state after exiting play mode. I also want to use snapshots for undo-redo so I need it to be somewhat lightweight. I'm not sure what would be the best way to go about this
[editline]edit[/editline]
Editor trajectory prediction for certain moving objects (soon to be any moving object)
[t]https://dl.dropboxusercontent.com/u/13781308/ShareX/2014-08/2014-08-13_12-00-39.png[/t]
It can predict any specified time into the future though the longer the prediction time the more performance intensive it is.
Also closing in on a more finalized UI
I've finally managed to get a 2D platformer multiplayer working, but I can't get the camera to follow each player (Each player should have it's own camera). The player is a prefab.
[QUOTE=Persious;45679124]I've finally managed to get a 2D platformer multiplayer working, but I can't get the camera to follow each player (Each player should have it's own camera). The player is a prefab.[/QUOTE]
Include a camera with each player prefab and when the game starts, check each camera to see if it belongs to the player who is checking (using [url]http://docs.unity3d.com/ScriptReference/NetworkView-isMine.html[/url]). If the camera is not theirs, disable it.
I'm pretty sure that's how I did it the few times I messed with networking.
Oh, okay, I'll try that.
[QUOTE=Handsome Matt;45680165]Anyone know how to get the key name a button is bound to using the default Unity Input Manager?
[editline]13th August 2014[/editline]
Or should I be rolling a custom input manager?[/QUOTE]
The former is not possible.
As for the latter, there's a few existing solutions on the asset store like cInput and InControl
For some reason there's lag in the movement, and I have no clue how to fix it. (Go to 1 minute)
[url]https://www.dropbox.com/s/e847ujfvb5v4d9w/2014-08-13-1948-25.mp4[/url]
You mean the networked movement?
What are you transmitting? Just position? You'll probably also want to transmit velocity, and maybe even disable gravity on objects belonging to remote players.
I'm using the "Reliable Delta Compressed"
I wanted to make a video update for today, but I don't think I'll be able to do it just yet.
In the meantime, have a picture of the latest tool I've been working on; the Matter-Combobulator
[img_thumb]https://dl.dropboxusercontent.com/u/107588088/combob_1.png[/img_thumb]
Not nearly finished with it yet, but it'll be able to calm/excite objects and NPCs in the game (i.e. slow enemies or aggro them to trap them with the towers, freeze/detonate bombs enemies throw at you).
I'm hoping to get some kind of demo working soon, but no idea when. I seriously need to polish things up/add more gameplay systems before people start playing it (if people start playing it).
[QUOTE=Persious;45680774]I'm using the "Reliable Delta Compressed"[/QUOTE]
Not what I meant. Is it watching the transform, the rigidbody, a custom script... ?
[QUOTE=Persious;45680774]I'm using the "Reliable Delta Compressed"[/QUOTE]
If you transmit just position it's going to stutter/be jumpy. The data isn't sent every frame so the position will only update on clients once every couple frames. If you send the velocity too then the clients can update the movement smoothly using that velocity in between getting position updates. Or something like that.
[QUOTE=KillaMaaki;45680824]Not what I meant. Is it watching the transform, the rigidbody, a custom script... ?[/QUOTE]
Custom script, that controls the the movements.
I'll try sending the velocity too, and see what happens.
- I mean it watches the transform only.
[editline]13th August 2014[/editline]
What's the best thing to set the network view to watch?
I'd say the most flexible would be a custom script that serializes what you need.
[QUOTE=KillaMaaki;45680968]I'd say the most flexible would be a custom script that serializes what you need.[/QUOTE]
That sounds complicated :P
Hm, I'll try that and see if it does any difference.
I'm trying to figure out a good way to save scene states for undo-redo and resetting the level after playing in the editor. I was thinking of serializing the gameobjects in the scene but I have some questions.
1) Can I serialize them to memory instead of to disk? How would it work setting the scene from a saved state?
2) Would it work something like deserialize, check if object is in scene or shouldn't be in scene, instantiate or destroy if needed, and set <some object in the scene> equal to its deserialized counterpart?
3) Can this be done smoothly in the case of undo-redo without visible slowdown with at most a few dozen objects?
In my game I have 2 scenes (MainMenu and Game) and in each level I have a game object that holds this code.
[code]
//MainMenu
public GameObject mainObjects;
public GameObject mainMenu;
public GUIText loading;
void Awake()
{
Screen.orientation = ScreenOrientation.Portrait;
}
void Start()
{
StartCoroutine(WaitFewSeconds(2));
}
IEnumerator WaitFewSeconds(float waitTime)
{
loading.text = "Loading...";
yield return new WaitForSeconds(waitTime);
gameObject.SetActive(false);
mainObjects.SetActive(true);
mainMenu.SetActive(true);
}
//Game
//Object to enable
public GameObject mainObjects;
public GameObject terrain;
public GUIText loading;
void Awake()
{
Screen.orientation = ScreenOrientation.LandscapeLeft;
}
void Start()
{
StartCoroutine(WaitFewSeconds(2));
}
IEnumerator WaitFewSeconds(float waitTime)
{
loading.text = "Loading...";
yield return new WaitForSeconds(waitTime);
gameObject.SetActive(false);
mainObjects.SetActive(true);
terrain.SetActive(true);
}
[/code]
The problem is that sometimes(pretty often) the game freezes at loading and the yield is not called.
The thing is that its not when I do something or at a specific time. Sometimes it works sometimes it doesn't.
I did try to only use yield and nothing else but it didn't fixed it.
Working on an AI cover node system "borrowed" (*cough* stolen *cough*) from Killzone for PS2.
[IMG]http://www.mophogames.com/wp-content/uploads/2014/08/Cover.png[/IMG]
Basically, if a point is not located in any of those "wedges", then the node is considered a valid cover point. The idea is that it's much more efficient than raycasting to find valid cover points, although slightly overestimating.
[url]http://www.mophogames.com/cover-nodes-in-orbital-assault/[/url]
[QUOTE=BoowmanTech;45681655] - snip -[/QUOTE]
Try this instead
[CODE]
IEnumerator WaitFewSeconds(float waitTime)
{
loading.text = "Loading...";
yield return new WaitForSeconds(waitTime);
gameObject.SetActive(false);
mainObjects.SetActive(true);
terrain.SetActive(true);
yield return new WaitForSeconds(0); // Add this line of code exactly where it is in your code, and see if it works
}
[/CODE]
[QUOTE=Skibur;45684165]Try this instead
[CODE]
IEnumerator WaitFewSeconds(float waitTime)
{
loading.text = "Loading...";
yield return new WaitForSeconds(waitTime);
gameObject.SetActive(false);
mainObjects.SetActive(true);
terrain.SetActive(true);
yield return new WaitForSeconds(0); // Add this line of code exactly where it is in your code, and see if it works
}
[/CODE][/QUOTE]
It didn't work, do you have another solution for this.
It doesn't really have to use yield, the reason why I am using yield is because if I don't some elements in the menu that are using Screen.width and Height are still going to use the ones from the game menu which is landscape and I need them to be for portrait.
[editline]14th August 2014[/editline]
I needed something for networking and since everyone complains about Unity Master Server I checked Bolt and idk but I thought it was a lot more expensive.
Hopefully I will get around it pretty easily.
[url]http://blogs.unity3d.com/2014/08/14/building-and-maintaining-value-for-developers/[/url]
TL;DR WebGL publishing is free for everyone, no changes to pricing/sub model.
Sorry, you need to Log In to post a reply to this thread.