Level! Objects!

Published April 08, 2007
Advertisement
I have my system to the point where I can log in (with a hard-coded password), it exchanges authentication cookies, and it can send messages back and forth and dispatches them. I'm now implementing the "LoadLevel" message, which just takes a string which is the name of a LUA script.

That script contains calls to MakeObject(), passing a table, which is the parameters for the object.

An Object is actually just a collection of components. Each component is a collection of properties, and behaviors that are written in C++ (I will probably add script components later). Thus, the definition of an Object looks like a definition of a number of components, with specific properties being set on the components.

I've implemented this pattern as a research prototype before, one or two summers ago, after reading a similar system in Game Programming Gems 5, and this time, I could crank it out (just the framework, no concrete components) in an evening. Yay! Properties are "live" (you can subscribe to them, and when they change you will hear about it), and daisy-chainable (the defined output of a property is set to the output of some other property).

I decided to forego asynchronous I/O in this effort. Usually, I know that I'll want it, and start out by putting it in, but the code structure becomes quite ugly, with deferred operations flying all over and it's hard to know what's going on, because everything is asynchronous. I'm not going to port this code to consoles; in fact, I'll be lucky to ship it on PC at all, so synchronous I/O is fine for now (and SOOOOO much simpler!). If and when I ship and have a working product, I can go back and make it better.

The executable can spawn any of two separate threads: a server thread, and a client thread (which is the main thread). This allows me to run a "full system" in a single process, which makes debugging easier. Running them in threads also simplifies code structure -- previous efforts have implemented a fully event and context driven system, which is very flexible, but also impedes progress. This time, it's progress or die! (warts and all)

The client runs Ogre, and already has CEGUI. It "should" be easy to bring up a simple level by writing a single "static mesh" component. I have no physics or collision yet -- that'll come later. (ODE? Just bounding spheres/boxes? we'll see)

It's time to sleep.
0 likes 2 comments

Comments

Saruman
Aegia is great for physics/collision and is completely free even for commercial use on the PC now. I'm not sure if you looked at using that over ODE, but I use Aegia for all of my game physics. Really great documentation, samples, support, and tools as well. (Collada support, Maya/XSI, etc)
April 08, 2007 11:33 PM
hplus0603
I agree that the PhysX SDK is really great!

I've actually used it for small research demos before. I hadn't thought of using it for this project, because it will not be physics intensive, but perhaps I should.
April 09, 2007 01:21 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement