AndEngine - Core-Terminology

  ... tutorials on how to use AndEngine.

AndEngine - Core-Terminology

Postby Nicolas Gramlich » Mon Aug 09, 2010 12:11 pm

AndEngine - Core-Terminology

BaseGameActivity:
The BaseGameActivity is the root of a game, that contains an Engine and manages to create a SurfaceView the contents of the Engine will be drawn into. There is always exactly one Engine for one BaseGameActivity. You can proceed from one BaseGameActivity to another using common Android mechanisms.

Engine:
The Engine make the game proceed in small discrete steps of time. The Engine manages to synchronize a periodic drawing and updating of the Scene, which contains all the content that your game is currently handling actively. There usually is one Scene per Engine, except for the SplitScreenEngines.

IResolutionPolicy:
An implementation of the IResolutionPolicy interface is part of the EngineOptions. It tells AndEngine how to deal with the different screen-sizes of different devices. I.e. RatioResolutionPolicy will maximize the SurfaceView to the limiting size of the screen, while keeping a specific ratio. That means objects won't be distorted while the SurfaceView has the maximum size possible.

Camera:
A Camera defines the rectangle of the scene that is drawn on the screen, as not the whole scene is visible all the time. Usually there is one Camera per Scene, except for the SplitScreenEngines. There are subclasses that allow zooming and smooth position changes of the Camera.


Scene:
The Scene class is the root container for all objects to be drawn on the screen. A Scene has a specific amount of Layers, which themselves can contain a (fixed or dynamic) amount of Entities. There are subclasses, like the CameraScene/HUD/MenuScene that are drawing themselves to the same position of the Scene no matter where the camera is positioned to.

Entity:
An Entitiy is an object that can be drawn, like Sprites, Rectangles, Text or Lines. An Entity has a position/rotation/scale/color/etc...

Texture:
A Texture is a 'image' in the memory of the graphics chip. On Android the width and height of a Texture has to be a power of 2. Therefore AndEngine assembles a Texture from a couple of ITextureSources, so the space can be used better.

ITextureSource:
An implmentation of the ITextureSource-interface like AssetTextureSource manages to load an image onto a specific position in the Texture.

TextureRegion:
A TextureRegion defines a rectangle on the Texture. A TextureRegion is used by Sprites to let the system know what part of the big Texture the Sprite is showing.

PhysicsConnector:
A PhysicsConnector manages to update the AndEngine-Shapes (like Rectangles/Sprites/etc...) when their physics representations "bodies" change. Once using Physics (and a PhysicsConnector) with an AndEngine-Shape you'd disable the Physics calculated by AndEngine itself, by calling setUpdatePhysics(false) to the Shape. Changes made to the AndEngine-Shape are not reflected in the Physics - you have to call the methods on the Body object you have used to create the PhysicsConnector.



Please request more classes that you'd like to get some/more description of.

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: AndEngine - Core-Terminology

Postby brewhaha » Fri Aug 20, 2010 3:08 am

What is a PhysicsConnector?

In the PhysicsExample.java, why was the PhysicsConnector used for the faces and not for the walls/ground/roof?

What effect do the pUpdateLinearVelocity and pUpdateAngularVelocity vars do? I tried turning this to true and didn't notice a difference.

Thanks,
Erik
brewhaha
 
Posts: 60
Joined: Mon Jul 12, 2010 1:06 pm

Re: AndEngine - Core-Terminology

Postby Barina » Wed Feb 02, 2011 9:27 am

everybody can look at some code but not everyone can understand it..
how do we work with main game loop(for action games)?
how Sprites and AnimatedSprites work and how do we implement it inside our code?

when we start to write our game what should we prepare first?
i mean.. what the game needs to work properly?
Barina
 
Posts: 59
Joined: Sun Jan 23, 2011 5:53 am

Re: AndEngine - Core-Terminology

Postby samyboy280 » Wed Feb 09, 2011 3:38 pm

Just to add a link to the Box2D manual, which has helped me a lot.

http://www.box2d.org/manual.html#_Toc258082975
samyboy280
 
Posts: 49
Joined: Thu Jan 13, 2011 8:44 pm

Re: AndEngine - Core-Terminology

Postby rreis » Mon Feb 21, 2011 8:24 pm

Barina wrote:everybody can look at some code but not everyone can understand it..
how do we work with main game loop(for action games)?
how Sprites and AnimatedSprites work and how do we implement it inside our code?

when we start to write our game what should we prepare first?
i mean.. what the game needs to work properly?


Like Barina said, how can we start a neg game?

Could you make a Pong Game sample? I think its game has the basic tools we need to start developing with AndEngine, because it´s simple.
rreis
 
Posts: 22
Joined: Thu Feb 10, 2011 6:21 pm
Location: Brazil

Re: AndEngine - Core-Terminology

Postby Duiker101 » Mon Feb 21, 2011 10:00 pm

I belive this are not andengine strictly related questions. Anyway there are many examples
http://code.google.com/p/andengineexamp ... 08fc551b62

also of full games

http://code.google.com/p/andengineexamp ... me%2Fsnake

But to get started you should start from example if you want to create a pong style game a good idea would be doing the following:
-Get an example and CLEAN it. remove evrything exept the things that will make it run (a scene, the engine fmethod etc..)to learn what this things are, just try, a crash will mean "i should keep this"
-start painting a sprite. Get the sprite example and get what you need.
-move the sprite.
-make the movements fixed
-create other sprites (for blocks)
-create a ball and make it move in a direction
-make a method to calculate the direction based on collision with borders(it's just a easy thing like if the velocity is +x+y when it touches the bottom it became +x-y)
-make collision for the blocks...

and everything will come by his own.

Start from something simple! ;)
"I do not agree with what you have to say, but I'll defend to the death your right to say it." Voltaire
Duiker101
 
Posts: 264
Joined: Tue Feb 01, 2011 11:28 am
Location: Italy

Re: AndEngine - Core-Terminology

Postby rreis » Wed Feb 23, 2011 1:51 pm

Duiekr101 wrote:I belive this are not andengine strictly related questions. Anyway there are many examples
http://code.google.com/p/andengineexamp ... 08fc551b62

also of full games

http://code.google.com/p/andengineexamp ... me%2Fsnake

But to get started you should start from example if you want to create a pong style game a good idea would be doing the following:
-Get an example and CLEAN it. remove evrything exept the things that will make it run (a scene, the engine fmethod etc..)to learn what this things are, just try, a crash will mean "i should keep this"
-start painting a sprite. Get the sprite example and get what you need.
-move the sprite.
-make the movements fixed
-create other sprites (for blocks)
-create a ball and make it move in a direction
-make a method to calculate the direction based on collision with borders(it's just a easy thing like if the velocity is +x+y when it touches the bottom it became +x-y)
-make collision for the blocks...

and everything will come by his own.

Start from something simple! ;)


It´s a great tip to me.

I´m studying some AndEngine concepts about animation and sprites. Thank you for answer.
rreis
 
Posts: 22
Joined: Thu Feb 10, 2011 6:21 pm
Location: Brazil

Re: AndEngine - Core-Terminology

Postby iram » Tue Mar 15, 2011 12:06 pm

Besides the core terms, I need to know the order the different methods are called.

BaseGameActivity::onCreate()
onLoadEngine

BaseGameActivity::doResume()
if(!this.mGameLoaded) {
onLoadResources
onLoadScene
onLoadComplete
}
.....
this.mEngine.onResume();
this.mRenderSurfaceView.onResume();
this.mEngine.start();
this.onGameResumed();


Now the question is whether there is a method that will be trigger for each frame?
or should i just override onGameResumed() since it appeared to be the one?

Any helps will be good.
iram
 
Posts: 2
Joined: Fri Mar 11, 2011 11:23 am

Re: AndEngine - Core-Terminology

Postby pverlaine999 » Thu Apr 21, 2011 6:23 am

I would be great if there is some javadoc to explain what the different functions and params are for, how to set them, etc. I'm new to this, I can read the code in the examples, but that does not cover every case scenario. For some simple behaviors (I think those are really simple), I have wasted a lot of time trying out different values for the params to see how it behaves.

For example, at my first try, I looked at PhysicsExample, and I tried to create my own texture region with

TextureRegionFactory.createTiledFromAsset(...)

just like it is shown in the example. The fist 3 params are obvious, the others are foggy for a newbie. This should be something really simple, but when I tried with my own png file, it just crashed without any obvious reason. For this simple function call, I had to dig through so much code trying to understand the behavior of the parameters.

This is one simple function. But to create a small game, if you have to dig through so much code like this, the majority of coders would be discouraged before they could get their first game compiled.

I'm a programmer, but not a game programmer, I'm mainly a server programmer, this is just for my own pass time. I just bought a new android phone, so I think I'd like to code some simple games on it. My math and physics are good, but trying to get familiar with the engine takes more time than it should.

For someone who is familiar with the engine, it wouldn't be too hard to add some javadoc. This would greatly help people to use andengine to develop games.

Anyway, great work for the engine, and I'd like to thank you for releasing it free. It would be even greater if there is some minimum of javadoc. I looked thru the source codes, it is so "clean" of comments and documents, especially in the example codes. Since those are examples that are supposed to help newbies to learn it, wouldn't it be nice to have some basic explanation of what they are trying to achieve? Sure, people can see the final behavior of the game, but they still have to guess what each function and param are doing.

Note that I'm not venting, I'm just saying from someone who is trying to use the engine for the first time. It would really help to make the engine popular, if there is good document. By comparion, renderengine has really nice docs.
pverlaine999
 
Posts: 2
Joined: Sat Apr 02, 2011 11:03 am

A humble request to Nicolos regarding ANDengine by a newbie

Postby drjava72 » Fri Apr 29, 2011 8:27 am

First of all I would like to thank Nicolas to be so kind to open source community. I am a professional game developer but I am new to ANDengine. I am looking into examples but I could not understand anything... I can see code but I don't know why are you passing them those parameters? I tried to pass them other arguments but this is simply guess work.

And I think with this poor documentation it took me ages to develop game. ANDengine is a framework for Android game devs. Imagine JSP or STRUTS without documentation!!! or with examples but without comments.

Dear Nicolas I would humbly advise you to kindly think like a newbie to ANDengine. The examples you gave are by perspective of people who know much about ANDengine like you, but for a newbie it is just piece of code and nothing more than that. Kindly add some more value to it.


I tried to dig up in code but couldn't find any thing understandable. It give me an error message that your file could not be saved... Now I don't know why.. if this remains I could not complete my games. I literally took weeks to get out if you stuck at some place.
Last edited by drjava72 on Mon Jul 04, 2011 7:58 am, edited 1 time in total.
Best Regards,
drJava72
drjava72
 
Posts: 287
Joined: Fri Apr 29, 2011 8:03 am

Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 21 guests