Jump to content
XCOMUFO & Xenocide

I Think I Made A Mistake


dteviot

Recommended Posts

The issue is dealing with alien prisoners.

I've gone and created a new class "prisoner" to hold these items as a different class of item.

Because, as I said before I thought they're a bit different from other items as they have rank. That is, a gray soldier is not the same as a gray commander.

However, while that is true, captured gray commander is the same as any other gray commander.

Therefore, instead of having a separate "prisoner" class, I should just create new "item" types, for each rank.

e.g. instead of having a "Grey Prisoner", with a rank of solder, and another with a rank of commander,

I have a "Grey Soldier" item, and a "Grey Commander".

While this will add more items to item.xml, it shouldn't be too bad, as on average each alien race only has 3 ranks.

And it simplifies the code base.

  • I can get rid of the prisoner class.
  • Special handling of rank
  • research.xml (and it's code) simplifies as well, because the combattant prerequist goes, and the itemref is used in it's place.

One other thought, items that can be carried by soldiers (or combatants) currently have 3 properties: xSize, ySize and mass. I think there needs to be one more. "equipable", which means while the item can be picked up in a battlescape, you can't equip a soldier with it when in an X-Corp outpost. (So equipable would be false for things like xenium, prisoners and corpses.)

Edited by dteviot
Link to comment
Share on other sites

"equipable", which means while the item can be picked up in a battlescape, you can't equip a soldier with it when in an X-Corp outpost. (So equipable would be false for things like xenium, prisoners and corpses.)
In EU you could equip anything IIRC (except from tanks and 4-tile aliens of course)

 

I think ranks should be handled as items

BUT, if alien corpses are already handled as items, instead of having a new item for each rank, can't you add a new "tag" to existing "Aliens"? Rank of alien for example... That way, you have an item that deals with the alien, and a tag that gives you his rank (or even more info, dead or alive, I haven't checked the item.xml for many months and I can't now, I'm not at home anyway)

 

I hope I'm not moving in a different plane of existence... :shy:

Link to comment
Share on other sites

Makes perfect sense dteviot. Although, each race has an average of 4.6 ranks not including the terrorists. If you could define the item type in item.xsd and provide me with a sample of an entry in item.xml, I'll be happy to add the info in for you.

Thanks,

I've updated item.xml and .xsd (and basic.xsd, and research.xml) checked into http://svn.projectxenocide.com/xenocide/xn.../Content/Schema

If you would be so kind as to check I've covered all the species/rank combinations that would be greatly appreciated.

And I suspect most of the score and mass attributes are wrong as well.

 

Agreed about the equipable flag. That is needed as we don't want "special items" (like recovered UFO components, bodies, etc) from showing up on a ship or a base defense mission. :P

- Zombie

Actually, it's more of a case that when the soldiers are in a base, and you're equipping them before sending them out, it doesn't make sense to be able to equip them with raw xenium or alien corpses or prisoners.

Link to comment
Share on other sites

Having to reconvert a Gray into a prisoner is a no-no because as you have already noted you have to write custom code to handle every single iteration.

 

Extending the Soldier class to handle the requirements of Rank is what I call a better deal, because you can add more ranks if you need and use that information as modifiers. For example: A lower level soldier will in the end have a defined base stats and then a modifier to somehow match the player advancing inside the same range randomly.

 

So a captured alien is just like any other Soldier... That doesnt means that you shouldnt flag it somehow as an IStorable class. If I were you I would decouple a little the Storage requirement with an interface (something that it is storable has Mass, Weight to something that it is IEquipable and have size requirements.

 

For example, some items are not IEquipable ( Xenium, Alien Alloys, etc) others are like (Guns, Missiles, etc). I would try to think what would happen if you do something like:

 

public interface IStorable
{
   float Mass { get; }
   float Weight { get; }
}

public interface IEquipable : IStorable
{
   Vector2D Size { get; } 
}

public class Item : IStorable
{}

public class EquipableItem : Item, IEquipable
{}

public class Soldier : IStorable
{}

 

That is just a sample but in the end the model is not that much Geoscape oriented and can be used as the base in Battlescape (dont be afraid of refactoring ;) ).

 

Greetings

Red Knight

Link to comment
Share on other sites

×
×
  • Create New...