Doubt about how to proceed with loader contents....

74 views
Skip to first unread message

Douglas Mendes Barreto

unread,
Aug 15, 2013, 12:23:37 PM8/15/13
to ash-fr...@googlegroups.com
Hello Guys!

First o all, I am thankful for all the work of fantastic framework written in As3 and the big  knowledge and experience that brought to me.

So guys I have one big question about how can I proceed with graphic contents which will be loaded externally. I work in one project that's all graphic contents in the game arrive in JSON format, because we have a lot of customization on the game like avatars, background, colors e etc... 

So I am not sure if I should create one System or only create the entity after the graphic component is ready, I know the both ideias could happen, but I'd like to listen what you guys think about this question and how are you proceed in this situation....

Regards.

johnjohn

unread,
Aug 17, 2013, 8:33:57 PM8/17/13
to ash-fr...@googlegroups.com
I assume the graphics content in JSON also has data on animations and spritesheets?  Assuming so I'd probably have an animation system that does not handle the JSON, rather it is agnostic towards the data, only caring about how it should process the rendered elements to proceed to another frame.  

I'd also probably have an animation component that gets created from the JSON data which is created from some factory or util type class.  That way you keep the JSON specifics out of your components and systems.  I'm not sure how complex your animations are but the animation component could be rather simple, just storing the current animation frame, and maybe a mapping to the frames of the spritesheet for various animation states.

You could also check out how the Finite State Machine classes could play into this, however I have no experience with the FSM yet.

Douglas Mendes Barreto

unread,
Aug 19, 2013, 10:59:32 AM8/19/13
to ash-fr...@googlegroups.com
Hello Man thanks for answer me!

Yes the data which I am working is JSON, but really problem is the Loader.... We assume that sprite sheet will be downloaded in 2 a 5 seconds but the system is updating data every frame, my problem is thinking where goes the loader content? Is one system who will take care about or it's will be holded externaly and after the event complete I will insert the entity on the engine? I'd like to know How would you do it.

Thx for all.

Best Regards
Douglas.

jwopitz

unread,
Aug 19, 2013, 5:31:34 PM8/19/13
to ash-fr...@googlegroups.com
Ok I understand your issue a bit better.  So one thing you need to think about is the loading experience.  Are we talking about something where the user is presented with a new zone (so basically a pause in the game, while the next level builds up) or are we talking about loading new entities DURING game play?

If it's the latter situation, say an MMORPG where people are constantly logging on/off and possibly bringing customized avatar sets with them, then I'd hold that entity out of the engine until your assets are loaded.

If it's the latter situation, you could stop the game loop while assets load, then start it up again?  If I knew more about the game experience from the user perspective in the context of when this loading takes place it would help me form a solution.


--
You received this message because you are subscribed to a topic in the Google Groups "Ash Framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ash-framework/EXQ9jZ7xQBs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ash-framewor...@googlegroups.com.
Visit this group at http://groups.google.com/group/ash-framework.
For more options, visit https://groups.google.com/groups/opt_out.

Khaled Garbaya

unread,
May 27, 2014, 10:43:05 AM5/27/14
to ash-fr...@googlegroups.com
I use this setup : 
LoadingNode
LoadingComponent
--progress
--steps
--loadingView

LoadingSystem extends ListIteratingSystem :
       // this is on NodeAdded add loading view
       private function onNodeAdded(node:GameLoadingNode):void{

            container.addChild(node.loading.view);
        }
      // this is on onNodeRemoved remove loading view
        private function onNodeRemoved(node:GameLoadingNode):void{
            container.removeChild(node.loading.view);
        }
if(!assetLoader){
//in the update function you create your loader and start loading if it is not created
}else{
//update progress using yourAssetLoader.progress
// if it is 100% remove loading entity and createGameEntity to start your game
Reply all
Reply to author
Forward
0 new messages