MegaGlest Forum
Archives (read only) => Vanilla Glest => General discussion => Topic started by: ProfEclipse on 21 September 2012, 20:20:09
-
Glest is based on C++ language, use XML-parser to parsing XML data, I know but I'm only a beginner programmer. (But not very bad)
Glest is a "library" of sources that it's very large, very large. Glest contains lots of sources, headers, and classes, functions, with many many variables, macros and expressions, so I don't know "Where the start point of the source is".
Do anyone can give me any trick or the fastest method to understand Glest code ?
Please introduce some of the most basic and important functions if possible.
@Moderators @: Can I compile Glest ? If possible, How can I compile Glest properly without error ?
What best sofware is used to programming and compile Glest ?
-
For MegaGlest, some of these questions are answered here: http://wiki.megaglest.org/Development
-
I'm not sure what you mean by start point? Do you mean main.cpp? Knowledge of its location is mostly unimportant, I can't ever remember changing anything in there.
Firstly looking at Glest source is silly, its better to check either GAE or MG source since there is a lot of useful stuff added to them.
There are various relevant aspects of source depending on what you want to do. For instance unit_type.h/cpp and unit.h/cpp for adding new things to units. I probably edit these the most. You also have resource_type.h/cpp and resource.h/cpp for changing things about resources and classes related to resources.
The most important aspect of modifying the source of GAE or MG is to have a program like TextCrawler because it makes it easy to track down things that extend across multiple directories and multiple files.
So if I want to add a new command it tells me all the places I have to change things to do that like typefactories and command_type.h plus whatever cpp file I want plus enum files and other things that are hard to understand that you need to change.
Fastest method to understand the source? There isn't a fast method. I still don't really understand many things. The only time its fast for me to make a change is if I have made a very similar change previously, for instance I can now add new skills and new command types with little effort and new GUI panels are easier to do than when I did my first few. Similarly for adding certain kinds of stats to units.
A lot of aspects of the way source is organized are not too great. The unit file for instance should really be split into unit_updater, unit_command, unit_stats, unit_graphics and so forth.
If you had a specific thing you wanted to change I or another dev might be able to point you at where to start. I was thinking that once I get more of my low level engine stuff like graphics and GUI done I might have time to make a guide on how to do certain things like add new commands and skills or other such things, which would mostly be generally applicable to all Glest derivatives.
-
The most important aspect of modifying the source of GAE or MG is to have a program like TextCrawler because it makes it easy to track down things that extend across multiple directories and multiple files.
Wouldn't that be better with an IDE such as Eclipse?
-
The most important aspect of modifying the source of GAE or MG is to have a program like TextCrawler because it makes it easy to track down things that extend across multiple directories and multiple files.
Wouldn't that be better with an IDE such as Eclipse?
I edit my source in Code::Blocks because I like the environment. I have to compile with VS2008 though.
I wasn't aware that IDE's had a find and replace feature, find for source, replace for modifying XML.
It's possible based on a cursory check on the CB menu bar that it does have this, but its far more convenient to have a separate program. And I have have multiple versions pointed at different stuff like when I work on libRocket I can check the git files for various things and also have my main TC pointed at the GAE source.
-
What should I choose between Ultimate and Professional pack ? (VS 2008)
-
I'm too poor to afford the commercial versions, I suspect it doesn't matter much either way since the free one can do whatever needs to be done so both of those should work.
-
The free VS 2010 express should suffice