Game Development Community

dev|Pro Game Development Curriculum

Mini Tutorial Community Contest #6

by Geoff Beckstrom · 03/06/2012 (8:55 am) · 51 comments

Okay everybody. With GDC on tap for the week I thought we would take a break from game design and have a mini tutorial writing contest.

The job: select 1 topic from either T2D or T3D, it could be an editor, it could be a single task - the topic is in your hands. Write a short mini tutorial and present it as a comment to this blog.

The tutorial may be written AND/OR video presented. You will have until the end of community power hour to present your tutorial and the winner will be determined by the end of the work day Friday.

Best tutorial will receive $129 in first party store credit. Lets get learning!

Game on!
Page «Previous 1 2 3 Last »
#1
03/06/2012 (12:19 pm)
1. Get Torque
2. Make Game
3. ?????????
4. Profit!

;)
#2
03/06/2012 (2:57 pm)
I've got so many ideas for this. Can we do multiple submissions?
#3
03/06/2012 (3:35 pm)
@Shaolin Dave - One submission per person please. But if you have a number of tutorial ideas please email me and we can talk!
#4
03/06/2012 (4:29 pm)
might just have to re do and update the geocontrol to torque terrain one I had.
#5
03/06/2012 (5:43 pm)
I should have waited until now, to post that "space scape" tutorial! ;o)

@Andy - geocontrol -> T3D would be great tutorial

So, we need to find a tutorial that hasn't been done (re-done) in last couple years, right ?

#6
03/06/2012 (8:07 pm)
When you say short mini tutorial, is there a word (or time if video) limit?
#7
03/07/2012 (8:42 am)
@Jeff - Obviously don't copy the work of someone else. But feel free to do your own take on a topic that has already been covered. We all have different learning and communication styles so I am not concerned about having multiple tutorials on a similar topic.

@Brian - No time or word limit for the contest. In general a mini-tutorial probably shouldn't go longer than 5 minutes in order to keep your audiences attention.
#8
03/07/2012 (9:28 am)
Can we to use a custom tool but that is developed with Torque and for Torque for this contest?
#9
03/07/2012 (9:29 am)
@Jean-louis - Yes
#10
03/07/2012 (11:58 am)
Here is my tutorial for importing objects from Blender 3D 2.6.x to T3D. It is about 30 minutes and is a 200MB wmv. I tried reducing size so I could put it on Youtube, but the quality loss was unacceptable. I used Microsoft Live Moviemaker and am not that great a video maker.

Blender Tutorial

Here is the text of what I tried to cover:

Exporting to T3D Using Blender 3D 2.6.1:

  1. Exporting is simple, but with a few caveats.
  2. ---Some constraints must be disabled prior to export.
    ---Only one animation thread can be exported.
    ---Animations cannot be exported by themselves.
  3. Blender has very good support for Collada and is continuing to be improved.
  4. Blender has features that make it great for developing all aspects of a model including the texture.
  5. T3D has great tools for using models and animations created in Collada.
  6. ---Textures must be assigned for UV maps, color maps, etc.
    ---Animations are divided up into separate animations using thread/sequence tools.
    ---There are post import tools available that allow a bone structure to be tweaked or fixed.
    ---Model config files are updated when changes are made in T3D.

Notes on the tutorial:

  1. There are assumptions that you are knowledgeable of Blender 3D and T3D to some level.
  2. When I go to "bake" an animation I use the "space" bar to bring up the dialog to search for "Bake Action".
  3. This video was put together in a few hours so don't expect high production value. I did divide up the video so as not to have a bunch of "dead air".

Edit:
I failed to mention a problem I ran into when exporting from Blender to Collada to T3D. If I select all the bones in my model and do a back it creates a very large file. Instead of 100K it produces a 2MB collada file. T3D will not read this file for some reason. I don't know why. It just dies on this file. So try to bake as few bones as possible when baking animations. Also, you don't actually have to bake animations if you are not using constraints like IK. From what I have learned I may be redoing my bone structure to use as few constraints as possible to avoid some of the baking issues I encountered.
#11
03/07/2012 (1:37 pm)
Cool stuff Mr. Carney! :)
Have you considered making a new "Orange Guy" stick figure?
Goes into nostalgia mode at the thought of Orange Guy...
#12
03/07/2012 (3:13 pm)
Creating a preview image and info for your new T3D level:



I could really use a weekend for these sort of contests. Weekdays are a bit busy.
#13
03/07/2012 (4:51 pm)
Cute voice by a big guy BigDaz. ;)
#14
03/08/2012 (9:58 am)
@BigDaz,
Great tutorial! I like the overlay bars for providing information to your the viewer. I also like the computer voice. I noticed I mumble some times so I have to do retakes. Using a generated voice would help with those kinds of issues.
#15
03/08/2012 (10:57 am)
A randomized bombardment script for dropping artillery around the player. Perfect for those "storm the beaches" levels.

//-----------------------------------------------------------------------------
// 	Creating a randomized mortar/artillery barrage
//	for those exciting "storm the beaches" levels ... 
//	no "Ball of Fruity" clone would be complete without it!
//-----------------------------------------------------------------------------

//	FIRST UP, CREATE A NEW CS FILE IN SCRIPTS/SERVER FOLDER AND CALL IT
//	bombardment.cs

//We only want the bombs to fall within a 100 unit radius of the player
//because the player may not see them if they are further away
//and then you're just wasting resources

function prepareBombardment()
{
	//find the playerObject via the client
	//we're only doing singleplayer here so we can only have 1 client
	//pick the first client
	%client = ClientGroup.getObject(0);
	
	//get the client's controlObject - hopefully the player, if not then the camera
	%player = %client.getControlObject();
	
	//and the playerObject's location
	%pos = %player.getPosition();
	
	startBombardment(%pos);
}

function startBombardment(%centre)
{
	//we start with an XYZ
	%centreX = firstWord(%centre);
	%centreY = getWord(%centre, 1);
	
	echo(%centre);
	echo(%centreX);
	echo(%centreY);
	
	//and extrapolate our max and min coordinates
	%minX = %centreX - 100;
	%maxX = %centreX + 100;
	
	echo(%minX);
	echo(%maxX);
	
	%minY = %centreY - 100;
	%maxY = %centreY + 100;
	
	echo(%maxY);
	echo(%minY);
	
	%x = getRandom(%minX, %maxX);
	%y = getRandom(%minY, %maxY);
	//z will always be high above the terrain
	//1024 should be enough to make sure it clears
	//dependant on the actual xyz of the terrain and also it's highest point
	%z = 1024;
	echo(%x SPC %y SPC %z);
	%target = %x SPC %y SPC %z;
	echo(%target);
	completeBombardment(%target);
	
	%random = getRandom(500, 3000);
	//and random pause before going back to prepareBombardment
	//incase player is dead and we need a new controlObject to target
	schedule(%random, 0, "prepareBombardment");
}

function completeBombardment(%start)
{
	echo(%start);
	//look down and find something below up to 1500 units
	//you can probably get away with less but just to be sure
	%end = vectorSub(%start, "0 0 1500");
	//what we want to hit
	%mask = $TypeMasks::TerrainObjectType | $TypeMasks::StaticObjectType;
	
 //  debugdraw.togglefreeze();
 // debugdraw.drawline(%start, %end, "0 0 1");
	
	%hit = ContainerRayCast(%start, %end, %mask);
	if(%hit == 0)
	{
		echo("c2error: LINE OF SIGHT FOR BOMBARDMENT MISSED!");
		//ignore and bail!
		return;
	}
   
	//get the XYZ of the impact
	%xyz = getWords(%hit, 1, 3);

    //and spawn the stock grenadelauncher explosion
    %blast = new explosion()
	{
		dataBlock = "GrenadeLauncherExplosion";
		position = %xyz;
	};
	MissionCleanup.add(%blast);
	
	//and roll for damage!
	radiusDamage(0, %xyz, 10, 25, "blastDamage", 2000);

	//and finally, slap on the stock decal at the impact site
	%decalObj = decalManagerAddDecal(%xyz, "0.0 0.0 1.0", 0, 1, "ScorchRXDecal", false);
}

/*
	We want to start this all up when the client has actually arrived in the game
	So open up scripts/server/gameDM.cs <--- because deathMatch is the stock default gametype
	And find onClientEnterGame and add:
	
	[start]
	//...
	function DeathMatchGame::onClientEnterGame(%game, %client)
	{
		//echo (%game @"c4 -> "@ %game.class @" -> DeathMatchGame::onClientEnterGame");
		
		schedule(3000, %client, "prepareBombardment");//yorks new!
	
		parent::onClientEnterGame(%game, %client);
	}
	//...
	[/end]
	
	And lastly, we need to exec our new file
	Open up scripts/server/scriptExec.cs
	And right at the bottom add:
	
	[start]
	//...
	// Load our gametypes
	exec("./gameCore.cs"); // This is the 'core' of the gametype functionality.
	exec("./gameDM.cs"); // Overrides GameCore with DeathMatch functionality.

	exec("./bombardment.cs"); // yorks new, right at the end
	[/end]
	


*/


Also added to the resources section
#16
03/08/2012 (12:35 pm)
@Steve,
Nice, this is cool!
#17
03/08/2012 (12:58 pm)
@Steve,
Do you have a screenshot of the "Orange Guy"? I remember the "Blue Guy", but not the "Orange Guy". That may be a good tutorial/exercise for making a model for people to use for learning, testing, and building from.
#18
03/08/2012 (1:28 pm)
@Frank, it was just the blue guy as a Blend file ... but orange for Blender colours. If I remember correctly it had to have it's animations as Blue Guy/Torque Orc/"Fluffy" wasn't compatible in stock.

Quote:
I also like the computer voice. I noticed I mumble some times so I have to do retakes.
Are there devs who don't constantly mumble with their non-mouse hand in front of their face whilst chewing on the fingers? ;)
#19
03/08/2012 (7:15 pm)
Sorry Steve.... Tutorial or Resource? ... i think is different O_o

Resource = Copy and Paste
Tutorial = Explain What and Why
#20
03/08/2012 (7:25 pm)
This forum post:
http://www.garagegames.com/community/forums/viewthread/129962
wanted to know how to use a dynamic cube map with T3D so here is a tutorial on shooting a large ball with a dynamic cube map.

Heres what it looks like:

The first thing we need to set up is a ReflectorDesc dataBlock
This should so somewhere in your art/datablocks folder
datablock ReflectorDesc( TestCubeDesc )
{   
   cubeFaceSize = 256;
   nearDist = 0.5;
   farDist = 2000.0;
   objectTypeMask = 0xFFFFFFFF;   
};

Next we need to setup the dataBlock for the actual object that will use the dynamic cube map. In this example I am creating a RidgedShape, but it could be anything like a player or staticShape.
datablock RigidShapeData(ShinySphere)
{
   category = "Test";
   shapeFile = "art/shapes/rocks/boulder.dts";
   cubeReflectorDesc = TestCubeDesc;
};
This dataBlock is just like a normal datablock with one extra line.
The cubeReflectorDesc needs to point at your ReflectorDesc datablock we created first.

The material that your shape uses also needs to be modified with one extra line.
singleton Material(DefaultMaterial)
{
   mapTo = "MossyRock02";
   diffuseMap[0] = "rock2";
   
   dynamicCubemap = true;
}
dynamicCubeMap = true; enables the dynamic cubemapping for this material.

If you draw this object in the world it should now have a dynamic cube map generated.


To make our weapon shoot these rigidShapes we need to create a new OnFire function for our weapon.

There is a function called WeaponImage::OnFire that is currently used by most weapons in a new project.

We can make a more specific OnFire function that only the Lurker weapon (the starting rifle in a new project) will use.

function LurkerWeaponImage::OnFire(%this, %obj, %slot)
{
   %id = new rigidShape()
   {
     datablock = ShinySphere; 
   };
   
   %direction = %obj.getEyeVector();
   %pos = %obj.getEyePoint();
   %direction = vectorScale(%direction, 3);
   %pos = vectorAdd(%pos, %direction);
   %id.setTransform(%pos);
   
   %direction = vectorScale(%direction, 10);
   %id.applyImpulse(%pos, %direction);
   %id.schedule(10000, "removeMe");
}
This function creates a new rigidShape using our ShinySphere datablock.
It then find a position 3 meters infront of the players eye point, along the direction that the player is looking.

It then applies a force to push this rigidShape in the same direction.
The amount (or the speed) that is applied can be changed by changing the "10" in this line:
%direction = vectorScale(%direction, 10);
Page «Previous 1 2 3 Last »