Articles tagged 'unity'
Unity Render Texture Sep 13 2013
UPDATE: All engine features are now available in both Personal and Pro editions of Unity, so you no longer need a paid Unity license to use this feature!
This is a fairly brief tutorial on how to setup a Render Texture. This feature makes it trivial (you don't even need any code) to show the live feed from a secondary camera on a screen within your game. I used this to great effect in Velocity Ball for 7DFPS, to show goal line views above each endzone!
I've made a video which covers using this technique on a basic Render Texture - check it out now to see how easy it is to use this feature in your games!
One thing I forgot to mention at the end of the video is that the scene being rendered on the render texture can come out a little dark - you can try different shaders to find one that works for your use, specifically something like "Unlit/Texture" will end up a lot closer to the "Camera Preview" for your secondary camera, but you might find that there is a specific shader you want to use to achieve a certain effect, in the same way that you can apply different scripts and effects to your secondary camera, and they too will be shown as part of the renderered view on the texture.
Here is how I put the technique to use in my 7DFPS game, Velocity Ball:

If you have any comments, let me know on this post, on the YouTube video, or you can catch me on Twitter @ejdraper. If you have suggestions for other tutorial screencasts, let me know - I'm looking to do more, fun little 5 minute videos on various topics to give you tips, tricks and insight into different Unity features!
CommentsThe Power of Prototyping Sep 5 2013
Recently I've been spending some time prototyping different game ideas. Partly this was so that I could get to grip with a wide variety of features of Unity - different types of game prototypes have lent themselves to me learning and polishing my knowledge on different areas of the engine. But also, it's a great way to quickly identify the ideas that work, and the ideas that don't.
Prototyping power
What's so great about prototyping then? You're still building games, perhaps smaller versions to test out, but it takes time, and you still need to decide which idea to work on first. That means working out which one you think might be most enjoyable to play. The difference is though that when you're prototyping you are quite often using temporary or transient placeholders for the majority of the structure of the game. The aim is to do the minimum amount possible in order to be able to play your idea, to test to see if it works, and to see if it is fun. That means that in terms of art and design assets, you can look to use stock assets, or temporary art. In terms of code, you can treat it very much as a hackday - use a game jam mentality, where you want to get the mechanics for the game up and running as quickly as possible, and you can look to extract the logic and tidy things up later if you pursue the idea.
Constraints are good
Speaking of game jams and hackdays, quite often constraints like that fuel creativity. Ordinarily, most of us are probably used to writing code in the nicest, cleanest way possible, and building assets in a way that makes them easy-to-use, re-usable, and flexible. But the constraints of a time limited game jam or hackday means that we're free to forget some of those things, and instead just let our creativity flow. We know that the end result is simply a playable validation (hopefully!) of our idea, rather than a shippable product (even if you do actually put it online so people can play it), so we can cut a few corners to test our theories, and then simply revisit and improve those things if we decide to pursue it.
From prototype to finished product
In fact, if we do decide to turn a prototype in to a real game we want to ship, we might well end up rewriting or rebuilding most of it. A prototype by definition is an experimental, primitive model on which something else is based, most often made out of placeholder parts. It is designed to test the theory behind a product in practice, and to help build specifications for then making the real product. Our prototype therefore serves a purpose not just in establishing if our idea is any good, but also, if it is, in setting out how we want to build the real deal - but this doesn't mean getting things right on the first go. It might be that during the prototype construction, we stumbled upon some pretty neat solutions that we'll want to keep - or it might be that we know we have the right idea, but it can be built better, and the prototype shows us the things we should be doing differently and improving. In terms of code, that might equate to making it more performant and smarter, and in terms of art that might be making something more detailed and more intricate, or even throwing it out entirely and changing the style while keeping the mechanics. Either way, a prototype paves the way for success - and the ones that don't make it, we can be safe in the knowledge that we didn't spend ages figuring out that they won't work!
Reflection
One other thing about prototypes is that you can get the idea that's in your head out there and into a playable form much quicker, as we're all probably guilty of thinking up ideas but then not implementing them in any form to test them out. After the prototype is finished, then you can even forget about it for a bit - you could work on another project, and just let the ideas that you've put into practice stew for a while, to see if time makes it better or worse. It's fairly natural for us to think that something new is better, because it's fresh, and it's our most recent work. Time helps to level that playing field, and then you can revisit your prototype with a more even handed and impartial view on things, determined to root out what works, and replace what doesn't. It might even be that you decide not to pursue it - but perhaps there is something in the prototype that you can keep and carry over to another project. If not, then you've almost certainly grown and taught yourself something in the process at least, so usually there is always something to be gained from knocking together a prototype!
Coming soon
We have another couple of prototypes I've worked on recently that I'll put up for playtesting soon! Follow me on Twitter so you don't miss out!
CommentsThrowing Shapes Aug 23 2013
I wanted an excuse to play around with Futile, the 2D framework for Unity by Matt Rix, especially since I read that it's quite easy to pick up if you're familiar with Cocos2d, which I am. I figured a simple puzzle or shape game would be best, so I didn't have to spend too long messing around with assets, so I came up with the idea for Throwing Shapes.
It's designed for touch screen devices (although right now you can just play the prototype in your browser) and specifically asks you to throw shapes, either to the left of the screen, or to the right of the screen. Throwing them to the left "scores" them, removing them from play, and incrementing your score. Throwing them to the right makes them split into three new shapes from the left. You start with a single shape, and a 30 second countdown, and the idea is to score as many shapes as you can in the timeframe. It's a fairly straightforward risk/reward dynamic, with you spending time splitting the shapes into more, and having to figure out when you bank the shapes you have to boost your score.
I have a fair few other ideas to extend it, as it isn't particularly challenging or providing of much entertainment more than a couple of plays right now. It'd be nice to introduce levels and increasing difficulty - starting with what the prototype has now, building up to only scoring shapes when thrown through a smaller and smaller gap on the left hand side, maybe even leading to sorting shapes by type or colour when scoring, making it a bit more than a frantic mashing of dragging fingers. It also lends itself to GameCenter leaderboards to compete with friends, given the score based nature.
The music as well is just a placeholder at the minute, me messing around with Garageband and the excellent 8-bit plugin, as well as just having the music shift to suit the context (more frantic in the last eight seconds to represent the final countdown).
Working with Futile was awesome, especially as Owen Goss released a starter script to help you get a blank Unity 4.2 project up and running with Futile incredibly easily. It certainly takes the focus out of the Unity editor and lets you concentrate on the code - whether that is a good thing or not is probably based on how much you like the Unity editor. I find it very useful for 3D games, but for 2D I prefer the structure of setting out my sprites and layers in code, and again this comes from working with Cocos2d a lot. Futile is very similar, and overall it doesn't take a lot of code to do some cool stuff. I'd recommend playing with it if you have an interest in cross-platform 2D games for sure.
So check out the video above, and then play the game for yourself - I'm thinking I might add a few more challenges and levels to Throwing Shapes, add GameCenter support, and then tidy it up a bit to get it on the App Store for iOS soon - what do you all think?
Comments7DFPS: after the dust has settled Aug 21 2013
I thought it might be fun to look back at 7DFPS, now the dust has settled, to look at what went right and what went wrong with the development of Velocity Ball. The observations here might be useful to other people doing a time limited game jam in future, and certainly will help me to solidify my experiences to make next time around even better.
Positives
- I learned a lot about Unity, in a very short space of time
- I shipped a pretty much complete (if a bit buggy, and short on content) game concept in 7 days
- 7DFPS gives you a spotlight, so a bunch of people have played the web and Mac versions!
- I think the game idea has a lot of potential, and I'm left with a lot of ideas on how to improve it and extend it
Improvements
- I probably spent too long on a few bells and whistles, then had a few late breaking physics related bugs that were tough to fully nail down and fix before the end - specifically I was messing around with the image effects to create the splash screen loading into the main game, as well as alternate camera angles for the main menu, and the goal line cams that show on big screens above each endzone
- The game doesn't have much longevity, and isn't particularly taxing as the AI is fairly one directional at the minute
On the whole though, it was an enjoyable exercise, and Velocity Ball is definitely something I'd like to continue working on and building out from the prototype it is now, into something bigger and better.
Other entries
Another bonus of course was being able to take a look at what other people can get done in a week - and it's pretty humbling and awesome to see some of the amazing things people did. Some clearly focused on short, polished experiences, while others worked on a broader, more ambitious vision that had a little less polish, but there were some gems in there. Here are a few of my favourites, after having gone through just a small percentage of the 167 games that were finished.
Really polished, with the design fitting the concept perfectly - the idea is to escape each maze, with them seemingly getting tougher and tougher, on your way to the escape pods
Old school style fragfest, frenetic multiplayer action - a great variety of weaponry, and it even has it's own stats server and leaderboards, great for bragging rights!
Nice change of pace, aerial combat - good style, was hard to test the actual combat as no one else was on when I tested it, but I can imagine it'd be quite tense!
Another innovative idea, this time a puzzle game set inside museum paintings, 2D puzzles in 3D - nice to see such an abstract, fresh concept squeezed into a game produced in such a short space of time
Incredibly stylish aesthetic, with a great unique selling point in that time only moves forward in the game when you're moving - would make a fantastic full game
Unity
Worth noting that all of the above games were built using Unity, just like Velocity Ball - I'm not sure exactly, but it seems like a good majority of the games were built with Unity, quite possibly as it lends itself so well to being able to get something up and running in a very short space of time, without really having to sacrifice the quality in visuals or fidelity that you might have expected from such a rapid tool in the past.
Over to you
How about your 7DFPS? What was good, what was bad, and what would you do differently next time? And what are your favourite games from the jam? Sound off in the comments, or hit me up on Twitter.
CommentsVelocity Ball (#7DFPS): Dev Blog #3 Aug 19 2013
7DFPS finished a couple of days ago, and I just about wrapped up a version of Velocity Ball I was happy with. It then took me a few days to sort out a video demoing the game, and also a downloadable build.
You can check out more about the game, including the Mac download and controls (keyboard/mouse or PS3 controller) for the game here - Windows build hopefully coming soon, and I might well get a build running on the OUYA too.
I'm pretty pleased that in a week I was able to get 2v2 gameplay with (fairly limited) AI in, working arena, some nice special effects, and proper game timers, scoring and restarting. I had a fair few other ideas beyond that, but 7 days isn't quite as long as it seems! Below is the video run through of what the build looks like right now:
Check out the video - and if you're on Mac, download it and give it a go yourself! You can let me know what you think in the comments on this post, on Twitter, or via the contact form. I'm going to pause and take stock of the project a little bit now (and work on some other prototype ideas), but then will return to it and do another iteration on the idea with feedback and refinements as I think it could be a lot of fun with a bit more time and attention!
If you've worked on a 7DFPS game too then please let me know - I'm checking out lots on the 7DFPS site, but don't hesitate to shout about your game so I know to take a look!
UPDATE: After a few requests, I've added the ability to play the game in browser using the Unity web player. Click here to check it out!
CommentsVelocity Ball (#7DFPS): Dev Blog #2 Aug 14 2013
Just a couple of days to go now for 7DFPS, and since the last dev blog I've only really had time to improve the arena and presentation a bit, and add a menu.
Here are a few screenshots of those features:
So I'm refining the list of what is possible in the remaining couple of days (multiplayer is definitely a post-7DFPS task now), and I'm hoping to get the following done:
- Sound effects (the game is entirely silent right now!)
- Countdown restart and position reset after each goal to make it more tactical and less hectic
- Improved AI and ball physics
- Getting games going solely with AI, for a spectator mode, and/or to make the main menu more interesting
- Improving the UI and presentation a bit further
- Dual stick controller support
The next dev blog will definitely be a video run through, most likely fairly close to the end of 7DFPS in the hope that I can show off as many of the above features in there as possible! I'll then probably package the game up for download on Mac (Windows too if I get time to test it).
A few more resources that have been useful in the last couple of days:
- NGUI: Next-Gen UI, great asset for building user interfaces on top of and around your games
- NGUI Basic Menu, a cracking little tutorial video on putting together a basic menu using NGUI
Hope everyone else is making good progress, looking forward to spending some time looking at other entries over the weekend!
CommentsVelocity Ball (#7DFPS): Dev Blog #1 Aug 12 2013
3 days into my 7DFPS game, and things are progressing quite well. I've learned the basics of blocking out arenas in Blender, and setting them up properly with UV unwrapping for texturing them in Unity.
I've got working ball physics (with a few quirks to be ironed out), and possession/throwing of the ball working. I've also implemented the two endzones, and got some basic AI working with teammates and opposition players in a 2v2, as well as scoring (red vs blue teams, naturally). The bot characters even have swish idle to run animation transitions after messing around with Mecanim.
I'm planning on doing a proper run through video once I add a few more bits in, namely I need to add a time limit to games, and also fine tune some of the mechanics for scoring, resetting after a score, and some of the ball physics and AI edge cases. At the minute it's only working on keyboard/mouse too, so I'd like to really getting it working on a controller (either OUYA or PS3 I think). After that, I can start to flesh out the content a bit more, sound effects, special effects, different arenas and team selection, and if I can improve the AI, it might be playable with more than just 2v2 as well (right now the bots go a little loopy if there are too many!). And who knows, maybe I'll get on to some multiplayer even which would be really great!
Some of the great tutorials and resources I've used so far:
- Simple FPS Tutorial Part 1
- Introduction to UV unwrapping
- Unity 4.0 - Mecanim Animation Tutorial
- Unity Documentation
- Free robot asset from Unity, along with re-targeted animations for idling and running from the Mecanim tutorial
- Stunning sci-fi prefab and texture pack, only using a couple of textures so far for a basic arena, but going to be making a lot more use of the rest of the content when I build out the proper arenas
Hoping to make enough progress now for a post like this each day until 7DFPS is up, but we'll see - how is everyone else getting on?
CommentsUpcoming Jam: #7DFPS Aug 8 2013
On Saturday, this years 7DFPS game jam begins!
It's a fairly straightforward jam - the only rules seem to be that you have 7 days to make a first person game. It's a great idea, as the first person genre is perhaps the most stale, certainly at AAA title level, so having hundreds, maybe even thousands of people getting together to work on crazy and fresh ideas for the genre sounds like fun.
I'll be taking part, and while not buttoned down 100% yet, I think I'm going to try to switch the S in FPS from "shooter" to "sports" - think something like the futuristic football and zero-G ball games you see in sci-fi movies, or Grifball from Halo but without any weapons. Perhaps even like a first person Speedball, for those that remember that far back.
Of course, how much I'm able to get done in seven days remains to be seen, but trying it and seeing is a part of the fun, and knowing that lots of like minded individuals are all trying to do something that isn't a Michael Bay-esque set piece driven FPS set in a modern theatre of war is going to be very refreshing.
Who else is joining in the fun? What ideas do y'all have? Get in touch and let me know on Twitter! I'll be posting up some regular progress updates throughout the week, and I look forward to playing some of the games you are going to be creating!
CommentsPage 1 of 1 |