Arcen Games

Other => Game Development => : Buttons840 May 06, 2010, 01:44:37 PM

: The thread of programming questions, advice, and secrets.
: Buttons840 May 06, 2010, 01:44:37 PM
Do you unit test?


One of the greatest features about AI War is the ability to join "hot seat," meaning you can join during the middle of an existing game.

I've seen so many very promising games riddled with crashes and desyncs.  One such game was Sins of a Solar Empire, which was unparalleled in multiplayer (competitive) depth.  A proper game would last 1 to 2 hours.  However, most games ended in 45 minutes and were always decided by factors such as players disconnecting, crashing, desyncing, etc.  If the game did last long enough memory leaks began to slow the game to an unbearably slow pace.  When a player disconnected the AI took over for them (a good feature), but it would have been even better if another play could "hot seat" join and take over the AI.  All the games troubles could have been solved by hot seats.  Disconnect?  Just reconnect.  Crash?  Reconnect.  Memory filled with memory leaks?  Quit and reconnect.  Desync?  Hopefully it's detected, and then everyone can resync with the host (or a randomly chosen player).

How does the hot seat in AI War work?  Any trouble implementing it?  Why do you think it's such a rare feature despite it being a universal solution to many RTS problems?

AI War may be simpler than many RTS games, since there are only units and positions; no simulated environment to speak of.  Would you consider it more difficult to have a hot seat in a game like Age of Empire where the environment is more complex?


Lastly, the title does mention secrets, so tell us something we don't know about your games.  :)  About the programming that is.


Thanks.
: Re: The thread of programming questions, advice, and secrets.
: x4000 May 06, 2010, 02:03:40 PM
I think you're looking for this section of my blog: http://christophermpark.blogspot.com/search/label/Programming (http://christophermpark.blogspot.com/search/label/Programming) ;)

A lot of your questions are things that I'll have to address in greater depth in later blog posts (I only do a few a month, due to the immense time required to create them), if there's interest in the nitty gritty details.  But, to give at least basic answers to your questions:

- There weren't any particular problems with the hotseat stuff at all.  Pretty trivial, really.  I don't know why more game developers don't support this; Age of Empires II did, and then other games that came after pretty much dropped it.  You also get really (pardon me, but) moronic types of save systems like the one in Neverwinter Nights 1, which just was essentially a memory dump.  To me, this speaks of nothing but poor planning and possibly cutting for scope.  I can't stress too much how trivial and simple this is when planned-for from the start.  It does make certain things like recorded games not possible (or at least simple) when spread across multiple sessions, but... so? I think that it's just something that pvp RTS developers tend not to care about because honestly who needs to save a game that lasts 20-40 minutes on average?

- Yes, we unit test, we do profiling, and so forth.  Though, we don't have any automated test cases that we run for mathematical correctness; we aren't using any testing software or anything.  Our unit testing involves a programmer firing up one of several savegames that we keep handy, and looking at profile data, performance, correctness and overall feel, etc.  Or if it's a brand new feature, then simply having the programmer fire up a game and test that out in a few situations, etc.  We use the prerelease betas for purposes of what we call integration testing, essentially using our core fanbase to help us balance and do the core testing.  They don't seem to mind (and in fact seem to really enjoy having input), and it's the only way for a tiny company like us to get by since we don't have a staff of hundreds (or even one or two) testers.  The programmers also play the game recreationally, which helps to find things and keep things clean, too.  Mostly we have an emphasis on clear software design and bug-avoidance techniques, which also works largely because of the low number of programmers working on it.  For things like balance, we do have the simulation that we run for strong/weak data, and we do some computer-assisted analysis of balance with that, but a lot of it also boils down to intuition and user testing because ships can be used in so many nonstandard ways.

- I would definitely not call AI War simpler than most RTS games -- the simulation itself for all the unit interactions, etc, is several orders of magnitude more complex than... well, any other RTS game, I feel confident saying.  However, we have no physics simulation to speak of, and obviously almost no environmental simulation to speak of, also.  So it's vastly simpler in a few areas (non-gameplay-related, mostly, just environmental), and it's vastly more complex when it comes to the core gameplay itself.  These factors don't matter one whit to having hotseat functionality if you design it properly -- in fact, most of those sorts of environmental factors can be completely ignored for most purposes as things like birds chirping or trees blowing in the wind, etc, are typically not synchronous in an RTS game, anyway; cosmetic, non-simulation-affecting stuff is run on an entirely different random seed that is not synchronous, typically -- same for 3D animations for units, and anything else that doesn't affect where stuff is, who lives and dies, etc.  There's no good reason not to just re-seed that for anyone who joins late in hotseat play, unless your game architecture is just designed in a nonideal fashion from the ground up.

- For secrets, check out the blog if you want a lot of inside stuff.  I don't have anything readily handy to tell you off the top of my head, honestly; I tend to be pretty open about most stuff with the game, so there tend not to be a lot of huge secrets to whip out. ;)
: Re: The thread of programming questions, advice, and secrets.
: Buttons840 May 06, 2010, 02:09:33 PM
Thanks, I didn't know about your blog and will have to visit it from time to time.  Looks like there's plenty posted to keep me busy already. :)
: Re: The thread of programming questions, advice, and secrets.
: x4000 May 06, 2010, 02:12:03 PM
There's a ton of AI stuff there (and here: http://arcengames.com/mediawiki/index.php?title=AI_War_-_AI_Design (http://arcengames.com/mediawiki/index.php?title=AI_War_-_AI_Design)) too, which has been really popular around the Internets -- Slashdot, Reddit, Hacker News, MSDN, How Stuff Works, etc.

Also, for more design-oriented stuff, you might like this section of the wiki: http://arcengames.com/mediawiki/index.php?title=AI_War:Fleet_Command#Design_Philosophy (http://arcengames.com/mediawiki/index.php?title=AI_War:Fleet_Command#Design_Philosophy)

I'm definitely always interested in new potential topics for the wiki or the blog, though, so questions are always welcome.  I just have to balance that with the time it takes to make such posts. :)
: Re: The thread of programming questions, advice, and secrets.
: Buttons840 May 27, 2010, 07:35:40 PM
Any opinions of F#?  I've been wanting to study O'caml which is very similar.
: Re: The thread of programming questions, advice, and secrets.
: RCIX May 27, 2010, 08:50:27 PM
If you're going to study OCaml, then i'd definitely go with F# instead. Nicer syntax (less rigid from what i hear), and you get access to the entirety of .NET (and you can use VS which is the best IDE bar none).
: Re: The thread of programming questions, advice, and secrets.
: x4000 May 27, 2010, 08:52:10 PM
I've looked at it briefly from time to time, and it seems like the sort of thing that has a lot of potential to me.  My other favorite language other than C# is TSQL, and I feel like F# takes a bit from both of those existing languages and mixes them together with some completely new concepts.  I'd have to really do some nontrivial work in it before forming a full opinion, but at the moment there hasn't been a compelling reason to do so.  I'd hate to think that I'm becoming a programming stick-in-the-mud already, but I don't yet have a case for anything that can be done in F# that I can't do just as fast with C# at the moment, with my library of past-developed functionality and my history with it.
: Re: The thread of programming questions, advice, and secrets.
: RCIX May 28, 2010, 12:31:29 AM
In that case, you might be interested in http://stackoverflow.com/questions/2785029/in-what-areas-might-the-use-of-f-be-more-appropriate-than-c :)
: Re: The thread of programming questions, advice, and secrets.
: Buttons840 May 29, 2010, 02:41:28 AM
What do you think of open-source engines like OGRE?  OGRE was used to create torchlight which was a fairly popular dungeon crawler available on Steam, and a full 3D game.  Could such an engine be used for 2D games similar to how your using the Unity engine?

(Note:  I don't bring it up to persuade you to move away from Unity by any means.  I like Unity and it's obviously done well for you with Tidadis.  I'm just wondering if you have any thoughts about it, though you most likely haven't looked into every obscure engine.  :)  )
: Re: The thread of programming questions, advice, and secrets.
: x4000 June 01, 2010, 07:25:12 PM
Sigh, the forums apparently went through a couple days where they did not notify me of some threads, which is really annoying.  So I'm only seeing this now, I wasn't avoiding it.

At any rate, we evaluated the following platforms when we decided upon Unity for AI War to move to, and to use for Tidalis, plus a couple of others:

SlimDX / .Net 3.5 (current platform)
OpenTK / Mono
Torque Game Builder
Unity 3D
Torque X 2D
XNA Framework
Tao Framework / Mono
OGRE
BlitzMax
Blitz3D SDK
FMOD (Audio Only)
TrueVision 3D
Gamebryo

For all of the above except for Unity, there were various serious drawbacks for Arcen specifically.  One or more of the following was true of everything on this list except Unity, in the end:

1. Overly difficult/long installation process.
2. Buggy and uneven support.
3. Lacking in the latest features and/or not frequently/recently updated.
4. Poorer performance than we were willing to accept.
5. Funky workflow requirements that we hated (Unity actually had this one as well, but we managed to work around that).
6. Lack of support for platforms beyond the PC.
7. Lack of support for productive/powerful programming languages and scripting (we are biased toward C#, but could have accepted an equally-functional alternative with a similar level of verbosity).
8. Price (Unity is $1200 per developer, but some were far more than that).

I think there were also a few others that we considered, like the LOVE engine for example, but some of them were so early in development and had such limited functionality at the time that they didn't even make it onto the full consideration list.  But, some of those -- LOVE specifically -- is looking like it will be really great for certain games in the future.  We also investigated FLEX to a heavy degree, and discarded it for various reasons.

I was nervous as heck about Unity, and I hated their way of loading assets and their workflow in general with an intense passion upon first using it.  However, I managed to completely bypass that style of workflow within Unity and approximated something more like what we had with SlimDX, except even more efficient and effective.

I can't stress enough how much I love SlimDX, I'm really sad to be moving away from that.  It's a great library, and if it wasn't for it's issues with #1 and #6 above, I'd want to stay with it.  And #1 really isn't its fault, it's more of a .NET 3.5 thing. 

My impression of OGRE and SDL.NET and most of the other open source C# ones was that they were at various levels of polish and completion, and that many of them haven't been updated much in the last 2-3 years.  I don't remember which ones were which, now, and certainly the C++ versions of several of those were much more active and had larger communities surrounding them.

In the end, everything on that list is a great product for certain purposes, or many purposes, as the case may be.  But, we needed something that matched with our really specific needs and our established (and semi unusual, but super effective) style of workflow.  So just because something doesn't work for us, doesn't mean it won't work for you.  Some of it even boiled down to us having this focus on 2D in 3D, a lot of those products would have been much better for 3D purposes, which is what many of them were designed for in the first place.

I couldn't be happy with how Unity turned out, though, and at this stage I love it pretty much the same as I do SlimDX.  Both really solid products.
: Re: The thread of programming questions, advice, and secrets.
: Buttons840 June 01, 2010, 09:49:54 PM
My impression of OGRE and SDL.NET and most of the other open source C# ones was that they were at various levels of polish and completion, and that many of them haven't been updated much in the last 2-3 years.  I don't remember which ones were which, now, and certainly the C++ versions of several of those were much more active and had larger communities surrounding them.

In the end, everything on that list is a great product for certain purposes, or many purposes, as the case may be.  But, we needed something that matched with our really specific needs and our established (and semi unusual, but super effective) style of workflow.  So just because something doesn't work for us, doesn't mean it won't work for you.  Some of it even boiled down to us having this focus on 2D in 3D, a lot of those products would have been much better for 3D purposes, which is what many of them were designed for in the first place.

I couldn't be happy with how Unity turned out, though, and at this stage I love it pretty much the same as I do SlimDX.  Both really solid products.

I looked at OGRE mainly because I know it was used successfully for the Steam game Torchlight; which looks good, and I hear it's good, but I haven't played it.  I will have to look at some of those others you mentioned.

I suspect many, if not all, of those engines could have worked but I guess there comes a time when you must choose just one of the many "good" options and go with it.  Glad to hear Unity is working well for you.

And thanks for your detailed comments, it's given me some new engines to look into.
: Re: The thread of programming questions, advice, and secrets.
: x4000 June 01, 2010, 10:40:39 PM
Well, also bear in mind that a lot of it is preference.  So a workflow that is ideal and perfect for one team might be horrible for another.  If you have a background in Ruby, you might prefer one platform, if you're a C++ guy you'll prefer a different set, and then the C# folks have a different way of thinking, too.  It also depends on your other goals, and what other components you intend to use (input, rendering, sound/music playback, as the basics -- plus windowing, physics, AI, or whatever else as secondary addons).  In our case we always roll our own physics and AI, but sometimes that's another consideration with a platform.
: Re: The thread of programming questions, advice, and secrets.
: getter77 June 10, 2010, 01:09:08 PM
Things being as they are, what's the Arcen take on the upcoming, to a layperson such as myself, "big deal" Version 3 Unity3D release in the grand scheme of things?  Or perhaps even just centric to Arcen's wares going forward with such presumed bullet points being implemented satisfactorily?  Given the like of the above examples, I know not of another engine engaging in such an aggressive and comprehensive seeming release outside of maybe the whole UDK shebang, which could well not be such an apt match up given the nature and history of it.  I would presume you lot will have already filed a pre-order for the rather nice chunk off?...

Though I could also see this being a good article topic to expound upon for when the release actually lands and the reins have been more or less grasped on all that is new and shiny regarding it.
: Re: The thread of programming questions, advice, and secrets.
: x4000 June 10, 2010, 01:34:14 PM
Well, we have bought version 3 (we got version 2 for free when we bought version 3), and we're definitely excited about it.  However, a lot of the big-ticket features that Unity themselves are talking about most are not really relevant to us, since they are focused on 3D and we won't even be using them.  But, the things (that we know about) that we're particularly excited about, are:

1. A much-improved font rendering engine, though we don't have details.  I'm really hopeful about this helping us cut down on font-related load with AI War and Tidalis.
2. They'll be having a full debugger, which we're really excited about.
3. Various bugfixes, etc, some we know about and others not yet.

Beyond that, honestly most of the features that would be of interest to us are a bit below the radar of what Unity is really discussing.  I'd like to see some improvements in some parts of the GUI rendering engine, for example.  And I'd love to see some of the Sprite Batching stuff that is reputedly in the latest Unity iPhone versions also make it into regular Unity.  I'd love to see support for things like force feedback, which would make sense given the new consoles they'll be supporting.  And I suspect there are a ton of other small API improvements, so I'll be excited to go through those and see what's what.

But, otherwise, for the time being that's pretty much all we know!
: Re: The thread of programming questions, advice, and secrets.
: getter77 June 10, 2010, 02:26:32 PM
Good to know!  I can't help but feel oddly drawn to Unity3D out of a sense that they are primed to be a thing promoting much growth, even aside from the incredibly simple price/licensing side of things, like the whole event they had with Google in terms of significantly upping the ante on "browser" level game development as another outlet.

I have a hard time imagining myself truly needing to reckon an engine into existence from scratch for any personal project down the line versus the likes of Unity and the various others, whereas some years back the field strikes me as one that was far narrower in terms of offerings available period, affordable, and capabilities/intuitiveness of use.

One would also surely think that Unity will hew closer to matching iDevice support with Version 3, especially given the latest wranglings regarding iDevices, Android, and likely specs afoot in the 3DS and PSP2 arenas that'll come out moreso during E3---it is marginally terrifying in an extravagant way how close these devices are hitting parity with the "gist" of desk/lap top level performance in general relative to gaming fidelity.

Still can't escape the feeling that somewhere within these apprenticeship months or beyond I'm going to wind up locked in with Unity3D V3 until I can come to grips with it...   :D
: Re: The thread of programming questions, advice, and secrets.
: x4000 June 10, 2010, 02:38:38 PM
Yeah, it's definitely a good time to be an indie, that's for sure.  The field of engines now, versus ten years ago, is just amazingly different.  Heck, even 7 years ago when I started seriously pursuing writing my own 2d game engine stuff on top of a DirectX7 (and later DirectX8, then 9) layer, it was an entirely different landscape.