Game Development Community

Trouble starting out, need some insight

by Rich Marinaccio · in Torque Game Builder · 08/09/2009 (2:46 pm) · 8 replies

I've made a couple of games with more traditional tools. Basically you do all your work in an IDE and if you want a sprite or some other graphic on your screen you blit it there.

I've tried the TGB demo several times over the last few years, and I just can't seem to get to a point where I feel that I could be in control of my project. The editor seems great if your game consists of sprites moving on a static background, but most of the games I make use procedural content. There's no way to know what the screen will look like until the game is running and deciding what to draw.

In my case, the editor seems more 'in the way' than helpful. What do I need the editor for? Can I get something out of TGB by doing all my work in Torsion or some IDE? After trying some of the tutorials, and reading some of the available books, I still feel like I'm completely blind to what TGB has to offer.

I guess the editor makes things easier for non-programmers, but for someone with some programming experience like myself, it's creating a psychological barrier. I know what kind of game I want to make and how to make it the old fashioned way, but I have no clue if TGB will make things easier or harder. I don't even know where to begin. How do I draw a sprite programatically? I have a TGE book that tries to explain datablocks, but I still don't get it.

I need a whole different set of tutorials. I think I have too many pre-conceived notions regarding graphics programming.

So anyway, I better get to the main question. I wanna make a turn based strategy game on a hex tile map. I've done this before using direct programming and did everything the hard way from scratch. Assuming that I will someday understand the reasoning behind TGB, can TGB help me do this? Or, is TGB only going to hinder me?

#1
08/09/2009 (9:52 pm)
From what it sounds like, you want to make a game where most of the art/levels are generated procedurally. With what I know from mucking around with TGB, this is most likely not possible artwise (I know of no way to modify individual sprites in any precision fashion using script). You will probably have to do some engine modification to get that functionality. How much, I really can't say. I haven't mucked around in that section of the engine code.

Anyways, I personally do most of my work in Torsion, but I do use the editor in order to layout my test areas and levels. Though some things involving the editor are so irritating that I modify the .t2d files by hand now sometimes.

As for datablocks. . .think of them as object templates. Essentially they're objects that hold a set of variables associated with a kind of object. So if I had a datablock that I wanted to be associated with a rock object, when I create the object I load that datablock into it. Also worth noting that datablocks are immutable.
#2
08/09/2009 (11:01 pm)
I've learned that it's fairly easy to create new objects derived off of T2D Scene Object as long as you know a little OpenGL. It allows you to create dynamically modified objects.

Also, I've written games completely in the editor and completely without the editor. Each has its own strengths. But almost every game has needed a custom object to get behavior to work exactly as I'd want it to work.
#3
08/10/2009 (6:34 am)
Actually, I can definately do this project with pregenerated building blocks. I don't have to actually access the pixel data. I would make a grass hex, and maybe have some trees or 'forest pieces' scattered around it. Then maybe a bunch of hexes with mountain graphics over them. Imagine a whole game world made of hex sprites, on a randomly generated map. I don't expect I'll need a super smooth framerate for this game, so maybe I can get away with a whole bunch of little sprites all over the screen?

I'm thinking that like Eric, I'll probably use the editor for mock ups and such to see how my graphics come together.

If I have to do some C++ work later on that's fine as long as I feel I'm making progress. Naturally I'm not sure where I would put it or what the program flow will be like, but I guess I will learn. Gah, there seems to be alot of torque specific stuff to learn! I hope it's worth it.
#4
08/10/2009 (10:30 am)
A whole bunch of little sprites/tiles all over the screen is how TGB works, anyway :)

The only difference is that you're doing hexagonal shapes, which isn't directly supported out of the box. I guess you're fully capable of making it work, though.
#5
08/10/2009 (2:16 pm)
The hex part is no biggie. Putting a sprite on screen programatically and then taking off screen... impossible! Well, at least currently.

Can anyone point me to a comprehensive torquescript reference? TS doesn't seem to be an object oriented language, and that means that you can pile on the global variables like a giant plate of spaghetti, and two weeks later you have no idea what you were thinking. Is there any guide for best torquescript programming practices? I'd like to organize my code as OO as possible, without creating a ton of overhead and getting myself into a jam due to lack of foresight.
#6
08/10/2009 (2:37 pm)
I disagree. I've made dozens of games where virtually all of the sprites were programatically added, manipulated, and deleted.

Also, it's very easy to create OO-like organization. Organize your code in ScriptObjects, and create inheritance with the superclass field.

The forums are filled with examples of dyanmic sprite creation and OO organization (including a resource that makes TS even more OO).

Later!
#7
08/10/2009 (4:21 pm)
Thanks William. I meant impossible for me... due to my lack of torque knowledge.
#8
08/10/2009 (4:36 pm)
Hehe! I see!

I assume you've seen www.garagegames.com/documentation/tgb and the TDN link from there. Tons of useful information about this stuff.