Game Development Community

Decals and Entities?

by Shane McLeod · in Artist Corner · 08/07/2002 (12:14 pm) · 19 replies

Is it at all possible to use decals in Torque? Such as blood smears on walls, torch smoke stains, etc.

I understand that they are not entities, but it seems like a pretty standard thing among engines today.

While I'm at it, how does one go about adding an entity? I mean creating a completely new entity to be used in Quark/Torque.

#1
08/07/2002 (12:25 pm)
decals? yes sure.. and their easy to do too... look in the code snippits for some examples (there's a search thingy on top of the site)
[edit]
here you go:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2707
[/edit]
and a new entity? like a new sort of light or something? Or a door? You'll have to tough the engine source for that (wich makes sense ;) )
#2
08/07/2002 (12:36 pm)
Woohoo, thanks Ward. Actually I did use the search function at the top, just didn't search resources. Searched forums. Lesson learned ;)

Perhaps there isn't a need for new entities. On the game I'm working on, I'm doing artsy stuff (aka programmer art) and another team member is doing the coding. But, I'm a programmer at heart so I may just buy the engine also. Hence the entity question.
#3
09/02/2002 (12:49 pm)
Let say I just wanted to stick a decal at a static location. Like some graffiti on a wall that is there when the game starts up and never leaves or moves. Can I add this decal using scripts or will I need to change code? Is the a tutorial for doing this?
#4
09/02/2002 (1:07 pm)
Hm, if it shouldn't move at all or anything, why not use a texture?
#5
09/02/2002 (1:26 pm)
Using decals allows you to "spice up" existing textures with stuff like scratches, cracks, graffiti, etc.

Right now, there's no way to place static decals but I'm sure it wouldn't take too much work.
#6
09/02/2002 (3:33 pm)
I guess I don't understand. If there is no way to do it, how can it not be too much work?
#7
09/02/2002 (4:02 pm)
You program it.
#8
09/04/2002 (2:21 am)
@matt: rotfl!
@byph: if you program it it isn't too much work ... for matt webster ! ;P
#9
09/07/2002 (8:09 am)
Well, I looked into the decal thing and I agree with Matt. It can't be done. But, I must disagree that it could be done pretty easily. I think it would take weeks to code it, even if done by the Torque developers.
#10
09/07/2002 (8:21 am)
Why should that take weeks?? There is already a decal manager, you'd just have to use it and maybe extend it a bit... I'd say it's a matter of hours if you know the engine... maybe a day or two, but weeks for some decals??
#11
09/07/2002 (9:30 am)
Footsteps are decals and are working in RW.

The more challenging part might be in figuring out a good way to paint/place decals.
#12
09/07/2002 (11:00 am)
I guess we just have our different estimates of how long it would take. I kind of think, however, that if it were just a couple hour thing, someone would have done it by now.
#13
09/07/2002 (2:14 pm)
Everything can seem difficult in the engine if you think it is. Just dive in where you think would be the best place to start, and scrounge around until you think you're onto something. The best help is when you help yourself. You might not get a working end-product, but you will be able to provide some guidance and suggestions for when this feature becomes top priority for one of the community's generous programmers.
Considering the editor I use (Hammer) has integrated decal "placer", it might be worthwhile to start there.

Personally, I've never looked at the format of a decal in the .map format. My suggestions on where to start:

1. Create a simple map in Worldcraft and place a decal with the editor.
2. Examine the resulting .map file, namely the portion containing the decal instance.
3. Compare this to other entities (brush and point) to figure out which it is most like (I'm assuming point, since I'd think it's an image path, position value, and direction vector)

I could go on, but it'd be based on my own predictions. If you take the first couple of steps I'm sure someone else might be willing to help with the rest.

Good luck, and never say something is too difficult.

That's too easy.
#14
09/07/2002 (3:26 pm)
{
"classname" "infodecal"
"texture" "DS_SCREEN"
"origin" "-81 -235 -33"
}

Map2dif won't process it, however.

Good call on using Hammer, Matt. I had forgotten all about decals there.
#15
09/07/2002 (6:01 pm)
Man, it can't be that hard.

It's not like you have to program a new FEATURE into the engine. The engine already creates decals when you shoot stuff, for instance. However, they currently fade after a certain amount of time; you can't place them manually in the Torque editor, etc. Probably the easiest workaround would be to make a new object type for your static decals that is a model/billboard (two poly square) that accepts a texture (including alpha textures). No collision detection. Then you just place it like you would a tree, rock or anything else.

I know it could be tough to integrate it into Worldcraft, etc. No idea on that; never looked at the file format for that stuff.
#16
09/07/2002 (6:24 pm)
Make a new "splat" object.

Copy out the code that calculates the decal position.

Make it render the same, only permanently.

Make a function that casts a ray, works out the splat position/orientation and creates the splat there.

The splat simply renders itself.

voila.. working splat.

then just make a new Splat in world editor.. call your "splataligndecal" function and boink.. its permanent.

Save mission..

Or something similar.

Phil.

PS: the reason why someone hasnt done it before? because they dont need it. Or couldnt be bothered, or would rather someone else do it, or arent capable.
#17
09/08/2002 (6:10 am)
All definately good info. I understand that modification would need to be made to the engine itself.

However, my question was pertaining to how Quark defines entities. How would one go about getting an entity (insert entity here) into Quark for Torque, ie decals?

What are the differences between the way other engines Quark supports and the way Torque exposes "features" as entities? When looking at the entity lists for other Quark supported engines, I found some that would be really cool to have in Quark for Torque, hence the question.
#18
09/08/2002 (6:19 am)
Madcap, see Phil's P.S. ;-) j/k

To answer the how-to, I think someone had done some work on implementing a door entity. Badguy did it. It somewhat goes through the implementation.
An .fgd file which defines unique items such as entities can be later imported into QuArK.
#19
09/08/2002 (8:31 am)
Thanks Eric, that is precisely what I was looking for.