Jump to content
XCOMUFO & Xenocide

Microsoft Xna


dteviot

Recommended Posts

But seriously folks.

 

The CeGui# library is now working well enough for me to start implementing Xenocide in XNA.

As a proof of concept, I've created a simple screen manager (as described in my post of http://www.xcomufo.com/forums/index.php?s=...t&p=161898)

and subed up a number of screens, to check that it works, and see how easy it is to make the screens. (And it's really easy.)

 

Anyway, I'd like to set up an XNA project in our SVN repository and start loading my work there, so that others can see how it's going. (And when they become as convinced as I am that XNA is the way to go, they can join me.)

 

[Edit]

CeGui# repository:

http://ceguisharp.svn.sourceforge.net/svnr...gui_0_5_0-cygon

 

Cheers,

David

Edited by dteviot
Link to comment
Share on other sites

  • Replies 212
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Well, I agree that XNA is pretty nice. Only thing is that I'm still a bit reluctant to throw away out platform independence. But anyway, tell me, how would you assess the effort (time) to do get Xenocide XNA to the current level of Xenocide w. python (read: Xenocide current trunk)?
Link to comment
Share on other sites

Well, I agree that XNA is pretty nice. Only thing is that I'm still a bit reluctant to throw away out platform independence. But anyway, tell me, how would you assess the effort (time) to do get Xenocide XNA to the current level of Xenocide w. python (read: Xenocide current trunk)?

In terms of functionality, I'd estimate about 2 months to add the features that xenocide currently has.

My plan:

1. At current time, I've got the screen manager working, and subs for a number of the screens.

2. Next step will be adding the 3D earth to the geoscape screen. That should be done by next week.

2.a With a bit of luck, it will include being able to move the camera, a skybox and sun moving with game time.

(Say 2 weeks to get to this point.)

3. Get XNet working. About 2 weeks.

4. Put craft into Geoscape. another 2 weeks.

That should get us up to the current state of the main trunk.

Link to comment
Share on other sites

In terms of functionality, I'd estimate about 2 months to add the features that xenocide currently has.

My plan:

1. At current time, I've got the screen manager working, and subs for a number of the screens.

2. Next step will be adding the 3D earth to the geoscape screen. That should be done by next week.

2.a With a bit of luck, it will include being able to move the camera, a skybox and sun moving with game time.

(Say 2 weeks to get to this point.)

3. Get XNet working. About 2 weeks.

4. Put craft into Geoscape. another 2 weeks.

That should get us up to the current state of the main trunk.

wow. this definetly is a pretty tough plan. You're speaking about how many man-hours here? I mean, who did you plan to be working on this? Or are the two months if you're working alone on it (it reads like this is the case, just want to make sure)? Do I get it right if I assume that this would speed up development process for future features significantly? Or is this just two months because you already know how to implement certain features? How is our chance to ever support other OSes than MS Windows / X-BOX with XNA?

Link to comment
Share on other sites

In terms of functionality, I'd estimate about 2 months to add the features that xenocide currently has.

My plan:

1. At current time, I've got the screen manager working, and subs for a number of the screens.

2. Next step will be adding the 3D earth to the geoscape screen. That should be done by next week.

2.a With a bit of luck, it will include being able to move the camera, a skybox and sun moving with game time.

(Say 2 weeks to get to this point.)

3. Get XNet working. About 2 weeks.

4. Put craft into Geoscape. another 2 weeks.

That should get us up to the current state of the main trunk.

wow. this definetly is a pretty tough plan. You're speaking about how many man-hours here?

 

I'm estimating about 10 hours/week

I mean, who did you plan to be working on this? Or are the two months if you're working alone on it (it reads like this is the case, just want to make sure)?

Yes, just me

Do I get it right if I assume that this would speed up development process for future features significantly? Or is this just two months because you already know how to implement certain features?

Yes, I believe progress will be faster:

1. Coding is easier/faster to do in C# than C++.

2. Don't have complicated Python/C++ interface and Library impedance mismatches.

3. Design will be well documented. With a HEAVY emphasis on kiss.

4. Don't need to talk to Guyver/Garo who are MIA.

 

I should add, my gut feel is to have everything but battle scape implemented by Christmas '07.

I hope to have a more concrete plan/schedule posted next week.

How is our chance to ever support other OSes than MS Windows / X-BOX with XNA?

Well, at this point in time doubtful. However, as it will probably take a couple of years (even with XNA) to get to v1.0, I'm hopeful that by that time Mono, Tao and/or Cegeda will have cought up.

 

Failing that, the C#/XNA code makes a good prototype for backporting to the mainline.

Edited by dteviot
Link to comment
Share on other sites

So do you have a solution for the models? As far as I understand the current meshes for Ogre won't work with XNA. And I could understand if Vaaish, who invested a lot of time finishing those, wouldn't be too happy to do it all over again. So do you know a way to port them, or would you be able to write a porter?
Link to comment
Share on other sites

So do you have a solution for the models? As far as I understand the current meshes for Ogre won't work with XNA. And I could understand if Vaaish, who invested a lot of time finishing those, wouldn't be too happy to do it all over again. So do you know a way to port them, or would you be able to write a porter?

I was under the impression that the models are in Blender and 3DSMax, and those tools can export to the Microsoft .x file format. Which XNA can read.

Link to comment
Share on other sites

I was under the impression that the models are in Blender and 3DSMax, and those tools can export to the Microsoft .x file format. Which XNA can read.

AFAIK Blender can't export to .x file format. Vaaish?

Link to comment
Share on other sites

2. Don't have complicated Python/C++ interface and Library impedance mismatches.

...

4. Don't need to talk to Guyver/Garo who are MIA.

[/qoute]

Those two are really an issue :(

But, at least the python problem should disappear (or become way smaller) once we move model to C++.

 

[qoute]

How is our chance to ever support other OSes than MS Windows / X-BOX with XNA?

Well, at this point in time doubtful. However, as it will probably take a couple of years (even with XNA) to get to v1.0, I'm hopeful that by that time Mono, Tao and/or Cegeda will have cought up.

 

Failing that, the C#/XNA code makes a good prototype for backporting to the mainline.

Mono is already .Net 2.0 ready, or extremely close to being there. I understand that on some of Microsoft's own tests Mono does better :P

Tao, Mono.XNA and cegui# are another issue. I guess it'll take months before they work really well on Linux.

 

Also, don't forget that .Net on Linux (and other OS's) is a really controversial issue for a lot of people, and the Novell/Microsoft deal didn't exactly make people want to touch it.

Link to comment
Share on other sites

i read up on it and blender can export to .x but you have to be careful at material names and object names or they will not work.

Good! Next thing is, can our models/meshes be exported. And can that be done without breaking sweat?

(Read: Would everyone in the team be able to do so, or would Vaaish have to do it?)

Edited by Mad
Link to comment
Share on other sites

Good! Next thing is, can our models/meshes be exported. And can that be done without breaking sweat?

(Read: Would everyone in the team be able to do so, or would Vaaish have to do it?)

 

It is possible. The material properties are complicated as it is with the Ogre-Mesh export also (Did many hours of manual material tweaking with Vaaish).

 

The funny thing, some of the exported models i can only view with a different Tool (3D Exploration) not with the DirectX Viewer from the DirectX-SDK.

It just says that it failed to load the model.

 

But if you want to experiment i converted some and zipped em up:DirectX_Models.zip

You can find the textures in the xenocide directory.

But you need to work on the materials for shure, because only color textures are exported. But correct material export is also a problem with the Ogre-Exporter.

 

greetings

Lars

 

PS: For the whole XNA-idea: What happens if dteviot gets MIA ???

Link to comment
Share on other sites

PS: For the whole XNA-idea: What happens if dteviot gets MIA ???

Huh?

He means the general tendency of the Project's staff to vanish.

Ah. Then there are two cases.

1. If I'm the only developer, it dies.

2. If there are other developers, it will be documented well enough that others can carry on.

 

At the current time, I have no plans of going MIA.

Link to comment
Share on other sites

What can I say, I joined the dark side long ago ;)

 

Proof is the framework I am programming as we speak, and a full fledged XNA environment rendering over Winforms (Not XBox360 compatible though :P ).

 

Contact with me as I fully support going that way, so I can help you in the prototype to measure productivity (that I believe based on my own experience that it would be way higher). I have been toying myself with the very same idea for a long time already (since Beta 1) but work and PhD is not helping in that regard, but I may be able to join "Computer Graphics 2" course training with some Xenocide doing Aerial Scattering for the Geoscape in XNA.

 

Greetings

Red Knight

xna.picture.bmp

xna.proof2.bmp

Link to comment
Share on other sites

What can I say, I joined the dark side long ago ;)

 

Proof is the framework I am programming as we speak, and a full fledged XNA environment rendering over Winforms (Not XBox360 compatible though :P ).

 

Contact with me as I fully support going that way, so I can help you in the prototype to measure productivity (that I believe based on my own experience that it would be way higher). I have been toying myself with the very same idea for a long time already (since Beta 1) but work and PhD is not helping in that regard, but I may be able to join "Computer Graphics 2" course training with some Xenocide doing Aerial Scattering for the Geoscape in XNA.

 

Greetings

Red Knight

OK, I'll take this as permission to proceed. (With creating an XNA branch in SVN.)

Not sure how you plan on measuring productivity. As I said previously in this thread, I hope to post up a dev plan in the next couple of days, and then track progress against it.

 

And, to temp people, here's some screen shots from the prototype as it stands.

xeno.xna.prototype.2007_01_26_a.JPG

xeno.xna.prototype.2007_01_26_b.JPG

xeno.xna.prototype.2007_01_26_c.JPG

Link to comment
Share on other sites

XNA Roadmap

 

Iteration 1: Initial Geoscape.

  • Geoscape screen with basic buttons. Done - 2007-01-30
  • Earth globe showing on screen. Done - 2007-01-30
  • Add sun, have sun move according to date/time. Done - 2007-01-30
  • Buttons to control game speed. Done - 2007-01-30
  • Skybox Done - 2007-01-30
  • Buttons to move camera’s position. Done - 2007-01-30
  • Draw bases (pyramid) on screen at randomly chosen geoposition. Almost Done - 2007-01-30
  • Code to compute geoposition of a mouse click on earth globe.
  • Base creation sequence.
  • Save/Load game time to file?
  • Document project structure: file locations, how the main loop works.

Iteration 2: Craft.

  • Specify Requirements.
  • Document design.
  • Build.

Need to document this phase better.

Things I need to cover:

  • UFO mission types (and behaviour during missions.)
  • Alien Overmind AI.
  • UFO AI.
  • Human craft mission types (and behaviours)
  • Human craft AI.
  • Repair/Refuel/Rearm of Human craft at bases.

Iteration 3: X-Net

Reason for doing this: test out XML parser.

  • Document requirements
  • Document design.
  • Implement.

Requirements:

  • Is single screen. With “tree” on RHS. LHS has 3D image + Text
  • Will only show items that user has researched.
  • Want it to show which entries player has read, and which player hasn’t

Iteration 4: Layout Base Facilities.

  • Document requirements
  • Document design (this has already been somewhat done.)
  • Allow user to pick a facility, and put on 3D image.
  • Allow user to destroy facilities.
  • Track state of facilities under construction.
  • Update base’s capability, as facilities are constructed.
  • Hook up radar, to detect UFOs.
  • Load/Save to file.
  • User funding. (Expenditure to buy, monthly maintenance.)

Iteration 5: People.

(People are probably the easiest things to test base capacity with.)

  • Define the people objects.
  • User can buy/sell/transfer people.
  • Load/Save to file
  • Monthly salary, Hiring fees.
  • Allocate scientists to labs?

Items 6: Items

  • Class hierarchy for items.
  • Allow user to buy/sell/transfer items.
  • Initial phase, just worry about storing items in a base.
  • Mapping items to craft
  • Load/Save to file
  • Don’t cover, equip craft with weapons.
  • Don’t cover, equip soldiers.

Item 7: Research

  • Read the research tree.
  • Determine when prerequistes are satisified. (Item in base, Technology researched.)
  • Show research projects that player can start.
  • Assign staff for projects.
  • Advance projects over time.
  • Tie into X-Net.
  • Present research when finished.
  • Load/Save to file

Item 8: Production

Similar to Research

  • Only allow building items that have been researched.

Item 9: Statistics screen.

  • UFO activity
  • X-Corp activity
  • Monthy financial numbers.
  • Need to track this information, and display it.

Item 10: User settings

  • Difficulty
  • Options? (Volume, other?)

Item 11: Aeroscape

  • Specify Requirements.
  • Document design.

Item 12: Sound

  • Specify Requirements.
  • Document design.

Item 13: Items- Revisited

  • Equip soldiers with items.
  • Crew craft with soldiers.
  • Can't equip troops with items that haven't been researched.

Item 14: Battlescape

Steal as much as possible from UFO2000

 

Edit: Updated progress.

Edited by dteviot
Link to comment
Share on other sites

Checked in.

 

Progress report

Iteration 1: Initial Geoscape.

  • Geoscape screen with basic buttons. Done - 2007-01-30
  • Earth globe showing on screen. Done - 2007-01-30
  • Add sun, have sun move according to date/time. Done - 2007-01-30
  • Buttons to control game speed. Done - 2007-01-30
  • Skybox Done - 2007-01-30
  • Buttons to move camera’s position. Done - 2007-01-30
  • Draw bases (pyramid) on screen at randomly chosen geoposition. Almost Done - 2007-01-30

Notes:

To compile, should just need to check out the files and build the xenocide project.

I've included the CeGui# dependency files to remove the need to fetch them separately.

However, I've had to patch it slightly (replace the window default background texture with a transparent one, so that the geoscene shows through.) The patched texture can be found in DependancyPatches and will need to be re-applied if anyone gets a later version of CeGui#.

As soon as I figure out how to put the 3D scene into it's own static image window, I'll restore the CeGui# texture.

xeno.xna.progress.2007_01_30.JPG

Link to comment
Share on other sites

So what do you need to get started?

MS Visual C# 2005

MS XNA Game Studio Express 1.0

Install in this order.

Check out http://svn.projectxenocide.com/xenocide/xna

Start XNA Game Studio Express

Load Xenocide.sln from /trunk

Build

After building Xenocide, go to Xenocide/Bin/x86/Debug/Content directory and create a sub directory "Schema"

Copy the contents of the Schema directory from the existing C++ Xenocide directory "xenocidegame/data/schema" to the new Schema directory

 

Run your build from /trunk/Xenocide/bin/x86/Debug

 

Edit: Thanks to dteviot fixed typo - I always think about PX, no wonder I wanted to have an .xln project file... ;)

Edit2: updated instructions

Edited by Mad
Link to comment
Share on other sites

Question: Will it be possible to implement look&feel of XenoUI? (read: Is it possible to make the Xenocide XNA interface just like Xenocide C++/Python?)

Short answer: Yes.

 

Long answer:

The look and feel of the C++ Xenocide interface is controlled by CeGui, via layouts, imagesets, and looknfeel files in:

xenocidegame\data\ui\layouts, xenocidegame\data\ui\imagesets & xenocidegame\data\ui\schemes.

 

As the C# uses CeGui#, it should be possible to use these as well. (When they are implemented in CeGui#.) Currently CeGui is up to 0.5.x release. I have yet to figure out exactly where CeGui# is tracking. (I suspect it's somewhere around 0.3.x)

 

At the current time, it's good enough for my purposes. I'm more interested in getting the game engine working than the cosmetics of the UI.

 

Oh, and from your previous post, can I assume you were able to build and run Xenocide.XNA?

Edited by dteviot
Link to comment
Share on other sites

Oh, and from your previous post, can I assume you were able to build and run Xenocide.XNA?

Yapp, I was. Looking good. Compiling is - atm - much easier than with Xenocide C++/Python.

Fascinating what you were able to do in such short time! Terrific job!

Link to comment
Share on other sites

Indeed that is one of the things that really makes a difference with .Net in general; if you have a well designed project everything works out of the box.

 

Dteviot: add the CeGui# code directly into the project and we can have it updated in there, so everything gets compiled in one shot.

There is another way, you can instead implement only the required things to get started without CeGui if putting it up to date is a too cumbersome task... we can program every object from the start up and custom made for the game (easiest way as there are less dependencies to take care of). It is my personal opinion (take it as an opinion) that CeGui is way to overengenieered, so scratching it would indeed diminish a lot the complexity.

 

 

Greetings

Red Knight

Link to comment
Share on other sites

Indeed that is one of the things that really makes a difference with .Net in general; if you have a well designed project everything works out of the box.

 

Dteviot: add the CeGui# code directly into the project and we can have it updated in there, so everything gets compiled in one shot.

There is another way, you can instead implement only the required things to get started without CeGui if putting it up to date is a too cumbersome task... we can program every object from the start up and custom made for the game (easiest way as there are less dependencies to take care of). It is my personal opinion (take it as an opinion) that CeGui is way to overengenieered, so scratch it wouldnt indeed diminish a lot the complexity.

 

 

Greetings

Red Knight

Im, sorry, I can't quite figure out what you're asking me to do.

The CeGui# code IS in the xenocide repository, and everything IS compiled in one shot.

Just load the xenocide.sln file in trunk (note to Mad, the file is .sln not .xln) and it builds both my code, and the dependencies.

Link to comment
Share on other sites

WTF... YOU DID IT...

After a lot of time I wrote code for Xenocide (Xna version of course :) ). Did some cleanup of the code, added some RK comments (I know I work as a .Net consultant I just cannot help it :devillaugh: ), and layed out the foundation of the ResearchTree task (I will take that one as a personal task to handle).

 

It is committing as we speak, so you should be able to see the changes soon.

 

Greetings

Red Knight

Link to comment
Share on other sites

WTF... YOU DID IT...

After a lot of time I wrote code for Xenocide (Xna version of course :) ). Did some cleanup of the code, added some RK comments (I know I work as a .Net consultant I just cannot help it :devillaugh: ), and layed out the foundation of the ResearchTree task (I will take that one as a personal task to handle).

 

It is committing as we speak, so you should be able to see the changes soon.

 

Greetings

Red Knight

 

Red Knight,

 

I appreciate your enthusasim, and your contributions.

However, there's a couple of things I need to point out.

1. I'm very, very angry at you for renaming my functions/variables without asking me. I was NOT using the Xencode C++ coding standard. I'm using my company's C# one. (And it's taken me 3 hours to merge my latest changes with yours.)

2. I'm trying to partition the UI code from the "Model" code (as in model/view/controller), Consequently the research code you're adding should go under "Source\model\Geoscape".

3. I've got working Research Tree code in the old C++ code base. There is no need to re-implement it from scratch.

 

My latest check-in.

1. Updated CeGui#

2. GeoScene is now in own window on GeoScreen, not covering entire background of screen.

3. Can right click mouse in Geoscene window, to allow mouse movement to rotate camera.

4. Left click on Geoscene window to place a Geomarker at clicked position on globe

5. Added FPS display to App's Titlebar.

6. Added Copyright notice to number of files.

Link to comment
Share on other sites

WTF... YOU DID IT...

 

Sorry, I don't understand. I did what?

 

Attached is a quick “codebase tour” of Xenocide.XNA. I’d appreciate any feedback.

 

While implementing a “select base location screen” and “load/save” functionality are next on my to do list, I thought I’d jump the gun a bit and get started on craft movement.

 

Objective:

  • Have a UFO that does a random walk across the globe.
  • Have a human craft that flies a patrol route.
  • When the human craft runs low on fuel, it goes to nearest human base for a refuel.
  • When refuelled, resumes patrol.
  • If comes within radar range of UFO, will intercept UFO.
  • When reaches UFO, UFO is destroyed.
  • New UFO is spawned at random location on Globe.
  • Pretend that human craft has 3 missiles, and takes 1 to destroy a UFO.
  • When human craft runs out of missiles, will return to nearest human base for re-arming.
  • When re-armed, resumes patrol.
  • Craft movement must be synchronized with rate of GameTime.

CodebaseTour.html

Edited by dteviot
Link to comment
Share on other sites

WTF... YOU DID IT...

After a lot of time I wrote code for Xenocide (Xna version of course :) ). Did some cleanup of the code, added some RK comments (I know I work as a .Net consultant I just cannot help it :devillaugh: ), and layed out the foundation of the ResearchTree task (I will take that one as a personal task to handle).

 

It is committing as we speak, so you should be able to see the changes soon.

 

Greetings

Red Knight

 

Red Knight,

 

I appreciate your enthusasim, and your contributions.

However, there's a couple of things I need to point out.

1. I'm very, very angry at you for renaming my functions/variables without asking me. I was NOT using the Xencode C++ coding standard. I'm using my company's C# one. (And it's taken me 3 hours to merge my latest changes with yours.)

2. I'm trying to partition the UI code from the "Model" code (as in model/view/controller), Consequently the research code you're adding should go under "Source\model\Geoscape".

3. I've got working Research Tree code in the old C++ code base. There is no need to re-implement it from scratch.

 

My latest check-in.

1. Updated CeGui#

2. GeoScene is now in own window on GeoScreen, not covering entire background of screen.

3. Can right click mouse in Geoscene window, to allow mouse movement to rotate camera.

4. Left click on Geoscene window to place a Geomarker at clicked position on globe

5. Added FPS display to App's Titlebar.

6. Added Copyright notice to number of files.

1. Sorry, it wasnt my intention to create havok in your working code (couldnt find you arround and I had some free time and it was doing something or not at all)... My bad there, but either way please stick to Microsoft Code Standard presented by the Pattern & Practices group. We know why standards exists and well they are trying to correct the lack of non public implementation standards (private methods, event handlers, etc), so in the end that would exist why not do it right from the start?

 

2. The Research tree can be moved to wherever you think it is appropriate. Personally, I prefer "Source\Model\Research" as unlocking lookup and other queries over the research information would need to be done from Battlescape too. But that is something that it is easily changed (at least with the IDE and C#).

 

3. We will have to reimplement having in account differences in platform, remember I only defined the ITechGrant and ITechPrerequisites interfaces only, no real query has been implemented yet (and that code took only 2 hours so I dont expect it to be final either). Just took Research as it was way up in the iterations but doesnt have the time yet, so I am just implementing ground up things (foundation) not code that will display anything in the iterations that are planned (only thing is automated tests). I will take a look at what it is in C++ and improve from there (try to bring the best from both worlds).

 

Greetings

Red Knight

Link to comment
Share on other sites

WTF... YOU DID IT...

Sorry, I don't understand. I did what?

Did, make him code again. After roughly 10000 years of not coding for Xenocide... (Might be a little bit exaggerated... ;) )

Exaggerated maybe, but you are not that way out ;)

 

Greetings

Red Knight

Link to comment
Share on other sites

1. Sorry, it wasnt my intention to create havok in your working code (couldnt find you arround and I had some free time and it was doing something or not at all)... My bad there, but either way please stick to Microsoft Code Standard presented by the Pattern & Practices group. We know why standards exists and well they are trying to correct the lack of non public implementation standards (private methods, event handlers, etc), so in the end that would exist why not do it right from the start?

Yes, I am offline during the weekends.

I'll look up the MS standards. Funny, I thought I was following them. Or at least our company standards were closely aligned with them.

And I really should not have gotten so angry, it's just that it was late, I was just about to check in my work, and then I had to spend 3 hours merging everying.

 

 

2. The Research tree can be moved to wherever you think it is appropriate. Personally, I prefer "Source\Model\Research" as unlocking lookup and other queries over the research information would need to be done from Battlescape too. But that is something that it is easily changed (at least with the IDE and C#).

You're right, that is a better location.

 

3. We will have to reimplement having in account differences in platform, remember I only defined the ITechGrant and ITechPrerequisites interfaces only, no real query has been implemented yet (and that code took only 2 hours so I dont expect it to be final either). Just took Research as it was way up in the iterations but doesnt have the time yet, so I am just implementing ground up things (foundation) not code that will display anything in the iterations that are planned (only thing is automated tests). I will take a look at what it is in C++ and improve from there (try to bring the best from both worlds).

Understood, just trying to save you some work.

Link to comment
Share on other sites

Red Knight,

 

Please expand on your comment in GameState.cs

/// RK: Too many "Singletons" laying arround, make yourself a favor in the long run... rule them out (you will understand when you need to do save and load ;) ).

/// Everything should come from there... try a Game/Player or something like that.

Specifically, what are the issues with having them implemented as they are? And how do you recommend implementing them?

 

Notes:

In fact, the Xenocide code only has 2 singletons. (I’m ignoring the program.cs singleton that the framework generates, and the singletons used by CeGui#.)

 

The two singletons are ScreenManager, and GameState. Both of these ARE singletons, as the game should have only one of each. I have implemented these as static C# classes. (Although I could also implement them as Singletons.)

 

I will observe that I could easily convert ScreenManager to not be a singleton. (Have the Xenocide class create a ScreenManager, and pass a pointer to the ScreenMnager in each screen’s constructor.)

 

The GameState does not hold state information itself, its function is to act as a global root node to access the actual state information.

Link to comment
Share on other sites

I noted that GameState and ScreenManager are singletons and in Xna you have yet another one (Game) an with it came a very powerful concept (Services). There is no reason why your ScreenManager should be a Singleton (afar from being the way how CeGui chooses to implement its manager) after all cause you are doing a very hard assumption over the implementation if you do it that way. Just an example: What if you have a multiscreen system that in the background is implemented using Layers in CeGui#? Any need for the Screen System to do:

ScreenManager.GetWindow ("Whatever")

or know that you have a "Root" Panel and then 2 other panels that are your layers?

 

Furthermore in XNA Framework based engines, Game is supposed to be the one stop shopping place for Services like: UIService, let say, SerializationService (where you Load and Save), AIService maybe?. While at the same time not specifically asking to force a unique instance. You can assume the DiscoveryService will give you the best pick for every one of them (sure you register only one of each one, unless required ;) ). But seriously Services and Components are often overlooked because we are tainted with traditional game development models (Most of them C++ oriented in from their roots ;) ).

 

At the end, the concept is extremely similar to what Microsoft Patterns & Practices propose for Windows Applications by means of CAB (Composite UI Application Block) and Smart Client Application Block. In fact, to be true to XNA, it is so similar that it looks like that some XNA Game Framework designers may have had some exposure to those concepts.

 

If you need some examples contact me directly over MSN and I will tell you about some work that I did for the company that shows that concept in action, but I by no means will leak the code ;) ... (I dont want to get in trouble, but think of a IRenderService that holds the key to an extensible SceneGraph and Scene Management System). Then you do:

IRenderService renderService = Game.GetService<IRenderService> ();
renderService.SceneGraph["Battlescape"].Activate();

or

IRenderService renderService = Game.GetService<IRenderService> ();
renderService.SceneGraph.CurrentScene.Deactivate();

 

Hope that helps

 

Greetings

Red Knight

Link to comment
Share on other sites

Well, wasn't as productive a weekend as I hoped.

But I've got a basic Alien AI implemented (which just launches UFOs on consecutive research missions.)

And UFO movement is synchronized with Game Time.

And the Research mission behaviour does look a bit like X-Com behaviour.

Link to comment
Share on other sites

Just a quick thing I noticed - probably you wanted to change this anyway: What would the Aliens want to research over water? ;) So, basically, you should think about preparing an implemantation of a different behavior for water/land (so they don't "land" on/ stop over water). (I guess sooner or later you'll implement this anyway, just thought it might be good to remember this while coding; I know it's too complex to implement it right now (with the missing land-type descriptions and all)) Edited by Mad
Link to comment
Share on other sites

Well, wasn't as productive a weekend as I hoped.

But I've got a basic Alien AI implemented (which just launches UFOs on consecutive research missions.)

And UFO movement is synchronized with Game Time.

And the Research mission behaviour does look a bit like X-Com behaviour.

Whoops, This post should have gone into the Microsoft XNA thread. http://www.xcomufo.com/forums/index.php?showtopic=242027716. Would some moderator be kind enough to move posts 71, 72 & 73 to correct forum? Thanks.

 

Edit by Zombie: Done.

Edited by Zombie
Link to comment
Share on other sites

Gentlemen,

 

I thought I’d spell out my plans for the next couple of weeks.

  1. Set up a Human base and craft. When intercept button is clicked, craft leaves base and tries to intercept UFO. If successful, UFO is destroyed and craft returns to base. If unsuccessful, craft returns to base. (This should allow me to check interaction between craft.)
  2. Get an “aeroscape” screen to come up when the human craft reaches the UFO. (To allow testing the Geoscape state machine updates to interacting with the screen manager.)
  3. Start implementing different alien missions, and keying the target to countries (as Mad has pointed out.)

In order to set up countries as targets, I need a way to convert a country to a geoposition. I also need a way to convert a geoposition to a country, for the cases where a UFO is intercepted in transit before it reaches it’s target.

 

My thought for this is to use the planets.xml file for this information. The existing planets.xml file has an entry that looks like this:

<region name="Sample_Country" >
<funding amount="100000"/>
<border>
	<coord x="0" y="0"/>
	<coord x="0" y="1.5"/>
	<coord x="1.5" y="1.5"/>
	<coord x="1.5" y="0"/>
	<coord x="0" y="0"/>
</border>
<cities>
	<city name="Sample_City" population="METROPOLIS">
		<coord x="5" y="5"/>
	</city>
</cities>
</region>

Where the cords in the border are a series of points that denote the boarders of the country. However, in order to keep things simple to begin with, I propose defining the “area” of the country as a “rectangle” with a north, south, east and west boarder.

It won’t exactly match the country, but it should be good enough for picking a point inside the country for the UFO to use as its target.

(And going from geoposition to country, I just take the rect closest to the crash point.)

 

So, the XML will now look like:

<region name="Sample_Country" >
<funding amount="100000"/>
<area>
	<rect north="14.5N" south="10.1N" east="175.0W" west="180.0W" />
</area>
<cities>
	<city name="Sample_City" population="METROPOLIS">
		<coord x="5" y="5"/>
	</city>
</cities>
</region>

 

And here’s where you gentlemen come in. Can I get you to figure out the co-ordinates for the countries? That should save me a couple of hours.

 

Some additional notes:

  1. If a single rect doesn’t work very well for describing the country, then you can use up to 4.
  2. The co-ordinates should be in degrees of latitude/longitude, but with the minutes and seconds part converted into a decimal fraction. You shouldn’t need an accuracy of more than a tenth of a degree. (That should be accurate to 11 kilometers.)
  3. Providing the co-ordinates for some cities, say 5 to 10 per country (for terror missions) would also be useful.

P.S. The countries are:

USA

Russia

UK

France

Germany

Italy

Spain

China

Japan

India

Brazil

Australia

Nigeria

South Africa

Egypt

Canada

 

City sizes are:

METROPOLIS

STANDARD_CITY

SMALL_CITY

BEACH. We have to have this for the bikini beach terror missions. :-)

TOWN

VILLAGE

RURAL

UNINHABITED

 

Finally, my apologies to Pi_Masta and Reist for changing my mind and going away from the bitmap idea. But this method should be simpler to implement than that, and good enough for v1.0.

Link to comment
Share on other sites

Alright, I'm still looking for something even better but for the moment I think the National Geospatial Intelligence Agency has something for us. Check out this page. And since you won't want to download every file, you might want to take a look at this monster file containing all data. Here is a description of the fields in the files, to give you a general idea what those files contain. However, this is an awful lot of information, most of which we're not really going to need. So what can we do about this? Do we need someone who actually filters the unnecessary data out? :O

So, another possibility is this smaller file, containing "only" nearly all cities of the world and their longitude+latitude. This file is interesting, because there are region codes as well, which are translated on these sites: USA and Canada, and rest of the world.

City sizes could be calculated by using the number of "duplicate" entries (slightly different longitude/latitude) for a city.

Both sources have a "no license policy" whatsoever or are GPL.

Actually, if i may dream a bit here, I think it would be pretty nice to some day use this data as well to make a lightmap for the dark side of the earth...

 

Let me know if this stuff is helpful in any way.

 

Edit: However, these are by no means country borders (at least as I see it, I didn't check the GNS Files (especially not the large one) deeper though). Those are quite difficult to obtain.

Edit2: I'm not sure if your idea of using coordinates for the borders is really going to work. Take into account that European countries have rather complex borderlines, so you would need an awful lot of coordinates to only get a primitive representation of a country. And if we want to draw country boarders on the globe, we should have pretty nice and realistic representations.So the question I'm rising here: Is it a good thing to have different datasets for the engine and the visual representation? Because if we go this way, it will frequently happen, that you shoot down an UFO over i.e. France, but get points from Germany...

Edited by Mad
Link to comment
Share on other sites

It looks overkill for my purposes.

I'm trying to solve the problems with a minimum work solution that is "good enough". Note, there is nothing to stop the solutions being replaced with a more sophisticated one later on, if we find a need.

That is, my current design philosopy is rather than spend a lot of effort producing a really exact model now, I'd rather do something quick and simple. This means once we have a working system, we can start focusing on the areas where effort will give us the most "bang for our buck".

 

So, the two problems I'm trying to solve are:

1. Once a country has been selected as a target, sending a UFO to the right geographical location.

2. If a UFO is shot down, allocating the points to some sensible country.

 

I'm pretty sure the rects will be a perfectly adaquate solution to 1. (We don't have to use the entire country as a target.)

I think it will be "good enough" for 2. Yes, when it's close to the boarder it may pick the wrong one. But it probably wouldn't be obvious to a human that it was wrong either.

 

At the current time, I'm not putting country boundries on the globe, so we don't need to worry about mismatching data.

 

And a full list of cities (while it would be nice) is overkill for our current needs. Keeping the data sets small makes testing a lot easier.

 

Also, exact size of city (in geographical terms) isn't necessary. The globe resolution isn't that high.

Edited by dteviot
Link to comment
Share on other sites

It looks overkill for my purposes.

Of course it's overkill. Didn't think otherwise. The question is: does it make sense to work on basis of this material (creating a new (smaller) list by copying stuff out - so we always can improve the model by adding more cities), or is it complete and utter waste? Thing is, putting together something like this by hand might take a while - and as long as I'm concerned I won't have time to even think about something this big before February the 22nd.

Another question: if I (someone) puts lists together manually, will more points improve "resolution" or are you planning on only supporting rectangles? Is it a need to work clockwise?

 

Edit: Oh, and the thing with the city size was just to explain my idea of a "lightmap"...

Edited by Mad
Link to comment
Share on other sites

Honestly,

I don't think that data (other than the cities) is very useful.

I'd just take a map, draw some rectangles on it. Then figure out the co-ordinates of the rects. I figure a couple of hours work. Note, we're only interested in 12 countries for v1.0

 

And I've just realized a simpler solution to problem 2. I can assign the points to the targeted country, regardless of where the crash happens.

Link to comment
Share on other sites

Alright. straight answer. Good. anyone going to work on this please post here or PM me, 'cause I'm not eager to do double work. As said before, I won't be able to work on this prior to the 22nd. So anyone willing to do this before this date, you're more than welcome to do so. Edited by Mad
Link to comment
Share on other sites

Progress report.

 

Screenshot.

The Green marker the the Human Base,

The Red marker is the UFO.

The Blue marker is the interceptor.

When intercept is clicked, the interceptor heads towards the UFO.

When it reaches the UFO, it returns to base. (UFO isn't effected yet. - That's waiting for an aeroscape battle screen.)

If UFO escapes, the interceptor still heads for the UFO's last known position. (Because I have yet to implement responing to that.)

However, fuel consuption/refueling has been implemented.

xeno.xna.2007_02_19.JPG

Link to comment
Share on other sites

nice progress, i know this has been said above, i read it but still lost. what did you replace with xna , python? so do you have to reprogram everything? base editor, xnet all over again, what is the main advantage to doing this? not arguing or anything, seriously, just curious
Link to comment
Share on other sites

nice progress, i know this has been said above, i read it but still lost. what did you replace with xna , python?

All the C++ and Python code. It's a complete rewrite from scratch, using C#

 

so do you have to reprogram everything? base editor, xnet all over again,

Correct, although we know how to build XNet, so that should only take a week or two.

 

 

what is the main advantage to doing this? not arguing or anything, seriously, just curious

I beleive working in C# will be a lot faster than the existing code base. For several reasons.

1. C# is nearly as easy/fast to write as Python.

2. By using a single language, we don't run into the considerable labour of interfacing C++ and Python.

3. I don't need to worry about figuring out a framework I don't understand.

 

And so far, it appears to be working.

Link to comment
Share on other sites


×
×
  • Create New...