Search Unity

[WIP] Sponge - A container for efficient condition detection

Discussion in 'Assets and Asset Store' started by PudgePacket, Feb 27, 2014.

  1. PudgePacket

    PudgePacket

    Joined:
    Feb 27, 2014
    Posts:
    11
    Hi, my name's Trent, I've recently completed a 2 year advanced diploma in game design programming and since finishing I've been enjoying creating this small tool, Sponge.

    Sponge is a niche case collection data type for holding game objects that require expensive/infrequent checks to see if they should be removed (death). Sponge slows down the rate that these checks are applied and lets the user adjust the rate. It works by the user writing the death check method and passing to the Sponge object, then every update you call the Sponges update and it will check one or more of the objects for it's death, it will continue checking the next few objects in the collection each update until it reaches the end of the list and then restarts from the beginning next time.

    It isn't meant for time critical collisions such as bullets or physics but more aimed at things that might exist in the game world that should be removed/unloaded eventually. One such use case I've found is for removing environmental assets such as houses/buildings and small objects that it would be too costly to check each one every frame to see if it is far enough from the player to warrant removing, but still need to get removed at some point to keep memory use down.

    It's early stages yet, but it works as I've described. The user also has the option of "squeezing" the sponge, running the death check on all objects in the collection. Sponge also inter-operates very nicely with memory pooling solutions for your game objects.

    Any criticism/ideas/use cases would be greatly appreciated as this is my first asset store production and quite a niche product.