views:

394

answers:

6

Will a game written in C# have any speed issues after long periods of play, like for 24 hours at a time? I'm specifically talking about a 2D RPG similar to old Final Fantasy or Dragon Quest games. I know that languages like Python will slow down too much, curious how C# would stand.

edit: programs I write are a lot like a termite-infested tree :)

@jimmy - thats the entire point of this. I'm working on a small FF clone to improve my coding

+12  A: 

Yes, it is. Take a look at XNA. There are already some games written in C#.

Charlie Salts
A: 

The XNA Game kit for XBox 360 uses C#...

ifwdev
No idea why you got a down vote. +1 from me.
Charlie Salts
+2  A: 

I'd take a look at this Channel 9 video posted years ago from Eric Lippert

Eric Lippert - Have you noticed a performance hit in .NET?

It's a great watch if you're wondering about comparative performance. Computer hardware has advanced a great deal more since then, but the concept hasn't changed, C#/.Net can have excellent performance if you're using it correctly.

Nick Craver
Wow, that's an oldie. I ran into Charles on the bus today; hopefully we'll get some more Channel 9 videos done one of these days.
Eric Lippert
+2  A: 

If code slows over the course of its execution -- and by that I mean doing the same thing takes longer -- it's a sign that memory is not being managed correctly. I don't know what you mean about Python slowing down, but I don't have much experience with it. It's possible that some game or graphics libraries don't handle memory correctly, which could cause performance to suffer (and eventually crash). But closing the app and restarting would fix any issue like that -- and surely you'd have a save feature if a user was to play for 24 hours?

To answer your question, correctly written C# will not slow down if you play the same game for too long. (But neither would correctly written Python code, or any other language).

Ian Henry
+2  A: 

The high-level game logic could definitely be written in Python. In fact it's quite common to use a "slow" scripting language to allow more freedom to the game designer. In practice the lowest levels of the game (like the hardware interface / drivers) are written in C. Everything else in between is open for debate depending on what type of performance you require and what type of hardware it will be running on.

karunski
A: 

The .NET rewrite of Quake:

http://www.codeproject.com/KB/mcpp/quake2.aspx

Alex
Excellent example of the potential of .NET performance! But, that port was actually done with managed C++ and not C#.
Paul Sasik
Yeah that's right, Paul. At the end of the day we have a some IL and a managed application. The actual language used to get there shouldn't matter too much.
Alex