Author Topic: Research developement  (Read 28254 times)

Offline gchevallereau

  • Sergeant
  • **
  • Posts: 41
    • View Profile
Research developement
« on: August 26, 2011, 06:34:40 pm »
Hi,

Over the last weeks, I have tried to implement research in OpenXcom. It's now working and I would welcome feedback on it.

What's need to be done:
* Documentation(especially the Dependency/unlock parts).
* Minor bug : If no project can be listed when Clicking on New project, you will be back the base view.
* UI bug : Colours are wrong in the Project Setting State(and sometimes in the End Research State).
* Research cost : According to https://www.ufopaedia.org/index.php?title=Research_Technical_Details, Research cost have +-50% cost modifier. It should be to easy to add it.


I have also added a CMake build to OpenXcom. I have checked that it work on Linux and Windows(MinGW build). It should also work for Visual Studio.

You can get the code from my personal git repo here: https://gchevallereau.net/cgit/cgit.cgi/OpenXcom
Code is in the research_cmake branch. The cmake branch hold the CMake build system port.

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: Research developement
« Reply #1 on: August 26, 2011, 08:01:33 pm »
Wow

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Research developement
« Reply #2 on: August 27, 2011, 06:03:17 pm »
Wow
Seconded. :o

I'll be sure to have a look and give you some feedback after 0.3 is out. If you're looking to get it integrated into the main OpenXcom codebase, my only suggestion right now is to check the guidelines and make sure it meshes in well with the rest of the code.

Offline panther

  • Sergeant
  • **
  • Posts: 42
    • View Profile
Re: Research developement
« Reply #3 on: August 28, 2011, 12:19:58 am »
That's great!  ;D
I did look a bit at the code, but couldn't find out how you manage to finish a research.
However, you can link this event to unlock certain articles in Ufopedia, by calling
Ufopaedia::releaseArticle(Game *game, std::string &article_id);

Or, to open the corresponding article state: Ufopaedia::open(...);
See Ufopaedia.h for details.

Offline gchevallereau

  • Sergeant
  • **
  • Posts: 41
    • View Profile
Re: Research developement
« Reply #4 on: August 28, 2011, 01:55:29 pm »
Hi,

Quote
my only suggestion right now is to check the guidelines and make sure it meshes in well with the rest of the code
I have tried to follow the coding rules, but maybe I have missed something. I will check that. By the way, maybe it would be helpfull to have something like https://astyle.sourceforge.net/astyle.html to check this ?

Quote
I did look a bit at the code, but couldn't find out how you manage to finish a research.
It's in the GeoscapeState::time1Day function (https://gchevallereau.net/cgit/cgit.cgi/OpenXcom/tree/src/Geoscape/GeoscapeState.cpp?h=research_cmake#n751).

Quote
Or, to open the corresponding article state: Ufopaedia::open(...);
Already done : https://gchevallereau.net/cgit/cgit.cgi/OpenXcom/tree/src/Geoscape/EndResearchState.cpp?h=research_cmake#n84. But the openArticle is not yet implemented. By the way, I think that the std::string & should be a const one.

Quote
However, you can link this event to unlock certain articles in Ufopedia, by calling
Ufopaedia::releaseArticle(Game *game, std::string &article_id);
I will add this.

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: Research developement
« Reply #5 on: August 28, 2011, 02:35:56 pm »
So gchevallereau, now you will implement manufacture and geoscape for 0.4 will be almost ready? ;)

Offline gchevallereau

  • Sergeant
  • **
  • Posts: 41
    • View Profile
Re: Research developement
« Reply #6 on: August 28, 2011, 03:45:47 pm »
Quote
now you will implement manufacture
Well I was thinking to it. But it would be better to wait for feedback on the research as manufacture will depend on it.

Offline gchevallereau

  • Sergeant
  • **
  • Posts: 41
    • View Profile
Re: Research developement
« Reply #7 on: September 02, 2011, 01:06:04 pm »
Hi,

A little update on the research branch. Here is the current status:
* Documentation(especially the Dependency/unlock parts). I have added doxygen documentation to most class. Not sure if it's enough
* Minor bug : If no project can be listed when Clicking on New project, you will be back the base view. FIXED
* UI bug : Colours are wrong in the Project Setting State(and sometimes in the End Research State).  Partially fixed. Colors are much more better now. But there still some little problems(assigned scientist, used space lab, available sicentist in the ResearchProjectState still have the wrong colors).
* Research cost : According to https://www.ufopaedia.org/index.php?title=Research_Technical_Details, Research cost have +-50% cost modifier. It should be to easy to add it. DONE

*
Quote
However, you can link this event to unlock certain articles in Ufopedia, by calling
Ufopaedia::releaseArticle(Game *game, std::string &article_id);
DONE

I reviewed most of the modification and try to make sure that it follow coding rules.

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Research developement
« Reply #8 on: September 02, 2011, 02:19:27 pm »
Your code looks great. I noticed you use relative coordinates to position your UI and various variables for the numbers, instead of absolute coordinates and hardcoded numbers, that's good :)

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: Research developement
« Reply #9 on: September 02, 2011, 04:00:17 pm »
Your code looks great. I noticed you use relative coordinates to position your UI and various variables for the numbers, instead of absolute coordinates and hardcoded numbers, that's good :)

Let me guess - you're thinking about higher resolutions? ;)

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Research developement
« Reply #10 on: September 02, 2011, 04:15:14 pm »
Let me guess - you're thinking about higher resolutions? ;)
You probably don't want to know what I'm thinking :)

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Research developement
« Reply #11 on: September 04, 2011, 09:51:05 pm »
btw gchevallereau, will you be introducing to us eventually? :)
Also we don't know what your plans are, and you don't know what our plans are.  It's a bit an awkward situation to be honest. I'm already starting to get scared you will take away the fun parts of battlescape core development too :p

Offline gchevallereau

  • Sergeant
  • **
  • Posts: 41
    • View Profile
Re: Research developement
« Reply #12 on: September 05, 2011, 06:16:22 pm »
Quote
btw gchevallereau, will you be introducing to us eventually?
Well, I'm french 30 years developer. I have discovered openxcom only 2 month ago. As I'm at the moment looking for a job, I have some time to spent on code.

Quote
Also we don't know what your plans are, and you don't know what our plans are.
You mean that the roadmap is not accurate ? ;D
More seriously, I'm just looking at the research/manufacture code at the moment. Nothing more.

Quote
I'm already starting to get scared you will take away the fun parts of battlescape core development too :p
Don't worry  ;) I promise I won't touch it.

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: Research developement
« Reply #13 on: September 05, 2011, 06:51:02 pm »
Since you're from europe too, maybe you could enter our irc channel ( details are here https://openxcom.org/forum/index.php?topic=63.0 ) ? SupSuper and Daiky are usually at evenings.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Research developement
« Reply #14 on: September 07, 2011, 06:50:41 am »
Quote
Also we don't know what your plans are, and you don't know what our plans are.
You mean that the roadmap is not accurate ? ;D
More seriously, I'm just looking at the research/manufacture code at the moment. Nothing more.
Well we can have things planned out in our heads before they're coded. I feel like I've been demoted. :P j/k

Anyways I tried to clone your Git repository to have a better look at your code but I get this error:

"Cloning into D:\SupFiles\Visual Studio Projects\OpenXcom\research...
gchevallereau.net[0: 88.169.205.14]: errno=No error
fatal: unable to connect a socket (No error)"

Any ideas?