Sign in to follow this  

Discussion about XNA and Tactics Games

This topic is 3463 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For Dream-Build-Play 2008, I'm building a tactics game. This is my first 3d XNA project, I'm a c++/Ogre/PhysX guy, so I'm having issues. The first and most pressing issue I see is how to implement terrain. There are multiple possible approaches: A)Build it using a heightmap that is derived from square stencils to preserve the "tiled" look. This makes camera and character movement implementation a breeze. The issue with this, in my opinion, comes in when you implement decals to display movement and attack range to the player. B) Build tile models in 3ds/XSI and display them. Here's where my lack of XNA experience bites me: I'm not sure of the efficiency limits of this approach. If I have a large level, will this slow the game down? Also, seams might be an issue. My biggest plus for this approach is that I can implement a level editor for my level design guys, and the players themselves. There are hybrid implementations, like building the entire level as one mesh in a modeling solution. Basically, I just wanted any input and discussion that we could have about this issue. I am hoping to build a starter kit for the community out of this, and full credit for design algorithms would be given where appropriate. Thanks guys!

Share this post


Link to post
Share on other sites
Well as far as PC goes you're really just working with Direct3D so the same performance considerations are going to apply. Mainly, that you're going to need to keep the number of Draw calls low if you want to avoid being CPU-bound. This applies mainly to the "B" approach: you'd definitely need to use some method of instancing if you're going to split your terrain up into multiple meshes. For the project I'm working on now I've noticed that my CPU usage is in C#/XNA has been a good bit higher than what I was getting in the prototype I originally made in C++/Native D3D9. This of course purely anecdotal and I have no idea if the same applies to everyone else, it's definitely a possibility that my relative noobiness with C# and .NET is leading to excessive GC compactions or something like that. However I'm fairly confident this won't be an issue anymore once I get instancing up and running, and use good frustum/visibility culling. This sample gives a nice overview of instancing in the XNA Framework.

If you're aiming at the 360...there are also some other considerations in terms of performance. I haven't gotten around to running my game on the 360 yet, but I suspect that my CPU problems will be somewhat amplified when I do. Making good use of the two cores (and 4 hardware threads) available seems to be key to getting good CPU performance.

Oh and if you're thinking of making a level editor...I definitely suggest it. I've made a level editor for my current project and the process has actually been very pleasant thanks to .NET and Windows Forms. I just compile all my graphics engine stuff into a common library shared by the map editor and the actual game, which keeps things uniform. This sample has some code you might find useful if you go that route. Or if you'd like feel free to ask about my editor, since I love to yapp about it. [smile]

Share this post


Link to post
Share on other sites
X360 is definitely the end result desired. I think the first step is building a level editor, akin to this one: http://youtube.com/watch?v=4JxtmYColOw

Now, this game had a large influence on my choice not to do pseudo-3d with 2d sprites, simply because it runs smoothly on the 360.

I have never written an editor before, so PLEASE feel free to yap away, either here or in a PM. Like my OP said, this is for discussion, and I feel this is relevant.

though it may just be you and I discussing. haha.

Share this post


Link to post
Share on other sites
That game looks really cool, especially for an XBLA game. Looks like the map terrain/elements is composed of elements that are uniformly sized and shaped, which probably helps a whole lot with collision detection and partitioning. Performance-wise it doesn't look hard to pull off, all the meshes and shaders look simple (from what I can make out in a Youtube video, anyway). You'd just need to implement instancing to reduce draw calls, like I mentioned earlier.

As for an editor that's built right into the game...it's a cool concept and I've though about getting something like that going for my project. See right now the map editor is a separate app and is all WinForms-based, which means its PC-only. I could easily distribute it with the PC version of my game of course, but it wouldn't do any good for 360 users. And after seeing games like this and Little Big Planet coming up, I'm starting to think an in-game map editor would be a sweet idea. Fortunately I think I haven't coded myself into any corners yet...what I did for the map editor was I created a new class called "MapEditorLevel" that derives from the class "Level", which is used by the actual game. So the MapEditorLevel still loads itself and renders itself just like the game does, but disables collision detection/running updates on game objects/running scripts/whatever. It also adds functionality used in an editor: adding objects at arbitrary position/orientation, setting object properties, saving to a file, copy and paste, etc. The nice thing is that this is all decoupled from the user interface: I have a different class (MapEditorControl) that derives from the Control class which is embedded in app's main form. This class takes all the user input from mouse/keyboard/menus and calls the methods in MapEditorLevel that do all the heavy-lifiting. This means (in theory) that I could make some other class that could be used in the actual game to handle input and render menus, and it would also talk to MapEditorLevel.

So yeah that's how I have things going...I'm sure there are other approaches with other benefits but I haven't heard many since map editors isn't a widely discussed topic. It'd be great if anyone else chimed in to talk about their implementation. [smile]

Share this post


Link to post
Share on other sites

This topic is 3463 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this