"Unprecedented Modding Tools"

Why invent a new scripting language? All you will do is introduce another possible source for bugs while not gaining anything in functionality that couldn't be done with proper bindings. Keeping with python will benefit the institutional memory of the civ4 modders and make more advanced civ 5 mods out the door quicker.
:dunno: probably you are right: creating a new scripting language is a waste of time and resources + require modders to learn a new language.

STL simply isn't a workable solution for amateurs. Seasoned engineers have enough trouble with it. I can use it when necessary, but I'd rather use this

Code:
units = []
for eUnit ...
    if ...
        units.append(eUnit)
for eUnit in units:
    # use eUnit

Than the STL equivalent. Manually dealing with iterators is so 1990. :p

As for standardized C data structures, I'm not familiar with them. I'm sure plenty of people have written good libraries, but none are standard as the STL is.
STL is part of the C++ Standard for over nine or ten years :banana:

Code:
for eUnit in units:
    # use eUnit
i suppose the e prefix means that eUnit is an enum?

for the sake of arguement let's suppose it is not:
let's eUnit be of some STL container type unit_t.

iteration:
Code:
for(unit_t::iterator it = eUnit.begin(); it != eUnit.end(); ++it)
  it->do_something();
there is a catch though :D : adding to or deleting from any STL container invalidates any pointers and iterators that reference the to-be-modified container :crazyeye:

But it doesn't matter, even in the SDK code that could make use of the STL they avoided it almost entirely. They used Vector in a few places and probably used the STL's hashtable for the info type map (string => int). Otherwise it's all arrays and looping where sets and maps could be used to good effect. If paid Firaxis developers aren't going to use the advanced tools available, you can't possibly expect amateurs to do so.
really strange :crazyeye:

actually i expect amateurs to think for themselves :p
STL does simplify your life. i cannot think of any reason to not use STL :dunno:

I don't get why they used arrays. Vectors are so much easier!
:thumbsup:
 
What do you think about keep C++ and python just update them to the most recent version
 
STL is part of the C++ Standard for over nine or ten years :banana:

That's what I said. In C there is no equivalent standard data structure library.

i suppose the e prefix means that eUnit is an enum?

Yes, that is Firaxis's convention (Hungarian Notation).

Code:
for(unit_t::iterator it = eUnit.begin(); it != eUnit.end(); ++it)
  it->do_something();

Are you making my point for me? Clearly that is more complicated to read, type, and understand than

Code:
for eUnit in units:
    # use eUnit

Here units is a standard Python list object. Or it's a Python set. Or it's a tuple. it doesn't matter. :) [Yes, the same is mostly true for the STL]. Let's say you want to loop over a dictionary (map) and print out each key and value.

Code:
for k, v in d:
    print k, v

What's the equivalent code in C++? Exactly.

STL does simplify your life. i cannot think of any reason to not use STL :dunno:

Of course the STL simplifies makes writing C++ code easier. I couldn't imagine writing my own C++ data structures. But that's not the point. Someone above suggested using C++ in place of Python, and you simply cannot convince me that C++ even with the STL is easier for amateurs to learn than Python.
 
Someone above suggested using C++ in place of Python, and you simply cannot convince me that C++ even with the STL is easier for amateurs to learn than Python.

It probably isn't, but it is definitely more powerful and more efficient, not to mention no reliance on whitespace!

I prefer C over both though.
 
What do you think about keep C++ and python just update them to the most recent version

Huge problems with both versions of both of those statements.

Python: No. Python 3.x is not at all standard compared to 2.x. Perhaps update to the latest 2.x, but not to 3.x.

C++: There is no new version of C++. Don't say that there is Visual Studio 2010. This is not a new version of C++. This is a new version of Visual Studio, not C++. They are completely different things and should not be used interchangeably. The fact that the code was not immediately upgradable was an injustice to Firaxis done by Microsoft due to Microsoft not sticking to the ISO C++ Standard.
 
It probably isn't, but it is definitely more powerful and more efficient, not to mention no reliance on whitespace!

While I too prefer C++ over python, the whole power/efficiency thing is bad reason to argue one language over another. If that's your decision making standard, you might as well write in direct machine code, that's much faster than having a compiler do work for you. ;)
 
While I too prefer C++ over python, the whole power/efficiency thing is bad reason to argue one language over another. If that's your decision making standard, you might as well write in direct machine code, that's much faster than having a compiler do work for you. ;)

Good point. I think efficiency is a good reason to use a language to a certain point. Mainly, I think its just best to use a compiler-based language rather than in interpreted ones, which tend to be slower.
 
But part of the main benefits of using python was that it is an interpreter language, and doesn't require setting up a compiler to start messing with. Alot of hobby modders got their start programming in python (like myself), and simply would not have been willing to jump into actual coding if they would have had to have gone through the whole process of setting up the compiler up front; this is a very daunting task for someone who isn't sure if they really understand what they are looking at. For me I needed to fix a python function another modder had set up, and they pointed me toward the code, I wasn't sure what I was looking at, but intuitively the structure and syntax of the language made sense. I was pretty sure I "got it" and was willing to start tinkering with it, but I couldn't be certain, it was just guessing off intuition, but I would not have been confident enough to invest the couple of hours it takes to set up a compiler for the first time just to find out, especially since at that time I didn't even know what a compiler was. Using an interpreter language like python allows for easier access into the whole process of programming for novice modders who otherwise are unwilling or unable to code in the conventional sense.
 
Get rid of Python. That language drives me nuts... whitespace for delimiters? come on...
 
Get rid of Python. That language drives me nuts... whitespace for delimiters? come on...

That was my initial aversion as well. But seriously, get an editor instead of Notepad and you'll never have an issue with it again. The fact that someone can use Notepad to mod the game vastly increases the likelihood of getting new modders.

To me, avoiding Python due to its use of whitespace for indentation is like turning down a free Testarosa because it's not red. :crazyeye:
 
I was pretty sure I "got it" and was willing to start tinkering with it, but I couldn't be certain, it was just guessing off intuition, but I would not have been confident enough to invest the couple of hours it takes to set up a compiler for the first time just to find out, especially since at that time I didn't even know what a compiler was. Using an interpreter language like python allows for easier access into the whole process of programming for novice modders who otherwise are unwilling or unable to code in the conventional sense.

:yup: right, that's the point of a scripting language being in for modders.
But hopefully they'll use one, which is easier to merge and to deal with. First thing to mention here is sure perl (which i'm not capable of at the moment, but re-learning for something you want to do is not hard ;)).
 
I'll tell you why STL is harder than Python:
You chose to write this:
Code:
for(unit_t::iterator it = eUnit.begin(); it != eUnit.end(); ++it)
  it->do_something();
I'd have written that:
Code:
for(unit_t::const_iterator it = eUnit.begin(); it != eUnit.end(); ++it)
  it->do_something();
Until the next version of C++ where the auto keyword might be used to infer the iterator type... Not only is that about twice as verbose as python (count the number of statements or characters), but if someone advocating C++ forgets the const-ness part, how do you expect someone to learn it?
C++, STL are way harder to learn than python. Furthermore, unit_t is also extraordinarily decieving. The type you'll be using is likely something like that:
std::vector< Unit >::const_iterator.

At which point you probably typedef'ed it away into unit_iter, CIT_Unit or whatever.
Although very powerful, the stl sometimes makes your life hard where python doesn't. Try that for instance: std::vector< std::auto_ptr< argh > >. You'll probably end up using boost::shared_ptr instead. A python user will just totally ignore all that and will be finished coding when his fellow newbie C++ coder will still be reading why it was a bad idea to put that kind of pointers in this kind of container.

C++ is a very powerful and efficient tool, but it's not something for everybody to use, and most modders shouldn't ever try to use it.
 
But part of the main benefits of using python was that it is an interpreter language, and doesn't require setting up a compiler to start messing with. Alot of hobby modders got their start programming in python (like myself), and simply would not have been willing to jump into actual coding if they would have had to have gone through the whole process of setting up the compiler up front; this is a very daunting task for someone who isn't sure if they really understand what they are looking at. For me I needed to fix a python function another modder had set up, and they pointed me toward the code, I wasn't sure what I was looking at, but intuitively the structure and syntax of the language made sense. I was pretty sure I "got it" and was willing to start tinkering with it, but I couldn't be certain, it was just guessing off intuition, but I would not have been confident enough to invest the couple of hours it takes to set up a compiler for the first time just to find out, especially since at that time I didn't even know what a compiler was. Using an interpreter language like python allows for easier access into the whole process of programming for novice modders who otherwise are unwilling or unable to code in the conventional sense.

In what way is it harder to set up a compiler than in interpeter?

To run a Python program:

Code:
python prog.py


To compile a C program:

Code:
gcc prog.c
 
Have you ever set up the compiler for Civ4? Try it and tell me a novice could do it. ;)
 
The way the python is loaded in Civ, there is no setting anything up. You just edit the python file with notepad++, then start up the game to see if your code works. With the SDK it's not that simple, setting up the compiler is a non trivial process the first time, and requires careful attention to about a 20 step process.
 
Yeah, compiling from the command line is easy. Compiling with a GUI, and the non-standard VS libraries, that's hard. I still don't understand the steps to set up civ4's SDK and have to read from the tutorial every time I need to set it up.

Python doesn't have to be interpreted. Star Trek: Bridge Commander was based entirely on compiled python files; it would simply compile any new/updated files at runtime. Civ4 has a bunch of compiled python files in the Python\System directory.
 
Yeah, compiling from the command line is easy. Compiling with a GUI, and the non-standard VS libraries, that's hard. I still don't understand the steps to set up civ4's SDK and have to read from the tutorial every time I need to set it up.

Python doesn't have to be interpreted. Star Trek: Bridge Commander was based entirely on compiled python files; it would simply compile any new/updated files at runtime. Civ4 has a bunch of compiled python files in the Python\System directory.

Those aren't technically machine-code though. Its still "interpreted" in a way. Think of how the java system works. You compile into a class file, but then that has to be JIT-compiled by the java virtual machine, which is similar to an interpreter.
 
Yes.

I installed Visual Studio 2003. I opened up the project. I compiled using the built-in menu.

It's a lot more complicated for those of us that don't have Visual Studio 2003 (that is, most of us). Even later versions of Visual Studio need to have a special setup so you can compile using VS 2003's libraries.
 
Back
Top Bottom