Main Menu

About your "Want to be a Game Developer" articles

Started by xelanoimis, January 21, 2009, 05:06:03 AM

Previous topic - Next topic

xelanoimis

Hi,

First of all, you're doing an amazing job bringing this game to life! I'm watching your progress for a few years now. I signed the petition in the dark ages, and I was very happy to see that for a first time such a petition have success!

It's an amazing experience to work on such project and I was very happy to see you decided to share some of it's details with us, in your journal entry about becoming a games developer. Top quality info!

Being a game developer myself, I want to ask you a few more details about it:

--------------------
1. How to you have your models organized in scenes?

I mean obviously you have some models shared between scenes, like the actors.
I suppose you load these shared models when the game starts the first time.

But what about other elements? Do you duplicate the file of a rock or a tree model, if you want to place it in two scenes? Or you share it too?

As I've seen in other games, if they use lightmap they have to duplicate the models, because of the different lightmap texture coordinates. Some games share only the diffuse texture files.

If you duplicate such scene specific objects, does they take long to load? I guess you can't go from scene to scene with a simple fade, like 2.5D games, and have to use larger scenes and load them with a loading screen.

About how big is the data loaded for a scene in MBytes?

--------------------
2. How does the lightmap creation process goes?

You said you do the lightmap in the CG software, by importing the scene, performing the lightmap, and exporting it back. But how the objects are handled during this? If the scene was only one big object I can understand, but if it's composed of individual object files...

Does all the models share the same lightmap texture, or they end up with individual lightmap textures? Or the processor deceide to distribute texture files on some set of rules?

And are the model meshes changed with new texture coordinates, and their materials to the new created lightmap textures names?

--------------------
3. How do you store the model components?

By model components I think of meshes, materials, skeleton and animations. Are they in separate files? Can you share them between models, like having one animated skeleton and use it for more characters with different meshes or even just different materials?

Can you create model instances at runtime (or load time) by combinig components from different models? Like creating some "soldiers" from a set of heads and bodies?


Well I hope you find some time to drop a few answers for me.
Thanks!

Alex
www.yolkfolk.com/dizzyage

Yonkey

I'm glad you enjoyed the special! :)

1. The characters are exported to separate folders than the scene objects, and in script they are added to the scene in the correct position before it loads up.  I don't think any models are shared between the scenes.  There might be some objects within a scene that get re-used (i.e. the doors in the Main Hall), but in general, each scene has its own objects that get loaded and unloaded whenever you enter and exit a scene.

Each object (including characters) has its own texture.  Sometimes we use dynamic lighting, such as fire or sunlight, which casts shadows and brightness onto the 3D objects underneath.

The loading time is directly dependent on one's memory.  For anyone with 1GB or higher, the loading time is 3-5 seconds.  For people with 512 or less, it could be much longer.

It's hard to say how much data is loaded per scene, because besides the 3D models & textures, we're also loading sounds.  A scene with a long song, ambience and dialogue could use a lot more memory.  Or a physically large scene with many textures could use a lot.  The larger scenes tend to take 5 or 6 seconds to load for me, but off the top of my head I can't really give an average in MB.

2.  I somewhat answered this already, but in general the lighting is done in Maya and baked into the textures.  In Maya, the scene is treated as one set with objects within it, and every object has its own texture.  The engine rarely lights things in real-time.

3.  The mesh is a 3D object, the material is its texture.  The animations are exported for each character, and they can't be shared once dropped into the engine.  But prior to the animations being exported, I believe we use a universal rig (i.e. animated skeleton) that most or all characters are based on. 

It is possible to mount objects to other objects, so in theory, we could have a body as one object, a head as another, and then mount the two together to create soldiers.  But in TSL, we don't have soldiers or use mass characters that have similar bodies.  The only thing I can think of that somewhat uses this concept are the people in the Winged City.  But still, the wings are duplicated and fastened before export, not in-game.
"A wish changes nothing. A decision changes everything."

xelanoimis

#2
Thanks for the detailed answer!

One more thing: when you said that some objects, like some doors, are shared in the same scene, you mean shared as sources in Maya but exported as separated objects for the engine, each with it's own texture with the lighting baked in?

Or there is only one door 3d object instanced twice (or more) in that scene? Both instances using the same geometry and texture. In this case what about the lighting? Do you lit it dynamic, without Maya baking it in the texture?

Oh, and your scenes loading times are really great! You said it depends on the user's memory. Does the game caches a lot of scenes when it first starts? Or does it loads the full scene when player enters it for the first time (and caches it for future uses).

I this case, the 3-5 seconds load time is when the scene is fully loaded (3d objects, sounds, etc) when first entered, or is based on some already cached data?


Thanks!

Yonkey

Actually, I was mistaken.  The doors are all separate in the MainHall, probably because of the different lighting used on each texture.

I don't think the game caches scene objects.  It loads whatever it needs to load on a per scene basis.  Then, when you leave the scene, all objects are destroyed, and the next scene's objects are loaded.  If you want to return to the previous scene, your current scene's objects are destroyed and the first scene is loaded again.  This is why the 3-5 seconds wait is consistent throughout.  If the scenes were cached, they would load quicker on subsequent entry.

One thing we haven't been able to fix properly yet though is audio.  There's an issue where audio is never deleted from memory when you walk from scene to scene, which results in a memory leak.  After a while, the game will suddenly drop in framerate and everything visual becomes choppy, including the cursor.  It is still possible to save and exit the game, but at 1 or 0.25 frames per second, it's pretty difficult.  We've implemented a temporary fix, which forces audio buffers to clear whenever a new scene is loaded, but there are a few places (with really large scenes) where it this issue still occurs.
"A wish changes nothing. A decision changes everything."

xelanoimis

All right, I got it!
A simple and efficient system!
And since the loading time is acceptable, there's no need for something different.

I wonder why I bother so much about how to share models, meshes, skeletons or materials... only to find out I can't, because of the different static lighting :)

Thanks again for the detailed answer.
And GOOD LUCK with your game!

Alex

Yonkey

Thanks for the interesting questions! 8)

The Torque engine was actually originally designed to be one world, with different scenes physically situated on that world.  In TSL, this would have been similar to putting all the scenes in one Isle into the same mission file.

When we did that, we encountered many of the things you mentioned.  The more scenes we added, the longer the initial load time, because we just kept adding more and more objects into memory, regardless of whether or not the user could see them. 

That was when we opted for loading and unloading scenes on-demand.  Yes, the scene loading time increased from instantaneous to 3-5 seconds, but the overall game performance improved because we weren't consuming up tons of memory.  Using up excess memory results in the framerate dropping, audio skipping, slow loading, or the game itself freezing or crashing.
"A wish changes nothing. A decision changes everything."

atec123

I'm a bit off topic with this post, but I have a question, what version of Torque are you using, if you know C++, how long does it take to master, and how much does it cost?  I may want to use it for my KQ8 game as one of my programmers (_ward) knows decent C++.  Otherwise, we'd probably use python in the Blender Game Engine.
Official maintainer of TSL in linux via Wine. TSL AppDB page
Maintainer of TSL in OSX via Wine
TSL IRC Chatroom Maintainer
We are the Defenders of Jazz Ballet
People say, when they see us:
Hey, folks! It's the Saviours of Jazz Ballet
Fearless heroes of kick and spin

Yonkey

That's more than one question. :P

We're using Torque Game Engine, but now they only have TGEA (the A standing for Advanced).  If you know C++, it won't take very long to get used to Torque.  It's more just a matter of understanding the overall flow.  Plus, there's the whole client/server aspect (since it's meant for multiplayer first person shooters, as opposed to adventure games).  The cost is $295, but I think it was half that back when we got it 5 years ago.
"A wish changes nothing. A decision changes everything."

atec123

Thanks.  Yeah, didn't realize, I was gonna ask one question, but I had more as I was typing, so it came out funny :P  I might consider Torque, though that's a damn lot of $$$ the way I see it, as Blander, and Crystal Space are free.  IDK, anyway, thanks.
Official maintainer of TSL in linux via Wine. TSL AppDB page
Maintainer of TSL in OSX via Wine
TSL IRC Chatroom Maintainer
We are the Defenders of Jazz Ballet
People say, when they see us:
Hey, folks! It's the Saviours of Jazz Ballet
Fearless heroes of kick and spin