Author Topic: Explore Glest source  (Read 2568 times)

ProfEclipse

  • Summoner
  • **
  • Posts: 49
    • View Profile
Explore Glest source
« 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 ?
« Last Edit: 22 September 2012, 06:49:05 by ProfEclipse »

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: Explore Glest source
« Reply #1 on: 22 September 2012, 16:38:48 »
For MegaGlest, some of these questions are answered here: http://wiki.megaglest.org/Development
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: Explore Glest source
« Reply #2 on: 27 September 2012, 10:27:50 »
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.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Explore Glest source
« Reply #3 on: 27 September 2012, 20:49:51 »
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?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: Explore Glest source
« Reply #4 on: 27 September 2012, 22:13:17 »
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.

ProfEclipse

  • Summoner
  • **
  • Posts: 49
    • View Profile
Re: Explore Glest source
« Reply #5 on: 2 October 2012, 05:55:20 »
What should I choose between Ultimate and Professional pack ? (VS 2008)

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: Explore Glest source
« Reply #6 on: 2 October 2012, 06:01:10 »
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.

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Re: Explore Glest source
« Reply #7 on: 2 October 2012, 15:55:39 »
The free VS 2010 express should suffice

 

anything