Rendering System

  ... the case you feel the need for a new feature or want to submit one.

Rendering System

Postby Resilient » Tue Jun 15, 2010 1:07 am

What kind of rendering system do you implement?

I was just getting ready to launch into creating a game based on the Replica Island engine and was wondering how you handled a couple issues.

Its my understanding that the hardware will block on rendering when drawing all the game objects. So Replica Island uses two buffers, one that is used for drawing from and one that is being written to by the game thread and they swap every frame.

I also really think their game object system is a good one. Everything is basically made of a base object and includes a collections of other "objects" that include things like the drawable, AI, physics etc. When an object is updated all its children get updated so its easy to dynamically add and remove components to in game objects.

I have looked a bit at your code and couldn't tell how the rendering system works exactly. I also was wondering how you would use your system to implement a more complex game. I don't quite follow how the updating of in game objects works and if it is easy enough to add sub objects to them.

I may well jump ship and come over to your engine if both of these issues are taken care of because I am sure I can expect more frequent updates to your engine than I can hope to get from Replica Island.

Thanks!
Justin
Resilient
 
Posts: 5
Joined: Tue Jun 15, 2010 12:30 am

Re: Rendering System

Postby Nicolas Gramlich » Tue Jun 15, 2010 3:59 pm

Hi Justin,

Resilient wrote:What kind of rendering system do you implement?

I was just getting ready to launch into creating a game based on the Replica Island engine and was wondering how you handled a couple issues.

Its my understanding that the hardware will block on rendering when drawing all the game objects. So Replica Island uses two buffers, one that is used for drawing from and one that is being written to by the game thread and they swap every frame.

I also really think their game object system is a good one. Everything is basically made of a base object and includes a collections of other "objects" that include things like the drawable, AI, physics etc. When an object is updated all its children get updated so its easy to dynamically add and remove components to in game objects.


Like Replica Island, AndEngine uses a Dual-Thread technique. The GLThread handles drawing, and while it is blocking in eglSwapBuffers to actually execute the draws, the UpdateThread can already do the update-stuff. (There also is the UI-Thread but that doesn't really matter).
Currently one cannot attach UpdateHandlers to a game-object but to the Engine itself or the Scene. This could very easily be implemented, but would require an ArrayList in every single GameObject, what might have a bad impact on performance.

Resilient wrote:I have looked a bit at your code and couldn't tell how the rendering system works exactly. I also was wondering how you would use your system to implement a more complex game. I don't quite follow how the updating of in game objects works and if it is easy enough to add sub objects to them.


To get an idea on how to add new objects to the Engine, have a look at the FPSCounter-Class.

basically all it does is implement this simple Interface:


Then you'd hook these either into the Engine or into a Scene via one of these methods:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. registerPreFrameHandler(final IUpdateHandler pUpdateHandler)
  2. registerPostFrameHandler(final IUpdateHandler pUpdateHandler)
Parsed in 0.010 seconds, using GeSHi 1.0.8.4


Btw: this is also how the PhysicsBox2DExtension is brought into play, so this mechanism also works for complex stuff. See: PhysicsExample.java -- Line: 107

Hope this helped :)

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

Re: Rendering System

Postby kuku202 » Tue Feb 10, 2015 11:45 am

Hello, AndEngine do not seems to support multitouch, which make difficult to write an advanced control system. Would it be difficult to implement this ?
You can check out our latest spanish programs and colostate.edu exams written by our certified teams to help you pass nova You can also purchase Florida Southern College Our selftestengine is simply excellent in quality.
kuku202
 
Posts: 2
Joined: Fri Feb 06, 2015 11:26 am


Return to Features

Who is online

Users browsing this forum: No registered users and 4 guests