Author Topic: Scorched Earth and Fabricators  (Read 10860 times)

Offline LaughingThesaurus

  • Master Member Mark II
  • *****
  • Posts: 1,723
Re: Scorched Earth and Fabricators
« Reply #15 on: March 26, 2013, 11:21:14 pm »
Oh
So you make all of these awesome changes without breaking too many things? I'm pretty impressed with that.

Edit: Because my experience with technology is that it's very fickle and breaks at the slightest touch when it doesn't seem like it should.
« Last Edit: March 26, 2013, 11:31:46 pm by LaughingThesaurus »

Offline Fluffiest

  • Full Member
  • ***
  • Posts: 140
Re: Scorched Earth and Fabricators
« Reply #16 on: March 27, 2013, 03:40:16 am »
Oh, I at least knew that you weren't on the game for quite a while after it was made, but I didn't really know how much you looked at all the details of the code and such. I have this view of programming where it just doesn't seem feasibly possible without knowing like everything that the code is inside and out. I don't know much about it, and that gives me this viewpoint I guess. I just figured, a game as in depth as AI War, the developer has to be a total expert to not break things. :P

There's an entire philosophy of programming dedicated to making sure that this isn't the case, and that a programmer can use code written by other people without understanding it inside and out.

Offline _K_

  • Full Member Mark III
  • ***
  • Posts: 219
Re: Scorched Earth and Fabricators
« Reply #17 on: March 27, 2013, 05:54:41 am »
There's an entire philosophy of programming dedicated to making sure that this isn't the case, and that a programmer can use code written by other people without understanding it inside and out.

Nah, that's just an urban legend.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Scorched Earth and Fabricators
« Reply #18 on: March 27, 2013, 10:40:02 am »
There's an entire philosophy of programming dedicated to making sure that this isn't the case, and that a programmer can use code written by other people without understanding it inside and out.
Yea, I think I recall hearing about that in college.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline orzelek

  • Hero Member Mark III
  • *****
  • Posts: 1,096
Re: Scorched Earth and Fabricators
« Reply #19 on: March 27, 2013, 01:36:54 pm »
There's an entire philosophy of programming dedicated to making sure that this isn't the case, and that a programmer can use code written by other people without understanding it inside and out.
Yea, I think I recall hearing about that in college.
I seem to overheard that part as well.. somewhere during my studies.
Reality... is a very different beast tho.. chaos theory runs rampant and Murphy's laws are suddenly not so funny.....

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Scorched Earth and Fabricators
« Reply #20 on: March 27, 2013, 02:11:22 pm »
I like writing "library" code with a foolproof (at least until the universe produces better fools) public interface.  But we don't do that for our games except where something is complex and/or fundamental enough to need it.  Like a custom data structure that gets used lots of places.  But we don't have time to build the game logic with those kinds of clean barriers of "don't know, don't care" so we just have to both know all the code that we'll ever touch :)  Given the stability of our games, I think it's working out.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline LordSloth

  • Sr. Member Mark III
  • ****
  • Posts: 430
Re: Scorched Earth and Fabricators
« Reply #21 on: March 29, 2013, 02:50:14 pm »
What, no variables named after your favorite pets? No abuse of global variables? Heresy.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Scorched Earth and Fabricators
« Reply #22 on: March 29, 2013, 03:01:26 pm »
Quote
What, no variables named after your favorite pets? No abuse of global variables? Heresy.
Haha, even the symbol variable names are descriptive.

And I haven't even checked to see if C# has truly global variables.  We use static stuff fairly often, though even there we go more for singletons.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline contingencyplan

  • Full Member
  • ***
  • Posts: 147
Re: Scorched Earth and Fabricators
« Reply #23 on: March 29, 2013, 09:29:02 pm »
Quote
What, no variables named after your favorite pets? No abuse of global variables? Heresy.
Haha, even the symbol variable names are descriptive.

And I haven't even checked to see if C# has truly global variables.  We use static stuff fairly often, though even there we go more for singletons.

By "truly global" do you mean global variables declared outside of a class? My understanding (semi-confirmed by a quick Googling) is that no, every variable has to be declared inside of a class. But in the case of public static variables, they are essentially just namespaced globals (permits the same uses and abuses, and you can access them just by importing the class), and I'd expect that they'd get compiled down similarly to how globals in C are --- at the least I'd expect all static variables to be stored in a separate section of memory from class instances (though additional stuff to prevent buffer overflows and the like may be done by the VM as well).

Singletons are fun. :)

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Scorched Earth and Fabricators
« Reply #24 on: March 29, 2013, 09:35:30 pm »
public, static, non-immutable (aka, point to an instance of a mutable object OR they lack the readonly or const flag in C# or the final flag in Java) are indeed almost as dangerous as global, non constant variables. The only thing they save you from is namespace collision.

Static mutable state does have its uses, but you should be very, VERY wary of making that public. (private mutable statics can be quite useful in some limited circumstances if you know how to deal with the memory and thread safety implications)

Offline contingencyplan

  • Full Member
  • ***
  • Posts: 147
Re: Scorched Earth and Fabricators
« Reply #25 on: March 29, 2013, 09:37:51 pm »
public, static, non-immutable (aka, point to an instance of a mutable object OR they lack the readonly or const flag in C# or the final flag in Java) are indeed almost as dangerous as global, non constant variables. The only thing they save you from is namespace collision.

Static mutable state does have its uses, but you should be very, VERY wary of making that public. (private mutable statics can be quite useful in some limited circumstances if you know how to deal with the memory and thread safety implications)


Agreed, though I'm one of those ivory-tower crazies that thinks the best way of handling thread safety / write programs in general is to use a declarative language. :D


Edit: since the thread's already semi-derailed, have y'all looked at F# any? How well do you think it's suited to game programming, especially interaction with Unity?
« Last Edit: March 29, 2013, 09:39:38 pm by contingencyplan »

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Scorched Earth and Fabricators
« Reply #26 on: March 29, 2013, 09:39:46 pm »
Yea, we don't use goto or whatever, but I'm sure some of the code in our games is war-crimes material when looked at from a "good programming practices" standpoint :)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline contingencyplan

  • Full Member
  • ***
  • Posts: 147
Re: Scorched Earth and Fabricators
« Reply #27 on: March 29, 2013, 09:42:42 pm »
Yea, we don't use goto or whatever, but I'm sure some of the code in our games is war-crimes material when looked at from a "good programming practices" standpoint :)


Ah, but the big question is whether you use break and continue. :P

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Scorched Earth and Fabricators
« Reply #28 on: March 29, 2013, 09:43:02 pm »
Yea, we don't use goto or whatever, but I'm sure some of the code in our games is war-crimes material when looked at from a "good programming practices" standpoint :)

Sometimes you have to sacrifice "good design" for the sake of performance. Given the kind of absurd loads that some of your games have to deal with (AI War especially), I can see that sometimes you have to that in your codebase.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Scorched Earth and Fabricators
« Reply #29 on: March 29, 2013, 09:45:07 pm »
Yea, we don't use goto or whatever, but I'm sure some of the code in our games is war-crimes material when looked at from a "good programming practices" standpoint :)


Ah, but the big question is whether you use break and continue. :P
It's worse than that.  I've been known to do this:

Code: [Select]
for(blah;blah;blah)
{
    //...
    switch(blah)
    {
        case blah:
            continue;
    }
    //...
}

Bwahahaha!
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!