Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Gasimzada

Member Since 11 Feb 2012
Offline Last Active May 10 2014 12:59 AM

Posts I've Made

In Topic: Pacman game smooth movement collision against a 2D Tile Map

09 May 2014 - 01:18 PM

Do I offset that while generating the new position or while checking the collision?


In Topic: Is Window Manager a part of an engine?

19 January 2014 - 07:21 AM

Thank you for the help! I was thinking in the wrong direction but not it all makes sense.


In Topic: "Proper" state management for CBE

15 January 2014 - 04:19 AM

Thats how I do it now, I have a "World" class that holds component holders holders and the systems act upon those component holders. The World doesn't care about the existence of any manager or system. I am still thinking about making design more cleaner as I am deciding whether a system should know about the state dealing with resources or does the system only act upon the world where the world is coming from, either from a state or from somewhere else.


In Topic: C++ templates, are they worth it?

11 January 2014 - 07:19 AM


I recently swapped most of my dynamic memory allocations by using vectors (except where it doesn't bring anything).

 

What do you mean by "Except where it doesn't bring anything"? Why would you use C array in a C++ code? With zero optimizations, I don't believe the performance would be so much different, as std::vector is just a wrapper around C style array? However the functionality you get with STD arrays is totally worth performance. 

 

And to answer your question about templates, of course learn it. Templates can be scary (it was for me); however once you get comfortable with it, you can write codes that are very flexible. 


In Topic: "Proper" state management for CBE

09 January 2014 - 04:35 AM


In my framework, you just create a particular System and add it to a list in the EntityManager. Each system is updated in exactly the same way (why wouldn't it?), there are no "views" or "controllers". If I want to make a new system, the only code changes it requires is in my initialization code when I add it to this master system list.

 

Do you register observers to the systems to do some system specific codes. Thats why I have a different update function per system. Like BulletSystem update:

//Bullet.cpp
void BulletController::update(World * world) {
   btDynamicsWorld * dynWorld = world->getHolder<BulletHolder>()->getBulletWorld();
   dynWorld->stepSimulation(1/60.0, 0);
}

//HordeController.cpp
void HordeGraphicsController::update(World * world) {
   for(auto component : world->getHolder<HordeNodeHolder>()->getNodes())
      updateComponent(component);
}

//HordeCameraView.cpp
void HordeCameraView::render(World * world) {
   for(auto component : world->getHolder<HordeCameraHolder()->getCameras());
      h3dRender(component->getHordeNode());
}

For me doing view vs controller is just a conventional thing. I just split the system into Controller and Views, where controllers do update while views do render.


PARTNERS