Game Development Community

dev|Pro Game Development Curriculum

My Cg Update and Random Musings

by Pisal Setthawong · 08/06/2006 (11:47 pm) · 9 comments

During the last few weeks/months (lost track of time since the last blog), I was kind of busy in a myriad of projects that is practically taking up all 7 days of the week. Working that hard isn't a good thing, but considering I'm putting my hands on practically too many projects, there isn't much to complain about. When all of it ends, and I there is a lot to look forward to.

Anyway other than that I just wanted to update a few things that I've been up through between all this time First of all my Cg musing with TGE is going along well. I initially started out due to a customer musing about the look of the game, so they wanted a visual upgrade, in which I implemented Cg to do some postimage processing which I started out with Glow. During that time I had the chance to talk with Paul Jan another developer who has started his own Cg project approximately on the same time, and on a sidenote he has a resource on CG Dynamic Gamma & WaterUpgrade at www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10830. I think many peeps would be interested on that project.

Anyway on my side, I went on to work more on creating a small framework for making image filters in Cg for TGE. I planned to make it to have dynamic loading and unloading of cgprograms that will create a filter effect on the postprocessing side, much similar to the photoshop filter idea.

When meeting with my customer the last time, there was a discussion with the Hell Expert who wanted Hell to look extremely dark, which I and my art director didn't agree. I do agree Hell should be dark, but as the game was marketed for younger players, I didn't agree with that. As not to waste too much time asking the artist to rework with all the texture arts in the game again, I decided to quickly write up a new cg program that basically darkens certain shades of color. The results are below :


img206.imageshack.us/img206/3375/withoutin8.th.jpg
img210.imageshack.us/img210/7607/withrs5.th.jpg
As noted it turned out the Hell Expert hated it, and we managed to stick with our own interpretations :P

Anyway during this time, as the game is getting closer to the beta stage, I decided to stop for a moment and focus on bug fixes and slight optimizations in code which is taking most of my time at the present. On a short note, I remember I tried to submit the resource of Cg postprocessing filter, but somehow it disappeared. I have a hunch I must have submitted it improperly O_o

In other related ramblings, there are a few things which I've wondered upon on a long while:

1) Why not six degrees of free in the Free Camera mode of the World Editor?

I was talking with an friend who was an architecture/3D artist who asked me when he saw the World Editor why was it so difficult to use. I know that the side, front, top view is better suited for people with background in this field, somehow after a series of discussions, one of the things that slipped out was, why didn't the camera in the free camera mode was offered 6 degrees of freedom? In 3D systems in the preview mode, the camera was supposed to move left/right forward/back and up/down. Strangely enough, there was no up and down, it couldn't move in relative to the height (z axis in TGE or y axis in the typical coordinate system). Hmm... No answers, so I just simply editted the creator/editor/editor.bind.cs and added the following:
//Add binding for moving in 6 degrees of freedom in editing mode
EditorMap.bindCmd(keyboard, "q", "moveup(1);","moveup(0);");
EditorMap.bindCmd(keyboard, "z", "movedown(1);","movedown(0);");
WorldEditorMap.bind(keyboard, "q", "moveup(1);","moveup(0);");
WorldEditorMap.bind(keyboard, "z", "movedown(1);","movedown(0);");
TerrainEditorMap.bind(keyboard, "q", "moveup(1);","moveup(0);");
TerrainEditorMap.bind(keyboard, "z", "movedown(1);","movedown(0);");
AIEditorMap.bind(keyboard, "q", "moveup(1);","moveup(0);");
AIEditorMap.bind(keyboard, "z", "movedown(1);","movedown(0);");

Since a normal character can't move up or down in my game, there is no need to check if the view mode was the free camera mode. Hmm... Now that is easier to use the World Editor. I wondered why I never thought of that before?

2) Scripting Languages that doesn't require the programmer to declare variables can potentially cause Bugs that are Hard to Detect

During my programming, I was quite alarmed to see that there was a huge lag at certain parts of the game which was happening on periodic occurrence. After trying to optimize many parts of the game, the lag was managable, but it spiked again after adding a few features. So after some miss and near hits for a long period, I later found out after debugging and going through the trace of the program that it was caused due to a stupid mistake, which was like this:

function doSomething(%this)
{
cancel( %tihs.lSchedule );
}

If you noticed, the cancel function is used on %tihs instead of %this which in turn doesn't cancel the scheduled event and continues to operate as there is another function that repeats the schedule over and over again. After a while, it turns out to cause numerous lags in the game even though supposedly the logic is correct. As noted, a good lesson learnt on having to make sure that I double check if I use existing variables with the correct identifier or not. If not, it can potentially cause huge problems in the longer run.

3) Unicode works fabulously, but is there more documentation on I18 ?

I've been testing TGE with unicode extensively during the last few weeks regarding tools and utilities. At the end of the day, I found TGE has good Unicode support and can work seamlessly with Thai characters. I've tested also changing the fonts by editing the font image dumps to create altered fonts which works perfectly! I have to say, its really nifty :)

Anyway on a side note, I haven't found much info on using I18 on the scripting side. There was a number of references there on using that as the language tables, but I ended up working making my own workaround with my own language table - which is like reinventing the wheel. On a slight note, I was wondering if there was more examples on I18? Hard to find incentive when there is a solution on place, but I am tempted to explore it sometime in the future when there is more free time starting on exploring the core engine scripting interface on that part.

Oh well, that is just a little that crossed through my head the last few weeks.

About the author

An Educator moonlighting as the Technical Lead at the indie game development studio called Flying Pig Game Studio


#1
08/07/2006 (1:16 am)
There is a whole load of script stuff for I18N that got overlooked when 1.4 shipped. I sent the old stuff to Beffy who updated it for 1.4 and sent the whole lot off to GG, so it should get into 1.4.2.
#2
08/07/2006 (1:37 am)
Thanks for the heads up on the I18N. I'll wait for the 1.4.2 release :)
#3
08/07/2006 (3:51 am)
Forget about your hell expert, the first sshot is much more interesting than the dark one. :)
#4
08/07/2006 (4:44 am)
When did you submit this resource? perhaps it just hasn't show up yet. Nothing "new" has shown up in weeks. They have to be manually added. Does this resource show up in your account menu?
#5
08/07/2006 (6:24 am)
In Torque, there is a variable (can be set in prefs.cs):
$Con::warnUndefinedVariables = true;
this will tell engine to make warnings about every single var that is not defined in scripts.
#6
08/07/2006 (9:08 am)
Like the dark one, feel more 3d or deeper than the bright one,
it makes viewer wants to look for more details in the 3rd dimension.
The bright looks good, but more like a 2d picture, too much
"light", sees everything.
#7
08/07/2006 (10:46 am)
@bank
Thanks for the tip! TGE is simply quite so large to figure all at once. Learning a new thing a day is indeed a blessing :)

@Ramen-sama
I've submitted the resource it quite a while ago (~1-2 weeks ago). It was a long post, and the page said it was successful sent, but I didn't see the resource in my account page. I'm assuming it is lost, and I have to retype everything again. Just needed to find the time to get that done sometime in the future.

@Xu
Thanks for the comments.
#8
08/07/2006 (10:52 am)
Hi my friends....

I just to see your topic....
#9
08/07/2006 (9:35 pm)
I prefer the darker one too. Kinda feeling when you are alone in the dark.

:) Good luck with your game

Aun