Please Focus on Code Quality

Discuss the future of Warzone 2100 with us.
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA

Re: Please Focus on Code Quality

Post by Zarel »

-Kosh- wrote:The keyword there is lately.
I meant the overall scope for the past 3-4 months, there can be no denial that there has been one active person holding up the ship, with a supporting cast.
Do not get me wrong, I know how a open source project works, and this is typical, but your definition of active is apparently different than mine.
...that still leaves both Per and cybersphinx...

http://developer.wz2100.net/timeline?fr ... ate=Update

Here's the last 3+ months. cybersphinx has been a bit more active than Per, but they're roughly even. I definitely don't see a clear "winner".

Heck, I'm only a month behind Per; if it weren't for my lack of access to my Windows machine and my inability to compile Warzone on Mac OS X, I could be one of those people, too. And i-NoD is a new developer; if we just look at the period of time after he got commit access, he's about as active as the rest of us.
zeland
Rookie
Rookie
Posts: 28
Joined: 14 Aug 2009, 01:24

Re: Please Focus on Code Quality

Post by zeland »

3. Air units do not consider buildings when doing route finding, often flying directly into them.
Can it be fixed as such that there is a special "VTOL height layer" that all VTOLs must ascend to before flying in any particular direction? No building or structures are allowed to be erected if any part of of the building/structure touches this special height layer.
LaughingEddy
New user
Posts: 4
Joined: 15 Sep 2009, 19:55

Re: Please Focus on Code Quality

Post by LaughingEddy »

Hi,

I had hoped that my original post didn't have that "OMG you guys suck" tone, but it would seem that I was incorrect.
With someone with 20 years experience you should know that if you are given a project that you know nothing about, have no design documentation, were not in on the planning meetings, and not in touch with the original crew that created this program, then you can't really complain about the state of the code, unless you can bring up specific examples of bad code that these guys created.
This kind of comment makes me really angry. I have 20 years gaming experience. And, yes, I certainly can complain about code quality, as much as I like. All the reasons you listed for me to not complain are excuses reeled-off by lazy bastards who look for reasons not to actually do any work. I am a Software Engineer, not 'just a programmer'; a 'mess' like the original GPL'd version of WZ is a challenge, not an obstacle.

Now that I've got that off my chest... :)

The point I was trying to make, is that there are plenty of little niggles in the original code that, when fixed, would improve gameplay. Now, someone made the point that fixing some of them require fundamental changes... or that 'fixing this will break something else'.

Well, this goes directly to the heart of my original post - if the code is so spaghetti-ish, then, in order to move forward with confidence, the best course of action is to refactor the code in question. Of course, when you're doing something for fun / part-time, hard-core refactoring can be difficult (this, I know from experience :) ), but I can guarantee that it will be worth it, for the reasons I outlined; a game that crashes all the time, will never be fun.

Yes, I do know how bad the code is - I looked into doing 64-bit compatibility fixes around the 2.0 - 2.1 change-over time. My professional opinion is that the primary problem is that it is Windows code. Devs who've worked on something other than Windows will understand this.

Knowing how bad the code was is the very reason I made the post in the first place; that many of the bugs in recent versions had their origins in the structure of the original code. I know from experience, that adding to 'bad' code is extremely difficult and becomes more difficult the more you add, or as someone once said "If you think good architecture is expensive, try bad architecture."

To the devs for their not-so-veiled appeals for assistance: I would, genuinely, love to be able to contribute directly to the code base. My excuse (and I'm sticking to it ;) ) is that I spend all day working on code that *ahem* "would certainly benefit from refactoring", so it kinda takes the edge off working on the same in my spare time. *grin*

Right now, I'm only able to offer opinion / guidance on how I feel improvements could be made :(

Okay, enough rants for one night :)

Much Lav,

Eddy
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA

Re: Please Focus on Code Quality

Post by Zarel »

LaughingEddy wrote:I had hoped that my original post didn't have that "OMG you guys suck" tone, but it would seem that I was incorrect.
Much of the forum (perhaps even some devs) get really defensive whenever someone criticizes the code. You'd do well just to ignore the defensiveness. :/

And I'm still waiting for more details on problem #5 here. I thought I had fixed it. Can you please go check out a recent version of 2.2-branch and tell me what's wrong?
LaughingEddy
New user
Posts: 4
Joined: 15 Sep 2009, 19:55

Re: Please Focus on Code Quality

Post by LaughingEddy »

Okay, so that's been fixed... I musta missed it in the release notes...
User avatar
Vermithrax
Trained
Trained
Posts: 66
Joined: 22 May 2009, 06:34
Location: Tucson, Arizona

Re: Please Focus on Code Quality

Post by Vermithrax »

Perhaps LaughingEddy would like to contribute to correcting the code?
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: Please Focus on Code Quality

Post by lav_coyote25 »

Vermithrax wrote:Perhaps LaughingEddy would like to contribute to correcting the code?


viewtopic.php?f=6&t=3771&p=37325#p37121 xD
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA

Re: Please Focus on Code Quality

Post by Zarel »

Vermithrax wrote:Perhaps LaughingEddy would like to contribute to correcting the code?
Hey, look, someone who didn't read the thread. :P
-Kosh-
Trained
Trained
Posts: 203
Joined: 16 Sep 2009, 23:34

Re: Please Focus on Code Quality

Post by -Kosh- »

LaughingEddy wrote: This kind of comment makes me really angry. I have 20 years gaming experience. And, yes, I certainly can complain about code quality, as much as I like. All the reasons you listed for me to not complain are excuses reeled-off by lazy bastards who look for reasons not to actually do any work. I am a Software Engineer, not 'just a programmer'; a 'mess' like the original GPL'd version of WZ is a challenge, not an obstacle.

Now that I've got that off my chest... :)

The point I was trying to make, is that there are plenty of little niggles in the original code that, when fixed, would improve gameplay. Now, someone made the point that fixing some of them require fundamental changes... or that 'fixing this will break something else'.

Well, this goes directly to the heart of my original post - if the code is so spaghetti-ish, then, in order to move forward with confidence, the best course of action is to refactor the code in question. Of course, when you're doing something for fun / part-time, hard-core refactoring can be difficult (this, I know from experience :) ), but I can guarantee that it will be worth it, for the reasons I outlined; a game that crashes all the time, will never be fun.

Yes, I do know how bad the code is - I looked into doing 64-bit compatibility fixes around the 2.0 - 2.1 change-over time. My professional opinion is that the primary problem is that it is Windows code. Devs who've worked on something other than Windows will understand this.

Knowing how bad the code was is the very reason I made the post in the first place; that many of the bugs in recent versions had their origins in the structure of the original code. I know from experience, that adding to 'bad' code is extremely difficult and becomes more difficult the more you add, or as someone once said "If you think good architecture is expensive, try bad architecture."
Is this not a folly?
You can not force anyone to do anything since this is mostly done by part-time people who do it for fun, so in what context do your words of wisdom fit in? In this case, your words ring hollow if you do not lead by example.

The biggest problem that I see is they have no real way to test things to make sure it does not break besides doing releases. You can run the game 10 different times and it will do 10 different things. Very hard to debug non-deterministic code.
This is a waste of space. Something important should be here.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Please Focus on Code Quality

Post by Per »

There are things that can be done. I started adding unit tests to the game not so long ago. We need more of those. We also need an automatic, scripted play-through of the entire campaign (by cheating victory at each level) to test that campaign transitions work. However, these things take a lot of time, and the return on investment (so to speak) is low to begin with and people want their bugfixes and new features yesterday.
LaughingEddy
New user
Posts: 4
Joined: 15 Sep 2009, 19:55

Re: Please Focus on Code Quality

Post by LaughingEddy »

-Kosh- wrote:
Is this not a folly?
You can not force anyone to do anything since this is mostly done by part-time people who do it for fun, so in what context do your words of wisdom fit in? In this case, your words ring hollow if you do not lead by example.

The biggest problem that I see is they have no real way to test things to make sure it does not break besides doing releases. You can run the game 10 different times and it will do 10 different things. Very hard to debug non-deterministic code.
I try to resist feeding trolls, but sometimes I just can't help myself...

Clearly you didn't read the bit where I said:
Of course, when you're doing something for fun / part-time, hard-core refactoring can be difficult (this, I know from experience)...
and where I said:
My excuse (and I'm sticking to it) is that I spend all day working on code that *ahem* "would certainly benefit from refactoring", so it kinda takes the edge off working on the same in my spare time. *grin*
Given that I, as my day job, refactor code, it is clear that my words do not 'ring hollow'. Would you make the same allegation to the likes of Myers or Fowler if they made comment, but didn't actually contribute code? I don't think so.

*sigh* Current commodity computer technology cannot be non-deterministic, unless it is malfunctioning. So, assuming that your computer isn't broken, then the behaviour is deterministic. This is a fundamental truth of computer architecture, but then, if you'd done a computer science degree, like myself and probably most of the WZ devs, you would know that.

Given this, any non-determinism in the software is due to the software. If it's in the software it can be changed, ergo, anything can be tested deterministically. This is done throughout the games industry (to the point where they even compare test-runs frame-by-frame).
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA

Re: Please Focus on Code Quality

Post by Zarel »

LaughingEddy wrote:*sigh* Current commodity computer technology cannot be non-deterministic, unless it is malfunctioning. So, assuming that your computer isn't broken, then the behaviour is deterministic.
When we say "non-deterministic", we don't mean it literally; we simply mean that the bug is difficult to track down - it's affected by too many outside influences.
LaughingEddy wrote:This is a fundamental truth of computer architecture, but then, if you'd done a computer science degree, like myself and probably most of the WZ devs, you would know that.
Well, our most active developer (Per) is a philosophy major, so... ;)

(On the other hand, I'm a CS major, and I consider him better than me, so take that as you will.
-Kosh-
Trained
Trained
Posts: 203
Joined: 16 Sep 2009, 23:34

Re: Please Focus on Code Quality

Post by -Kosh- »

LaughingEddy wrote:I try to resist feeding trolls, but sometimes I just can't help myself...
Yeah right.
Your troll logic detector is bassackwards. You come on here with your holier-than-thou attitude, "Do as I say, not as I do!" :rolleyes:
Clearly you didn't read the bit where I said:...
I read it. I just do not buy it.
Given that I, as my day job, refactor code, it is clear that my words do not 'ring hollow'. Would you make the same allegation to the likes of Myers or Fowler if they made comment, but didn't actually contribute code? I don't think so.
If you say so. If Myers or Fowler posted what you did, I would call them trolls as well. :P
It is pretty naive to think that they do not focus on code quality, when you still have not given one bit of proof of where the code is bad that the devs have made.
This is a waste of space. Something important should be here.
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA

Re: Please Focus on Code Quality

Post by Zarel »

Grr. Knock it off. Next person who accuses someone else of being a troll gets sternly reprimanded. <_<
themac
Trained
Trained
Posts: 415
Joined: 17 Jul 2009, 19:14
Location: Germany

Re: Please Focus on Code Quality

Post by themac »

I think A4tech is right: Time consumption can be really big if you like to make a quite good program code. I can not code in C, but in other languages, so I know that a lot of time may be needed to modify a piece of source-code to get the best result with it as possible. :-/