Jump to content
XCOMUFO & Xenocide

Xna Stage 0.4


dteviot

Recommended Posts

See the attached screenshot, I supposed it was normal :S

That screenshot is old, it should look like my post #42 on this thread.

 

And of course, if I click on a cell where there is no terrain, BOOM assert() fails and the application crashes :O

And that's been fixed in the latest build 0.3.1791

 

Edit:

I don't know about the EU formula and I don't know if there's anything related in Zombie's + NKF's ufopaedia, but let me give it a wild shot.

 

http://www.sciforums.com/showthread.php?t=53810 Discussion on lethal jump height

 

How fatal a fall is, is definitely determined by the (de-)acceleration of the body. Large a -> Large F -> Bigger possibility to receive physical damage.

Let's make it simpler and suppose it's just a matter of height. (for the game at least, I guess a soldier will never fall on his head :P)

 

It seems that a fall from the 4th floor (that would be aprox. 10 meters) is usually fatal. 10 meters, let's say that each xeno block is 2m. That would be 5 blocks.

 

Let's suppose that the average soldier has 60hp. A factor of 2 seems good, so... Let's say that you don't receive damage from a 1-cell fall (2 meters, that would be lame :P). So, there are 4 blocks that can kill our soldier, 60 / 2^4 = 3,75. Let's round it a bit, 4.

 

So:

if ( number_of_cells_of_the_fall >1 )
  hp -= 4 * (number_of_cells_of_the_fall - 1);

 

In addition, U = mgh, so you could once again say that the whole potential energy is received by our unlucky victim, he starts receiving punishment for falls >2m etc etc etc (another way of thinking)

 

Very rough and simple, but hey at least I tried :P

Damage from a fall isn't the big problem, it's getting the pathfinder to balance damage from fall against reduced travel time.

 

On a vaguely related topic, does anyone know if Apoc uses stairs/ramps anywhere to go between levels? or is it just grav lifts that can do that?

Link to comment
Share on other sites

  • Replies 155
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

That screenshot is old, it should look like my post #42 on this thread.

And that's been fixed in the latest build 0.3.1791

Yep that's the point, I'm compiling the latest SVN version and that's what I receive when I debug battlespace ;)
Link to comment
Share on other sites

Guest Azrael Strife
See the attached screenshot, I supposed it was normal :S

That screenshot is old, it should look like my post #42 on this thread.

 

And of course, if I click on a cell where there is no terrain, BOOM assert() fails and the application crashes :O

And that's been fixed in the latest build 0.3.1791

 

Edit:

I don't know about the EU formula and I don't know if there's anything related in Zombie's + NKF's ufopaedia, but let me give it a wild shot.

 

http://www.sciforums.com/showthread.php?t=53810 Discussion on lethal jump height

 

How fatal a fall is, is definitely determined by the (de-)acceleration of the body. Large a -> Large F -> Bigger possibility to receive physical damage.

Let's make it simpler and suppose it's just a matter of height. (for the game at least, I guess a soldier will never fall on his head :P)

 

It seems that a fall from the 4th floor (that would be aprox. 10 meters) is usually fatal. 10 meters, let's say that each xeno block is 2m. That would be 5 blocks.

 

Let's suppose that the average soldier has 60hp. A factor of 2 seems good, so... Let's say that you don't receive damage from a 1-cell fall (2 meters, that would be lame :P). So, there are 4 blocks that can kill our soldier, 60 / 2^4 = 3,75. Let's round it a bit, 4.

 

So:

if ( number_of_cells_of_the_fall >1 )
  hp -= 4 * (number_of_cells_of_the_fall - 1);

 

In addition, U = mgh, so you could once again say that the whole potential energy is received by our unlucky victim, he starts receiving punishment for falls >2m etc etc etc (another way of thinking)

 

Very rough and simple, but hey at least I tried :P

Damage from a fall isn't the big problem, it's getting the pathfinder to balance damage from fall against reduced travel time.

 

On a vaguely related topic, does anyone know if Apoc uses stairs/ramps anywhere to go between levels? or is it just grav lifts that can do that?

Of course it uses stairs and ramps :) don't you remember the slums? there are only a couple of grav lifts, or one at all, the rest are stairs, like the fire escape stairs in the side of the slum buildings and such.

Link to comment
Share on other sites

I think X-Com's (even Apoc) pathfinding didn't give a damn about a soldier's well being, it was your own fault if you ended up leading them to their doom. :P Plus most buildings are designed to not have convenient suicide points, so I suppose it comes down to luck and level design.
Link to comment
Share on other sites

That screenshot is old, it should look like my post #42 on this thread.

And that's been fixed in the latest build 0.3.1791

Yep that's the point, I'm compiling the latest SVN version and that's what I receive when I debug battlespace ;)

Something odd is going on here, if you've got 1791, you should NOT be seeing that on the battlescape. At the very least, the texture it's using to paint the tiles was replaced in build 1788.

 

I forgot to ask, as I saw the screenshot of the tiles you had in battlescape, what should it look like? This is what mine looks like.
I think you should be able to see the terrain. Well, I can see it, although it blinks like crazy, so there's something wrong.

Can you describe the blinking?

Does it occur all the time, or only when the mouse moves?

Also, what framerate are you getting?

 

 

On a vaguely related topic, does anyone know if Apoc uses stairs/ramps anywhere to go between levels? or is it just grav lifts that can do that?

Of course it uses stairs and ramps :) don't you remember the slums? there are only a couple of grav lifts, or one at all, the rest are stairs, like the fire escape stairs in the side of the slum buildings and such.

It's been 5 or 6 years since I last played Apoc. So forgive me if my memory is a bit rusty.

Link to comment
Share on other sites

Guest Azrael Strife

On a vaguely related topic, does anyone know if Apoc uses stairs/ramps anywhere to go between levels? or is it just grav lifts that can do that?

Of course it uses stairs and ramps :) don't you remember the slums? there are only a couple of grav lifts, or one at all, the rest are stairs, like the fire escape stairs in the side of the slum buildings and such.

It's been 5 or 6 years since I last played Apoc. So forgive me if my memory is a bit rusty.

Last time I played can be seen in this thread, it contains many screenshots, if you wanna look for something in particular :) here's a screenshot of ramps: http://www.xcomufo.com/forums/index.php?ac...ost&id=7540

Link to comment
Share on other sites

I forgot to ask, as I saw the screenshot of the tiles you had in battlescape, what should it look like? This is what mine looks like.
I think you should be able to see the terrain. Well, I can see it, although it blinks like crazy, so there's something wrong.

 

Progress:

  • Battlescape's terrain should now draw correctly
  • Non-flying units fall if step into empty cells
  • LineMesh implements IDispose

 

Notes.

  • I believe I've fixed the terrain not showning on battlescape issue. Also should fix flicker, as reported by Supsuper. Notes below.
  • However, even when I use a software renderer or the Debug DirectX, I haven't been able to replicate the problem Darkhomb reports with list solders Screen not showing.

 

Well, I've solved one problem. Here's how I did it, in case it's of interest/use to anyone else:

 

First thing I did was switch to the Debuging DirectX Runtime, with Maximum Debug Output Level and maximum validation (using Start->Programs->Microsoft DirectX SDK->DirectX utilites->DirectX Control Panel)

Then, when I ran my program, I now get an exception InvalidOperationException in Device.DrawIndexedPrimities().

 

So next I run PIX (Start->Programs->Microsoft DirectX SDK->DirectX utilites->PIX for windows) and use PIX to launch my program, and examine the output after it crashes.

 

What I saw was this:

Direct3D9: (ERROR) :Vertex shader function usage (D3DDECLUSAGE_COLOR,0) does not have corresponding usage in the current vertex declaration

Direct3D9: (INFO) :The vertex declaration is (Stream, Offset, Type, Method, Usage, UsageIndex):

Direct3D9: (INFO) :0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0

Direct3D9: (INFO) :0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0

Direct3D9: (INFO) :0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0

Direct3D9: (ERROR) :DrawIndexedPrimitive failed.

 

After scratching my head for a bit, I realised what this says is "The Shader has been told it is getting a stream of VertexPositionNormalTexture vertices, but the shader is trying to access a color element in each vertex, which isn't there."

At this point, I realised that:

  • The BasicEffect I was using to draw the mesh was also used to draw a set of VertexPositionColor vertices.
  • To get that to work, I'd set the basic effect's VertexColorEnabled to true.
  • So, problem solved by setting VertexColorEnabled to false before calling DrawIndexedPrimitive()

Link to comment
Share on other sites

Progress:

  • Added a controllable RandomPool to Xenocide.RollDice(), so "random" behaviour in unit tests can be controlled. and restored RetaliationTaskTest()
  • Up/Down/Left/Right keys on battlescape now move camera' position (in X-Z plane) relative to camera's orientation

Link to comment
Share on other sites

Considering my faulty rendering of the battlescape, I deleted everything and reloaded the whole XNA SVN tree. Rebuilt, and it works now :S, I can see the Morlock "pathfinding" his way around the house :D.

 

Unit Tests are successful. But, when in "Debug Battlescape", if I click the abort mission button, the game crashes! I ran it in debug mode and found that it was a "NullReferenceException was unhandled" error in the aircraft code

Edited by kafros
Link to comment
Share on other sites

But, when in "Debug Battlescape", if I click the abort mission button, the game crashes! I ran it in debug mode and found that it was a "NullReferenceException was unhandled" error in the aircraft code, have a look yourself:

That's expected. While I connect up enough to start the battlescape mission, I don't connect up enough for it to correctly finish when it's done.

But good to here everything else is working.

Link to comment
Share on other sites

Progress:

  • TerrainMesh's IndexBuffer uses 32 bit ints
  • "Debug Battlescape" screen no longer crashes when "Abort Mission" pressed.
  • Stubbed in a Random City Battlescape, to give some idea of what a big terrain is like.
  • Create alien forces on the battlescape based on the UFOs crew.

 

Notes.

  • Viper model isn't centering correctly on tiles in battlescape. Where is the model's origin?
  • Because the only alien models I've got are Morlock, Viper and Silabrate, all aliens in combatant.xml are using one of these models.
  • I'm still waiting for textures for "grav lift", "water" and "x-corp start position"

Link to comment
Share on other sites

Progress:

  • Assign starting soldiers to transport aircraft
  • Battlescape is populated with soldiers and aliens from aircraft and UFO
  • Draw X-Corp soldiers at their position on battlescape
  • Fixed problems with Release build not building
  • Keep values for soldier statistics

 

Notes.

  • Note, because I don't have any X-Corp soldier models, I've hooked them up to the Cannon X-Cap.
  • I've managed to fix some of the Battlescape tiling problems. The root cause is that the pixel sampler is using linear filtering.
    The solution is to place 1 pixel "gutters" around each of the textures in the atlas.
    E.g. the 128 x 128 pixel textures used to create the battlescape need to be 126 x 126, with the outermost rows duplicated to make the bitmap 128 x 128. (I hope that's clear.)
    I'll try and re-find the link explaining in more detail.
  • If you left click on the right rear quadrant of an X-Cap, you can then left click elsewhere on the map to move it. Hit 'escape' to select another X-Cap.
  • Pathfinder drawn on battlescape still keys of alien[0] however. Ran out of time to update.

Link to comment
Share on other sites

Progress:

 

 

  • Viper model isn't centering correctly on tiles in battlescape. Where is the model's origin?

believe the models origin is the back right. I'll check tomorrow.

 

  • Because the only alien models I've got are Morlock, Viper and Silabrate, all aliens in combatant.xml are using one of these models.
  • I'm still waiting for textures for "grav lift", "water" and "x-corp start position"

see what I can do.

 

Progress:

  • Note, because I don't have any X-Corp soldier models, I've hooked them up to the Cannon X-Cap.

should be able to give you the female soldier tomo

 

  • I've managed to fix some of the Battlescape tiling problems. The root cause is that the pixel sampler is using linear filtering.
    The solution is to place 1 pixel "gutters" around each of the textures in the atlas.
    E.g. the 128 x 128 pixel textures used to create the battlescape need to be 126 x 126, with the outermost rows duplicated to make the bitmap 128 x 128. (I hope that's clear.)

Not quite sure what you mean at the moment

I'll try and re-find the link explaining in more detail.

Good work as always

Link to comment
Share on other sites

I've managed to fix some of the Battlescape tiling problems. The root cause is that the pixel sampler is using linear filtering.

The solution is to place 1 pixel "gutters" around each of the textures in the atlas.

E.g. the 128 x 128 pixel textures used to create the battlescape need to be 126 x 126, with the outermost rows duplicated to make the bitmap 128 x 128. (I hope that's clear.)

I'll try and re-find the link explaining in more detail.

The full thread, describing the issue

The post that describes how to fix the problem, using gutters.

Link to comment
Share on other sites

Progress:

  • Added female soldier model. Connected to battlescape and xnet.
  • Geoscape can render using a v1.1 shader if 2.0 isn't available
  • Fixed last checkin breaking save games

Notes.

  • The 1.1 Geoscape shader is really sucky. After 4 hours fighting it, I couldn't get Day/Night to work properly (To say nothing of night and bump maps.)
    So, it just draws the earth, (And on game startup, warns user to expect awful graphics.)
    If someone's got a graphics card that only supports v1.1. would test it, that would be appreciated.

Link to comment
Share on other sites

Progress:

  • Strings.Designer.cs is now automatically generated as part of the build from strings.resx
  • Stopped crash if try to start a terror or Alien Outpost battlescape mission
  • Battlescape screen shows path for selected combatant
  • In Battlescape, if you have a combatant selected, and you left click on another combatant, your selected combatant changes.
  • Corrected the filename of CombatantInfo and CombatantInfo.Distribution

Notes.

  • Some of you might remember that when you add a new string to strings.resx, the resource editor would recreate Strings.Designer.cs. This gave a minor issue, because we had different language versions of Visual Studio, which meant the editor would put language specific comments into Strings.Designer.cs. Which meant that SVN flaged almost the entire file as changed, if even one string was added. Well, now that the build process automatically generates Strings.Designer.cs, this is no longer a problem, as we don't need to put Strings.Designer.cs into SVN.

Link to comment
Share on other sites

The 1.1 Geoscape shader is really sucky. After 4 hours fighting it, I couldn't get Day/Night to work properly (To say nothing of night and bump maps.)

So, it just draws the earth, (And on game startup, warns user to expect awful graphics.)

If someone's got a graphics card that only supports v1.1. would test it, that would be appreciated.

 

My 5200 is able to do (sucky, not really working) v2.0 shaders. So I used RivaTuner to force v1.1 Shaders. I get the "gfx are going to be sucky" dialog, but then I get an unhandled exception "Both a valid vertex shader and pixel shader (or valid effect) must be set on the device before draw operations may be performed". That happens in both, Release and Debug. Exception detail:

System.InvalidOperationException was unhandled
 Message="Both a valid vertex shader and  pixel shader (or valid effect) must be set on the device before draw operations may be performed."
 Source="Microsoft.Xna.Framework"
 StackTrace:
   bei Microsoft.Xna.Framework.Graphics.GraphicsDevice.VerifyCanDraw(Boolean bUserPrimitives, Boolean bIndexedPrimitives)
   bei Microsoft.Xna.Framework.Graphics.GraphicsDevice.DrawPrimitives(PrimitiveType primitiveType, Int32 startVertex, Int32 primitiveCount)
   bei CeGui.Renderers.Xna.XnaRenderer.DoRender() in E:\Downloads\PJxenocide\XNASource\trunk\Dependancies\CeGui\CeGui.Renderers.Xna\Source\XnaRenderer.cs:Zeile 263.
   bei CeGui.GuiSystem.RenderGui() in E:\Downloads\PJxenocide\XNASource\trunk\Dependancies\CeGui\CeGui\Source\GuiSystem.cs:Zeile 288.
   bei CeGui.Renderers.Xna.GuiManager.Draw(GameTime gameTime) in E:\Downloads\PJxenocide\XNASource\trunk\Dependancies\CeGui\CeGui.Renderers.Xna\Source\GuiManager.cs:Zeile 80.
   bei Microsoft.Xna.Framework.Game.Draw(GameTime gameTime)
   bei ProjectXenocide.Xenocide.Draw(GameTime gameTime) in E:\Downloads\PJxenocide\XNASource\trunk\Xenocide\Source\Xenocide.cs:Zeile 260.
   bei Microsoft.Xna.Framework.Game.DrawFrame()
   bei Microsoft.Xna.Framework.Game.Paint(Object sender, EventArgs e)
   bei Microsoft.Xna.Framework.Gamewindow.OnPaint()
   bei Microsoft.Xna.Framework.WindowsGamewindow.mainForm_Paint(Object sender, PaintEventArgs e)
   bei System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
   bei System.Windows.Forms.Form.OnPaint(PaintEventArgs e)
   bei System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   bei System.Windows.Forms.Control.WmPaint(Message& m)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   bei System.Windows.Forms.ContainerControl.WndProc(Message& m)
   bei System.Windows.Forms.Form.WndProc(Message& m)
   bei Microsoft.Xna.Framework.WindowsGameForm.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
   bei System.Windows.Forms.Nativewindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   bei CallWindowProcW(IntPtr , HWND__* , UInt32 , UInt32 , Int32 )
   bei MouseSubClassFunc(HWND__* hWnd, UInt32 msg, UInt32 wParam, Int32 lParam)
   bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNat
iveMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.Run(Form mainForm)
   bei Microsoft.Xna.Framework.WindowsGameHost.Run()
   bei Microsoft.Xna.Framework.Game.Run()
   bei ProjectXenocide.Program.Main() in E:\Downloads\PJxenocide\XNASource\trunk\Xenocide\Source\Program.cs:Zeile 44.

yea, it's german, sorry 'bout that. Zeile = Line, bei = at, but I guess that was understandable anyway...

Link to comment
Share on other sites

I found a Computer at work with a Radeon 9200 SE (pixel shader v 1.4), so I guess I could try it here as well. But I obiously don't have a compiled version of Xenocide on me atm. So if you're in a hurry with results, maybe someone could PM me with the latest compiled Xenocide version... Please? :rolleyes: Otherwise I can check it on Thursday.
Link to comment
Share on other sites

I just compressed the latest compiled build and it's around 30MB large! I can't send it via email, PM or upload it to my site, sorry :\

Even the rar-ed release build is 29MB big

 

Nope, maximum attachment size is 10MB :S

Edited by kafros
Link to comment
Share on other sites

I just compressed the latest compiled build and it's around 30MB large! I can't send it via email, PM or upload it to my site, sorry :\

Even the rar-ed release build is 29MB big

could you email to my PX adress?

 

Edit: nevermind, I'll get you the results on thursday then. :)

Edited by Mad
Link to comment
Share on other sites

Guest Azrael Strife
I just compressed the latest compiled build and it's around 30MB large! I can't send it via email, PM or upload it to my site, sorry :\

Even the rar-ed release build is 29MB big

could you email to my PX adress?

 

Edit: nevermind, I'll get you the results on thursday then. :)

If you're going to be online, kafros, why not send it over bitTorrent?

Link to comment
Share on other sites

I can upload it to the server if we want

 

edit maybe time for a new release

A minor point, if we're going to do a release, we should fix up the copyright issues. .mp3 sound files need to be .ogg, and we need a free font.

Progress:

  • Combatants now have a move action that moves them around the battlescape

Notes.

  • Watch the X-Corp soldiers slide around the battlescape!

Link to comment
Share on other sites

I found a Computer at work with a Radeon 9200 SE (pixel shader v 1.4), so I guess I could try it here as well. But I obiously don't have a compiled version of Xenocide on me atm. So if you're in a hurry with results, maybe someone could PM me with the latest compiled Xenocide version... Please? :rolleyes: Otherwise I can check it on Thursday.

No point, the debug tells me the problem is CeGUI is also using a 2.0 shader. I'll have to have a look at it and see if I can make it a v1.1 as well. Profanity.

Link to comment
Share on other sites

A minor point, if we're going to do a release, we should fix up the copyright issues. .mp3 sound files need to be .ogg, and we need a free font.

 

converting to ogg is not a problem, I should be able to do that tonight.

 

I don't have the skills to make a font. best we can do is find some free ones and vote which we like for each part.

Link to comment
Share on other sites

The 2 music mp3's have been converted.

Thank you for that.

Progress:

  • CeGUI#'s default shader should now run on v1.1 shader cards.

Can someone please try this out (see if Xenocide now runs on a Shader v1.1 card) and let me know how it goes.

Thanks.

Edited by dteviot
Link to comment
Share on other sites

By the way, I saw the movement finally, wow, great work! Wish we had more animated models.

I'm afraid it's going to be a while before you see the models animated.

The problem is the XNA libraries don't do animation "out of the box" for .x and .fbx models.

You need to write a significant amount of code to play animations (although sample code showing how to do it is available), but at the current time, my focus is to get the game logic working.

That said, there are a couple of XNA libraries out there that WILL draw and animate Quake2 (.md2) models.

Final comment, I'm not sure if this is in the art specs or not but, it will make life easier if

  • we figure out what animation sequences we want.
  • We make sure every model has all the sequences. (It would be nice if it was called the same thing in each model, but I can aways do a mapping layer to work around that.)
  • Each model needs a fake "bone/joint" in the left and right "hand" as an attachment point for the item in the hand. Ideally, the bones would have standard names, so it's easy to locate them in the model.

 

And a final speculation, could we use GTKRadient as a map builder?

Link to comment
Share on other sites

A minor point, if we're going to do a release, we should fix up the copyright issues. .mp3 sound files need to be .ogg, and we need a free font.

I digged these up.

 

OCR A Extended alternatives:

http://www.1001freefonts.com/datacontrol.htm

http://www.1001freefonts.com/bravenewera.htm

 

Gotthard alternatives:

http://www.1001freefonts.com/goodtimes.htm

http://www.1001freefonts.com/venusrising.htm

http://www.1001freefonts.com/zerohour.htm

http://www.1001freefonts.com/fraulein.htm

Link to comment
Share on other sites

Progress:

  • Renamed Action classes to Order
  • CeGUI# Bug: fixed Window::Show() or Hide() do not call Window::RequestRedraw()
  • Show stats (or at least TUs) for selected combatant on Battlescape.
  • Removed the "Select a soldier" state from Battlescape. When it's X-Corp player's turn to order soldiers, one is always selected.
  • (1 TU per 45 degress of turn, 8 TUs to move north/south/up/down. 12 TUs to move NE/NW/SW/SE.)
  • Each turn, combatants can only move until they run out of TUs
  • TUs are restored at start of each turn.
  • Path drawn on battlescape shows how far combatant can move this turn

Link to comment
Share on other sites

Progress:

  • Pathfinder doesn't clip corner off buildings
  • Pathfinder won't let a combatant walk through another
  • For testing purposes, on battlescape player can manipulate aliens just like x-corp soldiers
  • Combatant.xml has entry for default soldier loadout (what soldiers come equiped with when purchased.)
  • X-Corp soldiers now come equiped with assualt rifles & grenades
  • Fixed Left/Right labels on Equip soldier screen being transposed

Notes.

  • I'll take suggestions for changing the default equipment loadout.
  • Thought for 1st iteration Alien AI. (Shameless cheating) Each alien heads to closest X-Corp soldier and starts shooting as soon as has line of sight and is in range.

Link to comment
Share on other sites

Can someone please try this out (see if Xenocide now runs on a Shader v1.1 card) and let me know how it goes.

Thanks.

It is working nicely on a v 1.3 shader card (Radeon 9200SE). Funny thing: The pushpins still have lightning effects (earth itself has, as previously described, no effects - in fact, the pacific ocean is a bit dark... ;)).

Edited by Mad
Link to comment
Share on other sites

Can someone please try this out (see if Xenocide now runs on a Shader v1.1 card) and let me know how it goes.

Thanks.

It is working nicely on a v 1.3 shader card (Radeon 9200SE). Funny thing: The pushpins still have lightning effects (earth itself has, as previously described, no effects - in fact, the pacific ocean is a bit dark... ;)).

That's because the pushpins are drawn using XNA's basic effect. The Earth is drawn using a shader.

 

 

Progress:

  • In general Readonly members should be static (or const)
  • Weapons initially assigned to X-Corp soldiers are loaded.
  • On game start, check that graphics card is at least shader v1.1
  • Tweaked MessageBox. Hopefully shows more text for large messages.
  • Added a "select target to shoot" mode to battlescape, triggered by the "Right hand" button on menu.

Notes.

  • Mad, please check that the "at least shader v1.1" code works. Thanks.
  • At moment, I don't correctly populate the alien forces for an "attack on alien outpost" mission. (Or a terror mission for that matter.) However, I do correctly populate for X-Corp attacking UFOs. So. I can do the alien troops for a terror mission by creating a Terror UFO and stripping its crew. However, this won't work for alien outpost, because there's no UFO. Proposed solution: create an "AlienOutpost" UFO in item.xml that is just used to hold the troop info for an alien outpost. (Something similar can be done for the two phases of the Cydona mission as well.) Any comments?

Link to comment
Share on other sites

Mad, please check that the \"at least shader v1.1\" code works. Thanks.

 

Yep, it works fine! Great work, Thanks! :)

 

At moment, I don\'t correctly populate the alien forces for an \"attack on alien outpost\" mission. (Or a terror mission for that matter.) However, I do correctly populate for X-Corp attacking UFOs. So. I can do the alien troops for a terror mission by creating a Terror UFO and stripping its crew. However, this won\'t work for alien outpost, because there\'s no UFO. Proposed solution: create an \"AlienOutpost\" UFO in item.xml that is just used to hold the troop info for an alien outpost. (Something similar can be done for the two phases of the Cydona mission as well.) Any comments?

That sounds like a very good idea - maybe you can use the alien base itself as ufo. That way you would not have to write special code for alien base missions. A base would just be a special kind of landed UFO.

Edited by Mad
Link to comment
Share on other sites

Progress:

  • Implemented simple IsLineOfSight(). There are some odd corner effects, but I think it's good enough.

Notes.

  • Anyone who objects to the IsLineOfSight() behaviour is welcome to write a better version.
  • You can see the line of sight behavior by clicking on the "right hand" button. Cursor is yellow if target has line of sight, red if enemy and line of sight, otherwise white.

Link to comment
Share on other sites

Progress:

  • added "flyer" element to armors in combatant.xml
  • added dummy UFO entries to item.xml, for alien force size for outpost and cydona missions
  • added startSound attribute to action in item.xml
  • added shots (number of times weapon fired) attribute to shoot action in item.xml

 

Not much to see I'm afraid. I'm trying to get shooting to work (as you might have guessed) but it's going to take a while. It's a lot harder than you'd think.

Showing bullets on battlefield, handing hit and miss cases, and multiple shots from autofire.

Link to comment
Share on other sites

Progress:

  • Soldiers can now shoot on battlescape

Notes.

  • I've only just put in the plumbing to shoot, so you can now click on the "right hand" button, and then click on a location on the battlescape and if the cursor is yellow or red, a bullet will be fired at the location.
    It currently handles TUs, but not ammo usage, Hit/Miss or Damage checking.
  • I've had a look at the shader code, to try and correctly combine daylight and bump map. It turns out that mathematically it's easy to do. The problem is, the result looks bad. The reason is, the earth itself is a giant bump, so as the earth curves away towards the night zone, the terrain gets darker. The end result is areas that are in daylight look like they're night. So, it looks like daylight never reaches Europe.

Link to comment
Share on other sites

Progress:

  • Firing weapon consumes ammo, and can't shoot when run out of ammo
  • Combatants block line of fire
  • Shots can hit or miss (based on accuracy of weapon and combatant)
  • Shots do damage to combatants, and combatants can die.

Notes.

  • I haven't bothered implementing logic to figure out where the bullet goes when a shot misses.
    If anyone can figure out a better solution, please let me know. At moment, best I can come up with is:
    • Find all cells that are near (say within 3 cells) of target.
    • Exclude all cells that are (a) off map, or (B) not in the shooter's field of view.
    • Pick a cell at random from the remaining set.
    • Trace ray from shooter to selected cell, see where ray ends.
    • If ray is blocked, then shot hits whatever is blocking it.
    • Otherwise, if end cell is occupied, shot hits occupant.

    [*]I don't do damage to landscape from missed shots

    [*]I don't have combatants bleeding out from wounds

    [*]Weapons don't do random amounts of damage.

    [*]You can click on aliens, and have them move and shoot as X-Corp soldiers

    [*]You can't give orders to dead combatants. (But you can click on them and see their stats.)

    [*]Note, some aliens are equiped with BB launchers, and they can't fire because I haven't implemented the "Set Waypoint" action.

Edited by dteviot
Link to comment
Share on other sites

My current plan, is to try and get the battlescape to a minimally playable state as quickly as possible.

So, I need to figure out what the minimum set of features needed to do this is.

I believe the set is:

  • Soldiers can select fire mode (aimed/snap/auto)
  • Add a "turn" move type command to rotate soldiers in place
  • Aliens are only visible on battlescape when they're in line of sight of an X-Corp soldier
  • Soldiers able to examine their inventory on battlescape (at least to the extent of being able to reload weapons.)
  • Minimal AI for aliens. (Move to closest X-Corp soldier, shoot once in range, repeat until dead, or all X-Corp dead.)
  • Detect end of mission
  • Collect salvage (if any) at end of mission. (This will give aliens and hardware for research.)
  • Build a terrain that represents at least a small degree of difficulty. Say something like the "inside a human base" part of the capture a territory mission in UFO:Aftermath.

Additional points.

  • Have I missed anything?
  • These features are (I think) independent. So other people can work on them as well as me. I'll be starting at the top of the list and work my way down. Please post here if you're going to work on any of the features, so we don't duplicate our efforts.

Link to comment
Share on other sites

Indeed it seems to be the minimun battlescape requirement list :)

 

Some silly (sorry :$) questions/comments though: (just asking to be sure :O)

 

1) Grenades, medipacks and "waypoint-weapons" are to be implemented later?

2) In addition, what about stun damage? (either due to physical damage or by stun weapons)

3) Concerning the AI, the Aliens will know where the soldiers are and just move towards them until they are in their LOS?

4) The AI will be written exclusively in C#?

 

And super silly question #5:

5) Are there any parts that don't need "C#-specific" knowledge and that could be implemented with basic C/C++ knowledge?

Edited by kafros
Link to comment
Share on other sites

Indeed it seems to be the minimun battlescape requirement list :)

 

Some silly (sorry :$) questions/comments though: (just asking to be sure :O)

 

1) Grenades, medipacks and "waypoint-weapons" are to be implemented later?

Correct

2) In addition, what about stun damage? (either due to physical damage or by stun weapons)

Stun damage is already calculated, but because medipacks and bleeding to death won't happen until later, there's no difference between stun and wound damage. As you can see in the stats shown on battlescape when you click on a soldier or alien.

3) Concerning the AI, the Aliens will know where the soldiers are and just move towards them until they are in their LOS?

Yes, for first iteration, the alien AI will cheat shamelessly. It's not going to be complex enough to be clever.

4) The AI will be written exclusively in C#?

Yes.

And super silly question #5:

5) Are there any parts that don't need "C#-specific" knowledge and that could be implemented with basic C/C++ knowledge?

Actually, very little of the Xenocide code takes advantage of C#'s "special features", such as delegates. Most of it is bog standard code that would not surprise any C++ programmer that understood classes.

Basically, if you understand C++ classes, the only new concepts you need to grasp are properties, garbage collection and value vs reference types

Edited by dteviot
Link to comment
Share on other sites

* So, properties are just a 2-in-1 package? Instead of implementing an accessor(getData()) and/or a mutator (setData()), you create a property with a set part and a get part (any of them or both), which is more practical because, i.e. instead of passing the "data" to the mutator, you just set the "property member" equal to your "data"

 

* I know what a garbage collection does and that pointers can only be used in the unsafe{} part, is there anything more to it?

 

* Value vs Reference, well there's a very similar concept with data types and class variables in C++, so it isn't anything difficult

 

So, I just have to practise on XNA, CeGUI# and study your code? (definitely the most difficult part, hopefully your code is well organised and documented :))

Link to comment
Share on other sites

* So, properties are just a 2-in-1 package? Instead of implementing an accessor(getData()) and/or a mutator (setData()), you create a property with a set part and a get part (any of them or both), which is more practical because, i.e. instead of passing the "data" to the mutator, you just set the "property member" equal to your "data"

Yes.

* I know what a garbage collection does and that pointers can only be used in the unsafe{} part, is there anything more to it?

To work on most of Xenocide, that's sufficient. There are a few other things you may run into, specifically; "IDisposable" and "using", but they're only around graphics and files. (Things that use resources other than memory.)

* Value vs Reference, well there's a very similar concept with data types and class variables in C++, so it isn't anything difficult

Actually, it's a bit more complicated. with class variables, you need to be aware that the variable is a pointer to an instance.

e.g.

class Person { ....  public string name; }
Person bob = new Person();
bob.name = "bob";
Person joe = bob;
joe.name = "joe";
// now bob.name is also "joe"

value types are passed around as values, and you need to be careful, or you find yourself modifying a tempory copy of the variable, and not the variable itself.

So, I just have to practise on XNA, CeGUI# and study your code? (definitely the most difficult part, hopefully your code is well organised and documented :))

Actually, to do the things on the list, you probably won't need to do much, if any, XNA or CeGUI#.

As regards my code, I like to think it's well organised. There is starting documentation at http://svn.projectxenocide.com/xenocide/xna/trunk/docs, start with aa-readme.html. although it's incomplete. A lot of the newer code hasn't been documented. I've been very, very bad.

Still, post any questions and I'll answer them as best I can. (And try to update the docs as well.)

Link to comment
Share on other sites


×
×
  • Create New...