Thứ Tư, 31 tháng 7, 2013

Wednesday When The Art Attacked

There I Was

Yes indeed, there I was, minding my own business when Mark submits an email of intense significance to the Reloaded project. He only went and re-wrote my shaders, and replaced my textures for the Terrain Demo. Music to my ears it was, and upon running the video he prepared and the new prototype in dropbox, I was not disappointed.

In the space of a few hours, Mark transformed my prototype into a drab unlit world into a scorching explosion of sharp contrast and infinite detail. He rescued a texture stage from my terrain shader and made the result look even better than it did before. Now that's talent ladies and gentlemen!

And Now A Visual

Oh, that's right, we're on a visual ban aren't we? :)  Ah well, patience is a virtue, or so they say. That is, if you believe 'them', whoever they are. 

Anyhoo, I can confirm it looks darn good and I have a video and a screenshot for the newsletter so all is well.  Sorry for the visual black-out. I will try to convince Rick at the meeting on Thursday that SOME visuals would be okay for the blog, just not horrible ones that squarely belong in the programmers cassette box.

The Trouble With Physics

In fact, there is no trouble, whatsoever. The bullet physics wrapping is going very well, and resembles ODE in many ways in the way everything is set up, created, released, e.t.c. 

I am currently toying with getting static terrain into a simple DBP prototype. I already have static and dynamic cubes and spheres, and thanks to a reminder from the blog comments section, I even have a dynamic cylinder!  We never managed to get good cylinder physics in FPSC Classic, so their introduction in Reloaded will be a great plus.  Always wanted to roll a barrel down some stairs, then strafe bullets at it half way down and have it explode amongst my enemies, who just that moment started up the stairs.  It's the little things that make you smile!

No doubt, largely thanks to precious little examples on the subject, I will be working on static terrain for a while, but once I've overcome that I am onto Character Controllers and that's where it gets interesting for me.  More on this later in the week, as I hope to cram some work in Thursday evening when the meeting is over.

Signing Off

It makes sense to make this one an early night which makes a shorter day than usual, but I can make up for it Friday I think.  Hopefully Friday's blog will reveal something you can use, and push the boundaries of what we've been used to so far with FPSC.

A few more notes before I resume terrain physics fun, our AGK V2 Kickstarter is starting i's last 10 days run-down to get to that mythic 1000 pledger's. It's a good wholesome number to get to, and we're tantalizingly close.  I recommend everyone pledge another £3 (or get their friend to do it) so we can push it over the edge and watch the wonderful splash when it hits the sea (sorry, my mind is still in terrain mode).

I also wanted to provide a link to a great write-up of the AGK V2 effort, in the form of a review of our Kickstarter from Gadget Girl.  Great to see such enthusiasm, and a real kick to see the photos of the old products and the stack of TGC inspired books!  Here is the link for your delectation: http://www.gadgetgirlreviews.com/2013/07/app-game-kit-v2-calling-all-budding.html  

Oh, and before I forget, the current AGK V2 total (with TGC Paypal pledges) comes to a rocketing £27,918 and an amazing 770 backers.  Good luck to that project, and wish me luck with terrain physics. It should be straight-forward, but I don't have sufficient documentation for half of the required parameters, but that's life for a developer, right? ;)

Make the most of the last weeks of summer

A couple of weeks ago, I took a summer trip with friends. I found myself using plenty of Google tools while we were on vacation: from finding the best flight there and a last-minute hostel reservation, to discovering hidden gems in each city we visited, even I was surprised by how much Google made everything easier and smoother.

With that inspiration, we’ve created a one stop shop at g.co/summer with tips to help you also make the most of these last few weeks of summer.
Here are a few tips you might find useful too:

Meanwhile, my mom back home in New York found some great local activities and museum exhibits, like the MOMA Rain Room, using Google Now in her Google Search app. She even tried some Google+ MakerCamp classes, which inspired her to create her own DIY projects at home.

Post about your summer using hashtag #SummerTimes, and see what other folks are up to.

Happy summer!

Starbucks’ WiFi goes Google

Coffee shop + Internet—it’s a pairing that many of us have come to rely on. WiFi access makes work time, downtime, travel time and lots of in-between times more enjoyable and productive. That’s why we’re teaming up with Starbucks to bring faster, free WiFi connections to all 7,000 company-operated Starbucks stores in the United States over the next 18 months. When your local Starbucks WiFi network goes Google, you’ll be able to surf the web at speeds up to 10x faster than before. If you’re in a Google Fiber city, we’re hoping to get you a connection that’s up to 100x faster.

Google has long invested in helping the Internet grow stronger, including projects to make Internet access speedier, more affordable, and more widely available. The free Internet connection at Starbucks has become an important part of many communities over the years, such as in the aftermath of Hurricane Sandy, or for students without Internet at home who do their homework at Starbucks.

We’ll start rolling out the new networks this August. We appreciate your patience if it’s still a little while before we get to your favorite Starbucks—you’ll know your new network is ready to go when you can log in to the “Google Starbucks” SSID.

Thứ Ba, 30 tháng 7, 2013

Tuesday Got Physical

Box, Meet Sphere

I have a sphere which falls to a static box and slowly rolls away. I know it was not the most ground breaking start to my physics system masterpiece but it's a start :)  Most of the day in fact was spent re factoring the terrain prototype so it would integrate much more easily with the engine, which in real terms means an almost complete rewrite.

The data structures and subroutines had to be separated out, cleaned up and commented, the resources such as objects, images, shaders and cameras had to be accounted for and externally controllable (as it would integrate with an engine which already uses many DBP resource indices) and finally I had to move the files around and remove old ones, and place new ones in clever places for future proofing.  Test the whole thing to make sure nothing got broke in the conversion too!

Finally, I moved the media files and the newly created source files to the main engine, in such a way that I can still load and compile the terrain prototype as a standalone, but the types and main module can now be used in the main engine compile as well.

I stopped short of integrating the IDE (that is, seeing the terrain in the map editor window and linking in the controls) as I had an appointment with physics I did not want to delay.

Integration Delay

It might be a mistake postponing integration in favor of starting the physics module but there are many more integration modules to come and it might make sense to do them all at once.  The task is also quite involved and I should really treat it as a project in itself and give it the proper amount of time, not squeeze it in between modules. 

I have done my re-factoring correctly, which is the main thing, and I can still compile and run the terrain module proto as a standalone which means the new art which Mark is burning overtime on can be tested and dropped in when they are ready.

Signing Off

As you may have read from yesterday's blog comments, it appears Rick discovered a secret version of the terrain module on dropbox I was using to work with Mark on the final terrain texture sets.  Seems he liked it.  You might think that means you get a screen shot but I rather like the idea of a big reveal through the newsletter and the Friday blog. Something to start your weekend with a little bang.

Who knows, maybe it will get better in the next few days and you do want some WOW factor out of this project right?  I just hope I've not built the suspense too much, worst thing you can do that!

Wednesday's plan is a bit scatter gun, with some art integration's, more physics module work, new FPSC animated sprite pack to create an installer around, get rid of some office clutter so I can see the chairs again, create some GITHUB repositories and see if they all compile for me, prepare presentation notes for Thursday AM and who knows what else.  All in all, pretty happy with today's run of work.

Thứ Hai, 29 tháng 7, 2013

Monday Extra Time

More Terrain Time

Today I get a few more days terrain time thanks to a postponed meeting, which was really supposed to be day one of my Physics work.  I just could not resist continuing to add the eye candy and get the demo 'just so' before moving too far off my present mark.

Monday I finished the water shader, water effects code and added a better sky box texture to give a high definition feel to the whole scene. I then must have spent two hours just moping about making terrain, cutting out little rivers, playing with my height and paint editing tools to see what kind of landscapes I could come up with. During my 'fun' my mind raced about more editing tools I could implement, more refinements to the shaders, optimizations that fit the way I did some things and a general need for more plants, rocks and bits of scenery detail.

I think the screen shot I have not is pretty darn good, but I am going to stick to Rick's guns and refrain from putting any 'suspicious' art out there :)  Only a few more days to wait, and I think we will be using a 'terrain shot' for the next TGC newsletter so there will be no doubt you will see all this soon enough.

Details Details

It might seem adding water and new sky was a relatively trivial affair, but the very subtle code I added attempted to best some of the tricks done in high rolling games.  Little things like a subtle fog effect, not to cull distant objects but to provide a misty sense of distance (and I mean VERY subtle).  

Another trick. courtesy of Evolved, is to use a water mask texture to describe the edges of a lake or body of water. This ensures the water does not look strange when bumping up against solid geometry and is a great substitute for a depth read.  I also had a few ideas where I could hijack the other channels of the water mask to describe depth, and use a nifty pixel shader calculation to shade the refraction map darker as the water gets deeper, like you would see in the real world.  Alas these are all what I call 'nice to have' B list items and should not get in the way of my goals on this occasion.

No Blooming

I was tempted to make the 'maybe awesome' demo use post processing effects such as bloom, depth of field and haze effects (for the desert heat) but again for the above reason refrained. These can be added later, and are not what we all agree are 'essential features' of the engine.  Hopefully my terrain demo now stands on it's own without the smudging effects of post processing.

Next Things

Now I feel the demo stands alone for a presentation, I can move onto more serious matters such as re-coding and cleaning the prototype to use a data structure and resource numbering set that can drop right into the main engine and map editor IDE.  A terrain editor is no use as a prototype!  Hopefully this task won't take too long, and the subsequent introduction to the IDE will go smoothly if I do this preliminary step correctly.

Once the above is done, I will be free to resurrect the Bullet Physics prototype I very quickly knocked up before my holiday. It attempts to operate a 'character controller' walking over a 'height map', which is actually quite ideal as I could drop it into the present terrain module.  From there, which is no small trick to get all that set up and running properly, is to then add a few dynamic and static objects to test performance and stability of the floor.

We don't want a repeat of FPSC Classic with enemy characters suddenly disappearing through the floor and into infinity!  I am hopeful the new Bullet physics system will provide many wonderful toys to Reloaded in time, and if I can get the basics working great, the rest will follow smoothly.

Signing Off

My schedule puts this week down as pure Physics coding, so the sooner I can get off terrain and onto physics, the sooner I can get them both integrated and start the inevitable tweaks to ensure they all play nicely.

I am quite looking forward to creating a sphere and rolling it down a terrain hill and watch it hit the water and start bobbing about, then cast some wind around and see it subtly shift position as it islands it's way around the pond.

A new Zagat for finding the very best places

Today we’re launching a new Zagat website and mobile app for Android and iPhone that puts the very best restaurants and nightspots right at your fingertips. And for the first time, our trusted Zagat ratings and reviews are available for free with no registration required.

The new Zagat features the latest news and video content from our expert local editors, curated lists (think “10 Hidden Restaurant Gardens Around DC”), powerful search and map-based browsing to help you find the local gems.
These days, the challenge in deciding where to go is not about about a lack of information or user reviews, but finding accurate information and trusted opinions so you can quickly make informed decisions. Through our digital products—and the Google products you use every day like the new Google Maps for Mobile—you can rely on Zagat’s curated lists and summary reviews to cut through the clutter so you can find the perfect spot.



The new Zagat covers restaurants and nightlife in nine cities, and over the coming months we plan to expand to 50 U.S. and international destinations and cover shopping, hotels and other places of interest. We know that many of you are eager to have continued access to our content in these markets, so in advance of this expansion, we'll soon make our existing ratings and reviews available on Zagat.com.

For more than 34 years we’ve been surveying passionate locals about the places that matter to them most. This is the foundation on which Zagat was built—and we hope that through our featured surveys on Zagat.com, you’ll continue to share your opinions with us as you rate and review the places you visit.

Thứ Sáu, 26 tháng 7, 2013

Friday And The Randoms

Terrain Save, Load and Random Generate

Another good (but hot) night in the coders dungeon. At night I have to switch off the blessed air-con as the open window lets all the moths in.  After 10PM the office gets hotter and hotter and hotter this time of year!

It's now 3AM and I'm practically in a sauna, sweating like a coder without a compiler and hoping this blog entry is nice and succinct so I can go to bed. Some good news in that the Monday meeting has been pushed to Thursday which gives me much more time to add some polish and even start the Physics prototype next week!  The downside of course is that without a demo for management to approve, there will be no pictures or videos now until next Friday. If you want this policy to change, you know Rick's email ;)

Terrain Saver and Loader

It was key to be able to save all edits performed and reload the terrain in the exact same state to resume editing and of course to load in when the level requires it.  A few hitches though. One bug one is that when I construct the height data manually in the terrain module, I drop from 200 fps down to 30 fps for some unfathomable reason. I have yet to dive into the source code of the module and might just be something silly, but it has me a little vexed.

I also found that converting the terrain height data to a height map image, and then feeding that back through the loader created import distortion of some kind which would slowly (but subtly) change the terrain heights each time you saved and loaded. Not a good idea as your terrain would have washed away after the 100th save :)  I am instead directly storing the heights in a Dark Basic Pro memblock file so I can keep a very accurate eye on this most valuable data.  I also save the veg shadow map too, this time as a simple image and map it back to the system when I restart the prototype. It works just great.

Holy Random Terrains Batman!

A tickbox on my schedule was the successful generation of a believable 'random' terrain as part of the Reloaded terrain editing suite. I was certain many users would not want to define every hill, dip, lake, bump, slope and mountain over a 50,000 x 50,000 area.  They would want a single button to make one up, and then allow some editing in the part of interest.

To that end I borrowed inspiration from our friendly Dark Basic Pro forum, and an entry into our 20 line challenge which is a bit of fun which tasks any programmer to write something useful in under 20 lines of code. It's great to see the amazing things coders can do in such a small space and in this case, someone produced a terrain generator in 20 lines!

The name of this DBP star is Lewis999 who adapted a Diamond-Square algorithm to populate a matrix with realistic height data. Using the same technique, I generated pure height data using the same idea and applied it to the terrain constructor.  I then painted textures based on distance from the water level, and used smoothing to create a nice transition. I also painted a band of grass at the point I felt grass would ideally grow (not too high in the mountains, not underwater or on the shore).  You can still paint all this manually, but the terrain generator starts off as an automated process.

Finally I played with the grass sizes to create a more dynamic and rich veg experience, and concluded that a few more grass and vegetation models and textures would really lift my terrain visual. Something to add to Mark's list when he's not looking!

Is Something Missing?

Running around my newly generated terrain for a while, as good as it was, there was something missing. Naturally there is no game, so no enemies, no buildings, no game objects, no nout of course. Still, you can have a convincing terrain without all the above, right?  As I am making a deliberate effort not to add trees (as that is for another pack and another day), I wondered what else I could add. Perhaps a few cactus plants models when/if they are created, sure, but I need something more substantial!

Is it a bird, is it a plane, no it's a Rock!

Sure enough, what my bleak terrain level needed was rocks, and lots of them!  Not the little pebbles that can be baked into the floor texture but large ugly rocks left after the last glacier strolled through the land.  From my extensive terrain editing (playing) I knew how to create a rock by making a sharp raised land, then squashing the top bit, then adding a rock texture and surrounding it with grass.

Given that knowledge, I proceeded to add a system which would strategically add a rock, and not just a single rock but what I term a rock clump. These clumps comprise of about 15 rocks in close proximity and they really do look natural when sprawled over the floor. The system then moves somewhere else in the land and makes another clump, and so on until there are enough.

The terrain generator is pretty good for a V1 now, but it does take a while (30 seconds for 150 rocks) and the final level would probably need a few thousand of them.  The good news is that once the rocks are in the land, you can save and load the whole terrain within seconds :)

Signing Off

So that's the week, and apart from IDE integration, all my terrain objectives have been met on schedule which I am pleased about. Still needs spit and polish of course, but we're well on the way now.  It also occurs to me that our AI system will need to know about height map terrain so enemies can work out a path through cliffs, valleys, slopes, work out line of sight, know what height advantage means, e.t.c.  I have already started a list :)

I plan to use the weekend to quickly add shadow generation to the prototype, experimenting with things like burning the normals as shadows in the texture to improve LOD transitions, calculating when a large hill or rock casts a shadow onto the terrain and the big one, rendering the entire 'outdoor' scene of a level such that I can burn the resulting shadows into the veg shadow map too.  This of course means we cannot have a moving sun for day and night cycles, but adding cascade shadow mapping to the terrain proved too costly and unless there is a performance friendly solution out there I have decided to aim for quality visuals rather than a day / night cycle in V1.  I should have plenty of time to work on my shaders, and it won't be long before a solution pops into my head which allows us to have our cake and eat it.

As is my custom, no blog entries this weekend so I can be free to do nothing, or burn the candle at both ends.  I was going to sneak out a screenshot of the latest progress, but I resisted (Rick will be proud).  See ya Monday!

Thứ Năm, 25 tháng 7, 2013

Thursday Has Better Veg

Veg Improvements

Thanks to an urgent rush on a veg model, some tinkering and tweaking, the terrain module how has a better vegetation system which looks better, does not overhang cliffs, fits better on the ground and is faster for performance too.

Terrain Edit Cursor Highlighter

Thanks to the fact I am using a shader for my terrain, and I no longer need to save four texture stages for cascade shadow mapping, I have added three more diffuse texture options and a cursor highlighter texture as the last texture stage. Using some pokery, I am able to have the cursor render at the mouse coordinate during editing, and also reflect the radius of the brush which is now under shortcut control. It looks pretty snazzy too, as though a glowing light of creation spawns terrain from it's terrible orb of power :)

More Shader Fun

To combine the different textures coming into the terrain, I am using a control map (the veg shader map I mentioned in previous blogs) and rather that gobble up my useful channels, I can specify which of the five diffuse textures from a single Blue channel of the control map.  Here some code which does it:

float texselectorV = tex2D(NormalSampler,IN.TexCoord/500.0f).b;
float texselectorcol1 = max(0,0.25f-abs(texselectorV-0.00))*4.0f;
float texselectorcol2 = max(0,0.25f-abs(texselectorV-0.25))*4.0f;
float texselectorcol3 = max(0,0.25f-abs(texselectorV-0.50))*4.0f;
float texselectorcol4 = max(0,0.25f-abs(texselectorV-0.75))*4.0f;
float texselectorcol5 = max(0,0.25f-abs(texselectorV-1.00))*4.0f;
float3 textpart1 = tex2D(DiffuseSampler1,IN.TexCoord).xyz*texselectorcol1;
float3 textpart2 = tex2D(DiffuseSampler2,IN.TexCoord).xyz*texselectorcol2;
float3 textpart3 = tex2D(DiffuseSampler3,IN.TexCoord).xyz*texselectorcol3;
float3 textpart4 = tex2D(DiffuseSampler4,IN.TexCoord).xyz*texselectorcol4;
float3 textpart5 = tex2D(DiffuseSampler5,IN.TexCoord).xyz*texselectorcol5;

finalcolor.xyz = textpart1+textpart2+textpart3+textpart4+textpart5;

Neat I know, but when you have limited resources you need to get creative with what you have. Old school 8 bit experience that one!  I've also been impressed with the raw power of the GPU when running shaders. Almost all my bottlenecks have come from poor coding or some intense CPU activity, which is very encouraging for all the wonderful ideas one can perform through a shader!

Signing Off

The plan is to carry on and get the prototype so I can paint to the 'veg shader control map' by writing the texture directly from my program (performance alert) which can then reflect in the textures used by the terrain in real-time. This will lead onto being able to paint the veg color and at the same time the actual veg data which the vegetation system will use to populate the terrain. Right now the veg is being used for the entire terrain, which works fine and fast, but I dare say not everyone will want veg everywhere!

After that, I will add some quick 'randomize terrain' functionality and perhaps some 'save what I have done' code to make sure this edit can be reloaded and continued. The final step will then be to add it to the main FPSC IDE which is what I hope will occupy my Friday and have the weekend as an overflow buffer before the meeting on Monday.  I still have to play S.T.A.L.K.E.R (deferred renderer) which is still in it's shrink wrap :)

Thứ Tư, 24 tháng 7, 2013

Wednesday Progress

Terrain Takes A True Shape

An amazingly good day today, so much that it's one of those days you forgot what you had 24 hours prior to the very moment you think back. I started a new prototype to collect together the terrain painter and the terrain shader, so that I could have a relatively blank canvas to try my new technique ideas.

Thanks to the Blitzwerks Terrain upgrade, vertex normals now provide some great data to my newly concocted terrain shader which applied nicely without a fuss to the terrain geometry. I also got some super terrain textures from Mark and my shader experiments started right away. The trick is to get it looking good from the distance and from up close, which meant choosing the right textures, applying the right amount of scale, selecting a good detail map, balancing the effect of various lighting calculations and a good deal of trial and error. Finally I got something that looked pretty cool.

Being able to paint land and see it rise out of the water was a real treat, and I even applied a nice trick which automatically map rocky texture to the upward slopes of the terrain and sand on the flat bits.  Coupled with the normal shading, the whole thing was quite addictive during testing and I found myself drawing all manner of terrain islands :)

Bringing Forth Mr Vegetable

I was going to add some really nice reflective/refractive water which I realised that my schedule did not call for water, but DID call for vegetation effects.  I already have a water shader waiting in FPSC engine so the smart move was to avoid the easy eye fest and opt to solve the veg issue.

Thankfully I already had some preliminary desert vegetation and a rather nice shader from Mark, so was able to get started adding veg into the prototype quickly. For those who don't know, veg is my way of describing the grasses that rise out of the terrain to soften the hard surface of the floor and provide some nice decoration in what might be a rather barren landscape. Mark's shader also provided some soft movement and colour offsetting as the wind blows through the grass, very nice!

All well and good rendering some veg, but I needed enough to cover an area 50,000 x 50,000 units.  What I needed was a routine to create rolling vegetation based on the players position. After a few hours, this was created by allocating 500x500 grid squares a single batch of veg polygons, calculated in real-time to be placed on the terrain. By spacing out when these objects are created, I can keep performance even. By fading them out at the far distance, I can introduce them slowly into the scene to make some great veg LOD.  I then had the neat idea of creating a new texture 4096x4096 (the biggest I dare support for Reloaded) which stores what I call a 'veg shadow map' which uses the separate R,G,B channels for information to both the terrain and the veg shader.

Right now I have RED control the paint which is placed on the terrain where any veg is to be located. This is cool in that when the veg fades out, this colour remains to fool the user that distant patches of grass colour is grass, when in fact it's just painted to the terrain. 

The GREEN is being used as a shadow mask, which allows me to darken any area of the terrain as a separate process. My hope is that I can coax the cascade shadow map to draw into this channel and provide a 'sort of baked' full universe shadow to apply to the terrain. I can also use the exact same texture and channel to shadow the grass in the exact same way and position, creating unity between the two shaders.

In developing the veg, I realised that the cascade shadow mapping would be too performance intensive to apply to everything, so the 'painted veg shadow map' will be my very nice looking fall-back. I also realised that terrain normals maps get lost in everything I am rendering to the floor right now, and also the fact I needed the texture slot for something else. Now I have removed the need for cascade shadow maps on the terrain, I have freed up four texture stages which means I could bring back normals, but I think I might opt for something better like more texture paint choices and use the extra channels of the veg shadow map to control which texture gets selected for terrain painting.  Before these experiments can begin, I still need to add some 'editing' controls so I can paint the veg and shadows as part of the terrain modification system.

The Question Of Art

Looks like my Tuesday blog got quite a few comments there ;)  Don't be too hard on Rick, he's doing the job he's been assigned for this project, and if my horrid screenshots are going to disrupt the marketing job he has to do later then a cease and desist order is probably the wisest course.  It will be hard as I do like to gabble on as you know, but perhaps it will force me to insert better art in my prototypes just in case a screenshot happens to escape :)

Some good news is that I have a meeting on Monday morning, showing off the progress of the last two weeks terrain work.  If the feedback from that meeting are positive, I will post some screenshots and maybe a video of the demo.  It's internal name is called 'awesome demo', but that might be a tall order as I don't have the final graphics, no post process shaders, no real scene content and only a few days left to code it all.

Signing Off

A happy day all told.  Even a 3PM appointment with the Dentist today did not dampen my spirits, and apart from the infernal heat, flies, moths and other creatures which insist on tupping me all evening, it's a day that deserves a tick. At some point I want to get the whole shabang into the IDE, but I think before this I need to complete the whole range of 'painting controls', find out how to burn the cascade shadow into the veg shadow map and orient and align the prototype and code so that it can drop smoothly into the main FPSC Reloaded engine without too many compiles.

More good news is that my weekend looks free of social engagements which means I can dedicate those days to more terrain work, which means I might find time to add some of that 'oh so tasty' eye candy you can only get from a lovely water shader ;)

From TVs to tablets: Everything you love, across all your screens

When I was growing up, my family had a single screen we huddled around every day: the television set in the living room. Nowadays, we “huddle” around multiple screens—laptops, smartphones and tablets—using them almost interchangeably as we navigate through our day. In a world of ubiquitous computing, life would be a lot simpler if we didn’t have to learn new behaviors and interfaces each time we switched screens—if we could have one consistent, intuitive experience no matter where we are or what we’re doing. Today, with the launch of Chromecast and the new Nexus 7 tablet, it’s even more effortless to enjoy content you care about—whether it’s video, music, movies, games—wherever you are, across your devices.

Introducing Chromecast
To help make it easy to bring your favorite online entertainment to the biggest screen in your house—the TV—we’re introducing Chromecast. Chromecast is a small and affordable ($35) device that you simply plug in to your high-definition (HD) TV and it allows you to use your phone, tablet or laptop to "cast" online content to your TV screen. It works with Netflix, YouTube, Google Play Movies & TV, and Google Play Music, with more apps like Pandora coming soon. With Chromecast, we wanted to create an easy solution that works for everyone, for every TV in the house.

Remote-free
Once your Chromecast is set up, you can use your phone, tablet or laptop to browse and cast content to your TV, play and pause, control the volume, and more. But unlike other streaming solutions, you can still multitask—send emails or surf the web—while enjoying what’s on the TV screen. It works across platforms—Android tablets and smartphones, iPhones, iPads, Chrome for Mac and Windows (more to come), so your personal device is also now your remote control.

Cast the web to your TV
In addition to apps like Netflix, you can use Chromecast to bring a broad range of content available on the web to your big screen, thanks to a new feature in the Chrome browser that allows you to project any browser tab to your TV. From sharing your family photos to enjoying a video clip from your favorite news site, it’s as simple as pressing a button. This feature is launching in beta, but we’re excited for people to try it out and give us their feedback.

Google Cast SDK preview for developers
To ensure a great Chromecast experience over time, we've built Google Cast, a technology that enables developers to build consistent, intuitive multi-screen experiences across mobile devices and TVs. Today, we’re launching a preview version of Google Cast with more information for developers on our Google Developers blog. A handful of early developers are already working on enabling Google Cast technology in their apps, so more supported apps are coming soon. And while the Chromecast device is the first instantiation of Google Cast, we expect the technology to be embedded in a range of hardware from our partners in the future.
The new Nexus 7—the sharpest 7” tablet screen ever
Together with ASUS, we took what you loved about the original Nexus 7 and made it even better. The first thing you’ll notice is the sharpness of the screen: the 323 pixels packed into every inch of the screen makes it the world's highest-resolution 7-inch tablet. It’s lighter than ever, with more than nine hours of HD video playback and 10 hours of web browsing or reading. Nexus 7 now features stereo speakers and virtual surround sound from Fraunhofer (the inventors of the MP3 format), giving you rich and immersive audio.

Android 4.3—a sweeter Jelly Bean
Nexus 7 is the first device to ship with Android 4.3, the newest version of Android. Tablets are perfect for sharing with others, so in Android 4.3, we're introducing restricted profiles, which let you limit access to apps and content. For example, restricted profiles enable parental controls, so certain family members are prevented from accessing mature content. Likewise, retail stores can use tablets to show off product information, and shops can use tablets as point of sale systems. Android 4.3 also now supports Bluetooth Smart technology, opening the door to mobile apps that connect to new devices like fitness sensors. Android 4.3 is rolling out to Nexus devices starting today.

Ready to Play
The new Google Play Games app brings your friends together with the games you love, where you can invite a friend and start challenging gamers around the world, compete for top achievements, and race to the top of the leaderboard. You can also enjoy the world’s largest collection of eBooks, listen to millions of music tracks and immerse yourself in thousands of movies, TV shows, magazines and apps on Google Play. Plus, Nexus 7 comes loaded with your favorite Google apps, like Chrome, Maps, YouTube, Gmail and Google Now.

How to get Chromecast and the new Nexus 7
Starting today, the Chromecast device is available for $35 on Google Play, Amazon.com and BestBuy.com. It will be available in Best Buy stores across the U.S. starting July 28. For a limited time, you also get three months of Netflix included. More info available in Google Play.

Nexus 7 starts at $229, and is available in the U.S. beginning July 30 (with more countries coming soon!). Buy Nexus 7 online on Google Play, or check it out at Best Buy, Gamestop, Walmart, Staples, Office Max, Office Depot, Amazon, Home Shopping Network, Radio Shack, J&R and B&H Photo. Nexus 7 (LTE) is coming soon with support for T-Mobile and Verizon in the coming weeks. Learn more on our Nexus site.

Thứ Ba, 23 tháng 7, 2013

Tuesday Rocks

Some Shader Success

You will never find a more challenging maze that is the shader coders daily life. Every little dust of wind will affect the output of your shader, and when you are in experimental shader writing mode the problems magnify beyond belief.

I spent most of the day in a pitch battle against thin air for the most part, unable to make contact with anything and not even knowing whether I was winning or not.

Two hours before writing this text I decided to go right back to first principals and get something small working and work my way forwards. The technique worked and I can now sigh a little with my terrain now accepting a shader shadow and rendering alongside my other shaders. Phew!

Mark Art

After my green and white splodge screenshot I have now been banned from posting any more 'developer art'. The idea is that as we get closer to the release, this blog becomes part of the product marketing and we don't want any 'dislikes' or 'misunderstandings' over the final quality of the project.

To that end, I will only post prepared artwork from our esteemed artist Mr Blosser and Mr Peter.  Here is one such sample, a render of some rock which I will attempt to coax into my new terrain shader very soon.


Normal Success

Perhaps I celebrate prematurely but I just got an email from the Terrain Module author with some new source code which solves the normal issues I was experiencing.  Fingers crossed that everything goes smoothly this evening and we can get normals updating as the height changes. After my early shader work, I have concluded the normals are vital to the success of our terrain so I am very nervous about checking out the new code!

Signing Off

I would have shown you a sneak peek at the 'decent demo' with a terrain background plus shadowing, but it's not top draw so you will never see that version of it :)  Once we get something stunning, and our QA guy approves it, just maybe, you can have a sneak peek at Reloaded terrain.

More work due this evening, but looking at the clock I seem to have done an 8 hour stint without a break and currently light-headed.  Some food, then more lovely coding!!

Thứ Hai, 22 tháng 7, 2013

Monday And The Week Ahead

At The Beginning

I have decided to do another of my rolling blogs, which time stamps my day to give you fledgling and ageing developers alike an idea of the pace of life in front of a coders keyboard.

My day started about 12:30, around noon, and greeted me with a small mountain of emails and paper correspondence which was quickly opened and discarded. Same too in most part to the emails which now split into Social and Promotional categories thanks to Google.  Much easier to mass delete both sections and increase the working week I found. With the handful of 'relevant' emails remaining I fired off suitably brief replies all round and began my day.

1:20PM : Character Tweaks

An email containing feedback on my quick character proto required a few tweaks to speed up the character animations and modify the animation set selection so that diagonal forward and backward walking uses traditional forward and backward animations rather than sidestep animations.  The result was a marked improvement and sent back to source for further study.

2:00PM : Emails' Gone

I finally obliterated the final email from my inbox, and it's now terrain time. The last thing I did was a quick and dirty terrain painter with solid colours. It really needs a texture there, and it also needs to fade into other textures on the terrain also.  This will be my next task, and I feel a shader coming on!

5:43PM : Texture Splatter

After some scrolling through the source code of Blitzwerks Terrain, it became apparent that although it does support shaders internally, I could not find the commands to apply a shader externally, nor did I feel confident to modify the source sufficiently to allow full shader support in the time available to me.  

I had to think out of the box 'again' and created a strange yet working system which creates a camera and points it at a large textured plane containing the current version of the terrain 'paint map'.  I then splat some quads on the plane as I draw, and then the final camera image is sent to the terrain system as the terrain texture. I then combine the quad blobs into the main terrain texture source image by creating a bitmap and transferring the resulting camera image to a texture which in turn textures the original large textured plane. In effect, this cyclic process allows me to draw quickly to the terrain using texture splatters, then combine in real-time the results of those drawings to the original terrain texture image.

This technique also allows me to float a highlighter over the terrain for more accurate terrain editing, and I can save out the final terrain texture at any time (ideally when the level is saved).  Here is the current terrain map after all my experiments up to this point:


The downside is that the step which combines the texture splats to the new final terrain texture image takes about 1 second, so the editing sequence will need to account for this, perhaps as a 'commit' button. The advantage of a commit button is that any editing during that sequence can be reversed or entirely discarded without penalty which might prove a good feature.

It's also apparent to me that I need shadows here. Raising terrain (currently combined with the painter) offers little clue as height until you scroll across said terrain.  Alas without the ability to override the terrain renderer with a shader, I cannot add the shadow mapping extras needed to pull from a cascade shadow map source.  I am left once again to think out of the box.

6:00PM : Small Shadows

I tried a few height maps to get a better canvas to continue my painting experiments and realised (rather belatedly) that the terrain employs the use of normals in the geometry which are aligned when the height map is first created, which in plain speak means I DO have a method of creating basic shadows (of a kind) on the terrain. Enough of a kind to indicate to the level designer exactly where the lumps and bumps are located as they edit.


Alas there does not seem to be a command to generate the new normals once the height data has been changed, nor low level commands to edit the data myself. I have thus decided to 'enhance' the raise terrain command and modify the normal data as the position vertices are changed. This will add some performance hit to the overall procedure, but it will be well worth it I suspect.

8:25PM : Stubborn Normals

I have tried four ways now to update the normals associated with the edited vertices.  The terrain module is divided between two DLL blocks which means access to ALL functions and members of the feature are not readily available. It is also clear that normal generation was only meant to be done during the build step so extricating the required code from the QuadMap structure is proving to be less than straight forward. Couple this with the fact I've coded non-stop and am now very hungry makes for a frustrating time all round. 

My latest attempt involves re-using the normal calculation performed when the terrain is generated, but this brings the FPS down to 11 though 'seems' to generate correct normals of the original height data, just not my edited data. I suspect I am acting on the wrong height/vertex data here and some more investigation could see correct normals from height edits a reality. The extremely slow update is a concern, but once I have it running I can look at ways to localise the update to speed things up.

I think the smart move now is to eat, and return later with a fresh head on my shoulders in the hopes of cracking this before the day is done.

12:22PM : Darn It

Many hours later, I can conclude the current method in the module for generating normals is so intertwined with the origination of the terrain from a height map texture, to add the normal commands would equate to writing substantial new chunks of code. Such work requires a very good understanding of the entire system, not just a small window into it.

The bitter conclusion for this evening is that I cannot affect the normals based on height changes. The height modification is only being made at the very end, the vertex data stage, and does not carry back in any way to the origination data.  Therefore using the existing normal generation system is out of the question unless I can affect the core height data, which of course leads me deeper into the rabbit hole!

Signing Off

And there you go, sometimes you get good days and others, bad days. Some days are both, and at least I managed to add texture painting and highlighting the terrain cursor on this day. I only hope Tuesday brings good fortune and some new ideas. I am now going to take me and my massive headache to bed in the hopes of slumber born inspiration!

Perceptual Computing Gets An Extra Perspective

Just a small note to say that an interview I gave for Intel has transformed into an in-depth case study on the trials and triumphs of Perceptual Computing development, and for those with more reading time available, you can discover this freshly released article here:

http://software.intel.com/en-us/articles/perceptucam-case-study

Thứ Sáu, 19 tháng 7, 2013

Friday Early Knock

Painting and Textures

I got up early today to get back into the terrain stuff, which today was experiments into terrain painting.  Here is a quick and dirty video of where we are right now:


Be aware this video is scratch graphics only and does not contain any final artwork or editing controls. It is a technology demo to quickly test the editing capabilities of the terrain system and gain a performance metric.

I added a new parameter to Blitzwerks Terrain to cap the height of newly created land mass based on the layer/zoom height of the camera. This allows floors and outcrops to be created easily.

As an experiment I also added some basic grass colouring to the terrain affected to see what I might be needing when it comes to applying real textures. It turns out that even a basic colour can look good when multiplied by a detail map. That said, one of my objectives is to produce a high quality up close texture result on the terrain and I don't think blob colours are going to cut it for Reloaded. The good news is that both height and texture can be edited in real-time and it's a great starting point for the shader I will need to write for the next phase of this component.

Signing Off

As you might guess from my early rise and my early blog, it's an early knock for me today as jump in the car for a nice long drive. Join me again on Monday's blog when we test out the terrains ability to accept a shader and some real textures for up-close editing.

Thứ Năm, 18 tháng 7, 2013

Thursday Terrain Video Day

After The Rain, Sunshine

Another good day of development and a decision of sorts.  My day started by reading a recent paper on a technique called CDLOD terrain (Continuous Distance Level Of Detail Terrain) which basically uses the GPU with Shader Model 3.0 to blend the vertex geometry so that successively lower polygon meshes can be substituted seamlessly in the scene. As this technique uses texture lookups in the vertex shader, it is quite hungry on cards prior to SM3.0 and perfect for the newer generation of cards which is why I liked it so much.

The technique produces almost perfect and undetectable LOD transitions, is very fast with almost no CPU hit and quite memory efficient with the possibility of streaming the terrain data in and upgrading it to DX11 tessellation in the future.  All sounds good don't it?

The downside is that to learn the technique, modify the same code to fit in as a DBP module, work out the kinks to make it stable and usable for the Reloaded project then run it through a battery of usage scenarios would take much more than the time I have left for terrain work.

Step Forward Our Hero

Once I had accepted the fact that my plan A was too ambitious and risky, I once again looked at the solution that was sitting right in front of me screaming to be heard.  After only a few minutes of tinkering, I started to realise just how powerful and complete the Blitzwerks Terrain module for Dark Basic Pro actually was.


Not only can you create extremely large terrain in memory, the automated LOD system works seamlessly, the whole system runs very fast and as a massive bonus I discovered half way through the day that it also contains a huge array of real-time terrain modifier commands. The same commands I was going to write myself until I found them in the documentation, which again was top draw and a hidden gem of this module.

The author very kindly loaned me the entire source code to the entire project, and with it I was able to quickly step through and get comfortable with the various components. This now gives me confidence that should I need to add or fix anything, it's there waiting for me. It all compiled first time and turned out to be a very well written set of projects despite a warning that it was a bit 'bloated'.

If this code is bloated, I dare not imagine what it would look like streamlined! My universe was back on solid ground and the power of terrain was bristling off my trembling fingers!

And Then There Was A Big Hole

With no time to lose I started re-shaping one of the BT2 examples along the lines Reloaded would require. A terrain that stretches 50,000 units north and east. A top down camera perspective and of course, a set of basic terrain editing features such as adding and subtracting terrain heights using a brush size based on zoom distance from the terrain to the camera viewer.  I also added a cheap and quick water table plane so I could define the land masses from that part of the terrain underwater.


At the moment all the editing controls are super crude but the objective at this stage is to get all my ducks in a row, which means get each functionality in place. We have height modification, but we also need tighter terrain height controls so I can create flat (yet blended) areas, specific shape stamps, layer level control and who knows what else. I also need to make massive strides into the texture side of things. I want a highlighter actually part of the terrain texture, texture splatting, some sort of dynamic texture renderer based on the player position so I can do LOD for the texture to compliment the geometry LOD system.

Things like the water shader and other such eye candy might also be worth doing just to please those certain mentioning no names people who get giddy at the sight of gorgeous pixels.  I have some terrain textures being brewed up a week from now so hopefully the whole thing should jump in quality as we move forwards. There is also things like geometry vegetation, terrain shadows, maybe some depth normal editing and more ideas to try out.


I also added a first person perspective to the terrain prototype so I could run around my finished creation and see what it looks like from the players point of view. It's here you realise that I will need some sophisticated terrain height editing brushes to get the kind of results most users would expect from their landscapes. Huge smooth spherical gouges ain't one of them :)

Signing Off

The next step will be to create some kind of dynamic texture system so that I can paint multiple levels of detail onto the terrain for things like grass, rock and underwater surfaces, but also normal/depth painting so I can slice very subtle details into the very texture (rather than trying to use the geometry). I can then use this functionality to automatically texture the terrain based on height so flattish areas get some grass and steep slopes get some rock. Hopefully the effect will be that painting a high grass layer above a lower grass layer will look like a raised escarpment.  See the above video of ice and rock to see the effect of a series of escarpment layers.  I am sure users will be taking control of this painting eventually, but for the user who just wants to paint the terrain quickly and start playing their game, an automated terrain painting system is vital.


For those Dark Basic Pro users following my blog, you can check out the most excellent Blitzwerks Terrain plug-in from the TGC site:

http://www.thegamecreators.com/?m=view_product&id=2286


AGK V2 Kickstarter

Rather than feed you another incorrect AGK V2 pledge total, I will simply leave you the link so you can check it out yourself. Maybe Rick will step in and provide the 'real' pledge level:

http://www.kickstarter.com/projects/tgc/app-game-kit-v2

Thứ Tư, 17 tháng 7, 2013

Wednesday Performance

And Then Came The Rain

As much as Tuesday was fun and productive, Wednesday was muddy and slow in the world of terrain coding.  I had a few missions today, mainly to improve the shape of the lower LODs so they don't change shape too much on the horizon line, add multi texture support and improve the distant LOD level as it was too low polygon.

I started the day well and completed the first task, which increased my polygon count from 8800 to 13500 for the terrain geometry and dropped my frame rate from 850 to more like 450 fps.

At this point I decided to apply the brakes as there is no point continuing with texturing if I'm already loosing a significant amount of performance at the first hurdle. The third task was entirely academic as the solution 'was' to add more polygons but this clearly was not the direction I needed to go in.

Calling In The Blitz

As a point of comparison, I decided to bring in one of the newer DBP modules from the massive library of extra-features of the Dark Basic language has at it's disposal. This one was called Blitzwerks Terrain and with it, I created a terrain 500x500 with two levels of LOD.  When run, the geometry shapes where very well retained across all LOD levels, it already has basic texturing support and the best news of all, it was weighing in at over 3500 fps.

Clearly, my own initial effort was not even holding a torch to the terrain system already available via Blitzwerks Terrain. Perhaps this is not surprising given my one day effort was being compared to a highly optimised module that took months to create.

I have thus fired off an email to the author of Blitzwerks Terrain in the hope that the source code survived. If possible, I would like to add some extra features to it including a more sophisticated texturing system which will allow me to shade grasses, apply shader effects and other nice touches.

Character Meets Code

Another task I added to my daily list was the creation of a quick character prototype for Reloaded. The final character model and animation came through last night and I was itching to get it in code to see what it could do.


As I expected, the character performed really great in code and each time I wanted an animation it was documented and ready for to call up. I added some nice touches to the prototype while I was in there such as automatic smoothing from different animation loops, two modes so I could switch seamlessly between patrol and combat stance, eight directional walking in both modes and a few other subtle tricks to make it all feel natural.

I also had a quick play with transitioning the background music sound based on the character mode, so when patrolling the sound is calm and when the character is in combat mode, the sound gets more racy.  Proper sounds will be sourced and used for the final product, but the video should give you an idea what it might feel like.  I especially like now the combat sound fades out slowly as the heart rate falls after the high octane adrenaline rush.

Signing Off

It's about half eleven now which gives me a few more hours before I have to turn in. Even though my terrain geometry stuff is a little 'off' there is no reason why I cannot code up the real-time texture transition stuff for the terrain as this is quite separate from the polygons that shape the ground.  I can also experiment with some other ideas I had too once my terrain texture prototype is up and running.

AGK V2 Kickstarter

Taking a look at the latest score, we have pushed past £21K, hurray! It's great to see people pledging on this project, and my new goal is to see the 570 climb up to 600 pledger's :)  If you have any coder friends who don't know about the AGK kickstarter, send them this link if you think they might be interested: http://www.kickstarter.com/projects/tgc/app-game-kit-v2

570
backers
£21,205
pledged of £5,000 goal

22
days to go

Campus for Moms: Helping women entrepreneurs in Israel

Since opening our Campus Tel Aviv last December, we’ve hosted thousands of promising entrepreneurs and developers at events, workshops, lectures and hackathons. Many of these entrepreneurs refer to their start-ups as their “baby,” and it’s easy to understand why. Like having a newborn, a start-up is super-exciting, yet the days are hectic and the nights are... sleepless.

What’s really inspiring (and just a little bit crazy) is that some people do both at the same time. Take, for example, Israeli entrepreneur Hilla Brenner, who raised $5 million for her first start-up when she was nine months pregnant. Earlier this year, I had the chance to meet Hilla and we began talking about how juggling work and kids doesn’t leave much time to invest in learning and developing new skills. We also discussed how maternity leave can be one of the few times when women can stop and think about their career. We asked ourselves: what could we do to help women with young children get access to self-development and career support and, in doing so, to help more women become tech entrepreneurs?

Campus for Moms is a baby-friendly start-up school for new moms, run by Google in partnership with Yazamiyot, a networking group for Israeli women entrepreneurs. The first course, which ended this week, included nine sessions led by successful entrepreneurs, investors, technology experts and others. The sessions covered personal success stories, finance, legal and presentation skills, and tech knowledge, like cloud computing. We arranged mattresses, bean bags and diaper-changing facilities so that the moms could take care of their young ones during the sessions. Four babies were born during the course and one new mum returned to the program less than a week after giving birth!

At the end of the course, participants presented their initiatives to venture capital funds and the course speakers. Their ideas are exciting—including a platform for teachers to create apps for their students, a fashion-tech meet up to encourage cooperation between local fashion-related start-ups, a 2G mobile ecommerce gateway for emerging markets and a bunch of other great initiatives.

The participants are continuing to develop their skills: two of the start-ups have joined the Campus Tel Aviv “Launch Pad” program, an intensive week-long bootcamp for entrepreneurs, and another will be visiting Campus London to meet with U.K.-based entrepreneurs.
The first course of “Campus for Moms” is over, but we’re gearing up for another course in October. We're also looking forward to sharing the tools and best practices we've developed at Campus for Moms with others, so they can help entrepreneurial moms in their communities. After all, whether they’re moms or not, entrepreneurs can always do with a helping hand with their “baby.”