Jun 14 2011

Render SVGs to Textures!

Category: AndEngine,AndEngineSVGTextureRegionExtensionNicolas Gramlich @ 17:39

Hello Community,

having visited Google I/O in May one thing I had put to my ToDo list was adding a feature to AndEngine that allows you to easily render SVGs (Scalable Vector Graphics) onto a Texture(Region). Romain Guy dropped a hint on the svg-android project on GoogleCode, which I started looking over about 2 weeks ago.

I was amazed by the simplicity of how many features of SVG can be easily mapped to the Canvas API in Android. I had started off with their original code but soon noticed that they primarily supported a kind of limited SVG format called SVG Basic 1.1 that is not supported as an export format of Inkscape, while it could not parse InkScapes SVG output :( .

Besides that limitation, a couple of bugs, some missing object orientation and literally hundreds of SVG special cases, I basically came up with a complete recode, that supports the following features: (fixes and feature-wise differences from the original are colored red)

Features

  • Groups
    • Inheritance of group-transformations and attributes/properties
  • Colors
    • Opacity
    • Formats:
      • rgb(rrr,ggg,bbb)
      • #RRGGBB
      • #RGB
  • Gradients
    • Inheritance (lazy initialization, including transform/stop-inheritance)
    • Types:
      • LinearGradients
      • RadialGradients
  • Rectangles
    • RoundedRectangles
  • Circles
  • Ellipses
  • Polygons
  • Polylines
  • Paths
    • SubPaths
    • Fillrule
      • even-odd
    • Commands:
      • M/m – Move to
      • Z/z – Close path
      • L/l – Line to
      • H/h – Horizontal ine to
      • V/v – Vertical line to
      • C/c – Cubic bezier to
      • S/s – Smooth cubic bezier to
      • Q/q – Quadratic bezier to
      • T/t – Smooth quadratic bezier to
      • A/a – Arc to

Supported formats

  • Optimized Inkscape-SVG (Recommended Format)
  • Inkscape SVG
  • Adobe Illustrator SVG

And this is what you can do with it:

Quite nice, hm? :)

The code to make use of this is (as always) absolutely trivial:


final int size = (isHighResDevice()) ? 128 : 64;
ITextureRegion textureRegion = SVGTextureRegionFactory.createFromAsset(this.mBuildableTexture, this, “gfx/vector.svg”, size, size);


A full example is available here: http://code.google.com/p/andengineexamples/source/browse/src/org/anddev/andengine/examples/SVGTextureRegionExample.java

The SourceCode of the project is available here: http://code.google.com/p/andenginesvgtextureregionextension/

A precompiled, ready-to-use jar is available here: http://andengineexamples.googlecode.com/hg/lib/andenginesvgtextureregionextension.jar

 

Best Regards,
Nicolas


Jun 13 2011

AndEngine Games Weekly Roundup #1

Category: AndEngine,AndEngine Games Weekly RoundupNicolas Gramlich @ 13:50

Hello Community,

I’ve been super lazy writing new blog posts on here for quite some time now, but today I’ll start to give you a weekly list of some awesome and successful games that were made with AndEngine.

Chalk Ball

Available in the Android Market Chalk Ball is a quite unique physics game, where you have to draw lines of chalk onto a board to prevent a ball from falling down to the bottom of the screen. It has been featured on the Android Market and on the Amazon Appstore and sports about 150.000 downloads.

Farm Tower

Available in the Android Market Farm Tower is a cute and fun physics game for everybody from young to old. The mission is to remove all the blocks on screen, without letting the animals fall to the ground. It has been downloaded over 1.200.000 times and had nested in the Top #50 of all free Android games for quite a while.

Wheelz

Available in the Android Market Wheelz is a very successful side-scrolling monster-truck physics game, that has been downloaded far over 1.000.000 times up to date. Wheelz was featured several times in the Android Market.

So with the right idea, the right skill and enough time you can create very(!) successful games with AndEngine.

Best Regards,
Nicolas


Nov 22 2010

Farm Tower – a cute and fun physics game!

Category: AndEngineNicolas Gramlich @ 16:22

Hello Community,

some days ago I started this mysterious thread in the forums that was like “New physics game – looking for testers”. Given the awesome feedback provided by about 20 members of the community, I could smooth some rough edges in my new game “Farm Tower” and also add new functionality. I have to say, thanks a lot guys, you are awesome :)

So 4 days ago I released Farm Tower version in the Android Market which has about 2000 downloads/day and is being rated over 4.3 in average.

Today I am releasing the “Pro Version” to the Android Market.

Following is a Gameplay-Video of Farm Tower:

And here you can find the Ecoand Full version in the market:

I also put up a website:

http://farmtower.andengine.org/

where screenshots etc can be downloaded – just in case you want to write a review or so ;) .

Best Regards,
Nicolas


Nov 07 2010

AndEngine and the LGPL – clarification!

Category: AndEngineNicolas Gramlich @ 23:53

Hello Community,

as the license-questions keeps popping up again and again let me clarify about AndEngine and the LGPL:

While AndEngine itself is licensed under the LGPL, you do NOT have to make your actual game-code available under the LGPL! The only thing you have to make available upon request are the changes you made to the Engine itself (which usually are none to very few!).

So I repeat here:
You do NOT have to make your actual game-code available under the LGPL!

This statement is official!

Best Regards,
Nicolas


Nov 01 2010

DroidCon London 2010 – Review

Category: AndEngineNicolas Gramlich @ 02:01

Hello Community,

the last days I had been in London enjoying the DroidCon 2010 (http://www.droidcon.co.uk/). I’m not asking why you all weren’t there :| … your fault :P

I probably don’t have to tell you that there were some great talks by fellow Androids but there also was a hackathon-app-contest ( http://openapiservice.com/droidcon-hackathon ) powered by Alcatel-Lucent. So the participating teams had to build an app around one or more of the OpenAPIServices and could submit their apps within (less than) 24 hours.

Guess which game engine was used by the winner …? :)

We had made a Live-Wallpaper called “BuddyRadar” in like 6-7 hours (also during some talks) that showed the position of your friends in a ‘submarine-style‘ radar. This is what it looked like. (Note the sandbox environment provides a couple of test-users and the locations of the test-users form some funny patterns ^^) (I uploaded a similar app that shows some of the world’s biggest citities in the same radar style here.)

BuddyRadar

BuddyRadar

So while I’m not sure (due to only having access to the Sandbox environment) if the OpenAPIServices are 100% ready for primetime, they are definitely worth a look!

Oh and additionally to the prize-money we won this amazing BladeRunner-style umbrella:

BaldeRunner-style Umbrella

BaldeRunner-style Umbrella

All in all this were amazing days in London and you guys should consider coming to the next DroidCon too! :)

Best Regards,
Nicolas


Oct 31 2010

Announcing: AndEngine LevelStatsDB

Category: AndEngineNicolas Gramlich @ 17:25

Hello Community,

while making a new game that consists of a series of levels, you always have to think about the difficulty. You’d probably try to make the difficulty rise a bit each level, so there will be as little frustration as possible, while the levels don’t get to easy over time.

This question made me implement a new feature of AndEngine, the so called LevelStatsDB. The LevelStatsDB is a tool that consists of a single class in AndEngine, a few PHP-files, a couple of MySQL-tables and finally an Excel-2007 file (I chose Excel 2007 because of all it’s cool features, but you can get the data from the database through any other way!). So it’s really simple to setup on any webserver!

So from your code you call a single line of code, whenever your game-logic determines a level was solved or failed. And on the other end you get this neat table that shows quite some interesting data, like:

  • How long was level X played
  • How often was level X played
  • How often was level X solved
  • What is the chance a player solves a level vs. failing it
  • What was the fastest/average/slowest time level X was solved

AndEngine LevelStatsDB

AndEngine LevelStatsDB

So if you think this is cool or not, let me know so I’ll release this even sooner than planned :)

Best Regards,
Nicolas


Aug 13 2010

New Game: Gravity Collector

Category: AndEngineNicolas Gramlich @ 16:14

Hello Community,

while the development of AndEngine obviously didn’t stand still the last weeks and the List of AndEngine Apps and Games is getting longer every day, I took the time to make a game on my own.

Gravity Collector

“Simple yet addictive” – Collect the glowing spheres by changing the gravity and using the anti-gravity-boost. 50 Levels, more added weekly and you can even build your own!

Gravity Collector QR-Code

Price: 0,99€ ~ £0.81 ~ $1.26

The game uses the a lot of the features AndEngine provides, like:

So this game gives you an idea of what can easily be done with the Engine, while it performs very well even on low end devices. :)

And now… go and buy it !!! :D

Best Regards,
Nicolas


    Jul 28 2010

    AndEngine – Fully Featured Box2D Physics Wrapper

    Category: AndEngine,AndEngineExamples,AndEnginePhysicsBox2DExtensionNicolas Gramlich @ 22:19

    Hello Community,

    recently I sent the old Box2D-Wrapper to trash and replaced it with the fully featured Box2D-Wrapper from the libGDX-project created by Mario Zechner. The great thing about this is that now also Joints are supported. See the following video of some strong revolute joints kicking some objects around :)

    Best Regards,
    Nicolas


    Jul 27 2010

    AndEngine – Tiny Racing Game Example

    Category: AndEngine,AndEngineExamples,AndEnginePhysicsBox2DExtensionNicolas Gramlich @ 21:19

    Hello Community,

    following is a tiny racing game implemented with AndEngine. Its about 250 lines of code long and took approximately 2 hours to implement (including graphics).

    The code can be found here:

    RacerGameActivity

    Best Regards,
    Nicolas


    Jul 27 2010

    AndEngine – TiledMaps in the TMX format

    Category: AndEngine,AndEngineExamplesNicolas Gramlich @ 12:16

    Hello Community,

    I finally found the time to upload the following video, that is showing the support for TiledMaps, a grid of small tiles making something bigger than the sum of its parts. ;)

    The format I chose (better to say ‘I was made aware of’ :P ) is the TMX format. TMX is a XML based format, that is mainly human readable but still has very small file-sizes. The biggest plus of the TMX format is that it has a fully featured and easy to use cross-platform Map-Editor called “Tiled”, which can be obtained for free here: http://www.mapeditor.org/.

    Example-Code:

    TMXTiledMapExample

    So now go and make some amazing RPGs !!! :P

    Best Regards,
    Nicolas


    « Previous PageNext Page »