Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 

Confused about Scene Graph vs the older frameworks

I started developing a game using Scene Graph, it is not a very graphics intensive game, more of a board game style game. However it does require a small amount of animation. I am struggling to see how I use bitmap sprites in combination with Scene Graph. I can find lots of examples of using the old style roBitmap and roCompositor, but I am unsure of how to approach this with scene graph.

What is the actual deal with Scene Graph? I got the impression it was the new and correct way of doing things (all things?) 

Any advice much appreciated.

Cheers
0 Kudos
10 Replies
EnTerr
Level 9

Re: Confused about Scene Graph vs the older frameworks

"shibuyashadows" wrote:
I started developing a game using Scene Graph, it is not a very graphics intensive game, more of a board game style game. However it does require a small amount of animation. I am struggling to see how I use bitmap sprites in combination with Scene Graph. I can find lots of examples of using the old style roBitmap and roCompositor, but I am unsure of how to approach this with scene graph.

Can't use sprites and roCompositor with anything other than roScreen. That does not mean you cannot write games with simple animations in roImageCanvas or roSgScreen ("Roku Screen Graph") screen modes though. roScreen is necessary only for heavy animations where you care dearly about FPS.

What is the actual deal with Scene Graph? I got the impression it was the new and correct way of doing things (all things?)

Well... indeed it seems RSG is Roku's "first, last, and only"^ "new hope"^^. Comparatively, it's not a very good scene graph implementation - the scripting integration and events/multithreading are particularly atrocious. It can however be the "correct way" of doing things for a convenient definition of "correct" and for some very specific "things".

(^) Men in Black
(^^) Star Wars
0 Kudos
belltown
Level 7

Re: Confused about Scene Graph vs the older frameworks

What EnTerr said is fairly accurate. Components such as roCompositor, roRegion, roScreen, and roSprite "cannot be used in a Scene Graph application", according to the Scene Graph XML Guide section on BrightScript Support. Those components are part of the 2D API, which is commonly used in developing animated game channels. The 2D API uses an roScreen component as its screen canvas. While it may be possible (*) for a Roku application to use multiple screen canvas types (standard, roScreen, and roSGScreen), only one screen canvas can be active at a time, so you can't put an roSprite onto a standard canvas or an roSGScreen canvas, for example.

Scene Graph provides an alternative way to design a user interface. It is neither more "correct" nor less "correct" than using standard components or 2D API components, nor does it supersede previous components. It's just different (and newer), not necessarily better for every situation, and certainly not intended for all the things. Use whatever you deem to be most appropriate for your specific application.

If you are animating images or shapes that you can construct from Scene Graph components (rectangles, labels, etc.) than you may find the Scene Graph Animation components useful. If you are creating your own custom bitmaps somehow, then the 2D API (roScreen) may be more appropriate. You may even find it easier to use standard components (roImageCanvas) to construct your UI if you're not looking for high frame-rate animations.

---
(*) I'm not trying to suggest that you try this, just that I know from experience that it's possible in certain cases. Roku does not officially support, encourage or condone mixing screen types.
https://github.com/belltown/
0 Kudos

Re: Confused about Scene Graph vs the older frameworks

EnTerr , belltown
Many thanks for your replies, this clears a lot of things up!
0 Kudos
Komag
Level 9

Re: Confused about Scene Graph vs the older frameworks

I can't imagine making a game with anything other than roScreen and 2D API
0 Kudos
EnTerr
Level 9

Re: Confused about Scene Graph vs the older frameworks

"Komag" wrote:
I can't imagine making a game with anything other than roScreen and 2D API

Rumor has it that the "games" by StuffWeLike are made with RSG. 
(Note that the schlock quality of these is no RSG's fault)
0 Kudos
belltown
Level 7

Re: Confused about Scene Graph vs the older frameworks

"EnTerr" wrote:
"Komag" wrote:
I can't imagine making a game with anything other than roScreen and 2D API

Rumor has it that the "games" by StuffWeLike are made with RSG. 
(Note that the schlock quality of these is no RSG's fault)

Yes, they're definitely Scene Graph channels. If shibuyashadows is trying to make something described as "not a very graphics intensive game, more of a board game style game", then it might be worth taking a look at those "games". It can't be too hard to significantly improve upon them without too much effort.
https://github.com/belltown/
0 Kudos
EnTerr
Level 9

Re: Confused about Scene Graph vs the older frameworks

"belltown" wrote:
Yes, they're definitely Scene Graph channels. If shibuyashadows is trying to make something described as "not a very graphics intensive game, more of a board game style game", then it might be worth taking a look at those "games". It can't be too hard to significantly improve upon them without too much effort.

How can you tell with definitiveness if published app is RSG or not?
I was thinking of writing game in RSG for kicks but after hearing the "first one", lost interest.
0 Kudos
belltown
Level 7

Re: Confused about Scene Graph vs the older frameworks

"EnTerr" wrote:
"belltown" wrote:
Yes, they're definitely Scene Graph channels. If shibuyashadows is trying to make something described as "not a very graphics intensive game, more of a board game style game", then it might be worth taking a look at those "games". It can't be too hard to significantly improve upon them without too much effort.

How can you tell with definitiveness if published app is RSG or not?

r2d2_bitmaps
https://github.com/belltown/
0 Kudos
EnTerr
Level 9

Re: Confused about Scene Graph vs the older frameworks

"belltown" wrote:
r2d2_bitmaps

r2d2_bitmaps not working just means "not roScreen", right? could be RSG or roImageCanvas (easily)
0 Kudos