Jump to content
XCOMUFO & Xenocide

Xna 0.5


dteviot

Recommended Posts

Some progress:

 

- Fatal wounds with different body parts have been implemented.

- Fatal wounds works as in UFO: EU/D.

- Fatal wounds causes the soldier to bleed at the end of each turn.

- Fatal wounds can be healed (No med kit have been programmed, it is just that the fatal wounds can be healed which also heals a number of injury damage points)

- Fatal wounds are cleared after completed mission.

 

Things left to do related to fatal wounds:

- Fatal wounds should cause stat decrease (head => less morale, body => less energy, arms => less accuracy, legs => less TU's) I would like comments of references on how this works in the game. I'm not entirely sure on how to implement this. Adding properties in the Combatant class for morale, energy, accuracy and timeunits seems the best way right now.

- Injury damage should generate recovery days. Recovery days should decrease per day basis.

- Med kit healing...

 

I have attached the patch made on the trunk folder.

I've had a look at the patch, but it seems that you have not yet created (or at least not included in the patch) GameBalanceClass.cs. So the build fails.

Link to comment
Share on other sites

  • 3 weeks later...

I just built the latest copy and have noticed a couple of things.

 

Mainly after doing an action. Time stops. When I build the first base. When I tell an interceptor to attack a ufo, etc. Time pauses. And no matter what time button I click it is still paused. The only way to get time to start again is to switch screens (Go to base screen, research screen, etc) once I go back to geoscape. Time then starts. Has anyone noticed this?

 

Windows 7 x64.

Amd Phenom II X4 920 - Quad Core 2.8 Ghz

4 GB RAM

 

Also the button graphics seem to be off a little bit (Highlighted version is longer) I can look into this once I reinstall photoshop.

Link to comment
Share on other sites

I just built the latest copy and have noticed a couple of things.

 

Mainly after doing an action. Time stops. When I build the first base. When I tell an interceptor to attack a ufo, etc. Time pauses. And no matter what time button I click it is still paused. The only way to get time to start again is to switch screens (Go to base screen, research screen, etc) once I go back to geoscape. Time then starts. Has anyone noticed this?

 

Windows 7 x64.

Amd Phenom II X4 920 - Quad Core 2.8 Ghz

4 GB RAM

 

Also the button graphics seem to be off a little bit (Highlighted version is longer) I can look into this once I reinstall photoshop.

I had the same problem. It's when your FPS drop. In this case the game tries to bring them up by switching of the time advance. Unfortunately it seems that especially the more powerful machines are affected, which is kind of strange.

A workaround can be found here.

 

Too bad you won't have the time to be around more.

Link to comment
Share on other sites

I see, Maybe we can change that to check if it has already dropped a few updates and if so let a couple pass before dropping more. That way time still moves.

 

I want to stay around more, I just mean I prob will not be on every day for hours like I used to. But hopefully helping out here and there is possible.

 

 

Edit - I just tested this, after doing something, I just finished a fight FPS drop to 48-50 FPS. Maybe we should just lower it to below 30. Game shouldn't skip when your at 50 FPS.

 

Edit 2 - Should also try to figure out the drop. When I go to research and close it, game goes back to 59 FPS. I can then click off the game onto the web browser and it drops to 49. I click back to the game and it stays at 49 until I go to research and close it again. So something makes it drop.

Edited by Darkhomb
Link to comment
Share on other sites

Edit 2 - Should also try to figure out the drop. When I go to research and close it, game goes back to 59 FPS. I can then click off the game onto the web browser and it drops to 49. I click back to the game and it stays at 49 until I go to research and close it again. So something makes it drop.

Maybe speak to PezzA about this, he wanted to take a look at this problem (and since he is not a regular team member he can't read this...)

Link to comment
Share on other sites

Very nice work Loshult!
Who will patch up the trunk with the changes when I'm finished with the fatal wounds/healing stuff?
That would be Mad?

Probably. ;) But I'd prefer if dteviot would - it's his dept. after all.

So, are there any news about this? Or should I just patch it in? Loshult, are you still around?

Sorry, have been very busy the last few months with tons of work to do at work and at home. I'm starting to get some free time now so I'll get back into programming soon. Wait a few days and I'll try to finish everything up.

Link to comment
Share on other sites

I just found out that the stats are limited to integers while some usage of the stats assumes that it is double or float (Accuracy for example).

 

The Accuracy is loaded from an xml-file as a float value. Could anyone explain if it should be float or if it is a float value that actually is integers? I found out in combatant.xml that it is an integer value with 50 as mean and 20 in variance. I'll modify the shoot code so that it works correctly with integers instead of float.

Link to comment
Share on other sites

I just found out that the stats are limited to integers while some usage of the stats assumes that it is double or float (Accuracy for example).

 

The Accuracy is loaded from an xml-file as a float value. Could anyone explain if it should be float or if it is a float value that actually is integers? I found out in combatant.xml that it is an integer value with 50 as mean and 20 in variance. I'll modify the shoot code so that it works correctly with integers instead of float.

Well, the accuracy formula is given here: http://www.ufopaedia.org/index.php?title=Accuracy_formula

So the soldier's accuracy attribute can be regarded as a percentage.

Link to comment
Share on other sites

I'm currently continuing my implementation of wounds etc. and stumbled into the accuracy calculations of shooting actions. I'm trying to implement the function referred to by dteviot in his last post but I noticed that we have no information regarding the need to use both hands to not receive any accuracy penalty.

 

I have prepared the CarryInfo class with a bool property called BothHands for this purpose but I need help with going through the item.xml file and set it to the correct value. It should be true for weapons that requires both hands.

 

Could someone help me out with that?

 

Edit: I've attached the item.xml file that I have edited with the bothHands attribute set to false for all items since I cannot commit to the trunk yet.

item.xml

Edited by Loshult
Link to comment
Share on other sites

I think I have completed the fatal wounds implementation with healing and how it affects the stats. I've attached a patch from latest revision.

 

Edit: The GameBalanceClass.cs file in the foler Source\Model was missing in the patch. It is now also attached.

fatalwoundshealingstats.zip

Edited by Loshult
Link to comment
Share on other sites

Nice!

 

Two-Handed weapons:

Assault Rifle

Heavy Cannon (VAHC - Variable-Ammo Heavy Cannon)

Repeater Cannon (VARC - Variable Ammo Repeater Cannon)

Rocket Launcher

Laser Rifle

Heavy Laser Rifle

Plasma Rifle

Heavy Plasma Rifle

Stun Launcher

Gravity Distortion Launcher

 

The Stun Baton is "technically" a two-handed weapon, but it's guaranteed to work if you're next to the target, facing him. So, pick and choose ;)

Edited by kafros
Link to comment
Share on other sites

Nice!

 

Two-Handed weapons:

Assault Rifle

Heavy Cannon (VAHC - Variable-Ammo Heavy Cannon)

Repeater Cannon (VARC - Variable Ammo Repeater Cannon)

Rocket Launcher

Laser Rifle

Heavy Laser Rifle

Plasma Rifle

Heavy Plasma Rifle

Stun Launcher

Gravity Distortion Launcher

 

The Stun Baton is "technically" a two-handed weapon, but it's guaranteed to work if you're next to the target, facing him. So, pick and choose ;)

 

Thanks! I've updated the item.xml file with that information. It is attached.

 

Edit: Could someone with access check in my patch and the item.xml file in this post? I would like to continue with the stun damage handling but I don't want to add that into the same patch. It would be better if the working base was updated first.

item.xml

Edited by Loshult
Link to comment
Share on other sites

I think I have completed the fatal wounds implementation with healing and how it affects the stats. I've attached a patch from latest revision.
I'm at work at the moment, but I'll inspect and either clean it up and put it in the trunk, or let you know what needs fixing, either tonight or (more probably) this weekend.
Link to comment
Share on other sites

Edit: Could someone with access check in my patch and the item.xml file in this post? I would like to continue with the stun damage handling but I don't want to add that into the same patch. It would be better if the working base was updated first.
I'm a bit surprised the updated item.xml works, item.xsd should need to be updated as well. (Something else for me to look into.)
Link to comment
Share on other sites

Edit: Could someone with access check in my patch and the item.xml file in this post? I would like to continue with the stun damage handling but I don't want to add that into the same patch. It would be better if the working base was updated first.
I'm a bit surprised the updated item.xml works, item.xsd should need to be updated as well. (Something else for me to look into.)

 

Well, I updated item.xsd as well, adding the new attribute "bothHands" to the carryInfo element. Did you not get that in the patch?

Link to comment
Share on other sites

I decided to make a new version of the Patch and include all changes to it. It is attached.
OK, I've checked the code in (it took 5 hours to inspect it, so I don't want to do it again.)

 

Some observations.

1. Fatal Wounds should probably be removed from Statistics and Combatant and rolled into a FatalWounds class that is a member of the combatant. (This would allow different handling for the tanks, cyber disks, etc.)

 

2. Code like this

	otherArmOccupiedFactor = Inventory.ItemAt(activeArm == ActiveArm.Left ? 0 : 1, 0) != null ? 0.8 : 1;

especially the bit

Inventory.ItemAt(activeArm == ActiveArm.Left ? 0 : 1, 0)

is nasty. Really should be something like Inventory.ItemInHand(hand), where hand has values Left, Right, and None. (None is for things that don't have hands, like the tanks and cyberdisks.) Note, I'm guilty of this myself.

 

3. Names like "TimeUnitDecreaseDueToFatalWounds" in GameBalance aren't quite correct. They're not really exactly a 'decrease', they're more 'modifier'

 

4. I don't see how this unit test ever worked.

			Debug.Assert(combatant.Stats[Statistic.InjuryDamage] == 34);

		// Heal one wound
		combatant.Heal(BodyParts.Body);
		Debug.Assert(combatant.Stats[Statistic.InjuryDamage] == 31);
		Debug.Assert(combatant.Stats[Statistic.FatalWoundsHead] == 0);
		Debug.Assert(combatant.Stats[Statistic.FatalWoundsBody] == 1);

My reading of your heal code is the med kit either cures one fatal wound, or some points of injury, it doesn't do both. (or does it?)

 

5. GameBalanceClass needs a copyright notice.

 

6. This may not be a bug. (The thought is, even if the aliens win the battle, they've still got to fix their UFO before they can leave, assuming the UFO was shot down.)

>The UFO still remains when you have abandoned the mission. That's not the case in UFO Enemy Unknown.

 

7. In base healing rules are a bit different from UFO. Injured soldiers can be deployed. Therefore, they should get a random amount of healing per day. (0, 1 or 2 points, but that's not been implemented, and 1 point per day is good enough at this point in time.)

 

8. Please watch the line lengths. I try to keep it under 130 chars, as not everyone has wide screen monitors.

 

9. Please note the changes to Bleed() Heal() and Hit() in Source\Model\Battlescape\Combatants\Combatant.cs

I replaced replicated code in a switch with a lookup table.

Edited by dteviot
Link to comment
Share on other sites

Thanks for spending so much time with adapting my code to your code structure. I really appreciate that you took the time. I'll try to go through your list and improve everything and in the future create smaller patches.

 

When I updated my working copy i found out that some code had disappeared. I have attached a new patch with the things I think is missing and I would be glad if you could take another look at it and see if that is code that just happened to be missed when you applied my patch or if you rewrote the code so that it is working in another way.

Missing.zip

Link to comment
Share on other sites

Thanks for spending so much time with adapting my code to your code structure. I really appreciate that you took the time. I'll try to go through your list and improve everything and in the future create smaller patches.

 

When I updated my working copy i found out that some code had disappeared. I have attached a new patch with the things I think is missing and I would be glad if you could take another look at it and see if that is code that just happened to be missed when you applied my patch or if you rewrote the code so that it is working in another way.

1. I used the item.xml from the patch, I've just checked in the up to date version to trunk.

 

2. I removed WoundRecoveryDays, because we're using the Apocalapse model for injury (that is, you can deploy wounded soldiers on missions.)

 

3. ActiveTeam was removed from battlescape. Bleeding out for both teams is handled by Battlescape.onendOfTurn() (which is called when both teams have finished their turn.) See this, which I added with my last check-in.

 

4. This

			 foreach (Statistic s in fatalWoundsStat)
		 {
			 stats[s] = 0;
		 }

is the same as this

+			stats[Statistic.FatalWoundsHead] = 0;
+			stats[Statistic.FatalWoundsBody] = 0;
+			stats[Statistic.FatalWoundsLeftArm] = 0;
+			stats[Statistic.FatalWoundsRightArm] = 0;
+			stats[Statistic.FatalWoundsLeftLeg] = 0;
+			stats[Statistic.FatalWoundsRightLeg] = 0;

Link to comment
Share on other sites

  • 4 months later...

I was trying to check out how the new sprite looks that I was working on in equip soldier and I get an error clicking on soldiers in the menu.

 

---------------------------

Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue

---------------------------

 

 

 

 

 

 

at SoldiersListScreen.AddStatistic(Combatant combatant, Statistic s) F:\SVNs\Xenocide SVN\XenoXNA\Xenocide\Source\UI\Screens\SoldiersListScreen.cs(254)

 

at SoldiersListScreen.PopulateAttributes() F:\SVNs\Xenocide SVN\XenoXNA\Xenocide\Source\UI\Screens\SoldiersListScreen.cs(190)

 

at SoldiersListScreen.PopulateSoldierDetailPanel() F:\SVNs\Xenocide SVN\XenoXNA\Xenocide\Source\UI\Screens\SoldiersListScreen.cs(152)

 

at SoldiersListScreen.InitializeSoldierDetailPanel() F:\SVNs\Xenocide SVN\XenoXNA\Xenocide\Source\UI\Screens\SoldiersListScreen.cs(102)

 

at SoldiersListScreen.CreateCeguiWidgets() F:\SVNs\Xenocide SVN\XenoXNA\Xenocide\Source\UI\Screens\SoldiersListScreen.cs(83)

 

at Frame.Show() F:\SVNs\Xenocide SVN\XenoXNA\Xenocide\Source\UI\Screens\Frame.cs(109)

 

at ScreenManager.SwapScreens() F:\SVNs\Xenocide SVN\XenoXNA\Xenocide\Source\UI\Screens\ScreenManager.cs(141)

 

at ScreenManager.Update(GameTime gameTime) F:\SVNs\Xenocide SVN\XenoXNA\Xenocide\Source\UI\Screens\ScreenManager.cs(217)

 

at Xenocide.Update(GameTime gameTime) F:\SVNs\Xenocide SVN\XenoXNA\Xenocide\Source\Xenocide.cs(243)

 

at Game.Tick()

 

at Game.HostIdle(Object sender, EventArgs e)

 

at GameHost.OnIdle()

 

at WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)

 

at ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int

32 grfidlef)

 

at ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.F

PushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)

 

at ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

 

at ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

 

at Application.Run(Form mainForm)

 

at WindowsGameHost.Run()

 

at Game.Run()

 

at Program.Main() F:\SVNs\Xenocide SVN\XenoXNA\Xenocide\Source\Program.cs(52)

 

 

---------------------------

Abort Retry Ignore

---------------------------

Link to comment
Share on other sites

  • 2 weeks later...

Apologies for my absence.

Work has been brutal the last month (and will be for probaly the rest of the year. There's a multimillion dollar contract we're trying for, and we need to have the software ready by Christmas, or it's off.)

As for my spare time, I got a copy of Overlord, and it's _REALLY_ addictive.

 

fixed bug reported by Darkhomb with Soldier List screen crashing. (Was trying to display the fatal wounds information.)

SoldiersListScreen.cs.

 

 

I was trying to check out how the new sprite looks that I was working on in equip soldier and I get an error clicking on soldiers in the menu.

 

---------------------------

Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue

---------------------------

at SoldiersListScreen.AddStatistic(Combatant combatant, Statistic s) F:\SVNs\Xenocide SVN\XenoXNA\Xenocide\Source\UI\Screens\SoldiersListScreen.cs(254)

Link to comment
Share on other sites

×
×
  • Create New...