Author Topic: I'd like to help with programming...  (Read 13064 times)

Offline Istrebitel

  • Sergeant
  • **
  • Posts: 46
    • View Profile
I'd like to help with programming...
« on: August 01, 2011, 12:13:22 pm »
Greetings.

In short about me:
A very long term X-Com fan, and programming random stuff since 13, right now programming as a profession, but i always wanted to make computer games, however my projects never went too far since i couldnt gather enough people for a team and as a solo couldnt go too far being only myself. I know C,C++,Pascal (Delphi),C# and other kinds of stuff probably not related to games, had some time coding games with DirectX, DelphiX, XNA, very little OpenGL. Unfortunately i didnt have alot of experience with version controls, only used Tortoise SVN and only basically to get an open source project sourcecodes or to update my project for the team to have access to if i'm away (never coded something where more than one people are coding parts of one program/lib). I have sane understanding of game physics and workings, i wrote 2d platformers, asteroid -like multiplayer clone, even had a diablo-like engine up and working, and i'm willing to learn in any areas where i'm not that skilled. I'm trying to read on the Git version control system right now (https://git.wiki.kernel.org/index.php/GitFaq) but some simple tutorial would be very helpful.

I'd love to take part in coding or making or whatever of X-Com 1 remake since its one of the best games i ever encountered (rivaled by Jagged Alliance 1/2, Might and Magic 4-8,...)

Would i be of any help to the project?

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: I'd like to help with programming...
« Reply #1 on: August 01, 2011, 02:17:54 pm »

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: I'd like to help with programming...
« Reply #2 on: August 01, 2011, 09:57:56 pm »
Welcome Istrebitel,
always great to see other people wanting to contribute, I'm sure you can be of any help to the project.

I can suggest starting with setting up tortoisegit, which is similar to tortoiseSVN, so you should quickly get the hang of it.
There are tutorials about it, like here
https://dbanck.de/2009/10/08/github-windows-and-tortoisegit-part-1-installing-pulling/

After that you can try to check out your local repository and compile the program.
« Last Edit: August 01, 2011, 10:10:56 pm by Daiky »

Offline Istrebitel

  • Sergeant
  • **
  • Posts: 46
    • View Profile
Re: I'd like to help with programming...
« Reply #3 on: August 01, 2011, 10:42:52 pm »
I've read a lot about git to understand it, then went home and tried it. No luck.

I dont know how Tortoise Git is different from the Git for Windows (is it?) but the screenshots on the page you linked are identical to what i tried to install (and what github tells you to install if your have windows).

So, it fails when i try to interact with command prompt or generate a key, because i have russian characters in my user folder. Fixing it by adding HOME=(some folder) in the file suggested here https://code.google.com/p/msysgit/issues/detail?id=108 doesnt help either - it prevents error when running git bash, but it (git bash and git ui) still tries to go into your windows (documents and settings etc) home folder (and git bash goes there successfully btw!)
But then, nothing else works - cannot generate key neither from command prompt nor from gui, etc.

I tried installing choosing the red option (run git bash from windows cmd) - no difference. I still get the same home error.
Is there a way to install git with some home directory other than your windows home directory? So it never ever tries to access my windows user home directory which contains russian letters? Or change that home directory? All i found by googling is that you are not advised to change your home directory because that somehow messes up when you have numerous projects and something about using bat files and that's all...

Offline Istrebitel

  • Sergeant
  • **
  • Posts: 46
    • View Profile
Re: I'd like to help with programming...
« Reply #4 on: August 02, 2011, 09:36:48 am »
Oh well, looks like i got it going by setting HOME environmental variable in windows.

Forked the project and then cloned my fork (is that what i should have done, right?)

When i get home i'll install VS2008 and try to compile it.

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: I'd like to help with programming...
« Reply #5 on: August 02, 2011, 10:52:21 am »
Great :)
Yes, forking it, and when you have coded stuff you can issue a pull request, which will be reviewed by me or SupSuper and then merged into the master.
But I'd recommend just have a look at compiling it, and have a look at the code, getting yourselve familiarized with the engine. And there might be some little things to do here and there at first. There's still a large module todo, the "Graphs" part of the game, but I would like if either me or SupSuper first draw out the big lines for that first.

Offline Istrebitel

  • Sergeant
  • **
  • Posts: 46
    • View Profile
Re: I'd like to help with programming...
« Reply #6 on: August 02, 2011, 12:08:34 pm »
Oh yeah, decided to get a glimpse of it from work.
However, github isnt working correctly with my corp proxy so i had to download v02 release sources only (as i know much has been done since).

Gotta learn alot :) Learn constructions like vector iterations or << and >> stream operators to concatenate strings etc.
However code is very clean and i hope it wont take that much time for me to understand it all.

BTW:
1) Visual studio compiles the exe to DEBUG folder, but drops dll's in bin folder, and exe from debug folder wont see DATA folder anyway and complain and exit. Is there a simple way to make visual studio drop bins to bin folder, not DEBUG folder? Because as is, i have to compile, then go into debug foler, copy, go one up, paste, then run
2) If i drop dependancies in deps folder, it wont work right there, since one of the yaml header files references yaml headers by yaml_cpp/filename.h, so, you have not only to include folder deps/include/yaml_cpp in the list of include folders, but the folder deps/include, otherwise errors about those files not found will occur i see its fixed in lastest source
3) Whenever i switch between any two screens, i have a graphical glitch. It seems that pallete is changed too soon, as soon as screen we are transitioning from starts to black out, not when the screen is completely gone. Or maybe this is fixed already in lastest code?
« Last Edit: August 02, 2011, 12:50:22 pm by Istrebitel »

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: I'd like to help with programming...
« Reply #7 on: August 02, 2011, 12:33:47 pm »
Here's latest source

Offline Istrebitel

  • Sergeant
  • **
  • Posts: 46
    • View Profile
Re: I'd like to help with programming...
« Reply #8 on: August 02, 2011, 12:45:24 pm »
Thanks!

UPD:
On my work pc, VS2008 professional:
When trying to load first soldier nam file, it crashes in file SoldierNamePool.cpp at:
void SoldierNamePool::load(const std::string &filename)
exactly at:
YAML::Parser parser(fin);
with generic "Unhandled exception at 0x7805e2cf in OpenXcom.exe: 0xC0000005: Access violation reading location 0xcccccccc."

On my home pc, VS2010 Expert:
Another error happens some steps further - at:
for(YAML::Iterator it = doc["maleFirst"].begin(); it != doc["maleFirst"].end(); it++)
it throws an exception "abort() has been called"

Strange... Anyone has idea what can it be?
(There may be a difference in sources compiled though - at home i have set up git and at work i used sources from previous reply)

UPD2: I traced the problem to this code inside yaml file nodeimpl.h

inline const Node *Node::FindValue(const T& key) const {
      switch(m_type) {
         case NodeType::Null:
         case NodeType::Scalar:
            throw BadDereference();
         case NodeType::Sequence:
            return FindFromNodeAtIndex(*this, key);
         case NodeType::Map:
            return FindValueForKey(key);
      }
      assert(false);
      throw BadDereference();
   }
It tries to switch m_type but it is equal to -858993664 therefore it skips all cases and goes to assert, which obviously calls abort()
this code is called when doc["maleFirst"] is called. So, the node must be uncorrectly created or something... maybe that is because i am using precompiled dependencies?
« Last Edit: August 03, 2011, 09:08:38 am by Istrebitel »

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: I'd like to help with programming...
« Reply #9 on: August 03, 2011, 09:26:00 am »
Maybe you should report issue ? https://code.google.com/p/yaml-cpp/issues/list

If it's yaml-cpp issue of course. Or maybe there is some problem in OpenXcom - but why Daiky or SupSuper doesn't have that error? Also git builds looks fine too.
« Last Edit: August 03, 2011, 09:27:38 am by michal »

Offline Istrebitel

  • Sergeant
  • **
  • Posts: 46
    • View Profile
Re: I'd like to help with programming...
« Reply #10 on: August 03, 2011, 11:03:54 am »
could you please possibly build lastest executable and attach it here? then we could rule out if thats a problem with compiliing or with my computer/libraries?

PS: I was able to confirm that first problem (parser object causing access violation) is not openxcom problem. Using same precompiled dependencies, i made a small win32 console app that does simple yaml operation and it fails just the same way in the same place. Must have something to do with the dll?

I have tried to downoad yaml from google-code but it only offers source files and suggests some CMAKE to build it, but CMAKE only made me a visual studio 2008 solution (is it supposed to do that) and building that solution provides static linking library, not dynamic one (one lib file 7megs big, no dll's). using this lib (libyaml-cppmdd.lib) instead of yaml-cppd.lib made yaml code work okay. I recompiled openxcom with this bigger lib instead of that smaller lib and it works too!

I wish i'd actually have more experience and knowledge to understand what's going on here and why it fails for me on two different computers with same operation systems (licensed win XP sp3) in two absolutely different ways but doesnt fail for everybody, and if swtching from dll to a static .lib is a significant change, but at least i now have a working openxcom.exe and can continue exploring it... It isnt significant, right? since i didnt change any file from openxcom project yet (only changed name of the lib that is linked, but i can rename my 7meg lib fie to the original name and even that change would go)
« Last Edit: August 03, 2011, 05:43:59 pm by Istrebitel »

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2160
    • View Profile
Re: I'd like to help with programming...
« Reply #11 on: August 04, 2011, 10:22:28 pm »
1) Visual studio compiles the exe to DEBUG folder, but drops dll's in bin folder, and exe from debug folder wont see DATA folder anyway and complain and exit. Is there a simple way to make visual studio drop bins to bin folder, not DEBUG folder? Because as is, i have to compile, then go into debug foler, copy, go one up, paste, then run
3) Whenever i switch between any two screens, i have a graphical glitch. It seems that pallete is changed too soon, as soon as screen we are transitioning from starts to black out, not when the screen is completely gone. Or maybe this is fixed already in lastest code?
1) You can change the compilation directories in the Visual Studio project properties, though I find it easier to just change the Working Directory to the "bin" folder (this was mentioned in the Compiling instructions but they're kinda mangled right now), so it works for both Debug/Release.
3) https://openxcom.ninex.info/forum/index.php?topic=52.0

As for yaml-cpp, the latest version always seems to crash when building in Debug configuration in Windows, I never found a solution for it even after contacting the developers, the only workaround is using Release configuration instead.

Offline Istrebitel

  • Sergeant
  • **
  • Posts: 46
    • View Profile
Re: I'd like to help with programming...
« Reply #12 on: August 05, 2011, 10:34:23 am »
Strange, lastest one compiled in debug just fine for me and doesnt crash, but it compiled as static lib, not dynamic dll + lib.
However, if i compile it on 2008 and try to use in 2010 i get plenty of errors of unresolved externals, switching to 2008 on my home pc fixed the problem.
And as i said before, the "precompiled dependencies in visualc" fail for me in any case.

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: I'd like to help with programming...
« Reply #13 on: August 05, 2011, 06:18:30 pm »
I compiled a debug version of the yaml-cpp lib in visual studio 2010, and use it without problems while debugging openxcom in visual studio 2010.

Offline Istrebitel

  • Sergeant
  • **
  • Posts: 46
    • View Profile
Re: I'd like to help with programming...
« Reply #14 on: August 08, 2011, 05:40:28 pm »
I think it only works in the visual studio it was compiled in then...