Techniques for Fancy and Lightweight 2D Graphics

So you are going to use lots of 2D graphics on your next game project, targeting lower-end machines. It’s a casual-oriented game project, or maybe just a 2D indie game that should run on the most number of PCs possible (which is a smart move). You need:

  • Beauty
  • Performance
  • Fast download

Hardware-accelerated and software-rendered 2D graphics can be both fancy and lightweight. Even if your hardware-acceleration is an old one, like DirectX 7 or 8. You can make lots of effects (“Beauty”), use few video memory (“Performance”) and consume less disk space on the game final size (“Fast download”).

The three main techniques you use to accomplish that are:

  1. Tilemaps;
  2. Real-time draw deformations;
  3. Particles.

Tilemaps

Tilemaps will allow you to have a large amount of 2D sprites on a single 512×512 or 1024×1024 texture. Perhaps even all the graphics you need for the game! :). You load a small amount of tilemapped textures on your video memory and “mount” game graphics drawing pieces of it in the screen. Check this basic tutorial.

Some tools, like Torque Game Builder, generate tilemaps by slicing a texture on a matrix of equally squared tiles, mainly for frame-by-frame animations. But tilemaps can be more powerful. With a custom tool, you can optimize every single pixel of a texture for a different game assets, not space-wasters equally-sized squares! Consider, for example, what Bookworm Adventures did:

http://www.igda.org/casual/quarterly/2_2/index.php?id=2

With a very small set of textures, hundreds of different monsters could be generated with “pieces” of those textures! The outcome was a very small-sized game download (20 MB), but with lots of aggregated values and a tag price of 29 bucks at the time of its launch.

For Lex Venture, we used tilemaps for user interface and in-game sprites taking advantage of every possible available pixel. Loading times got faster than previous projects that used one texture file for each sprite, and disk space and memory usage got smaller.

Tilemap LexVenture

Real-time draw deformation

On hardware-accelerated 2D drawings, engines render sprites by creating a 2-triangle, 4-vertexes primitive rectangle mesh textured with the sprite image, right into the frame buffer. Think it like a 3D plane right in front of the camera (actually, thats exactly how Blitz Basic do it).

Draw deformation is the ability to modify sprite draw by manipulating this primitive mesh. With a good tool-set, you shall be able to change colors of vertexes, deform, scale and rotate the sprite.

For example: you have a white butterfly sprite. Before rendering you could modify the color of the vertexes of the primitive mesh to green, purple or anything else. You will then be able to draw the butterfly with a different color on the white tones using conventional vertex-color technique. Now draw the same sprite many times and you have lots of colorful butterflies in your game with just one single image file!

Deformations on scale, rotation and overall alpha transparency are quite good for GUI transitions. Almost all casual games today use them, and so should you. Pick tools and engines that allow you the vastest range of real-time draw deformations.

2D Draw Deformation 1Draw Deformation 2

Scale + alpha transition

For software-rendered graphics, draw deformations are more limited. For example, you can’t scale with bilinear filters without making the graphics look badly crispy. So plan ahead what the game will and will not be able to do considering the software-render technology you picked.

Dynamic applied alpha masks

Dynamic applied alpha (transparency) masks is a technique to make 2D graphics even lighter on disk space, extensively used by PopCap Framework. You use web-image formats without alpha – JPG and GIF – for your game graphics. For each image that requires alpha, there is an equivalent gray-scale image with the alpha mask needed. The engine loads the GIF or JPG image, and then modify the texture on the video memory applying an alpha channel based on the gray-scale information.

The sum of those two files is smaller and loads faster on software rendering than an image with the same content on a format with native alpha, like PNG. Works best for GIF images. (Note: you should study the differences between GIF and JPG to pick a format that fits into your game graphic style)

Particles

Particles are a important part of any game, but key ingredient to for casual / light 2D titles. You only need a handful of 16×16 textures to create amazing effects on screen! Don’t you dare not considering the particle system on your decision of the which framework to use!

You need a powerful particle system. It would be better if it could draw 2D particles, where particles will be drawn as regular sprites. Most 3D engines features however only features particles using 3D elements like PointSprite, Billboards and Meshes. They are beautiful, but they are also, well, 3D elements! They will consume more CPU with culling / render ordering calculations, and are not as precise for a 2D-based game.

For casual games, aimed on lower-end machines, I advise you to try engines that supports 2D particles. Specially if you are going to support software rendering. If they ain’t available go with PointSprite particles, which are 3D but optimized for 2D drawing at the DirectX device. Billboard and Mesh particles are heavy on rendering if the user don’t have a good video card.

If you can only choose between Billboard and Mesh, go with Billboard. But maybe you picked the wrong framework/engine!

As the last advice, don’t you get too heavy with particles! Low-end machines suffer if you push too hard. Emitters should not emit more than 20-40 particles at a time. I would say 50 on a very particular case, but try to keep the particle count under control . Remember that each particle is still something to be drawn.

DX Studio 2.3 Released With New PhysX Engine Option, Performance Boosts And User Controls

Pinewood studios based software developers Worldweaver Ltd announce the latest release of their games and simulation platform DX Studio.

Version 2.3 comes packed with new features including PhysX support, depth of field, simple user control creation, scrolling listboxes, full tweening on all object properties, DXT support and a spherical map importer. There have also been a number of performance and memory usage optimizations.

CEO and founder Chris Sterling commented:

We’ve done a lot of work embedding the PhysX engine into DX Studio but the benefits of using PhysX should really help users looking to create particular gaming environments, especially given the recent announcement of Nvidia’s acquisition of Ageia and that they will soon introduce PhysX physics processing support into all GeForce 8-series graphics cards through a simple software download. Of course we have still kept the option of using Bullet physics too as it is still proving to be more appropriate for creating certain environments ”

The latest version of DX Studio also sees the release of their own demo game, Hut of the Dead. The game is free to play and all script available to DX Studio users to help with their own projects. There is also a competition running for the best game play modification of Hut of the Dead.

DX Studio licenses are available in both freeware and commercial editions and can be downloaded from the website at www.dxstudio.com.

3 Simple Guidelines For Making Better Hardware Purchases

I got a brand new monitor yesterday. 20.1″ ViewSonic was bit more expensive than I had initially budgeted, but I’m happy with the purchase. The wide screen view is something I haven’t got used to (yet), but switching from CRT monitor to TFT one sure has improved my working conditions. My eyes like the sharp screen (at least I’m brainwashing myself to think that way – perhaps it’s true), and that’s one of the main reasons why I got the new screen.

I have some rules that I follow when I do purchases, and here’s three of them:

I consult people smarter than me
I check with some of my geek friends who know more about hardware than me, and also check out some magazine reviews before buying. I also hear the salesperson and compare his talk with what I’ve heard (it’s pretty easy to spot those who are more interested in selling rather than serving.) I also try the product at the shop if possible. By doing this I hope to get a better picture about what products are worth buying.

I don’t buy “bit more expensive version” over and over
It’s easy to spend $300 on some gadget, just to notice that with “only $50″ more I can get a bigger gadget. And with “only $1002 more a premium version of the bigger gadget. There’s no limit. That’s why I set up some budget, and try to stick with it. I simply set some limit. If I want a widget that costs $300, I don’t spend $450 because “it was such a good deal”.

I don’t buy cheap
Well, at least I try not to invest in cheap. Basically I don’t buy the most expensive gadgets, but definitely not the cheapest. While in some products it’s a matter of perceived value, it can be said that really cheap products come with less quality. Investing some extra often means better quality. In the end, cheap might end up costing more in terms of time and money. They might go broke and time is wasted with returns.

I don’t suggest that a higher price would automatically mean better quality. That’s something you can find out by asking for recommendations and learn by trying. I simply mean that getting the cheapest version isn’t necessarily a wise move. Sometimes it might be a good thing, but I tend to put some extra to ensure quality.

The new monitor costed bit more than I planned, but by simply thinking how important the quality of the monitor can be for my eyes – I have no doubt that it wasn’t a good purchase.

DX Studio v2.0 Released – 3D Applications Creation Software

DX Studio version 2.0 is released. Earlier I covered what DX studio does and now this 3D application builder software just got better. The new version 2.0 comes with a big list of features that improves the modeling tool and has several graphical additions to name but a few improvements.

DX Studio is a complete integrated development environment for creating interactive 3D graphics. The system comprises of both a real-time 3D engine and a suite of editing tools, and is the first product to offer a complete range of tools in a single IDE. A good list about features is available on their website.


Editor shot

Here’s a final list of the new improvements that version 2.0 adds:

  • New per-pixel lighting model
  • Per-pixel bump and specular map support
  • Fully integrated model editor including extrusion, lofting, UV mapping, boolean operations and much more
  • Full COLLADA support for models, materials, animations and skins
  • New material editor
  • Simplified properties panel with multi-select
  • Post-processing effects on scenes, with runtime control of properties
  • Full multitexturing
  • Unit scaling
  • Improved collaborative tools
  • New Wiki linked tutorial system
  • Quality setting in player
  • Cursor key perspective viewport navigation
  • Direct memory loading

DX studio uses Javascript, so a good JS skills are prerequisite for creating applications (at least anything other than very trivial ones). The tutorials and walk-troughs are good for getting your hands dirty – along with tool tips and other help files that will aid you.


Image of upcoming zombie game produced using DX Studio

DX studio 2 has an integrated model editor and a library of models included for free on the website. If you are into starting game development and creating 3D applications, then check out DX Studio. There’s a free evaluation version also available to give the application a test run.

How to Create Your First Game – Recommended Resources

The post about making your first game already got thousands of visitors in just couple of days (Thanks Kotaku and others). As this issue seem to be in people’s interest, I decided to give a brief list of tools that you can use to create your own game.

Resources for beginners
If you are a beginner in making games, check out the following tools. They’ll help you to get started.

  • Game Maker – Haven’t personally used this, but many people seem to be recommending it to people, so here it is.
  • Multimedia Fusion – This was actually one of the first programming kits I purchased in the past. I really recommend checking Multimedia Fusion, it has lots of good features for beginners. I liked it in the past, and it provided an easy way into making games.
  • Dark Basic – Another good, pretty simple programming tool for creating your game.
  • Blitz3D/BlitzMax – Very nice products, easy BASIC like syntax (in Blitz3D, BlitzMax has more advanced stuff). I’m using Blitz3D and created protos and games like Highpiled using it.

For more experienced developers
Bit more advanced resources, but worth checking for anyone who wants to get deeper into making games:

  • Torque Game Engine Advanced – Engine especially for multiplayer game making. Many people like and recommend it. There’s a free demo which you can use to test it.
  • Ogre3D – Open source graphics engine, with lots of modifications and additions available.
  • Java Monkey Engine – Java based graphics engine with lots of features.
  • Multiverse – Creating a MMO (like MMORPG game). Not perhaps the easiest solution for first game development, but if you are into making your massively multiplayer games – then you might want to check this out.
  • DevMaster 3D engines list – Mentioned this earlier, but since it’s such a good place to find a game engine I couldn’t leave it away from this post.

Now, just pick your tools and start making your game.

DX Studio – Build complete DirectX 3D Applications Without a Single Line of Code

DX Studio, is a tool for building interactive 3D applications for Windows. Besides a commercial version, there’s a freeware download version available which you can use to download rest of the files through the net (the final download will be between 10MB and 60MB). Version comparison and features can be found here.

I downloaded and tried the software and it looked very professional and clean to use. I tried checking out some demos and I liked especially the portfolio example that basically displayed an animated character on screen (picture below), but there were also example games and web applications available.

Overall the tool contained demos, coding examples, tutorials and other information as well, so really getting know the product would require bit more time. Anyone interested in creating 3D software (whether it’s games or houses or whatever), you might find DX studio interesting. More information on their website.

3 Practical Tips For Getting 3rd Party Tools

A few days ago I mentioned that while 3rd party tools are necessary for production, they are also likely to cause minor problems in game production. Here’s are some practicals tip for anyone considering getting libraries, game engines or other software to help your game production.

[1] Make sure the tool provides real help in your issue: Some time ago I bought 3D World Studio to help me out in making game levels. While initially the tool seemed to suit well (multitexturing support, lights etc.) to my needs there were many minor problems that caused bigger problems. While I wanted multiple textures, the tool couldn’t handle more than 2 textures (and I needed 4). The lights were not good for Blitz3D terrains and the exporter format for Blitz3D was not suitable to my case (as I wanted to use use Blitz3D terrain format rather than .B3D file format). So before purchasing, make sure the tool can really solve the problem rather than create more. I don’t blame 3D World Studio or say that it would be a bad tool, but for my specific needs it didn’t fit so well.

[2] Don’t be afraid to spend some money: I think indies generally won’t spend much money on tools when they really should. I think whenever tools can provide help, you should consider getting them. Many indie game producers have contract or part time jobs, so I think it’s good to calculate your hourly rate. If a $110 tool can save you 50 hours of work, I bet it’s a good investment. You don’t need to do everything by yourself.

[3] Tools require time for learning: While some libraries can save countless hours, you must remember that they often require training and learning. I spent many hours trying to solve problems with the world builder just to find out there didn’t seem to be a solution, only recommendations like “you shouldn’t use Blitz3D lights as they are poor” or “it works fine for me” – so be sure to count some hours for learning and solving problems.

3D World Studio by Leadwerks – World/Level Builder

This week I’ve been quite busy finding proper tools for making levels. I got recommended to get 3D World Studio by Leadwerks. In one sentence: 3D World Studio is a professional and inexpensive world and level building tool. I tried the software and skyped the Leadwerks support and got some very friendly & helpful answers. I also liked the way there’s couple video tutorials available: those were most helpful and easy to check & learn.

I’m still *learning* how to use the tools and I’m bit clumsy with how to move and scale objects. Maybe it’s that me but for some reason the user interface does not feel 100% polished. Don’t get me wrong: you can do amazing stuff with the tool like like paint textures into terrains, add noise and smooth, light them, split, export and everything, but my first impression is that the user interface is not suited for me. There is a demo version available, and I recommend checking it and try moving, creating and scaling objects to get a feeling how it suits you. I remember I had big problems with getting used to LOTR: Battle For Middle Earth’s right click when in other games left click was used. After playing the game for while right click felt natural. I suppose this can be the case with 3D World Studio as well.

That being said, I bought the $80 version (digital download) – there is also a $120 version that contains lots of textures, models and other stuff to build a level. The reason I didn’t buy the expanded version is that most of those models are Half-life/Unreal Tournament/Industry/Sci-fi stylish – which don’t fit in my games projects. Notice: “most of them”, there’s also plenty of stuff like trees and plant sprites that can be used in other type of games. Check out the screenies at their website to judge yourself.

I have used the tool only for some hours so I cannot give a rating for the tool. At the moment I think there’s need for some improvement in user interface & usability while most of the technical features are done very well. I really recommend checking the big list of features. There you can find lots of important info about whether to get the software or not.

I’ll give a final judgement in the future, but meanwhile: if you are struggling with how to do levels for your game or consider getting a world/level builder, then check out 3D World Studio.