1. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Debug message: "Too much particles!"

Discussion in 'Modding Help' started by Vermilicious, Feb 18, 2016.

  1. Vermilicious

    Vermilicious Ballista Bolt Thrower

    Messages:
    232
    I've recently gotten this message spammed in the console (but oddly enough not in the logs), when in debug mode (g_debug = 1). It doesn't refer to any line number or supply any other information.

    I'm just a bit uncertain about what this message actually means, and no, I wasn't confused by the poor spelling. I'm doing some small things in various onRender handlers like rendering lines, arrows and text using the GUI object/namespace. Not exactly particles! Could this be a cause of this message, or could this be a debug-related message originating from another problem source? Is it even a problem?
     
  2. Verrazano

    Verrazano Flat Chested Haggy Old Souless Witchy Witch Witch THD Team Global Moderator Forum Moderator Tester
    1. Practitioners of War Extreme Revolution - POWER

    Messages:
    477
    It's not related to your code, if you aren't using particles, and it's not an issue either way really. Basically there is a pool of particles allocated at startup, 2048 of them. If the game ever has that many particles active at one time, and then if another one is to be created, it wont be and instead that message will appear.
     
  3. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
    It could also be due to blobs constantly smashing on the ground and generating particles every time.
     
  4. Vermilicious

    Vermilicious Ballista Bolt Thrower

    Messages:
    232
    I'm stumped. This "problem" seems to only happen when I place my custom blobs next to each other in a row, and in debug mode. After this message appears, things like bombs don't get their particles and stuff like they should. In normal mode, however, I can't see any problems occurring. I've commented out any code that I could think of that either had to do with sprites or any kind of "heavy-lifting". I also commented out any rendering code, which is only run in debug mode. I also commented out every single vanilla scripts in the blob configuration file. No change. How odd!

    It's not really a problem, unless I want to debug stuff, since the console is flooded with this message. Is there anything you can think of that causes such blobs to "constantly smash" into something? The only thing I can think of is that the blob is configured with shape_collides set to no, but has vertices. In code, I place map tiles to get proper collision. I did this after a suggestion from Geti. Mechanisms work the same way. I tried changing the configuration, remove the vertices, and comment out the code that sets the tiles and adjusts the sprites. Made no difference. Very little of my code is debug-specific, and all that code does is draw some basic GUI stuff.

    If I can't really "solve" it, is there a way to disable this message?

    (Code at: https://github.com/ANybakk/kag-tran...b9c6117de8fb5419/Entities/Structures/Conveyor (BeltConveyor))
     
    Last edited: Feb 19, 2016
  5. Verrazano

    Verrazano Flat Chested Haggy Old Souless Witchy Witch Witch THD Team Global Moderator Forum Moderator Tester
    1. Practitioners of War Extreme Revolution - POWER

    Messages:
    477
    with your blobs that are dummy tiles are you setting them to static? No you can't disable the message, except for turning off g_debug.
     
  6. Vermilicious

    Vermilicious Ballista Bolt Thrower

    Messages:
    232
    Not sure what you mean. I've written this onSetStatic handler:

    Code:
    void onSetStatic(CBlob@ this, const bool isStatic) {
    
      Transports::ConveyorBlob::onSetStatic(this, isStatic);
    
      //Check if recently placed
      if(this.hasTag("wasPlaced")) {
    
        //Obtain a reference to the map object
        CMap@ map = this.getMap();
      
        //Set tile type to 256 (just to get proper collision)
        map.server_SetTile(this.getPosition(), 256);
      
        //Obtain a reference to the sprite object
        CSprite@ sprite = this.getSprite();
      
        //Check if sprite is valid
        if(sprite !is null) {
      
          //Set z-index to 500 (overlapping tile)
          sprite.SetZ(500);
        
        }
      
        //Retrieve tile space position
        Vec2f tileSpacePosition = map.getTileSpacePosition(this.getPosition());
      
        //Retrieve the offset index for this tile
        int tileOffset = map.getTileOffsetFromTileSpace(tileSpacePosition);
      
        //Set solid and collision flags for this tile
        map.AddTileFlag(tileOffset, Tile::SOLID | Tile::COLLISION);
    
      }
    
    }
     
  7. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    Re: using dummy tiles - you'll have to ask @Skinney about this. The dummy tile stuff isn't finished yet afaik (or it'd be actually used for the mechanisms and the like) and I didn't mean to suggest you use it in a mod. I'm not sure, but I dont think they're ready for consumption yet.

    Re: particle spam - search for any instances of the particle function that you're using (including vanilla scripts that spawn particles that you're using) and consider if there's something you might be doing to cause that to happen every frame.