Jump to content


Photo

Xna 0.5


  • Please log in to reply
77 replies to this topic

#51 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 12 October 2009 - 07:43 AM

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.
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#52 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 12 October 2009 - 08:18 AM

Something interesting I noticed since the port to XNA 3.0: http://www.xcomufo.c...c...st&id=10431
It seems the day/night border is not smooth anymore, but sharp like a razor. As I recall it, it was nice and smoothly running over the valleys and heights when we were using XNA 1.0 refresh...
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#53 Darkhomb

Darkhomb

    Captain

  • Xenocide Artwork Department
  • 628 posts

Posted 31 October 2009 - 08:21 PM

It probally has something to do with the version of the shader model used.

#54 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 01 November 2009 - 02:35 AM

It probally has something to do with the version of the shader model used.

Yes, it does, anyway it's more or less fixed now. You can find a buidable source (which contains almost all not yet approved patches) from here.

Nice to have you back! :)

Edited by Mad, 01 November 2009 - 02:41 AM.

Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#55 Darkhomb

Darkhomb

    Captain

  • Xenocide Artwork Department
  • 628 posts

Posted 01 November 2009 - 10:59 AM

Nice to have you back! :)


Thanks, I don't plan to be as active as I was, as I am very busy but I would like to help out everynow and then.

#56 Darkhomb

Darkhomb

    Captain

  • Xenocide Artwork Department
  • 628 posts

Posted 01 November 2009 - 11:18 AM

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.

#57 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 01 November 2009 - 12:07 PM

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.
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#58 Darkhomb

Darkhomb

    Captain

  • Xenocide Artwork Department
  • 628 posts

Posted 01 November 2009 - 05:01 PM

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, 01 November 2009 - 05:07 PM.


#59 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 02 November 2009 - 02:18 AM

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...)
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#60 Darkhomb

Darkhomb

    Captain

  • Xenocide Artwork Department
  • 628 posts

Posted 08 November 2009 - 11:47 AM

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



Fixed.

#61 Loshult

Loshult

    Sergeant

  • Xenocide Programming Department
  • 30 posts

Posted 09 November 2009 - 01:00 PM

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.

#62 Loshult

Loshult

    Sergeant

  • Xenocide Programming Department
  • 30 posts

Posted 09 November 2009 - 01:46 PM

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.

#63 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 09 November 2009 - 04:15 PM

I'll get back into programming soon. Wait a few days and I'll try to finish everything up.

That would be great! Thanks!
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#64 dteviot

dteviot

    Programming Department

  • [Xenocide Senior Members]
  • 1,479 posts

Posted 10 November 2009 - 01:01 PM

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...ccuracy_formula
So the soldier's accuracy attribute can be regarded as a percentage.
Saving the world from the scum of the universe is hard work. Especially when you have to create the scum to begin with.

#65 Loshult

Loshult

    Sergeant

  • Xenocide Programming Department
  • 30 posts

Posted 12 November 2009 - 12:46 AM

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.

Attached Files

  • Attached File  item.xml   82.78K   16 downloads

Edited by Loshult, 12 November 2009 - 01:17 AM.


#66 Loshult

Loshult

    Sergeant

  • Xenocide Programming Department
  • 30 posts

Posted 12 November 2009 - 06:01 AM

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.

Attached Files


Edited by Loshult, 13 November 2009 - 04:52 AM.


#67 kafros

kafros

    Creative Text Department

  • Xenocide Creative-Text Departmen
  • 1,800 posts

Posted 12 November 2009 - 07:47 AM

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, 12 November 2009 - 07:52 AM.


#68 Loshult

Loshult

    Sergeant

  • Xenocide Programming Department
  • 30 posts

Posted 12 November 2009 - 09:21 AM

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.

Attached Files

  • Attached File  item.xml   82.77K   14 downloads

Edited by Loshult, 12 November 2009 - 12:25 PM.


#69 dteviot

dteviot

    Programming Department

  • [Xenocide Senior Members]
  • 1,479 posts

Posted 12 November 2009 - 12:43 PM

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.
Saving the world from the scum of the universe is hard work. Especially when you have to create the scum to begin with.

#70 dteviot

dteviot

    Programming Department

  • [Xenocide Senior Members]
  • 1,479 posts

Posted 12 November 2009 - 12:54 PM

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.)
Saving the world from the scum of the universe is hard work. Especially when you have to create the scum to begin with.

#71 Loshult

Loshult

    Sergeant

  • Xenocide Programming Department
  • 30 posts

Posted 13 November 2009 - 04:53 AM

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?

#72 Loshult

Loshult

    Sergeant

  • Xenocide Programming Department
  • 30 posts

Posted 14 November 2009 - 12:27 AM

I decided to make a new version of the Patch and include all changes to it. It is attached.

Attached Files



#73 dteviot

dteviot

    Programming Department

  • [Xenocide Senior Members]
  • 1,479 posts

Posted 14 November 2009 - 03:28 PM

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, 14 November 2009 - 03:30 PM.

Saving the world from the scum of the universe is hard work. Especially when you have to create the scum to begin with.

#74 Loshult

Loshult

    Sergeant

  • Xenocide Programming Department
  • 30 posts

Posted 15 November 2009 - 06:03 AM

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.

Attached Files



#75 dteviot

dteviot

    Programming Department

  • [Xenocide Senior Members]
  • 1,479 posts

Posted 15 November 2009 - 01:17 PM

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;

Saving the world from the scum of the universe is hard work. Especially when you have to create the scum to begin with.

#76 Loshult

Loshult

    Sergeant

  • Xenocide Programming Department
  • 30 posts

Posted 16 November 2009 - 02:35 AM

Then I think everything is in trunk now. I'll start working on your 9 points above.

#77 Darkhomb

Darkhomb

    Captain

  • Xenocide Artwork Department
  • 628 posts

Posted 21 March 2010 - 02:39 PM

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
---------------------------

#78 dteviot

dteviot

    Programming Department

  • [Xenocide Senior Members]
  • 1,479 posts

Posted 03 April 2010 - 04:53 PM

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)


Saving the world from the scum of the universe is hard work. Especially when you have to create the scum to begin with.