Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

So how does your tile system work?

Human Shield

Augur
Joined
Sep 7, 2003
Messages
2,027
Location
VA, USA
I want a lot of details about how your tile movement system works and how it matches the 3D map. What code is used? Can you assign tile properties?

Did you have to also code turn-based mode from stratch? Is enemey AI new?
 

Nick

Iron Tower Studio
Developer
Joined
Apr 21, 2004
Messages
317
Location
Over the hills and far away
Human Shield said:
I want a lot of details about how your tile movement system works and how it matches the 3D map.
Well, the map is multi-leveled, so it's possible to go to the second (third, etc) floor without any reloads. A* algorithm is used for pathfinding.
XY plane on every "floor" is divided into squares (1 sq. meter each). Z coordinate is stored in a height-map, so there can be higher and lower areas on each map level.
Is that what you wanted to know?

What code is used?
I wrote the code myself because Torque doesn't have anything that works with tile-based maps and advanced pathfinding. The "waypoints" system that Torque comes with is useless if you are using tiles.

Can you assign tile properties?
Absolutely. That's how it works.

Did you have to also code turn-based mode from stratch?
Yep. There is no such thing as "generic turn-based code" at all. It's very game- and engine-specific.

Is enemey AI new?
I designed and wrote the AI myself, so yes, it's new.

It may not be Radiant, but my aim was to make it challenging in combat and simply smart enough in non-combat time. I had to make sure that opponents use all the advantages of their equipment, from the infamous greek fire to nets. Also, one of Torque's strongest sides is scripting. I used it to implement behaviour schemes. A behaviour scheme is nothing more than a script, but it adds varieties to combat - you'll be able see the difference between assassin's and common folk's combat style, even if they'll have the identical equipment. Don't get me wrong, it's not a profession-based script system; a scheme is assigned to every character individually. That should make battles really interesting - just imagine that someone starts using combat tricks that you didn't see before and didn't expect to be used against you. That can make you think twice if it's worth to continue fighting, maybe it's a good time to step back and talk to your enemy.
 

Human Shield

Augur
Joined
Sep 7, 2003
Messages
2,027
Location
VA, USA
Thanks for the reply.

Flashback said:
Human Shield said:
I want a lot of details about how your tile movement system works and how it matches the 3D map.
Well, the map is multi-leveled, so it's possible to go to the second (third, etc) floor without any reloads. A* algorithm is used for pathfinding.
XY plane on every "floor" is divided into squares (1 sq. meter each). Z coordinate is stored in a height-map, so there can be higher and lower areas on each map level.
Is that what you wanted to know?

So who does the map creation? They aligned all the buildings to match the tiles? Are the walls on the tile edges or a tile themselves?

How do stairs work with the tiles?

What are the squares? Is it just code for people standing with a virtual array or are their hovering tiles above the ground that can be highlighted?

I wrote the code myself because Torque doesn't have anything that works with tile-based maps and advanced pathfinding. The "waypoints" system that Torque comes with is useless if you are using tiles.

Is it in Torque script or can it be done in C++?

Can you assign tile properties?
Absolutely. That's how it works.

So do you have to assign walls in the tile properties or does it work around walls itself? Do you have to code the map layout in XY tiles cooridinates as well as creating a 3D map? Do you have to assign tiles as unpassable by hand, like water and such?

Yep. There is no such thing as "generic turn-based code" at all. It's very game- and engine-specific.

How much of the RTS starter kit did you use?

Do you think Torque handles it well? You haven't updated to 1.4 yet? If you could go back would you use a different engine?

I need some kind of framework for a tile-based turn-based engine, could I see the source code? I mite be able to modifiy it to be more generic and work with other engines or it mite convince me buy Torque.
 

Nick

Iron Tower Studio
Developer
Joined
Apr 21, 2004
Messages
317
Location
Over the hills and far away
Human Shield said:
So who does the map creation? They aligned all the buildings to match the tiles?
First, the modeller creates buildings and units, and makes sure that all the doors/walls/windows match the grid. Then VD and I do the level design.

Are the walls on the tile edges or a tile themselves?
On tiles.

How do stairs work with the tiles?
The heightmap thingy was created exactly for such things as stairs, hills, etc.
I.e. the first tile is on a height of 0cm, for example. The next is on 10cm. When a character moves from the first tile to second, his height is interpolated.

What are the squares? Is it just code for people standing with a virtual array or are their hovering tiles above the ground that can be highlighted?
Both. Each tile consists of both "virtual" part, i.e. array, and a visual representation (at this point it's a grid drawn by OpenGL).

Is it in Torque script or can it be done in C++?
C++, of course. TorqueScript is too slow to be used in pathfinding anyway.

So do you have to assign walls in the tile properties...
No, walls are a part of a 3D object sitting on some tiles. Assigning world objects to tiles was a common practice in 2D engines, but it's not very convenient in Torgue.

Do you have to code the map layout in XY tiles cooridinates as well as creating a 3D map?
No, there is a WYSIWYG 3D editor that comes with TGE, and I have tied most of XY stuff to it.

Do you have to assign tiles as unpassable by hand, like water and such?
No, I wrote a routine that scans the map and determines whether the tile is passable or not.

How much of the RTS starter kit did you use?
Used it mostly for learing how TGE works, the only thing from RTSKit that I'm using is RTSCamera, but I'm going to tweak it a lot anyway.

Do you think Torque handles it well? You haven't updated to 1.4 yet? If you could go back would you use a different engine?
Yes. No. No.
Do I sound like VD? :)

I need some kind of framework for a tile-based turn-based engine, could I see the source code? I mite be able to modifiy it to be more generic and work with other engines or it mite convince me buy Torque.
I'll be able to share some code with you after the game is released.
 

Human Shield

Augur
Joined
Sep 7, 2003
Messages
2,027
Location
VA, USA
Flashback said:
Are the walls on the tile edges or a tile themselves?
On tiles.

So that would make doorways their own lone tile. Are windows being used or moving through windows possible?

How do stairs work with the tiles?
The heightmap thingy was created exactly for such things as stairs, hills, etc.
I.e. the first tile is on a height of 0cm, for example. The next is on 10cm. When a character moves from the first tile to second, his height is interpolated.

So is each stair a 1 ft square? Does it look bulky? The visual grid follows stairs upward.

Both. Each tile consists of both "virtual" part, i.e. array, and a visual representation (at this point it's a grid drawn by OpenGL).

So its an OpenGL technique? It takes in mouse over and selection? So its not possible with DirectX? Does Torque natively accept OpenGL abilities?

Do you have to assign tiles as unpassable by hand, like water and such?
No, I wrote a routine that scans the map and determines whether the tile is passable or not.

Do you have to assign tile properties by hand then? Like if you wanted every tree to be usable with an axe, or if you wanted water tiles to have certain effects?

Is each tile a class or struct that holds data that is referenced in an array?

Do you think Torque handles it well? You haven't updated to 1.4 yet? If you could go back would you use a different engine?
Yes. No. No.
Do I sound like VD? :)

Could you explain why you think Torque is good if you could leave out that you already learned it?

I need some kind of framework for a tile-based turn-based engine, could I see the source code? I mite be able to modifiy it to be more generic and work with other engines or it mite convince me buy Torque.
I'll be able to share some code with you after the game is released.

Alright, could you point me to the OpenGL process and documentation you used?
 

Nick

Iron Tower Studio
Developer
Joined
Apr 21, 2004
Messages
317
Location
Over the hills and far away
Human Shield said:
Are windows being used or moving through windows possible?
It's possible, but no animation for this action is planned, so the action will be handled in a "text adventure" style, i.e. you click on a window and a dialogue box pops up presenting a brief description plus some options.

So is each stair a 1 ft square? Does it look bulky? The visual grid follows stairs upward.
No, there can be several stairs per square. But there should be a stair in the center of the square, to avoid stupid situations when character is hanging in the air.

So its an OpenGL technique?
So its not possible with DirectX?

Yes, it is, but *not exclusively* an OpenGL technique. I just use basic OpenGL routines to draw the grid - lines and filled rects - but I'm sure this could be done with DirectX too.
But I'm going to tweak the grid anyway - replace OpenGL squares with 3D shapes, which will allow us to apply more effects to the squares.

It takes in mouse over and selection?
No, it has nothing to do with mouse events. At least, not directly. With Torque, you get such events through more high-level API.

Does Torque natively accept OpenGL abilities?
It was originally built on OpenGL, that's why it works on many platforms. But there is a DirectX renderer for Windows available.

Do you have to assign tile properties by hand then? Like if you wanted every tree to be usable with an axe, or if you wanted water tiles to have certain effects?
No. Tree, for example, is a StaticShape. I can pass all needed flags and properties to it with datablocks (another Torque-specific feature). Or I can just derive my own class from StaticShape and make it react differently to incoming events. Properties are assigned to the object, not to the tiles.

Is each tile a class or struct that holds data that is referenced in an array?
Yes.

Could you explain why you think Torque is good if you could leave out that you already learned it?
1. It's well-supported (community, forums, resources, free updates, utilities);
2. It supports many features that most free engines don't: convenient graphical format, exporters, big variety of animation types, powerful scripting language.

Alright, could you point me to the OpenGL process and documentation you used?
There is a planty of such literature on the Internet, just google for it. You can also try http://www.opengl.org/documentation/. To be honest, I don't remember exactly what literature I have used, as it was years ago.
If you're planning to work with Torque, knowledge of OpenGL is recommended, but not necessary.
 

Vault Dweller

Commissar, Red Star Studio
Developer
Joined
Jan 7, 2003
Messages
28,035
Flashback said:
Could you explain why you think Torque is good if you could leave out that you already learned it?
1. It's well-supported (community, forums, resources, free updates, utilities);
2. It supports many features that most free engines don't: convenient graphical format, exporters, big variety of animation types, powerful scripting language.
3. GarageGames has its own marketplace and offers a decent exposure once your game is ready.
 

Araanor

Liturgist
Joined
Oct 24, 2002
Messages
829
Location
Sweden
C++, of course. TorqueScript is too slow to be used in pathfinding anyway.
Hah, I can testify to this. I adapted an A* pathfinder to Torquescript, it was sluggish as hell. Boy was that stupid - at least it wasn't my idea - but I should have known better.

Anyway, I'm happy to see Torque working so well for AoD. My experience with the engine was... less than optimal. Altough most of the problems back then were not Torque's fault, but they really should really make more and better documentation. Forum search was pretty unusable too. (Disclaimer: this was nearly two years ago.) I might consider it again if I ever need a game engine. You really do get a LOT for the amount of money, even if most of it is geared towards FPSs.
 

Human Shield

Augur
Joined
Sep 7, 2003
Messages
2,027
Location
VA, USA
Flashback said:
No, there can be several stairs per square. But there should be a stair in the center of the square, to avoid stupid situations when character is hanging in the air.

Yes, it is, but *not exclusively* an OpenGL technique. I just use basic OpenGL routines to draw the grid - lines and filled rects - but I'm sure this could be done with DirectX too.
But I'm going to tweak the grid anyway - replace OpenGL squares with 3D shapes, which will allow us to apply more effects to the squares.

It takes in mouse over and selection?
No, it has nothing to do with mouse events. At least, not directly. With Torque, you get such events through more high-level API.

So you are going to use a bunch of invisible 3D cubes hovering above the ground? How did you scan to set them up stairs or block trees, detect collision?

Is each tile a class or struct that holds data that is referenced in an array?
Yes.

So what data is held?

1. It's well-supported (community, forums, resources, free updates, utilities);
2. It supports many features that most free engines don't: convenient graphical format, exporters, big variety of animation types, powerful scripting language.

What can the scripting language do that is so great?
 

Nick

Iron Tower Studio
Developer
Joined
Apr 21, 2004
Messages
317
Location
Over the hills and far away
Human Shield said:
So you are going to use a bunch of invisible 3D cubes hovering above the ground? How did you scan to set them up stairs or block trees, detect collision?
Yep, it's a technique that uses collisions. I cast rays from the sky that collide with 3D objects. Repeat N times with different masks to gather all the data. This way I get various tile properties (passability, height, ...), set triggers, do pathfinding optimizations, etc.

So what data is held?
Hard to say, a lot of stuff. I would need 10 pages to describe all those awesome member fields :wink:

What can the scripting language do that is so great?
If you want to find out more about TorqueScript, you should check this:
http://www.garagegames.com/docs/tge/general/ch05.html

What I love it for, is that it's very C++ like language, keeps the properties of last including the OOP. You can make anything to be accessible from script - from standard datatypes to your own objects.
Also, I love generating variable names on the fly and referring to them, C++ doesn't allow that. Here is an example:
Code:
for (%i = 0; %i < $characters_count; %i++)
   ("character_" @ getProfession(%i) @ "_" @ %i).doSomething();

This will work like:
character_assassin_0.doSomething();
character_mercenary_1.doSomething();
...etc. Just an example.

And, of course, you don't have to recompile anything when you're using script. In theory, you could expose everything into console and don't touch the code at all :) But that would be a mod, not a game.
 

John Yossarian

Magister
Joined
May 8, 2006
Messages
1,000
Location
Pianosa
The script language does look nice (a lot better than the Fallout script). So when I get the game will it include the uncompiled version of the scripts you guys wrote (like the .ssl files from FO) or will we have to decompile them somehow? If its the first option, will we need TorqueScript to make any changes?
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom