Game Development Community

Billboard Clouds

by BJNelson · in Torque Game Engine · 09/28/2004 (4:51 pm) · 4 replies

Ok, a simple question (I hope!).

I've searched the forums for already and couldn't find a definite answer, oh and the search feature is terrible :p

What I want to do is have large floating clouds, at a reasonable distance up in the sky. Nothing fancy, just flat billboards with big fluffy cloud textures that turn around to face you.

What's the easiest/best way to achieve this?

Thanks,
Matt

#1
09/28/2004 (7:13 pm)
Another question ... what would be the best datablock to use for wandering non-interactive npcs? For instance, a small crab that wanders around, either on waypoints, in a boundry or randomly ...

ATM I'm using the AiPlayer file with a different model and a bit of code creating particle emitters and playing an animation when it reaches each waypoint. This works but there is a lot of stuff that is uneeded that comes with the player datablock. Especially things like the healthbar overlay etc ...

Thanks.
Matt
#2
10/01/2004 (1:09 pm)
For both the clouds and the crabs, you should look at the fxShapeReplicator and the fxFoliage code and see how it works. It's usefull for drawing objects on client-side, with less overhead. You can also render tons of objects in a batch (like crabs, birdies and other harmless stuff), so performance will be better than having each one of those as an independet entity. You'll need to add a little code to animate the objects, of course.
#3
10/01/2004 (1:29 pm)
For wandering npcs, you can make your own datablock. ( Thx Gonzo! )


datablock PlayerData(crab) {...}

And delete the stuff u don't want.

When you spawn a crab, you can overwrite settings and give the crabs some variation...

datablock PlayerData(Crab1 : Crab)
{
horizMaxSpeed = 50;
};

datablock PlayerData(Crab2 : Crab)
{
horizMaxSpeed = 75;
};

function AIPlayer::spawn(%name,%spawnPoint){

if($NextAiPlayer == 1)
{
%player = new AiPlayer(npcCrab1)
{
dataBlock = crab1;
scale = "1 1 1";
path = "";
};
}
else {
%player = new AiPlayer(npcCrab2)
{
dataBlock = crab2;
scale = "1 1 1";
path = "";
};
}
MissionCleanup.add(%player);
$NextAiPlayer++;

%player.setShapeName(%name);
%player.setTransform(%spawnPoint);
return %player;

}


To move them around use a path or
npcCrab1.setMoveDestination(%lx SPC %ly SPC %lz);
#4
10/01/2004 (1:33 pm)
For wandering npcs, you can make your own datablock. ( Thx Gonzo! )


datablock PlayerData(crab) {...}

And delete the stuff u don't want.

When you spawn a crab, you can overwrite settings and give the crabs some variation...

datablock PlayerData(Crab1 : Crab)
{
horizMaxSpeed = 50;
};

datablock PlayerData(Crab2 : Crab)
{
horizMaxSpeed = 75;
};

function AIPlayer::spawn(%name,%spawnPoint){

if($NextAiPlayer == 1)
{
%player = new AiPlayer(npcCrab1)
{
dataBlock = crab1;
scale = "1 1 1";
path = "";
};
}
else {
%player = new AiPlayer(npcCrab2)
{
dataBlock = crab2;
scale = "1 1 1";
path = "";
};
}
MissionCleanup.add(%player);
$NextAiPlayer++;

%player.setShapeName(%name);
%player.setTransform(%spawnPoint);
return %player;

}


To move them around use a path or
npcCrab1.setMoveDestination(%lx SPC %ly SPC %lz);