Questions about creating large FPS games and event handling in a game engine.

Started by
0 comments, last by kRogue 14 years, 5 months ago
Hello, I have some questions about creating large FPS games and event handling in a game engine. Question 1) Ok, so some games have very large worlds and there is a finite amount of memory available. To reduce memory, I use resource instancing etc. (standard procedures). My question now is ... if I program a large (or very large) world as my game, how do I manage the world properly so that there is enough memory for everything and that everything runs smoothly. I am assuming you cannot simply have the ENTIRE world loaded in memory which means you are probably doing something like loading portions at a time (probably slowly in a separate thread) as regions become visible etc. I am needing information on how to properly manage LARGE FPS worlds in this manner and in memory and at run-time. Question 2) Ok, so events happen in games ... something collides with something else and you need to notify the objects that events have occured. Other times you want to simply trigger events in other objects without collision. Currently my game engine physical entity class has a couple of virtual methods:

class JPhysicalObject
{
public
     void HandleCollision(JPhysicalObject* collider) = 0;
     void HandleEvent(int event_id, void* arg1, void* arg2) = 0;
};

When two objects collide they pass themselves to each other for querying the collider type and performing collision events. When events need triggering you simply trigger the event with HandleEvent. I am hoping to get some information as to whether there is a more robust solution or if I am doing this correctly. Thank you for your help. Jeremy
Advertisement
Signals _might_ be a good idea for events to trigger things to happen, http://libsigc.sourceforge.net/ is a signal library that has minimal overhead (it is mostly syntactic sugar unless you get into marshalling stuff).
Close this Gamedev account, I have outgrown Gamedev.

This topic is closed to new replies.

Advertisement