terrain – Release and Debug mojo3d diferent behaviour.

About Monkey 2 Forums Monkey 2 Programming Help terrain – Release and Debug mojo3d diferent behaviour.

This topic contains 5 replies, has 3 voices, and was last updated by  impixi 1 year, 9 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9172

    Pakz
    Participant

    I modified the terrain test and added my own terrain generator. I put the start code in a function so it can be called to create a new terrain by pressing space. But I am getting different results with emscripten en wasm in release and debug mode. In release mode the terrain seems not to be cleared? The terrain seems to grow every time you press space, In debug mode it does not seem to do this. In the desktop mode (release and debug) I am also getting different types of maps.

    Did I stumble on a bug or am I not doing something I should do?

    #9174

    impixi
    Participant

    Bugs, I’d say. I’m seeing similar results from my own terrain generator (quite different than yours).

    But remember Mojo3d is still a WIP Alpha, so much of it is not “production” ready yet.

    #9208

    Mark Sibly
    Keymaster

    Had me going for a while, but the main problem here is that pixmaps are not cleared by default.

    Add a pm.Clear( Color.Black ) after the New Pixmap(…).

    #9217

    impixi
    Participant

    I just discovered my bug was forgetting to clear the scene’s Terrains stack, so on each runtime call to my generate function a new terrain model was created. It looked like an addition to the existing terrain model… FFS, I’m making a lot of rookie mistakes lately I’m just about ready to quit coding forever…

    #9219

    Mark Sibly
    Keymaster

    The scene Terrain stack is internal and may yet change – using Entity.Destroy() is the correct way to remove something from a scene (assuming it works!).

    There are many internal/experimental features like this. When in doubt, consult the docs, all the internal stuff should be hidden.

    It’s probably about time to add a real ‘Internal’ directive to the language…

    FFS, I’m making a lot of rookie mistakes lately I’m just about ready to quit coding forever…

    Well, it’s not like any of this is particularly well docced!

    #9221

    impixi
    Participant

    using Entity.Destroy() is the correct way to remove something from a scene (assuming it works!).

    Just tried Destroy() and it does indeed work for terrain objects. Thanks for the tip. 🙂

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.