Quantcast
Channel: Answers by "saldavonschwartz"
Viewing all articles
Browse latest Browse all 30

Answer by saldavonschwartz

$
0
0
So it's been a while but here are my two cents so far: First off, my whole asking was cause I'm doing a game / demo of sorts as project to teach myself unity. So obviously, I'm not cloning the game I based my example on. It's just that what I'm working on has similar aesthetics. So my test is really like so: - being able to click anywhere on the screen and have a circle silhouette / non-filled circle instantiated. The circle then starts emanating a pulsating version of itself. That is, a second circumference starting at the same scale and size scales up in x and y as it also fades out. This repeats for ever, giving the pulse / radiance effect. - if I click on the circle and drag, a line follows the mouse and when I release, a new circle is created and so the circles are connected thru the line. That being said, at this point I tried two approaches - **A** - Making the shapes with Dynamic Circles. So each of these circles is really two. One that stays put and another that I animate via a script. - Making the line that joins the circles with the line renderer. - **B** - Making the shapes (the circle and the pulsating aura) in Flash and then merely importing them in Unity with UniSWF. I then animate by actually writing a script where I make the flash animation jump from frame to frame and loop over different ranges. - Making the line that joins the circles with the line renderer. Right now I'm not making dotted lines. Which is why I'm getting away with the line renderer. I also got a copy of Vectrocity but didn't try it yet. Though then I could replace the line renderer and do dotted lines for instance. Vectrocity also takes me to think that another way about the whole thing would be: - **C** - Everything in Vectrocity. And I don't know that Cipher Prime did this, but certainly another possibility is: - **D** - Doing (almost) everything in either UniSWF or Scaleform. After all, when you couple the UI / menus with the gameplay itself, it seems it lends itself pretty well to making 80% of it in Flash and then staging it in Unity. Now, as far as the two approaches I tried, between **A** and **B** the quality difference seems negligible; I tested zooming in and out as far as I'd want to for this game and the quality is pretty much the same. I am now wondering which approach would be more efficient if I had, say, 10 of these circles connected by 9 or more lines (assuming a circle can connect to more than one circle). The trade off seems to be: - **Dynamic Circles:** - 2n shapes of t triangles each, since each shape is made up of the circle itself plus the pulsing one. - animation code inside Update() (the pulsating circles for instance, scaling up and down). - An interesting note, the meshes don't have normals. Instead, the DC shader turns backface culling off. I wonder if this is more efficient than using a shared normal. It also means without tweaking the script that generates the shapes, I can't really assign other materials to the DC shapes. - **UniSWF:** - At first glance 1 quad per shape, regardless of the pulsating effect or anything else I add. - The Unity script boils down to handling a few state changes and that's it. No color.a or transform.localScale tweaking in Update(). - However, as far as I understand, each shape which animates in the swf is really rasterized to a texture per frame. So I'm really loading in and out as many textures as I have frames in the whole animation for all states of the shape. And I'm not sure if behind the scenes the thing is smart enough to realize the n shapes are the same so it can share the textures across all of them. - Also potentially I really have a bunch (and not just one, even though it all shows up in a single quad) of proprietary (to put it somehow) UniSWF objects inside each flashObject / quad, depending on me exporting them from flash or not. And for what I understand, if I wanted to control the pulsating circle independently from the fixed circle, I'd have to export them separately in the swf file.

Viewing all articles
Browse latest Browse all 30

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>