A C++ programmer asking questions, I guess

Users who are viewing this thread

Akkernight

Recruit
Hello.

I've been thinking a bit about making a M&B mod. The main reason I havn't started yet is 'cause I have no idea of pythons similarity to C++, or how much you can modify M&B...
So, what do you peeps think/have to say?

Just some general python questions:

Is python object oriented?
Which does python look most similar to, C or C++?
As a C++ game developer, how much different stuff will I have to get used to?


Some Mount&Blade questions:

Does it only support Python modding?
Do I have to use the Caladria world, or can I make my own?
How well can I work with the game's AI?


I might add some more questions, but thanks for reading!
 
Not sure about most questions but

I think it looks similar to BASIC stuff

You can make your own world

AI depends on how well you can work with the module system
 
It's a misconception that you need to know python to do M&B modding.  Knowing python is helpful when things start going wrong or if you're doing "compiler" hacks/tricks to make life easier.  Even then, python isn't terribly hard to learn if you know another language.  The module system itself is more like assembly than a higher level language with a bunch of interesting intrinsics like add_xp_to_troop and try_for_parties thrown in.  The way I think about it is that your code lives in python structures which the "compiler" turns into txt files that target a virtual machine.  You could with a little effort rewrite the compilation process and source in whatever language you liked as long as the txt files at the end of the process were well-formed. 

The game is very modifiable.  I'd say a good 90%-95% of the game code is available in the module system including a bulk of the AI (with a couple caveats).  If it weren't for a handful of missing tools, we'd be able to completely rebuild the thing into whatever we wanted.  In fact, even without those tools, we still have cool mods that stray pretty far from Calradia.  If you've done any Quake modding, think of the module system as the game DLL. 

I won't delve deeper into a discussion of python unless you have further questions, but feel free to ask if you do.
 
Are you saying i could make a C++ compiler for this? I'll go look at the modules I've downloaded and look at the coding...
 
If you were so inclined, yes.  Would it be worth it?  YMMV.

People seem to think that there's magic in what we do.  There isn't.  The module system is a relatively straightforward representation of assembly-like instructions and a pile of game-specifc intrinsics that compile down to an interpreted language that lives in txt files.  That's it.  If you understand which bits go where and what the compiled txt is doing, it's a fairly straightforward thing to build a compiler that goes from whatever language you choose to txt. 

If you just want to change the compiler, awesome!  I can give you a laundry list of stuff I've patched in python to make my life easier and a longer laundry list of stuff that I had trouble doing that I'd love to see.  If you want to change the source code language for the module system, awesome!  A more C-flavored syntax with clearer failure modes seems like a win.  Both of these are markedly non-trivial.  Both will be be time consuming and tedious but neither is impossible.  If what you want to do is make some fun mods, awesome!  Don't mess with this level of stuff because the module system is sufficient and minus the (small) investment in learning its syntax, it's not that bad.

It's your time; spend it how you see fit.

 
I'd like to mention a fact here. That is, Python is commonly known as having advantages in processing strings and words, and doing parsing, etc. And that is what Module System essentially does.
 
If you are looking to make a new Module System, know that one with a semi GUI interface is in the works by MAXHARDMAN.  That's being going for some months now without any updates, so I can't say that it will be completed.  Since no updates have been seen, it may be a lost project.

Kt0,

What have you added to make life easier?  Are you sharing that stuff?  My life is hard... :sad:

 
Most of what I've done is add better checks for common failure modes.  I also pre-generate a bunch of module system code at compile time because I'm lazy and can't be bothered to a) write a bunch of boilerplate code, and b) get such boilerplate code correct.  So I cheat. 

If I get bitten by a syntax bug that isn't immediately obvious, I try to change the process_ scripts to give me better warnings/errors.  I'll go through my stuff this weekend and make a post if I've get some spare time.  I'll also try to go through some of the other error reporting that I know are deficient and try to work some stuff up for those.

foxyman said:
I'd like to mention a fact here. That is, Python is commonly known as having advantages in processing strings and words, and doing parsing, etc. And that is what Module System essentially does.
"C++ can give better performance than Python and it is a better language for low level systems work."  This statement is equally true and equally unhelpful in this context.  The module system is its own language; Python is just the environment. 
 
I'm thinking about either making it possible to script using C++ or if it has to be a scripting language, then LUA I guess...  Or Imma learn the DirectX API, dunno what to choose xP
 
kt0 said:
foxyman said:
I'd like to mention a fact here. That is, Python is commonly known as having advantages in processing strings and words, and doing parsing, etc. And that is what Module System essentially does.
"C++ can give better performance than Python and it is a better language for low level systems work."  This statement is equally true and equally unhelpful in this context.  The module system is its own language; Python is just the environment.

If I understand correctly what you mean, I'd say I don't think what I said is incorrect or "not to the point". Yes neither Python nor C++ would be the actual scripting language. But what I mean is as Python is only doing the parse/compile thing, it turns out to be more helpful and friendly over C++. And I guess that's the reason it's chosen at first place by the official ModSys.
 
kt0 said:
My bad.  English is frequently ambiguous  :mrgreen:
Oh, so I will appreciate it if you point out some grammar errors of my english. I'm still not quite comfortable with it. After all, I'm a Chinese and likely to come up with some Chinglish.
 
Back
Top Bottom