Porting to C++

For code related discussions and questions
stiv
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 876
Joined: 18 Jul 2008, 04:41
Location: 45N 86W

Re: Porting to C++

Post by stiv »

DuKe2112 wrote:Put it simply: old code works, .. for the purpose it was intented, but if you need it to do something it was not quite intended for, it gets increasingly difficult to adjust.
Well said! And exactly the problem WZ is starting to face.
Also refactoring is everything but starting from scratch! You look what you did last time and try to (probably) do it better.
Worth noting that various parts of the game *are* being refactored - graphics, scripting, GUI toolkit, networking. Most people don't see it because the work is hidden away in the trunk version (where the terrain graphics are awesome, btw)
Seismo
Trained
Trained
Posts: 70
Joined: 06 Feb 2010, 17:32

Re: Porting to C++

Post by Seismo »

stiv wrote:Worth noting that various parts of the game *are* being refactored - graphics, scripting, GUI toolkit, networking. Most people don't see it because the work is hidden away in the trunk version (where the terrain graphics are awesome, btw)
Well thats not exact enough due to the fact that changing some parts of technology has nothing to do with refactoring. It is still hacked code, nothing more. You should be able to maintain code without changing it over 5 or more functions and scripts. You can not understand all side effects than and it is sure as death that you will miss something important. It is a major goal of code refactoring to solve this issue. Than you will save time and improve the quality of the results due to easy and simpler ways of supporting and even understanding it.
User avatar
bornemix
Code contributor
Code contributor
Posts: 56
Joined: 09 Mar 2010, 09:39

Re: Porting to C++

Post by bornemix »

But one shouldn't refactor unless it hurts not to...
newp_samT150
Rookie
Rookie
Posts: 19
Joined: 26 Apr 2010, 23:49

Re: Porting to C++

Post by newp_samT150 »

I don't really know much about programming (still teaching my self C, C++, C#) but from what I have read is that C# is the best version to use for games. Being self taught I could have misinterpreted what I read as a often do. So I was wondering, if C# is supposed to be better for games. why not port it to C#? (I did read about the fact that the older language has less bugs) Unless there of course that would take to long, and I'm not good enough to attempt it my self
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: Porting to C++

Post by Zarel »

C# is better for Windows games. Warzone is not a Windows-only game. It's possible to get C# working on other operating systems using Mono, but it's not the best for those platforms.

On the other hand, porting Warzone to C++ is not a problem and will eventually be done, but I doubt we will ever move to C#.
User avatar
Emdek
Regular
Regular
Posts: 1329
Joined: 24 Jan 2010, 13:14
Location: Poland
Contact:

Re: Porting to C++

Post by Emdek »

C# best for games? How? :-D
I never seen any topic in which it's better (as language), maybe a bit easier to use (but with cost of efficiency) and comes with .NET platform that has some built in classes (but C++ has many libraries and frameworks).
But as said before it's mostly Windows friendly only (and to note, only modern versions count) and I've never heard about any game made with it and nothing about any libraries created to help in game development, especially is not suitable for games where performance is important (C# Solitaire would work ;-)).
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.


Beware! Mad Qt Evangelist.
plumar
New user
Posts: 2
Joined: 03 Feb 2010, 12:49

Re: Porting to C++

Post by plumar »

Emdek wrote:C# best for games? How? :-D
...
I've never heard about any game made with it and nothing about any libraries created to help in game development, especially is not suitable for games where performance is important (C# Solitaire would work ;-)).
http://www.xna.com/

It's a framework made by Microsoft. It allows game development using any .net language for PC, xbox and zune.
User avatar
Emdek
Regular
Regular
Posts: 1329
Joined: 24 Jan 2010, 13:14
Location: Poland
Contact:

Re: Porting to C++

Post by Emdek »

plumar wrote:http://www.xna.com/

It's a framework made by Microsoft. It allows game development using any .net language for PC, xbox and zune.
If something is possible then it doesn't automatically means that it should be done.
A bit reversed example, games could be written in low level assembler language, it would have great benefit in their efficiency but have very bad impact on development progress, with .NET we can say that it can make development faster (but maybe in only some areas, as other frameworks, and not really for games, but other frameworks can help, these made for game development) but also drop application efficiency and portability.
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.


Beware! Mad Qt Evangelist.
User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: Porting to C++

Post by Rman Virgil »

.

First came across the NeoAxis Game Engine and development environment about 18 months ago & its effective use of .NET. Looked pretty solid to me back then - even more so now.... but then again, I make no claims whatsoever to being the Yoda Guru of game development choices. :ninja:

- RV :shock:

.
stiv
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 876
Joined: 18 Jul 2008, 04:41
Location: 45N 86W

Re: Porting to C++

Post by stiv »

If we were building games solely for Windows, .NET might be a viable platform for us. We are not and it isn't.
newp_samT150
Rookie
Rookie
Posts: 19
Joined: 26 Apr 2010, 23:49

Re: Porting to C++

Post by newp_samT150 »

stiv wrote:If we were building games solely for Windows, .NET might be a viable platform for us. We are not and it isn't.
I didn't realize that C# only works with Windows. It would be a shame if only Windows users got to play your great game. Thank you for clarifying this, all of you.
User avatar
Emdek
Regular
Regular
Posts: 1329
Joined: 24 Jan 2010, 13:14
Location: Poland
Contact:

Re: Porting to C++

Post by Emdek »

newp_samT150 wrote:I didn't realize that C# only works with Windows.
Not only there, but only there is supported (and only on very recent versions).
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.


Beware! Mad Qt Evangelist.
segg2
Greenhorn
Posts: 6
Joined: 04 Feb 2010, 14:49

Re: Porting to C++

Post by segg2 »

Also refactoring is everything but starting from scratch! You look what you did last time and try to (probably) do it better.
Worth noting that various parts of the game *are* being refactored - graphics, scripting, GUI toolkit, networking. Most people don't see it because the work is hidden away in the trunk version (where the terrain graphics are awesome, btw)[/quote]

let see.
we need serialization. Like we would like to stop the press(the game). Or we have MS users that must, imperatively reboot their now walking OS. Game will resume in two hours.

Show me how to do it, without moving thing around.

That is, you have added nothing, just move thing around,
it is still a clever arrangement of an infinite series of stupid instructions.
i do not want to delete that, it will take half of eternity to redo.
Chojun
Regular
Regular
Posts: 518
Joined: 25 Nov 2006, 17:49
Contact:

Re: Porting to C++

Post by Chojun »

C++ for the sake of it isn't a good enough reason. I currently do contract software development for the US Air Force and although most of the new/evolving stuff is written in the latest .NET 4.0, you'd be surprised to learn how old the code is that some F-16s and older aircraft are running on (30-40 years old in some cases).

The old axiom "if it ain't broke, then don't fix it" is what fits there. The crux is that the code works exceptionally well and changing it just to simply modernize it creates maintenence hazards that in some cases can be untenable.

The fact is that Warzone's core code works reasonably well, so there has to be a good reason to migrate. Some advocate C++ because at some level they understand that it is superior (++) to C, but they don't quite understand why. C and C++ both compile to the same machine code, so what's the big difference?

Design. :hmm:


Edit: Wow, that's an old topic. Sorry about that. :stare:
User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: Porting to C++

Post by Rman Virgil »

Chojun wrote:C++ for the sake of it isn't a good enough reason. I currently do contract software development for the US Air Force and although most of the new/evolving stuff is written in the latest .NET 4.0, you'd be surprised to learn how old the code is that some F-16s and older aircraft are running on (30-40 years old in some cases).......

"30-40 years old in some cases".....same in major financial institutions...and major Govt. Divisions. Uni Ed life serves many good ends but it can never take the place of working the trenches (& infrastructure) of RL and these type examples can be deeply instructive for those making their way on a maiden voyage through the source's Strait of Messina (assuming arrogance doesn't way lay them between Scylla and Charybdis). O_o

- RV :hmm:
.
.

Impact = C x (R + E + A + T + E)

Contrast
Reach
Exposure
Articulation
Trust
Echo
.
Post Reply