Sunday, 13 January 2013

Eureka Moment (Blog Update 13/1/2013)

Helloooo ladies, gentlemen, gamers and lurkers! Welcome to another proper update of the Sonic Punch Line! Just a change of plans; despite me saying that I will be talking about Age of Wushu in this week's blog update, I have decided against it due to the fact that (1) Age of Wushu's second closed beta period has been extended indefinitely, and (2) I figure that 's it's better for you guys to go check it out yourselves as different people may have different tastes and opinions on it.

And so, onto the main topic of the update!

Over the past week I have been working on a system that resizes and repositions assets and UI elements according to the resolution of the device Bubble Virtuoso is running on. This thing, I tell you, this thing took me a whole WEEK to figure out how to do properly due to some problems that took me forever to figure out what had went wrong; and as always the solution turns out to be so hair-ripping simple that...! Ugh....!

*Deep breath...* Phew!

The system is made up of different parts that act independently from each other and are responsible for a different part of the playing interface. Here's a brief overview of the system features:


  • Boundary resizing: One of the main concerns I had when considering on how Bubble Virtuoso will play on different were the boundaries that kept the bubbles inside the screen instead of flying out of it. I was initially using static meshes that were at set positions and scale and I figured that I will need to do something about it since I'm not going to focus on just one device. The "manager" (what I usually call a game object with a FSM that handles a specific feature of the game) that takes care of the boundaries will detect the resolution of the of the device's display before performing a series of calculations that will determine where the barriers will instantiate. The barriers themselves also has a FSM attached that enables them to scale themselves according to the height and width of the device's screen.
  • UI repositioning and resizing: With different screen sizes comes the need to make sure that the UI can accommodate those differences. The UI elements each has a FSM attached that will make sure that they will stick to the corners of the screen regardless of the screen dimensions. There's an additional manager that will resize various UI elements on a global level depending on which thresholds the device screen dimensions cross. Essentially speaking, there are three sizes that the UI can scale to.
  • Bubble resizing: And obviously since different devices has different screen sizes, the bubbles will have to be at different sizes. It works on the same principle as the UI resizing but on a individual level due to how the bubble assets were structured. I tried doing this in the UI resizing manager but due to the fact that each individual bubble is an instance being called out multiple times instead of just once it became a little bit tricky - I might look into making this more optimized.
One funny thing to note is that it was the bubble resizing system that got me stumped for the longest time. For some apparent reason when resizing the bubbles during run time the size of the collider and the animated sprite for the bubble didn't scale at the same size and rate, especially when shrinking the bubbles at a much more smaller size. At that time only X and Y axis scales were being affected by the size randomization function while the Z axis scale remained unchanged, and it was because of this that the scaling got a little bit screwy.

The problem that almost made me [/RAGEQUIT]
And the solution to this problem? I have to have the Z axis scale of the bubble asset to be affected by the  size randomization function - yes, it was as simple as that! 

Final Thoughts

The current system in place is by no means final. I'm pretty sure that the system needs a lot more refining and tweaking to make sure everything works smoothly, but in the meantime this will serve well as the basis for UI work once I get up to that stage. Right now I will need to get back to refining the gameplay features to Bubble Virtuoso.

For those of you who are wondering, yes I am aware that there's NGUI (http://www.tasharen.com/), it's just that it didn't come into mind when I was developing this system. I'm pretty sure it may come into play sooner or later but in the meantime learning how to use NGUI and integrate it into my PlayMaker code base is low on my priority list.

Closing Time

Whelp that's all I've got to say for this week. As far as talking about Age of Wushu in my blog is concerned, I will postpone doing that indefinitely until I get more important things out of the way. In the meantime, make sure you guys remember to tune in next week to get up to date with Sonic Punch Studio's shenanigans! Peace out!

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...