Hey guys,

I’m working on an RTS game, and I’m trying to figure out a good way to implement a tech tree, but I’m not sure what is a good way to determine when various techs become available.

As a simple example, here is part of a tech tree from Civ 5.

So here is the scripting solution I was able to come up with to implement this…

```
public bool Pottery_available;
public bool AnimalHusbandry_available;
public bool Archery_available;
public bool Mining_available;
public bool Sailing_available;
public bool Calendar_available;
public bool Writing_available;
public bool Trapping_available;
public bool Wheel_available;
public bool Masonry_available;
public bool BronzeWorking_available;
public bool Optics_available;
public bool Philosphy_available;
public bool HorsebackRiding_available;
public bool Mathematics_available;
public bool Construction_available;
public bool IronWorking_available;
void Update ()
{
if(Pottery_available)
{
Sailing_available = true;
Calendar_available = true;
Writing_available = true;
}
if(AnimalHusbandry_available)
{
Trapping_available = true;
Wheel_available = true;
}
if(Archery_available && Wheel_available)
{
Mathematics_available = true;
}
if(Mining_available)
{
Masonry_available = true;
BronzeWorking_available = true;
}
if(Sailing_available)
{
Optics_available = true;
}
if(Writing_available)
{
Philosphy_available = true;
}
if(Wheel_available)
{
HorsebackRiding_available = true;
}
if(Wheel_available && Archery_available)
{
Mathematics_available = true;
}
if(Masonry_available)
{
Construction_available = true;
}
if(BronzeWorking_available)
{
IronWorking_available = true;
}
}
```

…but I’m CERTAIN there has to be a better, more elegant way to do it. Anyone know what it is?