4. March 2014 17:59 by Squize

The past couple of days I've been working on some of the UI aspects of the game, the level complete sequence in this case.

I thought adding a star rating would be a nice touch, adds a bit of replay ability and enables me to add a simple achievement or two. Little did I know what a complete ball ache it was going to be.

I wanted to use Away3D to display it as I wanted perspective on the panel. In the main game the camera is constantly rotating around, so I thought I'd just figure out where the camera is looking and position the panel relative to that, updating it's position every frame so it appeared static.
Simple in theory, but totally beyond me. I just couldn't figure a way out to work out where the camera was looking ( There's camera.projec()t, which I guess is the way, here's the docs for that ). After dicking around for hours, I cracked and binned that approach, the maths is beyond me.

So let's just add another view and another camera and treat it as a separate entity from the main background. Sweet, all done. Now let's add some love to our texture, a specular map and some nice lighting. Sweet, that looks awesome, I'm really pleased with it, and I dropped some lens flares and moisture effects on top using Starling, looks great. I guess I should test it on the iPad now...

...ah, it runs at less than 30fps. Bollocks.

I've just spent the last hour or so removing all the sexy love I'd added in there, it still looks pretty good ( The grab above is from the cut right back down version ) but it was painful to do.
In my other recent iPad project I found that scaling images seems to cause a real hit on the first time, I don't know why, mipmaps being created on the fly ? Which means that you have to display your meshes scaled up but hide the textures with alpha=0, wait one frame, hide the meshes and restore the textures, that makes it skip that initial performance spike.

All in all a lot more painful than it should have been, but it does look good in motion, those stars fly into it and have a little impact shudder and as you can see a shower of particles. When I get some sound in there the impact should feel nice and weighty.

And that's what my last two days have been.

Squize. 

3. March 2014 10:25 by nGFX

I think I mentioned one or two times how much I don't like the maker of Flash. I really wonder what kind of morons make the decisions there. Even though I mentioned my utter dismay with Flash one too many times, I still think it's a great piece of software that deserves better than what it is getting from it's makers.

Remember the "Flash is the gaming platform for the net" blurb? So what has happened so far?

I really wonder why they don't start to push Flash more, trying harder to establish Flash as multi platform development environment and getting rid of the "all you can do with it are annoying ads" notion.

Oh well.

(And just to mention it: who the fuck is responsible for the shit UI in CS6? ... No I'm not sold on Creative Cloud either and I *never* will be)

Anyway the point of this post is closely related to my move to a new PC and the re-install of CS6, as after I was done installing it (ok, just Flash, Photoshop and Dreamweaver out of the Master Suit), I had a look at the autostart panel in windows' (8.1) TaskManager.

Big A has added 6(!) new entries to the list:

  • Acro Tray, Adobe Systems Inc. (ugly icon, btw)
  • Adobe Acrobat SpeedLauncher, Adobe Systems Incorporated
  • Adobe CS6 Service Manager, by ... right
  • Adobe Reader and Acrobat Manager, ...
  • Adobe Updater Startup Utility
  • Switchboard Server (32 bit)

WHAT THE FUCK is all that shit? (This is a rhetorical question).

I like to mention that everything still works fine without these.

All in all, 17 entries have been added to startup by various applications, of which all but 5 remained, plus one I set up myself.
Some of the entries that remained:

  • Acronis with 2 (no need for the image mounter)
  • Logitech Setpoint (for better mouse and keyboard settings)
  • Deamon Tools (for the need of a virtual drive at times)
  • 1 of the 2 NVIDIA entries (no need for the capture service proxy)
  • LanLights (the one I set up intentionally, a neat little app to show network traffic, also has a neat tray icon)

While I was at it I gave the registry startups a good bash (using CCleaner) and found more Adobe entries to kill (Adobe Bridge to note one) and if you are as annoyed as me about Acrobat adding his dirty fingers all over the system with adding "Convert to PDF" to each and every context menu you can get rid of it with this:

(This is for the 64 bit version AND cs6, but you should be good to adapt for other versions quite easy)...

regsvr32 /u "%programfiles(x86)%\Adobe\Acrobat 10.0\Acrobat Elements\ContextMenu64.dll

To run this little gift, use "Run as Admin" while starting CMD and reboot afterwards.

... and now have a nice week, I'll be coding like a mad god on non-game stuff.

-- Oliver / nGFX

1. March 2014 17:25 by Squize

We don't normally pimp things on here, but I think Flash devs need to stick together with the whole world telling us that Flash is dead, so here's a cheeky couple of lines about Roberto's game ( Which I promised to talk about months and months ago ).

It's an educational game for younger players, available for your favourite device:

iOS App Store

Google Play Store

That's it, give it a try and give the guy some feedback.

Squize.

Tags:

News

28. February 2014 10:48 by nGFX

I've been doing 16h coding shifts for the last couple of days (shipping deadline ahead) so I couldn't face touching the prototype game afterwards, which means no update on that this post.

Anyway, after Christmas I decided to rebuild the CSH22 MOC I've done some time ago (the original post is here). One thing I noticed while building the model with "real" Lego parts that the base and the roof (which looked OK as digital model) are not very stable or buildable, the obvious conclusion was to redo them before building the model.


The old base, without roof.

That said, it took the better part of 5 evenings to redesign the base and the roof, keeping an eye on stability and making it buildable. To say I went a bit over the edge with it, barely covers the amount of new parts - roughly 760 to be precise - adding up to 1254 parts for the whole model.


The new base, again without roof. The pool is all new, too.

Yesterday the last bag of parts finally arrived (Lego Pick-A-Brick is your friend here) and so while having my morning coffee I started to build the base plate and was - mildly - surprised how fucking big it is. For some odd reason I always have that with Lego models, wondering how I could have underestimated the size by that much.


That's a) a bad picture and b) 32.5cm x 31.0cm of base-plate goodness.

Oh. Well.

To end this post with something to look forward to, next post will be about messing up a game's items with exposing values to the Unity editor and how something I call the "ItemFactory" saved the whole enterprise.

... and now: there's a deadline ahead, ahoy.

-- Oliver / nGFX

26. February 2014 18:06 by Squize

I was on client work so no progress yesterday. Today I thought I'd have another look at what I could do with Starling to try and save some cycles here and there.

We use sprite pooling like everyone else in the world. Rather than add/removeChild them, I just set visible=false as it should be quicker.

Because we have a ton of possible objects, even if they're not visible, I had a look at DisplayObjectContainer.render(). This loops through all the display objects running a check first to see if they're worth plotting ( i.e if visible=true, alpha>0, scaleX/Y>0 etc. ) and if so calls their render method to actually display them.


Now if we've got 500 particles running, but not displayed, it felt a little redundant still looping through them all just to not plot them, so I altered the visible method to spit the display object into one of two different Vectors, visibleChildren and hiddenChildren. If you change the visibility it's moved from one Vector to the other, which is a little costly and I want to look at that again. But, it means for our render loop we're now only looping through objects we know are visible, so it's a shorter loop and we've removed that extra visibility check which would happen for every object.

Other savings included lots of little things, for example there's a check to see if when you alter a x position has it actually changed. 99 times out of a 100 it will have, so there's no need for a check there every time.
Also because I use alpha a lot for the particles / explosions I had a look what could be saved there too, mainly "inlining" methods ( Not the compiler inline option, as that seems to break the Starling code ), VertexData.setAlpha was a really costly call before I cut it right back.

Just to make it clear, this isn't a criticism of Starling, it's a great piece of code which has to be all things to all people, and anyone can always look at someone else's code and speed it up, there's nothing clever about that.
In a perfect world I'd make my own Stage3D engine from the ground up, but I really don't know how many more Flash projects I'm going to do so I think it would be wasted time and just be a vanity thing.

Squize. 

24. February 2014 14:33 by Squize

Did some work on the game Saturday and Sunday, which wasn't the plan as I had the html5 game to amend, but I got in the zone and really enjoyed it.

I altered the equaliser effect to the colour you see there, and after taking this grab I added another fainter layer on top to fake some HDR light bleeding.

The main push then was finally adding the explosions / particles / points. This was my big worry with the whole 60fps thing, and I managed to get there with some sly tinkering.

My first attempt was to split the particles up into two arrays ( Well Vectors, but that's such a confusing term when talking about Flash ), and run each particle in the two different arrays every other frame, so even though the game is 60fps, the particles actually only run at 30fps. This kind of load balancing really helps.
I'll be honest, I did notice the difference at first, but only because I was really looking for it, in real life they don't look like I'm cheating.

I'm not running a silly amount for each explosion, only around 60 particles, which doesn't sound much but when you've got 3 or 4 explosions at once they really help fill the screen.

After that I cracked and changed the code over to using linked lists to handle the explosions and particles. Normally I have code like this for my mainloop

var cnt:int=0;
var explosion:Explosion;
	
for each (explosion in activeExplosions){
	if(explosion.mainloop()=="dead"){
		activeExplosions.splice(cnt,1);
		explosionsPool.unshift(explosion);
	}
	cnt++;
}

Where we just loop through all the active explosions, any dead ones are removed and pushed back into their pool.

With a linked list ( I think technically I used a "Double linked list" but really who cares about the proper terms ) you store the first and the last object, your Head and Tail, and then each object has a reference to it's next and previous neighbours.

If the Head isn't null you call it's main loop and when it's finished it looks to see if it has a next neighbour, if so it calls it's main loop and so on. It removes the overhead of running a loop and changing the size of the array by inserting and removing from it. It has a slight cost when you want to remove it as it has to tell it's next and previous neighbours it's not longer there and update their next and previous pointers, but it's a handful of conditional statements.

I'm away from the game for another day or two now, but when I get back to it I'll be looking to change the player bullets to a linked list, I'm not sure if that will be possible as the baddies all expect to know about the player bullets so passing them an array is a nice easy way to do that, then I'll add the baddie shooting routines.

Squize.

23. February 2014 16:16 by nGFX

With this title in place, I don't think I have to write much about the technical details, do I?

I read an interview a few days (or is it weeks?) ago (forgot who was interviewed) and one of the things that were said was something like "mini maps are a lazy design choice". Maybe.

I still needed something like that in the prototype game, one reason is that it shows where things are, but I don't want to show a map. In reality it works more like a radar, but honestly who is going to search for "game development" and "radar"?

...

And here ends this post. I got myself a new PC, you see. Seems like I now got most things set up and running again (I could have just migrated my old stuff, but I do like a fresh start now and then).

Well, tomorrow is Monday, so it's time for a new post anyway and I try to push it in between some very serious deadlines.

 

-- Oliver / nGFX

Tags:

General | Unity

19. February 2014 14:33 by Squize

I'm not a 100% sure of our contractual obligations, so we're going to say we had nothing to do with this game.

We didn't make this over the Christmas break with our friends at Producto Studios, actually we weren't even there when whatever happened, happened.

So if you'd like to play this game that we had no hand in at all, it's here: http://www.mrpeabodyandsherman.com/lostintime/

( Also check out the main site, because you know, advertising: http://www.mrpeabodyandsherman.com )

I'm pretty sure that's all legally binding and there's no way we can get into trouble.

Squize.

18. February 2014 19:14 by Squize

A bit of client work has come up this week, so I've not managed to touch DN8 today.

One thing I did mange to do yesterday though was to give the particles some colour, I'm really pleased with them.

They're a lot more colourful than in the original game, they have a nice 8Bit colour wash feel to them. Rather than going the tint route of the original, which is expensive, I just created a 260 frame tween in the Flash IDE and got it to spit all the frames out as pngs, dropped them into Texture Packer and the game just picks the next one in an array every time we need to plot one.

I think unfortunately that's where I'm going to have to leave the game for a couple of days, there's too many other moving parts work wise right now to be able to try and claw some free time back to work on it, which is kind of annoying as next up would be some explosions and all the particles which go with them. Oh well.

Squize.

14. February 2014 19:52 by Squize

Quick update today, as it's Friday and I'm sure we've all got places to be.

The first level baddies are in now, and the particles which show their path.

You can shot them to earn points, but no explosions yet ( That's the next big thing ). I noticed the frame rate drops slightly when the path is onscreen, so I'm going to have to look at that as well ( It's not too bad right now, but when we have a silly number of bullets running every little saving helps ).

Basically I'm trying to get all the costly in terms of CPU / GPU stuff in as quickly as possible and then optimise that so we keep as close to the magic 60fps as possible. I'm lucky in a way that I've got an iPad3 to test on, it's the slowest device out there ( iPad 1 doesn't count, that's really not worth targeting ).

Hopefully Mondays update should have more in the way of particles, as they always look good.

Squize.

GYW on the web ...

Even more of GYW ...
GYW Homepage +GYW GYW on Facebook GYW on Twitter nGFX on Twitter

Month List