Author Topic: I'm interested in coding for MG  (Read 4874 times)

Zoythrus

  • Guest
I'm interested in coding for MG
« on: 19 December 2012, 06:17:32 »
I put this here because I want to help code some of the more needed feature requests (and GAE stuff). But before I do, I have some questions about coding.

First, what IDE do you all use? I use Code::Blocks, but I want to be the most efficient.

Second, what is the best way to get the source?

Third, how do I compile it all?

Okay, anything else I should know?

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Re: I'm interested in coding for MG
« Reply #1 on: 19 December 2012, 06:21:56 »
The compiler depends on the operating system.

Full instructions for getting code and compiling are here:

Code: [Select]
https://docs.megaglest.org/MG/Development
« Last Edit: 18 June 2016, 18:47:13 by filux »

Zoythrus

  • Guest
Re: I'm interested in coding for MG
« Reply #2 on: 19 December 2012, 06:49:52 »
I got the SVN and other required materials for Windows, but when I click on the svn.exe, the command prompt just flashes. Any ideas?

EDIT: Never mind, I just read the instructions wrong. It's all good now! :)

EDIT AGAIN: Never mind again, it's no longer good anymore! When I run the build-mg-2010.bat, it runs for a bit, then stops with 7 errors. All of those errors are missing files. Should I post the output here?
« Last Edit: 19 December 2012, 07:48:02 by Zoythrus »

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,239
    • View Profile
    • http://www.titusgames.de
Re: I'm interested in coding for MG
« Reply #3 on: 19 December 2012, 13:16:19 »
put it on pastebin and post link here
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Zoythrus

  • Guest
Re: I'm interested in coding for MG
« Reply #4 on: 19 December 2012, 15:38:41 »
I feel like I'm missing something.

http://pastebin.com/t7XsqAiy

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: I'm interested in coding for MG
« Reply #5 on: 19 December 2012, 15:44:56 »
Are you building using the batch file or using the VC GUI? In the latter case, I think you need to download and extract (to the source directory) the dependency package manually.

Generally, the path where it's looking for these files is weird:
C:\Program Files\SlikSvn\bin\megaglest\mk\windoze\xml2g.vcxproj

A better location to have your svn working copy (and build) would be, e.g.
C:\Users\YOURUSERNAMEGOESHERE\svn\megaglest

Generally it is helpful to post both the output (you did this) and the command you ran (or describe what you did exactly on some GUI) when a problem occurred.
« Last Edit: 19 December 2012, 15:57:15 by tomreyn »
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 · · ·

Zoythrus

  • Guest
Re: I'm interested in coding for MG
« Reply #6 on: 19 December 2012, 16:03:40 »
I'm sorry, I'm kinda new to this....

Anyways, I used the mg_build_2010.bat. Does that mean that I still have to extract the dependency package?

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: I'm interested in coding for MG
« Reply #7 on: 19 December 2012, 16:12:27 »
I'm sorry, I'm kinda new to this....
That's fine, I was just explaining.

Anyways, I used the mg_build_2010.bat. Does that mean that I still have to extract the dependency package?

Do you mean this (relative to where you checked out the subversion working copy)?
mk\windoze\build-mg-2010.bat

Where (full path) did you check out the subversion working copy? I.e. which directory were you in, and which user were you operating as, when you ran the "svn co ..." command?
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 · · ·

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Re: I'm interested in coding for MG
« Reply #8 on: 19 December 2012, 16:14:42 »
I suspect you are missing the dependencies (which should automatically download).

Do you have a windows_deps folder in:

c:\Program Files\SlikSvn\bin\megaglest\

When you run the build-mg-2010 batch file please pastebin all the output from start to end.

Zoythrus

  • Guest
Re: I'm interested in coding for MG
« Reply #9 on: 19 December 2012, 16:18:35 »
Yes, I was using this one:
Code: [Select]
C:\Program Files\SlikSvn\bin\megaglest\mk\windoze\build-mg-2010.batAnd I was running it with an elevated command prompt (otherwise it would give me some "access denied" error).

I was doing the entire operation as the administrator account (the only user on my laptop).

It just seems like it's missing the dependency package. I was surprised that none of the batch files would download them for me (I ran all of them).

here's the entire output:
http://pastebin.com/gBA8tffw

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Re: I'm interested in coding for MG
« Reply #10 on: 19 December 2012, 18:16:39 »
You don't have the whole svn folder structure checked out:

Quote
Input Error: Can not find script file "C:\Program Files\SlikSvn\bin\megaglest\mk
\windoze\getTools.vbs".

Please make sure you checkout the megaglest svn project as per instructions in the wiki.

Zoythrus

  • Guest
Re: I'm interested in coding for MG
« Reply #11 on: 19 December 2012, 18:18:59 »
You don't have the whole svn folder structure checked out:

Quote
Input Error: Can not find script file "C:\Program Files\SlikSvn\bin\megaglest\mk
\windoze\getTools.vbs".

Please make sure you checkout the megaglest svn project as per instructions in the wiki.

Odd, I've run the command 3 times now.....

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: I'm interested in coding for MG
« Reply #12 on: 19 December 2012, 18:23:43 »
From what I remember, getting the compiler to work was/is much harder than doing actual programming :)
Include and library directories, cmake, dependencies being not there or in weird places and so forth. It will be a great relief to finish this part and get to the fun, and easier, programming part. Good luck :)

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Re: I'm interested in coding for MG
« Reply #13 on: 19 December 2012, 19:25:27 »
You could open a command prompt go to the folder you want the code to be placed in and run:

Code: [Select]
svn co https://megaglest.svn.sourceforge.net/svnroot/megaglest/trunk megaglest
When it is finished you have all the files you need to run the bat file

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: I'm interested in coding for MG
« Reply #14 on: 19 December 2012, 19:43:15 »
You may already know this, but I'll bring it up anyways, in case the reasoning is unknown.
Working as Administrator by default is kind of the same as working as root all the time on Linux: it's something you should prevent if you want to keep your system secure and clean for longer. Working as a less privileged user by default (and running select tasks/processes with elevated permissions) adds an extra security boundary. One which is simple enough to deal with for you as a user, while it makes it considerably harder to compromise (or pollute) your entire system for any malware (or goodware which uses non-standard locations to store data).

I lack in-depth understanding of the Windows permission system, but I think that, even when you work as an administrator, permissions/ownership on C:\Program Files\ is special (as it is on some other directories). This may mean (just a theory, I haven't tested this) that both the svn command of sliksvn as well as the script which downloads and decompresses the dependency archive may not be able to store files in this location without further modifications. So even if you continue to work as Administrator, I suggest you check out svn (the process softcoder describes above) to a different directory, such as C:\Users\Administrator\megaglest-svn (and delete the other copy).
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 · · ·

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: I'm interested in coding for MG
« Reply #15 on: 20 December 2012, 13:55:48 »
What is this crazy notion with putting files in the user folder?. stop it.

Bulk data should NOT be saved in the user folder.

I run win7 and have a path like this

D:/stuff/megaglestfolderhere/mg_root

and it works perfectly, i can't remember when i last had troubles.(i do currenly have a single notion in the batch file complaining about a missing folder but hey it works).

Dont mess with programs folders. They have some werid permissions going on with them.

Only install program that have a installer to them.
WiP Game developer.
I do danish translations.
"i break stuff"

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,239
    • View Profile
    • http://www.titusgames.de
Re: I'm interested in coding for MG
« Reply #16 on: 20 December 2012, 14:03:23 »
LOL  .... ;D :P ::)
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: I'm interested in coding for MG
« Reply #17 on: 20 December 2012, 14:32:36 »
What is this crazy notion with putting files in the user folder?. stop it.

Bulk data should NOT be saved in the user folder.

I run win7 and have a path like this

D:/stuff/megaglestfolderhere/mg_root

and it works perfectly, i can't remember when i last had troubles.(i do currenly have a single notion in the batch file complaining about a missing folder but hey it works).
That works perfectly fine, but so does the user folder. Either one works as the user has full privelleges over the folder. The issue with yours, however, is that unless you manually set permissions, any user can edit your folder. That's fine and dandy if you're the sole user of the computer (like I am), but if you have multiple accounts, that's not so hot. Don't want anyone to mess with your stuff, after all.

Dont mess with programs folders. They have some werid permissions going on with them.

Only install program that have a installer to them.
The program folders have perfectly sane permissions. It's a normal folder in every way, but all users of the system have access to them in differing degrees. All users can normally access the program files, which allows you to install a program once on your computer for all accounts. However, most programs can't necessarily write to the programs folder. An admin account can, but may need permission. Most regular users can't, and thus the program being run by a regular user might not be able to either. So technically, if you're the sole user of your computer, installing the program to the user folder will work fine. If there were multiple accounts, only you would be able to run that program (which has its uses). At any rate, since we don't know if we'll be able to write to program files, that's where appdata comes in. The appdata folder is located within the user folder, so it can store settings for a folder in a way that's unique to each user. As well, the user will always have write access to appdata, but we don't know if the user will always have access to the program files folder. Technically, you can even manually give an account full rights to the program files, but programs will generally persist to use appdata as they don't know any better. Programs that need to save things in a user accessible folder will generally create a new folder in either the user's folder or their documents folder (which is why I really hate where MegaGlest saves the user folder, in AppData; do any MegaGlest devs even use Windows?).

If you make a new folder in the root of your drive, though (or on a new drive, etc), it'll have full permission of everyone unless you manually change that. With a single account, "C:/My Folder" is no different than using the user folder. But with multiple accounts, you just opened your stuff to everyone else using the computer. Sometimes you want that, sometimes you don't. However, some programs also don't work too hot in the limited rights of the program files folder. Sure, they could use appdata, but they want to write to their folder. For example, Eclipse (an IDE) doesn't like being in program files. It works best in either your user folder or a base folder of its own.

So a recap: Program files is good for having a limited program available for all users. It's bad if the program wasn't designed with this in mind. In which case, any base folder of your hard drive works, but all users have full access to it. On the other hand, storing it in the user folder ensures you have full access, but nobody else will (note you can break links if you store a shortcut in a place anyone can access but the target is in a place only you can access; for example, the start menu is stored in two locations, one only you can access and one anyone can access).
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: I'm interested in coding for MG
« Reply #18 on: 20 December 2012, 14:47:45 »
If Zoythrus isn't completely confused by now then we did a bad job. ;)
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 · · ·

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: I'm interested in coding for MG
« Reply #19 on: 20 December 2012, 15:21:51 »
If Zoythrus isn't completely confused by now then we did a bad job. ;)

He told me on Skype that he was all good to code now.. Soo..... try try again. :P
Egypt Remastered!

Proof: Owner of glest@mail.com

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: I'm interested in coding for MG
« Reply #20 on: 20 December 2012, 15:36:10 »
He told me on Skype that he was all good to code now.. Soo..... try try again. :P
Have you tried connecting the flux capacitor to the ion drive while calculating the answer?
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

Zoythrus

  • Guest
Re: I'm interested in coding for MG
« Reply #21 on: 20 December 2012, 17:41:13 »
Thank you all for the help! Now comes the more interesting part....actually coding!

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Re: I'm interested in coding for MG
« Reply #22 on: 20 December 2012, 17:48:39 »
Compiling mg is as easy as a C++ project will likely get. If you properly follow the Wiki you will not have the problems described in this thread. If you don't understand about things like file permissions and operating system issues, you likely should not be coding in the first place (unless of course you're just starting to learn how to code and you will work your way through it)

Thanks

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: I'm interested in coding for MG
« Reply #23 on: 20 December 2012, 18:01:18 »
It it really easy, as someone who have tried compiling different projects trough vs2008-2010. I can say MG have one of the best compiling methods, you know setup for it and so on, i can't actually know how good the compiler itself is i mean..

It's easy to use okay?. That's my point!.
WiP Game developer.
I do danish translations.
"i break stuff"

Zoythrus

  • Guest
Re: I'm interested in coding for MG
« Reply #24 on: 20 December 2012, 18:22:06 »
I've done a few C++ classes at college, so I know my way around (well, I can write some basic programs). I've never worked with something this large before, so I have this fear that I'll screw something up just because of my inexperience. But that's okay, since I'm going to be using this engine as a learning experience (I need to work on my C++ anyways, since I really only code in Java).