Finally I’m moving on ( Wed 25 Jun 2008 )

Pfff it’s been a crappy month. I’ve rebuilt the zSort algorythm twice and smashed my head againt the keyboard many times, but finally this one does work and does perform. How frustrated I felt during the process is something I’ll never forget.

Also, I received feedback from several people trying to have big maps and complaining about the grid initialization times and memory usage. This got me thinking: generating a grid at initialization is very inneficient (stupid) and makes impossible to have big maps. So, why don’t we make it work as a real cache, and cells are generated on-demand ?

So I have done it. Now a cell is only created when it is needed. I think this is a big improvement. You can extract the latest code via SVN and tell me how it works.

So after a few weeks of desperation It seems that everything stays the same, but I think I have more solid foundations now. Next: pathfinding (at last !! ), character-character collision and bullets. Sounds easy after all I’ve gone through lately.

10 Responses to “Finally I’m moving on”

  1. Hi !
    If i understand well your code, z-sorting is only done on cells (ans levels) ?
    Are elements in a same cell z-sorted ? I think not, but maybe i am wrong.

  2. Hi Gregory,

    elements in the same cell are not zSorted, but the new implementation allows you to have small cell sizes in big maps without incurring in extra initialization times and excessive memory usage.

    Therefore, if you define a cell suitable to your character size, you shouldn’t need to add any extra zSorting in your program.

  3. I will re-try it, to see.
    In my project i didn’t see any changes at loading… maybe i have forgotten something.
    Will you prepare a new little demo ??? ;o)

  4. Great to see the engine is moving.
    I am sorry that I am bad in coding.
    May just use your engine for my games projects and promote to people around about your engine ^_^

  5. HI!
    I think there is some problem with the game restart .for example we wanna create a sports game by your engine but when the game over we wanna play it again it will be take a lot of PF usage .How can I fix this bug thx
    and sorry for my poor English

  6. Hi Terry,

    I need to add a method to delete scenes and free system resources ( mainly internal arrays and bitmaps ). I’ll do it during this week.

  7. Thanks very much !It’s a good news ,and glad you can reply my message thank you very much .
    thx \\(^v^)//

  8. Hi…
    Great improvement, and more will come I think…
    Just a strange question: how would it be possible to load a run-time new objects or characters? Since the definition is in the XML files, how can the problem of adding i.e. characters to the scene on the fly, and how to manage the addition/removal of them?
    Moreover, there is the possibility to map events (such as for example a collision with an object or a click on it) with a reaction of the browser (open a new tab/window)?
    Finally, interaction with incoming/outgoing informations (json messages) can be handled normally (via an appropriate controller) or the retrieval of such information is impossible?

  9. Hi,

    the scene provides methods to create/destroy dynamic elements such as characters and lights. See http://www.ffilmation.org/docs/api/1.1/org/ffilmation/engine/core/fScene.html#createCharacter()

    As for mapping events, yes it is possible, you can Add Listeners to collision events and do whatever you like there. See the demos and docs for examples.

  10. I was also wandering if there would be the possibility to modify some property of the fEventIn() in order to get and also update the xml information i.e. the coordinates of an event (in order to follow an object [properly created as an fCharacter] to move it along the scene)…

Leave a Reply