Jump to content
XCOMUFO & Xenocide

Xna Stage 0.4


dteviot

Recommended Posts

  • Replies 155
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Progress:

  • On Battlescape, handle combatant being "stunned". (Mostly, similar to dead case.)
  • On battlescape, right click on cell you want currently selected combatant to face. (Right mouse drag no longer moves battlescape, arrow keys must be used.)
  • Aliens that are not visible to X-Corp soldiers are not shown on the Battlescape. (Simple, brute force line of sight checking.)

Notes.

  • As regards the "not visible" aliens, in the file Xenocide\Content\Schema\startsettings.xml, set showAllAliens to "true" to draw the hidden aliens as transparent, useful for testing/debugging.
  • Font copywrite isn't quite as big an issue as I first thought. Specifically, the fonts used by CeGUI# are dynamically generated using the windows TrueType fonts on the target PC. (So we're not distributing those fonts.)
    The Font we DO have a copywrite issue with is the one used by the SpriteFont. Which is used in two places, Labelling the X and Y axis of the monthly statistics graphs, and the "units in stock" numbers on the equip solider screen.
    So the immediate priority is picking a free font that's acceptble for that. Note that you can easily try different fonts by changing the fontname entry in the file Xenocide\Content\SpriteFont1.spritefont
  • Had a bit of a thought after reading the articles on terrain analysis to find areas good for ambush, sniping, etc. How about we cheat. Instead of Alien AI analysing the terrian for suitable sites, the terrain builder intentionally CREATES such sites, then tells the Alien AI where the sites are.

Link to comment
Share on other sites

Brave New Era, size 10. It is cool for freeware use, so we are free to use it

Electric City 8-9 is also nice, although the readme is in a corrupted encoding (probably a japanese one anyway) and I can't find an english description

Edited by kafros
Link to comment
Share on other sites

Progress:

  • Bug fix: line of sight extends in vertical line directly above and below cell combatant is in
  • Bug fix: aliens not being equipped with armor when they're created
  • ScreenManager now handles a stack of screens.
  • Default X-Corp soldier load out includes a stun baton.
  • Can now call Equip soldier screen on battlescape for selected combatant.
  • Create correct alien forces for Terror and Alien Outpost missions.
  • Save Game works again

Notes.

  • On Battlescape, the Equip Soldier screen is (presently) very limited. But I think it's just enough for the moment. Details:
    • It shows you what combatant is carrying, and ammo levels for weapons and magazines.
    • You can move items around, and load/unload/reload weapons that use magazines.
    • There is no TU cost for moving items around
    • It does not interact with the battlescape, so if you drop anything, it's gone.

 

edit: fixed typos.

Edited by dteviot
Link to comment
Share on other sites

Brave New Era, size 10. It is cool for freeware use, so we are free to use it :)

Add Electric City 8-9 is also nice, although the readme is in a corrupted encoding (probably a japanese one anyway) and I can't find an english description

 

If you like it I'll compile a release build :)

Looks fine to me. However we will need to include the font's true type file with the source, because it needs to be installed into windows when someone builds the game. (The font is used to create the sprite font at build time, then the sprite font (a bitmap) is distributed with the executable.)

I assume the release build is for internal use (not general distribution) as I'd like to get the battlescape to a working state first. Maybe 4 weeks off.

Link to comment
Share on other sites

Progress:

Quick, (and really ugly hack job) to put barracks model onto the battlescape.

This broke the unit tests. I hope to fix them up tomorrow.

A couple of screen shots. First shows the result, second shows the "cells" underlying the 3D barracks model.

Notes.

  • You can see the barracks model if you do a debug build and click on "debug battlescape" on the start menu.
  • I'll let those of you who can compile and run this try it out.
  • Note, you can use the up/down/left/right arrow keys and page up/down to move the camera.
  • 'A', 'W', 'X' and 'D' turn the camera left/right up/down
  • Note that the cube grid doesn't exactly match the model.
  • Also, the model seems to be 18 meters wide, not 20. (I got a better match to the cube grid when I scaled the barracks model to aprox 18 meters square)

Let me know what you think.

01_BarracksBattlescape.JPG

02_CellSkelleton.JPG

Link to comment
Share on other sites

Works well, those guys even walk on the table. Just a question though, is the "cell texture rendering" (what you have on the second picture) accessible from there somehow?

 

By the way indeed, the unit tests break in a unit pathfinding file

Link to comment
Share on other sites

Works well, those guys even walk on the table. Just a question though, is the "cell texture rendering" (what you have on the second picture) accessible from there somehow?

Only if you change the code. As I said, it was a really quick hack. I'll try and clean it up a bit over the next couple of days. (And maybe add a button to toggle between the three modes. Facility and cells, cells only, facility only.)

Link to comment
Share on other sites

Another question: Did you say that we can create a custom cell layout for each facility?

what I wrote was:

That said, the 3D models that have been done COULD be used in the batllescape, using them as a "skin" over the cell structure.

That is, in battlescape, instead of the existing render code that draws quads where cell walls are, it draws a facility model.

However, in the game engine where the logic lives, there's a set of cells that represent the 3D model. I.e. there's cell walls where there are walls in the 3D model, door gaps, etc. Of course, to do this someone's going to have to create the cell layouts that match the 3D models. (Probably not too difficult to do.)

We could go down this route, if people are willing to do the work. 3D model building and cell layout.

If yes, how?

The cell layout for the barracks facility is built in TerrainBuildBarracksTestMap.cs

Have a look at that, and if you have any questions, feel free to post them.

The idea would be someone needs to write similar code for each of the facilities.

However, it would not be a good idea to try doing that just yet, as I plan on refactoring the Terrain construction code.

And see if I can fix the scaling of the facility model.

Edited by dteviot
Link to comment
Share on other sites

Progress:

  • Moved Terrain building code into TerrainBuilder class
  • Repaired the unit tests that adding barracks facility to the battlescape broke
  • Corrected minor error in item.xml and InventorySprites.txt. Sprite sheet for equip soldier screen Gravity Distortion Drone is 1 wide by 2 high, so swapped its position with Plasma Rifle clip and Heavy Plasma Rifle clip. Note, someone needs to fix up inventorysprites.png

Notes.

  • If we want to continue using the "cell layout" under a 3D image, then take a look at the new file Xenocide\Source\Model\Battlescape\Terrain\TerrainBuilders\TestTerrainBuiler.cs
    The idea would be for each 3D model, we would create a function similar to BuildBarracksAt(). So, to generate a battlescape, (say, an X-Corp base) we look up the facilities making up the battlescape, and draw the 3D models at the corresponding locations, and make up a cell layout that matches.
  • From a programming viewpoint, this shouldn't be difficult to implement. However it would require someone building the 3D models, and the cell layouts.
  • Note, before anyone attempts to build anymore layouts, we need to figure out how to get the cell layout to match the model (or vice versa). Note that the current code doesn't have perfect alignment. And there's a lot of clipping going on.
  • To that extent, can someone confirm that the facilities are supposed to be 20 meters square?
  • I'm reluctant to continue further with the 3D model and cell layout method, because, as Shinzon pointed out, it's may not work for a destructible environment. Which means any work done will be thrown away when we go destructible.
  • Note, it _MIGHT_ be possible to do the destruction programatically. Figure out which polys of the model are in each "cube" and then delete the polys when the cube is destroyed.
  • The facility model is loaded in FacilityMesh.LoadGraphicsContent() in Xenocide\Source\UI\Scenes\Battlescape\FacilityMesh.cs. (If anyone who has the code wants to change the facility model.) Note that you'll also probably need to recalc the scaling matrix in FacilityMesh.BuildScalingMatrix(),
    and that this can probably be done automatically when I finally figure out how to get a bounding box for the models. (No, don't go Google for it, I've already got most of the sample code, it's just a case of putting the pieces together.)
  • If you want to see the cell layout and the 3D model, there's two functions to tweak.
    • BattlescapeScene.Draw(), uncomment the line "terrainMesh.Draw(device, basicEffect, topLevel);"
    • FacilityMesh.Draw(), uncomment the line "effect.Alpha = 0.7f ;"

Edited by dteviot
Link to comment
Share on other sites

Progress:

  • Removed Barracks facility model from Battlescape.
  • On Battlescape, when X-Corp player finishes turn, aliens persue X-Corp soldiers. (Sorry, they don't shoot yet, I ran out of time.)

Notes on Battlescape AI.

  • AI has two layers, a Team layer and a Combatant layer
  • Team (and combatant) AIs should be X-Corp/Alien agnostic, so ideally could give X-Corp team one AI, Alien team another AI, and have them fight each other automatically, to compare/test AI. (no need for human to drive.)
  • Team AI is very simple to start with.
    foreach (combatant in team)
    while (combatant has time)
    	combatant.update()
    if (battleOver)
      done;


  • Combatant AI is also simple, combatant AI figures out order, and passes it to combatant to carry out. (Much like human UI.) So logic goes something like
    if (combatant.HasOrder()) then combatant.Update()
    else if (no target or target not valid) then PickTarget()
    else if (can shoot at target) then combatant.Shoot(target)
    else if (other enemy visible) then make enemy target
    else if (can move towards target) then combatant.MoveOneCell()
    else combatant has finished move for turn


Link to comment
Share on other sites

IIRC the model is 18 meters to allow for a 1 meter link section between the other facilities. Could probably scale the facilities up to the full 20 meters and just sandwich the door in between.
Link to comment
Share on other sites

IIRC the model is 18 meters to allow for a 1 meter link section between the other facilities. Could probably scale the facilities up to the full 20 meters and just sandwich the door in between.

Scaling existing model to 20 meters makes aligning the edges of a 1 x 1 meter grid to the 3D model very difficult. (Refer image in post 106 above.)

Link to comment
Share on other sites

That got me thinking so I went back and dredged through the original baseview thread from back when I was creating the models to find out what size they should be:

 

the size of each modules should be 24x24 meters and the hanger should be 49x49 meters so as long as they are scaled to that it should be fine. I don't know what might have happened with export since I've been able to pull in all of the modules I sent you and composite them together w/o scaling for the base image I rendered off.

 

http://www.xcomufo.com/forums/index.php?sh...ost&p=26164 is the post for reference.

Link to comment
Share on other sites

Progress:

  • Added Centurion's Credits page.

Notes.

  • The credits file loads (and shows) the file Xenocide\Content\DataFiles\credits.txt
  • I've just put junk in it for the movement, but it would be nice if CTD (i.e. Mad) could flesh it out. (It's getting late, and I need sleep, please don't be offended if I didn't put you in the credits, just contact Mad with what you want there.)

Edited by dteviot
Link to comment
Share on other sites

That raises the question: do we only want active members (that would be extreme) in there or everyone who ever contributed (that would be the other extreme)?

 

Edit: Maybe we should leave out the actual tasks, that would be pretty difficult and in some cases pretty much to read. What do you think?

 

Edit: There is a first version to be seen on the server - but I'm still working on it, so please don't flood me with PMs right now

 

Edit: Now you may PM me. ;) Credits file should contain everyone now.

Edited by Mad
Link to comment
Share on other sites

That raises the question: do we only want active members (that would be extreme) in there or everyone who ever contributed (that would be the other extreme)?

I was thinking it should be everyone who contributed.

 

Edit: Maybe we should leave out the actual tasks, that would be pretty difficult and in some cases pretty much to read. What do you think?

Well, I was hoping we could do that, but I think you're right. With hundreds of sound files/models etc it would be just too big.

That said, I think we do need (for copyright reasons if nothing else) a list of who contributed what.

 

Edit: Now you may PM me. ;) Credits file should contain everyone now.

Nice work. Thanks very much.

I do note one group that got missed. The original X-Com development team. :)

Link to comment
Share on other sites

Edit: Maybe we should leave out the actual tasks, that would be pretty difficult and in some cases pretty much to read. What do you think?

Well, I was hoping we could do that, but I think you're right. With hundreds of sound files/models etc it would be just too big.

That said, I think we do need (for copyright reasons if nothing else) a list of who contributed what.

do we really need this? I mean, the license PM does say that the authors permit us to use their work. I think making such a list would be almost impossible, especially in CTD...

 

Nice work. Thanks very much.

I do note one group that got missed. The original X-Com development team. :)

Added those just now... :)

Link to comment
Share on other sites

Nice, looks nice, we will have to get a background for it..

 

Quick Q, why are some of the text sharp and brighter and others are darker/blurred...

 

 

edit - also fixed a typo

credits.jpg

Edited by Darkhomb
Link to comment
Share on other sites

Edit: Maybe we should leave out the actual tasks, that would be pretty difficult and in some cases pretty much to read. What do you think?

Well, I was hoping we could do that, but I think you're right. With hundreds of sound files/models etc it would be just too big.

That said, I think we do need (for copyright reasons if nothing else) a list of who contributed what.

do we really need this? I mean, the license PM does say that the authors permit us to use their work. I think making such a list would be almost impossible, especially in CTD...

You might be correct. I should have said, I _think_, but I'm not sure, ...

However, I do note that UFO:AI specifically records who did which 3D models. (Probably because they're under different copyright.)

 

Quick Q, why are some of the text sharp and brighter and others are darker/blurred...

I think it's a visual artifact due to the lack of kerning in the SpriteFont engine. Try blowing up the raw image with a pixel viewer.

Link to comment
Share on other sites

That artifact is a typical antialiasing issue. What it is happening is that the font pixel coordinate is not aligned with the resolution pixel coordinate (That issue is pretty annoying and you can install Expressions Blend to see it in action). The way to solve it is to "snap" to the pixel grid, that can be done using a rounding or floor if the coordinate system you are using is orthogonal and scaled to the resolution.

 

Greetings

Red Knight

Link to comment
Share on other sites

Progress:

  • (Should have) fixed blurring of some credits caused by off center copying of textels to pixels. Thanks for the assist RK.

That artifact is a typical antialiasing issue. What it is happening is that the font pixel coordinate is not aligned with the resolution pixel coordinate (That issue is pretty annoying and you can install Expressions Blend to see it in action). The way to solve it is to "snap" to the pixel grid, that can be done using a rounding or floor if the coordinate system you are using is orthogonal and scaled to the resolution.

 

Greetings

Red Knight

Link to comment
Share on other sites

Progress:

  • Wounded X-Corp soldiers heal at rate of 1 HP per day.
  • Show injuries (and kills and days hired) for soldiers on Soldier list screen
  • Recover alien bodies, prisoners and equipment from battlescape. Get score for kills/captures and losses

Notes.

  • IIRC, all that's left for the 0.4 release is getting a random map builder going. And StaffSargeant has been working on that. Might have something ready by end of this weekend.

Edited by dteviot
Link to comment
Share on other sites

Progress:

  • Added StaffSargeant's random maze generation code

Notes.

  • The maze generation code is only a single level maze, but I think that's good enough for the moment.
  • (If someone wants to modify it to make a multi level maze, with stairs and/or grav lifts, be my guest.)
  • Which means that I think we're code complete for a 0.4 release.
  • What this means is that we've got a game that's aproximately playable. The geoscape works, and a minimal battlescape is playable.
  • And it should be possible (theoretically at least) to play all the way to researching the Cydona mission.
  • Note, researching Cydona won't actually give you the Cydona mission, that hasn't been implemented yet.
  • Although I'd like to add the font that Krafos found.
  • Also, we might want to add NASA to the credits list, as the Geoscape uses images from NASA.

As always, feedback is appreciated.

Link to comment
Share on other sites

I guess I forgot the most important question.

Are we "go" or "no go" for an official 0.4 release?

 

If you want to do an official official release, could someone wrap up an installer (thus eliminating some of the support emails)?

 

edit: an open source installer would be War Setup. If noone has the time, I could check it out, though I would prefer someone else doing it, since I am more than swamped with RL atm... /edit

 

 

 

Otherwise CTD is go... ;)

Edited by Mad
Link to comment
Share on other sites

What about that installer that checked for xna, direct x and .net first? Some people do not read anything then post it is not working...

 

The only other issue I see is the fonts. If you give me a week I can change them (Still moving) and see which people want where.

Link to comment
Share on other sites

What about that installer that checked for xna, direct x and .net first? Some people do not read anything then post it is not working...

If this is possible, that would be great - especially if we could offer to download and install the missing parts. And if we have somethign like this implemented, it should be very easy to add the possibility to download the sound package.

I know this is possible, but is it possible for us - I mean, is any of this possible without consuming too much time?

Link to comment
Share on other sites

What about that installer that checked for xna, direct x and .net first? Some people do not read anything then post it is not working...

If this is possible, that would be great - especially if we could offer to download and install the missing parts.

http://forums.xna.com/thread/9927.aspx

 

So, that's what we need: http://www.nuclex.org/installer

 

In addition, you could check this utility:

http://xnamatrix.com/xnareq.php

 

@darkhomb: this may help http://www.xcomufo.com/forums/index.php?ac...st&id=10031

 

@dteviot:

 

Concerning the maze gameplay, I think that 2 changes could prove useful:

1) Smaller walls, as they block the player's view and Vipers are barely viewable

2) Easier difficulty, 1 Viper got 4 of my soldiers and it still didn't die

They're not very important of course but they'd make the experience a bit more funny

Edited by kafros
Link to comment
Share on other sites

Concerning the maze gameplay, I think that 2 changes could prove useful:

1) Smaller walls, as they block the player's view and Vipers are barely viewable

Actually, I need to make the vipers bigger, and center them properly.

I also need to have some sort of "alien in sight" message for when aliens become visible.

And I probably need some sort of marker to make their position more obvious.

2) Easier difficulty, 1 Viper got 4 of my soldiers and it still didn't die

excellent. (Simpson's reference)

Seriously, I thought vipers were supposed to be hard.

That said, there's a couple of things that could be done.

  • Adjust combatant.xml, to make the viper weaker
  • Adjust item.xml, to make the human weapons stronger
  • Adjust settings.xml, to equip the human forces with heavier weapons.

As combatant.xml and item.xml match the X-Com 1 stats, I'd perfer not to change them. So, I recommend tweaking settings.xml. There is no 80 item limit, so you can afford to load up on ammo for the autocannon.

Edited by dteviot
Link to comment
Share on other sites

Thing is, you usually meet snakemen later in the game, when you are better equipped. So two possible solutions:

 

You could have two different sorts of Vipers, one a grey in viper disguise for the beginning of the game and one viper which is an actual viper for when you have researched the better weapons later in the game.

Link to comment
Share on other sites

* Aha that helped. It also depends on the generated maze. By camping at a tactically better spot I managed to down (with default equipment) 5 vipers and lost 4 men.

* Those viper fixes will be neat! Thanks dteviot

* I played around for some minutes and I couldn't find anything displeasing. Just noticing 2 things (so I won't forget)

1) At the sound options, if you set a new volume level and click save, you notice the difference right away. But, once you enter the options again, the sliders are on 100% again. So you only have full or no volume saved. I guess it isn't saved anywhere

2) Sometimes you think that the soldier is able to target an alien. So, you choose to fire at him, but when you hover the mouse you notice that you can't target him (white cube). Unlucky, you can't cancel and are forced to hit thin air in order to continue. Proposed change: either (cancel the order with right click) or ( turn at him and fire )

Link to comment
Share on other sites

I tested the sound options, it didn't used to do that, what happens is the code checks the stored values for the checkbox, if it is not muted it sets the checkbox to unmuted and changes the sound to full volume. But it doesn't change the value to what it is after that...

 

if (enable)
		{
			slider.Enable();
			slider.Value = 1.0f;

 

For anyone who doesn't have an updated compile here it is

 

http://rapidshare.com/files/102374289/Debug.rar.html

 

just copy the audio files over from your older version.

Edited by Darkhomb
Link to comment
Share on other sites

* Aha that helped. It also depends on the generated maze. By camping at a tactically better spot I managed to down (with default equipment) 5 vipers and lost 4 men.

* Those viper fixes will be neat! Thanks dteviot

er. I meant for YOU to try tweaking the file, and let me know what seems to work best.

 

* I played around for some minutes and I couldn't find anything displeasing. Just noticing 2 things (so I won't forget)

1) At the sound options, if you set a new volume level and click save, you notice the difference right away. But, once you enter the options again, the sliders are on 100% again. So you only have full or no volume saved. I guess it isn't saved anywhere

IIRC, the sound options are not saved to file.

 

2) Sometimes you think that the soldier is able to target an alien. So, you choose to fire at him, but when you hover the mouse you notice that you can't target him (white cube). Unlucky, you can't cancel and are forced to hit thin air in order to continue. Proposed change: either (cancel the order with right click) or ( turn at him and fire )

Press "esc" to cancel the firing command.

Link to comment
Share on other sites

er. I meant for YOU to try tweaking the file, and let me know what seems to work best.
I was referring to the "Actually, I need to make the vipers bigger, and center them properly." part ^_^

 

Concerning the the tweaking: Changing the starting settings helps a bit, but it's more a matter of "camping". Just camp around a corner and then rush the incoming enemies (i.e. I need 9+ successful "bullets" to kill the viper, the viper usually gets me with 3-5). Not very tactically-oriented but works

 

Press "esc" to cancel the firing command.
Aw haven't noticed, thanks Edited by kafros
Link to comment
Share on other sites

IIRC, the sound options are not saved to file.

 

Yes, sound options are not saved in the file, what we are talking about, if you go to sound options, change settings and hit ok, everything is fine, when you go back into options its back at full volume. The value is saved, but when it does a check for the checkbox after you reopen it, it sets its value to 1f.

Link to comment
Share on other sites

Progress:

  • Combatants (esp. Viper) should now be centred in the cell they're in on the battlescape
  • Initial version of function to calculate Axis Aligned Bounding Boxes for models (seems to be buggy.)
  • Added an optional scale attribute to the graphics element in combatant.xml, to allow manually adjusting the size of combatant's model on battlescape.

Notes.

  • I've used point 3 above to make the viper model appear roughly the same size as the human soldier.
  • I've added code to Xenocide\Source\Utils\util.cs to try and calculate the bounding boxes of models (needed so that I can correctly scale facilities.)
    However, it's giving me some really weird results. Can someone check the facility models and tell me what numbers I should be seeing?
    Also, can someone (e.g. Red Knight) look at the AABB calcuation code, and see if there's anything obviously wrong with it?
    My results are:
    Facility		   Min X,	 Min Y,	 Min Z,	  Max X,	Max Y,	Max Z
    Barracks		   -3157.931  -208.9011  1944.373	3157.931  843.7427  1213.553
    Laboratory		 -3156.883  -2.591341  -1922.355   3156.883  1091.74   2711.305
    Alien Containment  -30.48	 -17.145	-11.39392   30.48	 10.27367  18.81054


    As you can see, the facilities are not square in the XZ plane. Which makes me think I've stuffed up somewhere, but I can't see it.

Link to comment
Share on other sites

Progress:

  • SpriteFont now uses Font "Brave New Era G98" (no copyright problem) Thanks Krafos.
  • Scale the Barracks facility to 24 meters square.

Notes.

  • Because SpriteFont uses a non MS supplied font, to build Xenocide you need to add the font to windows before you can build Xenocide.
    Steps on XP are pretty simple.
    • Close VS 2005 Express (it caches fonts, if you have it running it won't see the new font until you restart it. Grrr.)
    • Unzip the file xenocide\Dependancies\Misc\bravenewera.zip
    • Click Start, point to Settings, and then click Control Panel.
    • Double-click the Fonts folder.
    • On the File menu, click Install New Font.
    • Select BNEG98.ttf from the zip file
    • Double-click the folder that contains the fonts.
    • Click to select the Copy Fonts To Fonts Folder check box.
    • Click OK

Link to comment
Share on other sites

Steps on XP are pretty simple.

  • Close VS 2005 Express (it caches fonts, if you have it running it won't see the new font until you restart it. Grrr.)
  • Unzip the file xenocide\Dependancies\Misc\bravenewera.zip
  • Click Start, point to Settings, and then click Control Panel.
  • Double-click the Fonts folder.
  • On the File menu, click Install New Font.
  • Select BNEG98.ttf from the zip file
  • Double-click the folder that contains the fonts.
  • Click to select the Copy Fonts To Fonts Folder check box.
  • Click OK

Or just right-click the font and select Install in Vista. :P

Link to comment
Share on other sites


×
×
  • Create New...