Results 1 to 2 of 2

Thread: What I would need to do to implement a new entity type or something?

  1. #1
    Join Date
    Mar 2010

    Default What I would need to do to implement a new entity type or something?

    I am noticing HUUUUUGEEEEE slow-downs on my game when creating entities, I then realized:

    The MovingEntities themselves have bazillions of data and methods, there are even some cool AI stuff there (I mean, the stuff that help pathfinders), this is already bad for when I want to create several entities.

    Then, all MovingEntities that have collision box, have physics, meaning that all the bizarre amount of Box2D data is added, and meaning also that it fiddles with Box2D binary search tree (even in the lastest version of Box2D, any time you add or remove something from it, it activates a binary search algorithm to add or prune it from its binary tree... kinda stupid if you ask me, or even other Box2D users, but that code work perfectly for Erin Catto games, better than other methods would, and he reject any patches to it without even reading them...)

    So I need a way (even if some C++ coding is needed) to create a "simple entity" that has only its picture, script attached, position, rotation, color, bounding box... No physics, no AI states, no brain manager (well... with brain manager I can add brain fade and that one is really cool... but I dunno about the overhead that the brain manager add, or not...), etc...

    So, there are a way to do it using stuff that already exist, or if I need to code my own class, what I have to edit (beside obviously creating a edited copy of MovingEntity.h/.cpp)

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002


    Well, the pathfinding, brain system, and physics don't actually get initialized unless they are specifically used. (should check this though.. just in case there is a bug, or you're calling something you don't need)

    But you're right, despite this, entities are still a bit "heavy".

    Depending on what your doing, it might make sense to create a Brain that itself is just a hook into your own custom entity system, providing you don't need to communicate with them in the same way as normal entities.

    For example, the example brain that creates the "game of life" can great thousands of its own little 'life' cells, which would be crazy to try to make entities out of each one.
    Seth A. Robinson
    Robinson Technologies

Similar Threads

  1. CL_ProviderFactory: Unknown image provider type png
    By The User in forum Official ClanLib SDK Forums
    Replies: 9
    Last Post: 02-05-2010, 01:33 PM
  2. A Castlevania/Metroid type game
    By illspirit in forum Novashell Game Creation System
    Replies: 20
    Last Post: 01-27-2009, 11:14 AM
  3. How do I make an entity face a certain direction?
    By Jeral in forum Novashell Game Creation System
    Replies: 2
    Last Post: 12-14-2008, 07:44 PM
  4. Problem with turorial 'convert to entity'
    By hellbound007 in forum Novashell Game Creation System
    Replies: 2
    Last Post: 05-30-2008, 12:58 PM
  5. Some requested things to implement
    By SLATE in forum Funeral Quest
    Replies: 6
    Last Post: 09-27-2004, 04:59 PM



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts