Scenes

From Data Realms Wiki

(Difference between revisions)
Jump to: navigation, search

Revision as of 04:25, 9 July 2010

The art of a scene consists of one material image, and up to three background images. The colours used in the material image are the colours specified by the material instances that you want to have in your scene, for example, if you wanted sand you would use the colour with the following RGB values, as they are the colour specified in the sand material instance in the Materials.ini:

	Color = Color
		R = 220
		G = 190
		B = 128

The background files should be obvious if you look in Base.rte and have actually played Cortex Command so I'll move onto the coding;

AddScene = Scene // The instance call, defines the next text as parts of a scene
	
	InstanceName = Grasslands // The name used to refer to the instance later.
	
	LocationOnPlanet = Vector // Unused. Possibly planned for the future campaign mode.
		X = 0
		Y = 0
	
	GlobalAcceleration = Vector //a.k.a gravity, measured in m/s^2, advised to not use X direction acceleration.
		X = 0
		Y = 19.82
	
	Terrain = SLTerrain // The instance call, defines the next text as parts of a SLTerrain
		
		InstanceName = Grasslands Terrain // The name used to refer to the instance later.
		
		BitmapFile = ContentFile
			Path = Base.rte/Scenes/Grasslands.bmp // The scene material file.
		
		WrapX = 1 // Boolean values that determines if the map wraps in the X, Y or both directions,
		WrapY = 0 // it is advised to not set Y to 1 as DropShips and Rockets cannot return.
		
		ScrollRatio = Vector // Determines the rate of scrolling.
			X = 1.0
			Y = -1.0
		
		BackgroundTexture = ContentFile
			Path = Base.rte/Scenes/Textures/DirtDark.bmp // Texture to use for destroyed earth.
		
		/////TerrainFrosting/////
		
		AddTerrainFrosting = TerrainFrosting // Frosting: "A roughened or speckled surface". simulates randomly sized grass.
			
			TargetMaterial = Material
				CopyOf = Topsoil // The material to have frosting on.
						
			FrostingMaterial = Material
				CopyOf = Grass // The material to use for frosting.
			
			MinThickness = 5 // Min length.
			
			MaxThickness = 7 // Max length.
			
			InAirOnly = 1 // If Target material has another material on top of it whether to replace it (0) or not (1).
		
		/////TerrainDebris/////
		
		AddTerrainDebris = TerrainDebris
			CopyOf = Gold
		
		AddTerrainDebris = TerrainDebris
			CopyOf = Plants
		
		AddTerrainDebris = TerrainDebris
			CopyOf = Boulders
		
		// Terrain Objects go here:
		
		PlaceTerrainObject = TerrainObject
			CopyOf = Rocket Silo
			Location = Vector
				X = 1357
				Y = 693
	
	//note all of the above, after "Terrain = SLTerrain", belong to the SLTerrain instance.
	// Movable Objects go here:
	
	PlaceSceneObject = AHuman
		CopyOf = Robot 1
		Position = Vector
			X = 1444
			Y = 870
		Team = 0
		AddInventoryDevice = HDFirearm
			CopyOf = SMG
	
	// Background layer images, goes from closest to furthest away.
	
	AddBackgroundLayer = SceneLayer
		CopyOf = Near Layer
	AddBackgroundLayer = SceneLayer
		CopyOf = Clouds Layer
	AddBackgroundLayer = SceneLayer
		CopyOf = Sky Layer

Contents

TerrainDebris

TerrainDebris is randomly chosen and placed objects in a specific material.

AddTerrainDebris = TerrainDebris // The instance call, defines the next text as parts of TerrainDebris.

	InstanceName = Boulders // The name used to refer to the instance later.

	DebrisFile = ContentFile
		Path = Base.rte/Scenes/Objects/Boulders/Boulder.bmp // Sprites of the TerrainDebris.
	// When loading, 000-001-002 etc is added automatically before .bmp 

	DebrisPieceCount = 103 // Amount of different pieces (sprites) of TerrainDebris.

	DebrisMaterial = Material
		CopyOf = Stone // The material the TerrainDebris is made of.

	TargetMaterial = Material
		CopyOf = Earth // The material to place the TerrainDebris in.

	OnlyOnSurface = 0 // Boolean value that determines if it is anywhere in the material (0) or only on the surface (1).

	MinDepth = 0 // Minimum depth that the TerrainDebris can be at.

	MaxDepth = 300 // Maximum depth that the TerrainDebris can be at.

	DensityPerMeter = 1.5 // Density per meter.

Backdrops

Backgrounds layers, while unnecessary, make scenes much more visually appealing. A scene generally has a back-most layer which doesn't move in relation to the 'camera', along with other layers that use parallax scrolling. There are three background groups; Near Layer, Middle Layer, and Far Layer. Each layer goes in it's relevant group, either Near Backdrops, Mid Backdrops or Far Backdrops.

AddBackgroundLayer = SceneLayer // The instance call, defines the next text as parts of a BackgroundLayer.

	InstanceName = Near Layer  // The name used to refer to the instance later.

	AddToGroup = Near Backdrops // See message above concerning Layer grouping.

	DrawTransparent = 1 // Boolean value for if the layer uses transparencies (1) or not(0).

	WrapX = 1 // Boolean values that determines if the backdrop wraps in the X, Y or both directions.
	WrapY = 0 

	ScrollRatio = Vector // It is good to set closer backdrops to have a higher scroll ratio than further ones.
		X = 0.25
		Y = 1200

	BitmapFile = ContentFile // Starts definition of BitmapFile
		Path = Base.rte/Scenes/Backdrops/Middle.bmp // Filepath for ContentFile of BitmapFile

Lord Tim's Scene Tutorial

Lets go through this line by line. I think that will be helpful. Code tags take up too much space, so I'll just use the list format thing.

  • AddScene = Scene

This creates a new Object of the Scene class and adds it to the list of scenes in the game.

  • InstanceName = Prom Grounds

Names the scene. In this case, the scene will show up in the list as "Prom Grounds".

  • LocationOnPlanet = Vector

This currently doesn't do anything noticable in the game, but probably eventually will correspond to the metagame map or something.

  • GlobalAcceleration = Vector

X,Y vector. Most common gravity is positive Y, which is down. But if you're doing something really weird, you could, potentially, make it go in other directions.

  • Terrain = SLTerrain

Terrain is a variable of Scene. This creates a new terrain of the SLTerrain class and assigns the Scene's terrain to it.

  • InstanceName = Prom Terrain

Names the SLTerrain object. This doesn't show up ingame, it's just for referring back to if you want to use it again.

  • BitmapFile = ContentFile
  • Path = PromGrounds.rte/Scenes/PromGrounds.bmp

Assigns the BitmapFile variable of the SLTerrain to a ContentFile. Game gets the image for the terrain and converts it from mat palette colors to ingame materials. More on creating these images later.

  • WrapX = 1

This means that if you go past the farthest right side of the scene, you'll be at the farthest left side, and vice versa. This is a boolean value.

  • WrapY = 0

Same as above, only for the top and bottom.

  • ScrollRatio = Vector

Effs stuff up if you mess with it, but if you really have to know, it changes the speed that the terrain scrolls ingame. Set the X to 2 and the ground will move twice as fast as the actors walking on it.

  • BackgroundTexture = ContentFile
  • Path = Base.rte/Scenes/Textures/DirtDark.bmp

Sets the texture of the background that shows when you dig through dirt.

  • AddTerrainFrosting = TerrainFrosting

This adds a TerrainFrosting to the scene's list of terrain frostings.

  • TargetMaterial = Material

Sets the material that you want the frosting to "frost" in/over.

  • FrostingMaterial = Material

Sets the material that you want the frosting to be made out of.

  • MinThickness = 5

Minimum length of the frosting. Straight up from target material. In pixels.

  • MaxThickness = 7

Maximum length of the frosting.

  • InAirOnly = 1

Allows you to decide whether the frosting will be allowed to be placed when there is another material in the way. Usually looks better with this on.

  • AddTerrainDebris = TerrainDebris

Adds a TerrainDebris object to the scene's list of TerrainDebris. I'll show how to create one of these later.

  • PlaceTerrainObject = TerrainObject

Adds a TerrainObject object to the scene's list of TerrainObjects. These are the "bunkers" and geology.

  • PlaceSceneObject = Any class

This allows you to place any other objects that you want in your scene. Includes AHumans, ACDropships, and the brains.

  • AddBackgroundLayer = SceneLayer

Adds a layer of background image to the scene's list of backgrounds. These will be displayed behind the BackgroundTexture, and in order from front to back in the same order that you add them. How to create these is described later.

A shortcut by DylanHutch

A quick way to make a scene (in .bmp) is copy a scene from base.rte/scenes/ and paste it somewhere.

  • Open it, and delete around half of it.
  • Now fill it in with the BG colour.(R=255, G=0, B=255)
  • Ok, now use the colour picker to copy the 'soil' material. this should be the top colour apart from 'BG'.
  • Paint a line around as thick as the vannila soil. This will be the top. (the part you stand on)
  • Now copy the Earth colour.(180, 130, 80 (RGB))
  • Paint another line, this time a little lower, ok bucket fill above the line, this will be the 'Earth' material.
  • Keep doing the last step till you get to 'Rock'

There! Done! You made a map! Now you can add detail to the map as you wish.

TerrainDebris

To finish up, here's how you create a TerrainDebris object:

AddTerrainDebris = TerrainDebris

   InstanceName = Boulders //Name
   DebrisFile = ContentFile
      // When loading, 000-001-002 etc is added automatically before .bmp
      Path = Base.rte/Scenes/Objects/Boulders/Boulder.bmp
      // You can have as many (or up to 1000) images as you want. They all have to be in the same location.
      // You manually put the 000,001, etc. on the image's filename, and here all you have to do is define one image. It will get the rest.
   DebrisPieceCount = 103 //Tell it how many images you made
   DebrisMaterial = Material //The material the debris is made out of
      CopyOf = Stone
   TargetMaterial = Material //The material the debris will be scattered in. Make another TerrainDebris object to have it in more than one material
      CopyOf = Earth
   OnlyOnSurface = 0 //Same as Frostings. 1 will make it only go on the top of the material.
   MinDepth = 0 //How far down the placement will be (assuming OnlyOnSurface is 0)
   MaxDepth = 300 //See above

   DensityPerMeter = 1.5 //How close together the debris will be randomly placed

Backgrounds

And a Background Layer:

AddBackgroundLayer = SceneLayer

   InstanceName = Near Layer
   AddToGroup = Near Backdrops // For scene editor
   DrawTransparent = 1 // Do you want it to make the magenta areas transparent?
   WrapX = 1 // You should make this the same as your scene's warpping.
   WrapY = 0 // Same here
   ScrollRatio = Vector
      X = 0.25 // Make this smaller if you want it to scroll slower. Making it the same as the width of the image or higher will cause it to not scroll at all.
      Y = 1200 // Make this the height of your image.
   BitmapFile = ContentFile // Where is the image?

      Path = Base.rte/Scenes/Backdrops/Middle.bmp


Now for the Terrain's BitmapFile. This image has to be in the CC Mat palette (unless you're doing custom materials, but that's really hard, and I explain it below, as well).

The colors in the mat palette correspond to the index in Materials.ini, so the first color in the palette is the first material in Materials.ini. When making a scene, you'll probably only need a few colors.

Personal tools