Jump to content
XCOMUFO & Xenocide

Item.xml


Zombie

Recommended Posts

@ dteviot: fold it in. You are correct on all counts. :)

 

@ kelargo: The medkit can be used on any units on the battlescape. This includes aliens or civilians. (I use this feature all the time to revive an alien on my alien base "smash 'n grab" missions). And making this available for V1.0 shouldn't be too hard since all it would take is a single flag.

 

@ Moriarty: Yes, all items in the battlescape have a mass and are therefore defined in item.xml. I agree about the bit that items should have armor ratings. Though, I'd really like to tweak the numbers a bit for Xenocide since in the original game it was way too easy to destroy items (a simple human grenade can obliterate everything). :wink1:

 

- Zombie

Link to comment
Share on other sites

  • Replies 147
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I agree about the bit that items should have armor ratings. Though, I'd really like to tweak the numbers a bit for Xenocide since in the original game it was way too easy to destroy items (a simple human grenade can obliterate everything).  :wink1:

 

- Zombie

Would ItemTroop items need armour and hit points values, or just armor values?

And do you want to update item.xsd to include these, or shall I?

Link to comment
Share on other sites

@ kelargo: The medkit can be used on any units on the battlescape. This includes aliens or civilians. (I use this feature all the time to revive an alien on my alien base "smash 'n grab" missions). And making this available for V1.0 shouldn't be too hard since all it would take is a single flag.

really? you can heal aliens and civilians in XCom? wow. I don't know if I ever tried to, but I probably just assumed that it is impossible. huh. okay, if that's the case, it should be the same in Xenocide V1, of course. how will we manage who/what can be healed by the medkit? for later versions, we might consider changing it so that the human medkit can't heal aliens, and giving Alien Medics their own, alien medkit which only heals aliens. if we want to do that, do we give each unit a flag for "can be healed by medkit" or do we rather give the medkit a list of units that can be healed by it? I'm thinking of "repair kits" for mechanical units, so we might end up with several items that can "heal" specific units.

 

@ Moriarty: Yes, all items in the battlescape have a mass and are therefore defined in item.xml. I agree about the bit that items should have armor ratings. Though, I'd really like to tweak the numbers a bit for Xenocide since in the original game it was way too easy to destroy items (a simple human grenade can obliterate everything).  :wink1:

 

I'm absolutely behind you on that.

@dteviot: I think a "hitpoint" value for any kind of item would be enough. then again... I can see why an armor value would be nice, considering that very small amounts of damage should not damage sturdy items at all. ah, what the heck, put the armor value in there, even if it's just a possibility. I've seen some threads discussing XCorps soldiers using shields like swat teams, I guess for stuff like that an armor value would come in handy. :)

Link to comment
Share on other sites

Guest Azrael
Buddies, dont overengineer the item system.. use the IANGTNI principle (I am not going to need it). Put it in only if you need it right now.

 

Greetings

Red Knight

I thought it was the KISS principle :P

Link to comment
Share on other sites

There's another rule of thumb: test first, code next. Stackless branch way ;). Btw, stackless shows earth scene, a little less functional (no rotation), nevertheless it took about 90% less code to do it... that means: simple.
Link to comment
Share on other sites

  • 1 month later...

Sorry for the delay in getting this done, but I finally updated item.xml with the human craft data. Some things like hull hardness I didn't attempt to change, as I do not fully understand how it will be used. (The documentation in item.xsd clears things up a little bit though).

 

Since PX is using only the metric system, I modified the craft speed from knots to MKS (Meters, Kilograms, Seconds) standards - in this case, meters/second. Not sure how comfortable everyone feels about strict MKS usage, so I'd be willing to implement the "derived" MKS unit for speed which is km/h.

 

I have a slight problem with the repair cost for the human craft. For the Avenger, the cost is $1000 per unit of damage. Since the Avenger has a damage capacity of 1200 units, a full repair would cost nearly $1,200,000! (Remember: it only costs $900,000 to build the darn thing in the first place). Perhaps we should have a max limit like 10-50% of the initial construction cost and then and then modify that number according to the amount of damage inflicted. For instance: assume we decide that 50% is a fair max repair cost for an Avenger. The total would then be $450,000 for a full repair job. Say the Avenger was damaged for 600 units (50% damaged). The total repair bill would be 50% of $450,000 which is $225,000. Not saying we should use the 50% figure as I think that is still too high, but 10% isn't bad with a max repair of $90,000. :wink1:

 

I was going to work on adding alien craft to item.xml, but noticed we may need to define some characteristics yet, like weapon power, distance and hit accuracy. :)

 

- Zombie

Link to comment
Share on other sites

Sorry for the delay in getting this done, but I finally updated item.xml with the human craft data.

Thanks for that.

I won't complain about how long it's taken you. Look how long it's taken me to get the production information to be shown. (My pathetic excuse, I had a major case of X2 addiction.)

Dumb question: where did you put item.xml?

 

I have a slight problem with the repair cost for the human craft. For the Avenger, the cost is $1000 per unit of damage. Since the Avenger has a damage capacity of 1200 units, a full repair would cost nearly $1,200,000! (Remember: it only costs $900,000 to build the darn thing in the first place). Perhaps we should have a max limit like 10-50% of the initial construction cost and then and then modify that number according to the amount of damage inflicted. For instance: assume we decide that 50% is a fair max repair cost for an Avenger. The total would then be $450,000 for a full repair job. Say the Avenger was damaged for 600 units (50% damaged). The total repair bill would be 50% of $450,000 which is $225,000. Not saying we should use the 50% figure as I think that is still too high, but 10% isn't bad with a max repair of $90,000. :wink1:

Actually, damaging something so badly that it's cheaper to throw it away and buy another does happen, just ask the insurance companies. (Usually though it's when the item is built on a production line.)

 

I was going to work on adding alien craft to item.xml, but noticed we may need to define some characteristics yet, like weapon power, distance and hit accuracy.  :)

I would have thought the alien craft are equiped with weapons just like the human craft. (In which case, do we need to add a "default weapons" element to the craft?)

Link to comment
Share on other sites

Dumb question: where did you put item.xml?

Nowhere, the updated version is still on my hard drive. If you want it, let me know. :)

Edit: Bah, might as well upload it here. It's bundled with item.xsd and the previous item.xml.

itemsWithCraftInfo.zip

 

Actually, damaging something so badly that it's cheaper to throw it away and buy another does happen, just ask the insurance companies.  (Usually though it's when the item is built on a production line.)

True. But I was thinking this is more of a v1.0+ attribute than 1.0. :wink1:

 

I would have thought the alien craft are equiped with weapons just like the human craft.  (In which case, do we need to add a "default weapons" element to the craft?)

UFO weapons are integrated into the craft itself, whereas the X-COM craft weapon aresenal can be swapped. This is why a new definition is necessary (I think). Correct? :P

 

- Zombie

Edited by Zombie
Link to comment
Share on other sites

Dumb question: where did you put item.xml?

Nowhere, the updated version is still on my hard drive. If you want it, let me know. :)

Edit: Bah, might as well upload it here. It's bundled with item.xsd and the previous item.xml.

itemsWithCraftInfo.zip

Thanks, I'll upload it to the subversion repository tonight, when I get home.

 

I would have thought the alien craft are equiped with weapons just like the human craft.  (In which case, do we need to add a "default weapons" element to the craft?)

UFO weapons are integrated into the craft itself, whereas the X-COM craft weapon aresenal can be swapped. This is why a new definition is necessary (I think). Correct? :P

At the moment, has not been decided, we can model the UFOs with either either with fixed or modular weapons. Personally, I suspect that modular weapons (same as human craft) would be the way to go. Code can be shared (so less work) and more flexibility for the future. However, before proceeding, need to know:

1. What weapons DO the UFOs carry?

2. Are they different to the human weapons?

3. Do UFOs always carry the same weapons?

 

Oh, and one more question, in X-COM, do the interceptors that you can buy come pre-loaded with weapons? (Probably cannons)

Link to comment
Share on other sites

At the moment, has not been decided, we can model the UFOs with either either with fixed or modular weapons. Personally, I suspect that modular weapons (same as human craft) would be the way to go.  Code can be shared (so less work) and more flexibility for the future.  However, before proceeding, need to know:

1. What weapons DO the UFOs carry?

2. Are they different to the human weapons?

3. Do UFOs always carry the same weapons?

1. Unknown. Probably some type of plasma cannon. (Cant tell from the interception screen and there is nothing in the game-files).

2. Well, they have different ranges and damage potentials from the normal plasma cannon, so they are different in some respect.

3. A certain UFO always has the same type of weapon installed on it. For instance, the battleship is never equipped with the medium scout's weapon, or visa versa. A puny weapon on a giant ship is kinda a waste of resources as the UFO will go down like a ton of bricks because your weapons can hit farther out. In the same manner, a huge weapon on a small ship is also a waste as the investment is not worth while. ;)

 

Oh, and one more question, in X-COM, do the interceptors that you can buy come pre-loaded with weapons?  (Probably cannons)

Nope, when you purchase an interceptor they are weapon-free. :wink1:

 

- Zombie

Link to comment
Share on other sites

  • 4 months later...

Apologies everyone. I haven't been working on this much as I had a multitude of other things on my plate for a long time. One of those things was learning to code with html (came about as a necessity). Unsurprisingly, the structure of xml files are very similar so understanding them just became 1000% easier, hehe. :D

 

Anyhow, I know some have been asking for this so I finally sat down with my calculator and craft spreadsheet and figured out the exact fuel consumption rates for human/hybrid craft. Da da da dum. Updated item.xml to boot so everything should be up to date. Last thing to do is add in the UFO data. Shouldn't be too hard as most values will be 0 or won't apply. =b

 

Revised_item.zip

 

- Zombie

Link to comment
Share on other sites

Apologies everyone. I haven't been working on this much as I had a multitude of other things on my plate for a long time. One of those things was learning to code with html (came about as a necessity). Unsurprisingly, the structure of xml files are very similar so understanding them just became 1000% easier, hehe. :D

 

Anyhow, I know some have been asking for this so I finally sat down with my calculator and craft spreadsheet and figured out the exact fuel consumption rates for human/hybrid craft. Da da da dum. Updated item.xml to boot so everything should be up to date. Last thing to do is add in the UFO data. Shouldn't be too hard as most values will be 0 or won't apply. =b

 

Revised_item.zip

 

- Zombie

Thanks, I've updated copy in subversion

Link to comment
Share on other sites

Anyhow, I know some have been asking for this so I finally sat down with my calculator and craft spreadsheet and figured out the exact fuel consumption rates for human/hybrid craft. Da da da dum. Updated item.xml to boot so everything should be up to date. Last thing to do is add in the UFO data. Shouldn't be too hard as most values will be 0 or won't apply. =b

 

Er, what exactly those numbers mean? I have found in item.xsd that consumptions means "just generic units per hour", thus fuel is "units", but what about speed? Is it "units of distance in Planetscape per hour"? Or something else? Also, what about acceleration? Is it units of speed per second? It's not all that important, I just want to clarify it.

Link to comment
Share on other sites

Er, what exactly those numbers mean? I have found in item.xsd that consumptions means "just generic units per hour", thus fuel is "units", but what about speed? Is it "units of distance in Planetscape per hour"? Or something else? Also, what about acceleration? Is it units of speed per second? It's not all that important, I just want to clarify it.

Speed is in meters per second. In Xenocide we are using strict metric units for all measurements so the units of knots is not used. Suppose I could have converted it to km/h, but I prefer to stick to "standard" MKS units (meters, kilograms, seconds). :) The units of acceleration are not existant. It's just a number given in the original game to compare crafts against each other. We'll have to address this property sometime to see if we even want to use it. ^_^

 

- Zombie

Link to comment
Share on other sites

Speed is in meters per second. In Xenocide we are using strict metric units for all measurements so the units of knots is not used. Suppose I could have converted it to km/h, but I prefer to stick to "standard" MKS units (meters, kilograms, seconds). :) The units of acceleration are not existant. It's just a number given in the original game to compare crafts against each other. We'll have to address this property sometime to see if we even want to use it. ^_^

 

- Zombie

 

MKS units are the best way to have one common standard, I agree; it's only that fuel consumption is measured in units per HOUR, which made me wonder. :)

Link to comment
Share on other sites

True, but if you take a look at how much fuel a craft consumes in a second, the resulting number would fall into fractional parts. (0.035 units/sec for the Skyranger, 0.0117 units/sec for the Interceptor and 0.000333 units/sec for the Elerium powered craft). Those numbers are rather tough to compare. Converting to minutes doesn't help much either as everything is still fractional. Hours was the best choice as it brings all the consumption levels above 1. I think we can tolerate a derived MKS unit here and there as long as the change is properly documented. :D

 

- Zombie

Link to comment
Share on other sites

  • 2 weeks later...

I just finished adding the UFO stats to item.xml today. Just a few notes: Max speed for UFO's are in meters/second and weapon range is given in meters. Now, in the original game, a UFO's weapon range was listed as a number multiplied by 8. Why the programmers did this is unknown. But by comparing X-COM craft weapon ranges (listed in kilometers) against UFO weapons it becomes clear that the multiplier is 8.

 

At dteviots urging, I also updated basic.xsd since UFO's were undefined in the item class. They are in the X-NET entry class so that's good. I didn't add UFO's to the research class since in the original game UFO info was learned through the interrogation of a live engineer. Not sure how we are handling this aspect so I left research as-is.

 

Included below is a zip containing the revised item.xml, item.xsd (with the new UFO class added by dteviot) and basic.xsd. Someone should remove craft.xml and .xsd from the trunk as they are not needed anymore.

 

From the looks of things, item.xml should be basically complete now (at least in the case that everything is defined). Updating will still be necessary as some things such as the X-CAPs clip name and shooting percentages are commented out. Updating item.xml took a lot longer than I originally bargained for, but heh, at least I learned something in the process. What's next on the agenda? Perhaps combatants.xml? That needs some major help IMHO. ;)

 

UFO_Items.zip

 

- Zombie

Link to comment
Share on other sites

  • 8 months later...

As per requested, dteviot, I am attaching my current copy of Item.xml which is fairly up-to-date (Late June). I just did a bit of organizing and fixed up the spacing to make things easier to follow (in addition to tweaking the craft data). Using tabs for spacing is fine and all that, but when the nests become deep it can push the line off the screen (a tab = 8 spaces or so). For this reason, I made all indents a constant 4 spaces. I also added a blank line between items.

 

Just a tiny question though. I am wondering about the element in the section. See, in the areas where there isn't any special materials required for construction, the cost element looks like the line above. When there is special materials, the cost element looks something like this:

 

		<cost hours="1600" money="150000">
		<material type="ITEM_ALIEN_COMPOSITES" quantity="3" />
	</cost>

I'm just wondering if it is ok to close the cost out with the /> if there isn't any sub-elements, or is it necessary to use to close it out? I suppose it's proper to do it like this: /> if there isn't a sub-element, but it just seems sloppy to me. Ah well. ^_^

 

Item.zip

Edit: Whoopsie! Posted in the wrong Item topic. Moved my post to the correct one. :blush1:

 

- Zombie

Edited by Zombie
Link to comment
Share on other sites

As per requested, dteviot, I am attaching my current copy of Item.xml which is fairly up-to-date (Late June). I just did a bit of organizing and fixed up the spacing to make things easier to follow (in addition to tweaking the craft data). Using tabs for spacing is fine and all that, but when the nests become deep it can push the line off the screen (a tab = 8 spaces or so). For this reason, I made all indents a constant 4 spaces. I also added a blank line between items.

 

Thanks

 

Just a tiny question though. I am wondering about the element in the section. See, in the areas where there isn't any special materials required for construction, the cost element looks like the line above. When there is special materials, the cost element looks something like this:

		<cost hours="1600" money="150000">
		<material type="ITEM_ALIEN_COMPOSITES" quantity="3" />
	</cost>

I'm just wondering if it is ok to close the cost out with the /> if there isn't any sub-elements, or is it necessary to use to close it out? I suppose it's proper to do it like this: /> if there isn't a sub-element, but it just seems sloppy to me. Ah well. ^_^

Yes, it's fine to close an element with a />

The XML parser Xenocide uses treats these identically

		<cost hours="1600" money="150000">
	</cost>

		<cost hours="1600" money="150000"></cost>

		<cost hours="1600" money="150000" />

(OK, technically not quite true, the first two cases will put an "end element tag" into the parse stream, but we throw those away.)

Link to comment
Share on other sites

Thanks, I understand now. BTW: the cost element isn't closed properly in the laser cannon entry. Also, the hull element in the Xeno human craft don't need the closing, just the />. I think that's all the problems I saw. You may catch more. :blush1:

 

- Zombie

Link to comment
Share on other sites

  • 1 month later...

I see you fixed those problems dteviot, thanks. :)

 

Anyhow, I did some minor updating with item.xml today. There were a few of missing entries in the aliens so I added them (will update basic.xsd to reflect). The item weights are fine for the aliens. I assumed score is for recovery purposes (for battlescape items) at the end-of-mission summary screen, correct? Problem is that aliens have two score types: a lower score for killing the alien (aka VPS or Victory Points which is found in combatants.xml) and a score for capturing the alien alive (2xVPS). I assumed we wanted the latter score as the " alien items" are alive. As for the general alien item (no rank), I just made those all 0. ^_^

 

Aren't the scores for X-COM craft supposed to be negative? I'm not entirely sure if the variable type can handle negatives, but assuming that "xs:float" means a real number it should be fine. Don't know why it needs to be real as decimals will not be used, but oh well. For the UFO's we define the score only for destroyed - are we just going to calculate the shot down score from the destroyed? (This idea applies to the aliens as well, if we are just going to manually calculate the score for a dead alien then we don't really need the VPS attribute in combatants.xml. Then again, VPS is also a battlescape score which helps to raise morale of a soldier: kill the alien and the VPS are applied to a soldiers morale if it is below 100).

 

- Zombie

Link to comment
Share on other sites

I see you fixed those problems dteviot, thanks. :)

 

Anyhow, I did some minor updating with item.xml today. There were a few of missing entries in the aliens so I added them (will update basic.xsd to reflect). The item weights are fine for the aliens. I assumed score is for recovery purposes (for battlescape items) at the end-of-mission summary screen, correct?

correct

Problem is that aliens have two score types: a lower score for killing the alien (aka VPS or Victory Points which is found in combatants.xml) and a score for capturing the alien alive (2xVPS). I assumed we wanted the latter score as the " alien items" are alive. As for the general alien item (no rank), I just made those all 0. ^_^

um. The one with no rank is supposed to be the corpse. Should probably update name with _CORPSE suffix, to eliminate confusion.

If you're adding additional alien race/ranks, please update research.xml as well.

 

Aren't the scores for X-COM craft supposed to be negative? I'm not entirely sure if the variable type can handle negatives, but assuming that "xs:float" means a real number it should be fine. Don't know why it needs to be real as decimals will not be used, but oh well. For the UFO's we define the score only for destroyed - are we just going to calculate the shot down score from the destroyed? (This idea applies to the aliens as well, if we are just going to manually calculate the score for a dead alien then we don't really need the VPS attribute in combatants.xml. Then again, VPS is also a battlescape score which helps to raise morale of a soldier: kill the alien and the VPS are applied to a soldiers morale if it is below 100).

- Zombie

Craft and UFOs know to treat their scores differently. IIRC, aliens get points for shooting down X-Corp craft. X-Corp get points for shooting down UFOs. And yes, crash points are derived programatically from destruction. And yes, we do need to figure out where the VPs should be stored. We should have "one point of truth". Personally, at this stage, I think item is better, as you also get VPs for recovering hardware so it puts the VPs in one place.

Edited by dteviot
Link to comment
Share on other sites

um. The one with no rank is supposed to be the corpse. Should probably update name with _CORPSE suffix, to eliminate confusion.

If you're adding additional alien race/ranks, please update research.xml as well.

Ah, so that's the corpse! I was just about to bring that point up. Right, I'll update that too. =b

 

Craft and UFOs know to treat their scores differently. IIRC, aliens get points for shooting down X-Corp craft. X-Corp get points for shooting down UFOs. And yes, crash points are derived programatically from destruction. And yes, we do need to figure out where the VPs should be stored. We should have "one point of truth". Personally, at this stage, I think item is better, as you also get VPs for recovering hardware so it puts the VPs in one place.

Thanks for clearing the issue of score for UFOs/craft up, I keep forgetting we are doing things a little bit differently. I did a little bit more research into morale today and found out VPS do not play a role in it whatsoever. The solder who did the killing gets a +20 base increase in morale plus a +10 bonus for the team. (+30 altogether). The only thing that VPS do is to give you points at the end of mission. Just to clarify, right now we have two scores: the death of the unit and the capturing of the unit. And from what I gather the _CORPSE item score is for recovering a body of that species. Makes sense. So we are going to cut VPS from combatants.xml and transfer them to item.xml, correct? Or are we going to leave it out and just calculate VPS from the captured score?

 

- Zombie

Edited by Zombie
Link to comment
Share on other sites

The only thing that VPS do is to give you points at the end of mission. Just to clarify, right now we have two scores: the death of the unit and the capturing of the unit. And from what I gather the _CORPSE item score is for recovering a body of that species. Makes sense. So we are going to cut VPS from combatants.xml and transfer them to item.xml, correct? Or are we going to leave it out and just calculate VPS from the captured score?

Well, if VPs only come into play at end of mission, I'd put them in item.

At the end of the battlescape we gather all the items together (hardware, corpses and prisoners) and total up the points in one operation.

Link to comment
Share on other sites

Ok, I did some more updates today.

 

Item.xml is complete except for victory points. Not sure how we are going to implement it, but it needs to be defined in item.xsd. If you give me a sample entry I can add them in (or if you want to do it yourself, that's fine by me). The "_CORPSE" string was added after the specified aliens as well as the body recovery points.

 

Basic.xsd was also changed to reflect the "_CORPSE" string.

 

I did a lot of work on research.xml (don't worry, I don't think I screwed the tree up but I'll have to look for a current tree to double check). ;) First, I added the "_CORPSE" string after the selected aliens. For some reason, a random soldier interrogation yielded alien mission info. Alien mission info is actually given by Navigators. When I went to the navigator section, an interrogation didn't yield anything, so I added the alien mission info there. Don't know why we need a section for alien soldier interrogations so I removed it - the interrogations/autopsies are found later in the file. Alien Medics yield a chance to get not only an interrogation but also an autopsy - so I changed that. Also, under the live alien race interrogations there were medics listed. In truth, anytime you research a medic, you may not get the exact species info of the medic: the result is a random choice of any of the alien interrogations and autopsies which are left. Removed Medics from the list. I also added some aliens which were missing from certain lists - forgive me, I don't remember which ones or where as it is late. Below is a zip file containing my changes to item.xml, basic.xsd and research.xml up to this point.

 

Later all! :)

 

XenocideSchemaChanges.zip

 

- Zombie

Link to comment
Share on other sites

Ok, I did some more updates today.

 

Item.xml is complete except for victory points. Not sure how we are going to implement it, but it needs to be defined in item.xsd. If you give me a sample entry I can add them in (or if you want to do it yourself, that's fine by me). The "_CORPSE" string was added after the specified aliens as well as the body recovery points.

 

Thanks for your efforts. The VP entry should be the score element. It's the number of points X-Corp gets for retrieving an item of this type from a battlefield mission.

<item name="ITEM_GREY_SOLDIER" xsi:type="troopItemType" score="0">
<storage type="STORAGE_ALIENS" units="4" />
<price buy="0" sell="20000" />
<size xSize="2" ySize="3" mass="30" equipable="false" />
<throw percentage="0.25" />
</item>

Link to comment
Share on other sites

So we want the score element for living aliens to be victory points now?

 

Sorry, but the whole score issue hasn't been answered to my satisfaction yet, hence why I'm confused. There are three scores. 1) Recovery of corpse (answered), 2) Victory Points - the points awarded end of mission for killing that alien and 3) Recovery of live alien (=2*VPS).

 

Right now, the values for the score field for each non-corpse alien in item.xml are the recovery points for the live (stunned) body. My question is this: are we going to have both VPS AND Recovery for live alien scores in item.xml? Or are we only going to use one score and calculate the other one? If we are going to calculate one set of values, then we need to choose which score is listed in item.xml and which will be calculated. I don't really care which one, but this needs to be decided now. If you want the VPs to be the only score, I'll have to update item.xml again (not a big deal). ;)

 

- Zombie

Link to comment
Share on other sites

So we want the score element for living aliens to be victory points now?

 

Sorry, but the whole score issue hasn't been answered to my satisfaction yet, hence why I'm confused. There are three scores. 1) Recovery of corpse (answered), 2) Victory Points - the points awarded end of mission for killing that alien and 3) Recovery of live alien (=2*VPS).

 

Right now, the values for the score field for each non-corpse alien in item.xml are the recovery points for the live (stunned) body. My question is this: are we going to have both VPS AND Recovery for live alien scores in item.xml? Or are we only going to use one score and calculate the other one? If we are going to calculate one set of values, then we need to choose which score is listed in item.xml and which will be calculated. I don't really care which one, but this needs to be decided now. If you want the VPs to be the only score, I'll have to update item.xml again (not a big deal). ;)

 

- Zombie

Ah. I see the problem. I hadn't allowed for case 2) Points for killing an alien, being seperate from recovering the corpse/prisoner.

On that basis, I say leave the VPs (for killing an alien) in the combatants.xml, and the the item recovery points (cases 1, and 3) in item.xml.

This means that we can decouple VPs from salvage points.

Link to comment
Share on other sites

Ah. I see the problem. I hadn't allowed for case 2) Points for killing an alien, being seperate from recovering the corpse/prisoner.

On that basis, I say leave the VPs (for killing an alien) in the combatants.xml, and the the item recovery points (cases 1, and 3) in item.xml.

This means that we can decouple VPs from salvage points.

Very good, thanks for clearing that up dteviot! :)

 

- Zombie

Link to comment
Share on other sites

  • 1 month later...

Well, this is a bit embarrassing.

I've been attempting to implement "default loadout" for the soldier inventory. That is, you can specify (for each soldier) what each soldier should be carrying. And every time a soldier returns to base, the soldier will be re-equipped to his "default loadout".

 

An what I've discovered is: I have not defined the item classes for the equipment carried by soldiers.

 

Now, some good news. I've realized that the existing CraftClipItem class can be used by soldiers as well. The reason being, the original plan was to have a class hierarchy with a ClipItem, for ammo used by soldiers, and deriving from a "SoldierItem", and a CraftClipItem (for ammo used by craft, which did not derive from SoldierItem.)

However, I've instead defined an optional CarryInfo property that any Item can have. If the item has a CarryInfo, then it can be carried by a soldier. If it doesn't have a CarryInfo, then it can't.

And when we look at the CraftClipItem and clipItem

<item id="ITEM_TITAN_HEAVY_MISSILE_CLIP" name="Titan Missile" xsi:type="craftClipItemType" score="0">
<storage type="STORAGE_GEAR" units="5" />
<price buy="9000" sell="7200" />
<damage type="DAMAGE_EXPLOSIVE" amount="100" />
<capacity value="1" />
</item>

<item id="ITEM_R_C_AP_CLIP" name="RC AP Clip" xsi:type="clipItemType" score="0">
<storage type="STORAGE_GEAR" units="1" />
<price buy="500" sell="400" />
<size xSize="2" ySize="1" mass="5" equipable="true" />
<throw percentage="0.25" />
<damage type="DAMAGE_PIERCING" amount="42" />
<capacity value="14" />
</item>

We can see, the only difference is the clipItemType has and elements.

And it's the element which is the CarryInfo. (The element is currently unused, but will probably be added to an optional list of "actions" that soldiers can do with an item.

 

My next thought is, if I can do this with clips, can I do the same thing with weapons? Unfortunately, the answer here is probably, but I'm not quite sure. The first issue I run into is that there are 2 types of craft weapons. Those that have clips, and those that don't. (Which is consistent with soldier weapons, the laser family of soldier weapons don't use clips.) This can be dealt with by providing a ClipInfo property to each Weapon. If null, the weapon doesn't need a clip. If present, it does.

However, this is where I run into the only major difference; craft weapons only take one type of ammo, while some of the solider weapons take multiple ammo types. (Oh, and craft weapon's clip element includes the clip size.)

So, just for people's edification here's a sample of each craft and soldier weapon type.

<item id="ITEM_TITAN_HEAVY_MISSILE_LAUNCHER" name="Titan Launcher" xsi:type="craftWeaponItemType" score="0">
<storage type="STORAGE_GEAR" units="10" />
<price buy="17000" sell="12750" />
<clip name="ITEM_TITAN_HEAVY_MISSILE_CLIP" capacity="3" />
<shoot time="20" name="ACTION_SHIP_SHOT" accuracy="0.8" range="60000" />
</item>

<item id="ITEM_REPEATER_CANNON" name="Repeater Cannon" xsi:type="rangedWeaponItemType" score="0">
<storage type="STORAGE_GEAR" units="3" />
<price buy="13500" sell="10125" />
<size xSize="2" ySize="3" mass="19" equipable="true" />
<throw percentage="0.25" />
<clip name="ITEM_R_C_HE_CLIP" />
<clip name="ITEM_R_C_AP_CLIP" />
<clip name="ITEM_R_C_IN_CLIP" />
<shoot percentage="0.4" name="ACTION_AUTO_SHOT" accuracy="0.32" range="30.0" />
<shoot percentage="0.33" name="ACTION_SNAP_SHOT" accuracy="0.56" range="30.0" />
<shoot percentage="0.8" name="ACTION_AIMED_SHOT" accuracy="0.82" range="30.0" />
</item>

 

So, what I'm currently thinking is change the craftWeaponItem to WeaponItem. Then, add a "CraftInfo" (or similar) property to Item, to indicate that an item can be mounted on a craft. (Later on, this might be expanded to include other mods that a craft could carry, e.g. Shields, upgraded engines, fuel tanks, etc.)

And I add a "ClipInfo"to item, to indicate the item uses ammo. (Ideally, it would be nice if it could indicate "number of uses" so it could be used with medkits, to indicate number of uses before needing a refill.)

So, to assist in this, I'd make some changes to the XML. Specifically, make all elements have a capacity. This allows the weapon to hold a different quantity of ammo than the clip.) Not really relevant for most soldier weapons, but will be useful for X-Caps, we can then dispense with their special clips, and load them with standard rockets, and GAIA missiles.

But, I'm still not sure how to fit in med kits, grenades and X-Caps.

 

At any rate, I'd appreciate some feedback. Sorry if I'm not very clear.

Link to comment
Share on other sites

For weapons, I would use ClipItem as a collection, where either a null value or a count of 0 will indicate a weapon that doesn't take clips. This way a weapon that can take multiple types of clips can also be accommodated.

 

Also, wouldn't Capacity indicate "number of uses"? I noticed that medi kits don't have capacity in Item.xml suggesting they never run out...

Link to comment
Share on other sites

For weapons, I would use ClipItem as a collection, where either a null value or a count of 0 will indicate a weapon that doesn't take clips. This way a weapon that can take multiple types of clips can also be accommodated.

That's an interesting idea. I will need to contemplate it.

 

Also, wouldn't Capacity indicate "number of uses"? I noticed that medi kits don't have capacity in Item.xml suggesting they never run out...

Yes, med kits are a special case. Currently only elements have a capacity, and med kits don't have a clip.

So a possible solution would be to give med kits a clip. Which would involve either making them weapons or adding a new class with a single instance, the med kit, or moving clip down to the base class.

 

Hmm. Does anyone have a problem if the med kits take a 10 "shot" "medical supplies" clip? Would be a bit of a change from X-COM 1, but not majorly so.

 

Just came across this, which seems relevant. Shows replacing inheritance with aggregation.

Edited by dteviot
Link to comment
Share on other sites

For weapons, I would use ClipItem as a collection, where either a null value or a count of 0 will indicate a weapon that doesn't take clips. This way a weapon that can take multiple types of clips can also be accommodated.

That's an interesting idea. I will need to contemplate it.

This is kind of how the original game did it. Check OBDATA.DAT over at the X-COM wiki. It has a limitation of 3 ammo types which could be used by a weapon. The great thing about that file are the booleans which define the capabilities of the weapon or clip. It makes things really easy to understand. :)

 

Yes, med kits are a special case. Currently only elements have a capacity, and med kits don't have a clip.

So a possible solution would be to give med kits a clip. Which would involve either making them weapons or adding a new class with a single instance, the med kit, or moving clip down to the base class.

 

Hmm. Does anyone have a problem if the med kits take a 10 "shot" "medical supplies" clip? Would be a bit of a change from X-COM 1, but not majorly so.

You might have a problem with the Medi-kit though. It would have 3 "clips" loaded into the kit at once: a stim clip with 10 shots, a healing clip with 10 shots and a painkiller clip with 10 shots. Compare this to a Heavy Cannon which can only have 1 clip loaded at once. See what I mean? ;)

 

- Zombie

Link to comment
Share on other sites

Yes, med kits are a special case. Currently only elements have a capacity, and med kits don't have a clip.

So a possible solution would be to give med kits a clip. Which would involve either making them weapons or adding a new class with a single instance, the med kit, or moving clip down to the base class.

 

Hmm. Does anyone have a problem if the med kits take a 10 "shot" "medical supplies" clip? Would be a bit of a change from X-COM 1, but not majorly so.

You might have a problem with the Medi-kit though. It would have 3 "clips" loaded into the kit at once: a stim clip with 10 shots, a healing clip with 10 shots and a painkiller clip with 10 shots. Compare this to a Heavy Cannon which can only have 1 clip loaded at once. See what I mean? ;)

That assumes Xenocide med kits are going to have 3 Stim, heal and painkiller. My edit: current plan is just have heal.

Edited by dteviot
Link to comment
Share on other sites

That assumes Xenocide med kits are going to have 3 Stim, heal and painkiller. My edit: current plan is just have heal.

Sorry, I didn't realize that. I guess making the med kit to use a healing clip is fine then. We could do it like the UFO series does: instead of a positive damage, just make it negative. That way we do not have to make a separate class for the clip. :hmmm:

 

I'd assume healing shots would just heal fatal wounds and not do anything to health levels, correct? In this instance, we would only need a clip with each shot applying -1 fatal wounds per application (up to the amount of fatals of course - we wouldn't want to allow soldiers to end up with negative fatals). :D

 

 

- Zombie

Edited by Zombie
Afterthought
Link to comment
Share on other sites

  • 1 month later...

Now that I'm starting on the battlescape, I'm starting to notice other issues.

  • I don't have ranges for the X-Cap weapons.
  • Not directly related to item.xml, but I don't have the specs for the weapons that are integral to the terrorist units. (I'm figuring simplest way of dealing with this is adding damage and action elements to the relevant combatant entries in combatant.xml.)
    Alternatively (and possibly a more general solution) replace the integral weapons with weapon entries in item.xml, and add a tag of some sort to say that the player will never see the items. Thoughts anyone?

Edited by dteviot
Link to comment
Share on other sites

For the second I think the proper way is to add a new entry and handle it as a special weapon selection round on the Alien Terrorist (they can only get that weapon) :) ...

 

Greetings

Red Knight

Huh? Add a new entry to which: combatant.xml or item.xml?

 

Let me explain, there are two problems.

  • How to encode the weapon information into the XML files. There are two pieces to this:
    1. the specs of the weapon itself,
    2. The fact that some weapons are only used by a single combatant type, and don't exist separately from the combatant.
  • How to handle the weapon in battlescape gameplay.

If we ignore terrorists, then the way I was thinking of handling these two issues is:

  • Weapons are in the item.xml file.
  • I'm going to add a set of "loadout entries" to the combatants table. Conceptually a loadout would go something like:
    <loadout name="sampling">
    <stock item="ITEM_STUN_LAUNCHER"				   quantity="1" location="rightHand" />
    <stock item="ITEM_STUN_BOMB"					   quantity="3" location="backpack" />
    <stock item="ITEM_PSIONIC_PROBE"				   quantity="1" location="leftHand" />
    </loadout>
    <loadout name="grav">
    <stock item="ITEM_GRAVITY_DISTORTION_LAUNCHER"	 quantity="1" location="rightHand"/>
    <stock item="ITEM_GRAVITY_DISTORTION_DRONE"		quantity="3" location="backpack"/>
    <stock item="ITEM_ALIEN_GRENADE"				   quantity="2" location="rightshoulder"/>
    <stock item="ITEM_PLASMA_PISTOL"				   quantity="1" location="belt"/>
    <stock item="ITEM_PLASMA_PISTOL_CLIP"			  quantity="1" location="leftleg"/>
    </loadout>


    Note, it's assumed weapons that take clips (i.e. all alien weapons) will be loaded with a full clip.

  • With each combatant, I add a set of loadout entries, which gives the odds that combatant carries each loadout. e.g.
    <loadout name="sampling"	 odds="10"/>
    <loadout name="lightPlasma"  odds="10"/>
    <loadout name="mediumPlasma" odds="10"/>
    <loadout name="heavyPlasma"  odds="10"/>
    <loadout name="grav"		 odds="60"/>


  • So, when I create a combatant, I then pick a loadout at random. (Ideally, over time the AI would evaluate which loadouts work best, and adjust the selection odds to favour
  • The way combat works, I look at a combatant, and see what weapon is in the right and left hands. This is what they can attack with.

So, I think the solution that requires the minimum custom work would be.

  • Add a boolean property to item entry in item.xml, "aliensOnly". This means item won't be salvaged on battlescape.
  • Add itegral weapons to items.xml, with aliensOnly set to true, a purchase cost of 0, and no build cost. Then item can't be bought or built. So player should never see it.

The alternate option would be add a "weapon" element to each terrorist in combatant. Write code to parse the XML, and special weapon handling code in combatant for the integral weapon, and things are starting to look complicated.

 

Additional thoughts

  • I probably need to treat X-Caps in the same way as terrorists. Except they're already items. Any ideas?
  • As it's only terrorist units (and X-Caps) that have integral weapons, should probably note that player can never see the inventory of a terror unit. Otherwise players are going to try mind controlling terror units and getting them to drop the weapon. Hmm. Should I give X-Caps a "terrorist" rank, or add a "no inventory" parameter to combatant.xml? Stupid question, of course I need to add another parameter.
  • The stock element in a loadout will probably go:
    	<stock item="ITEM_STUN_BOMB" x="0" y="0" />


    where x and y are the positions in a combatants inventory as given by InventoryLayout.cs.
    Reason for going this way is it makes code to equip soldier easier, although it does make writing the XML harder/more error prone

Link to comment
Share on other sites

AliensOnly attribute makes more sense I would move toward the first approach. That is what I intended to point... that the process of giving the characters at loadout would handle the special terrorist case. I would put another one in the loadout to force for an specific alien type too.

 

Greetings

Red Knight

Link to comment
Share on other sites

Guest Azrael Strife
Additional thoughts

[*] I probably need to treat X-Caps in the same way as terrorists. Except they're already items. Any ideas?

How about an "isAutonomous" boolean? if true they are also treated as combatants while on battlescape? :)

Link to comment
Share on other sites


×
×
  • Create New...