OpenXcom Forum

Modding => Work In Progress => Topic started by: Xtendo-com on April 15, 2016, 12:33:52 pm

Title: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Xtendo-com on April 15, 2016, 12:33:52 pm
OpenXcom Highly Advanced (OXCHA) based on latest openxcom nightly (commit b7f1b13, May 13, 2016 )

The main purpose of that fork - make as many advanced options for geoscape and battlescape, as possible in order to satisfy the different tastes posted in suggestions.
That fork is not ruleset wise. If you want more rulesets options, try OpenXcom Extended (https://openxcom.org/forum/index.php/topic,2915.0.html) or OpenXcom Extended+ (https://openxcom.org/forum/index.php/topic,4187.0.html) instead. If you want some options merged to their forks, ask authors or merge yourself using a feature branch.

Advanced scanner (https://openxcom.org/forum/index.php/topic,2391.0.html)
Description from game: Locations of enemies, uncovered by motion scanner, will be marked as red boxes on the battlefield.

Aliens shoot blindly (https://openxcom.org/forum/index.php/topic,4421.0.html)
Description from game: Aliens can shoot to spotted x-com operatives without visual contact.

Alternate clip consumption (https://openxcom.org/forum/index.php/topic,4062.0.html)
Description from game: Reduce inefficient calculation of clip consumption after statistic screen if clip is almost full. If that option disabled, clip counts as consumed if there are not enough bullets to fill clip completely.
More details: if you don't understand the short description, open a link higher.

Show blast radius (https://openxcom.org/forum/index.php?topic=1532.0)
Description from game: Shows blast radius for every weapon that have a blast radius (grenades, high explosive, rocket launchers, etc).

Increase survivability of x-com soldiers
Description from game: Healthy soldier with high morale and bravery has a chance to lose consciousness instead of dying after a mortal hit. Soldiers with high bravery are more likely to survive a mortal hit.
More details: In vanilla if HP reaches 0, your soldiers dies. When that option enabled, if HP reaches 0 and less the game calculate a chance to survive by losing consciousness instead and recovers 10% HP from max HP. Chance based on HP overkill, on a morale and bravery.

Extend civilians behaviour
Description from game: Makes civilians more valuable with possibility to save them without stun. Beware, every death of civilians affect a morale and in unconscious state civilian lose pulse and can die.
More details: Completely breaks vanilla behaviour of civilians:
  • You can save civilians when you abort missing
  • Civilians sit quietly and tries to break line of sight instead of walking around except when they panic
  • Civilians can lose a morale. They lose a morale after noticing an enemy at start of civilian's turn, lose a morale after every death of humans.
  • You can control civilians manually when x-com operative is nearby (7 tile away)
  • Civilians lose less morale under player control
  • Civilians under player control never panic when x-com operative is alongside (2 tile away)
  • Civilians lose a pulse in unconscious state, so never stun civilians without a special reason
  • Changes turn priority to: Player, Civilians, Aliens. So in first turn civilians can break line of sight

No pulse in unconscious state
Description from game: Human lose pulse in unconscious state and lose HP to death. You need to use stimulators from medikit in that case.
More details: That rule applied to x-com operatives and civilians, aliens not affected. Human in unconscious state can't regain consciousness without external help. Stunlevel overdose for humans resets every turn, so you don't need a lot of stimulators (more than 3).

OpenXcom Highly advanced (branch: OXCHA) (https://github.com/Xtendo-com/OpenXcom/tree/OXCHA)
Advanced scanner (branch: adv_advanced_scanner) (https://github.com/Xtendo-com/OpenXcom/tree/adv_advanced_scanner)
Aliens shoot blindly (branch: adv_aliens_shoots_blindly) (https://github.com/Xtendo-com/OpenXcom/tree/adv_aliens_shoots_blindly)
Alternate clip consumption (branch: adv_alternate_clip_consumption) (https://github.com/Xtendo-com/OpenXcom/tree/adv_alternate_clip_consumption)
Extend civilians behaviour (branch: adv_extend_civilians_behaviour) (https://github.com/Xtendo-com/OpenXcom/tree/adv_extend_civilians_behaviour)
Increase survivability of x-com soldiers (branch: adv_increase_survivability) (https://github.com/Xtendo-com/OpenXcom/tree/adv_increase_survivability)
No pulse in unconscious state (branch: adv_unconscious_no_pulse) (https://github.com/Xtendo-com/OpenXcom/tree/adv_unconscious_no_pulse)
Show blast radius (branch: adv_show_blast_radius) (https://github.com/Xtendo-com/OpenXcom/tree/adv_show_blast_radius)

OpenXcom (https://github.com/SupSuper/OpenXcom) by SupSuper, Daiky, WarBoy1982, hmaon, Karvanit, l2uriel, volutar and etc.
OpenXcom Extended (https://github.com/Yankes/OpenXcom/tree/OpenXcomExtended) by Yankes
OpenXcom Extended+ (https://github.com/MeridianOXC/OpenXcom/tree/oxce2.9-plus-proto) by Meridian
Advanced scanner (https://github.com/redv/OpenXcom/commit/892a3caace0fa8b17a1e8c8ea466acc0abeea87b) by redv
Alien Snipers (https://openxcom.org/forum/index.php/topic,4421.0.html) by psyHoTik
Bullet saving patch (https://openxcom.org/forum/index.php/topic,4062.0.html) by Arthanor
Manual control of civilians (https://openxcom.org/forum/index.php/topic,3553.msg42680.html#msg42680) by yrizoud
Show chance to hitting and the throw trajectory (https://openxcom.org/forum/index.php/topic,1532.0.html) by redv

Links to binary:
Windows binary (https://drive.google.com/open?id=0B-i8_ljY54GvVEJ6dURvVVZpQXc)
Linux binary (https://drive.google.com/open?id=0B-i8_ljY54GvdWRpdlltc1NDeTQ)
Title: Re: [EXE][WIP]OpenXcom Highly Explosive (OXCHE)
Post by: ivandogovich on April 15, 2016, 05:21:23 pm
Hmmm... from the OP title, I thought you were creating a mod with increased HE damage, rather than just a different port with a compilation of exploratory features.   I'm not sure, but maybe there might be a more accurate name somewhere. :)
Title: Re: [EXE][WIP]OpenXcom Highly Advanced (OXCHA)
Post by: Xtendo-com on April 15, 2016, 05:45:43 pm
Hmmm... from the OP title, I thought you were creating a mod with increased HE damage, rather than just a different port with a compilation of exploratory features.   I'm not sure, but maybe there might be a more accurate name somewhere. :)
Thanks, changed title to more accurate name.
Title: Re: [EXE][WIP]OpenXcom Highly Advanced(OXCHA)
Post by: Xtendo-com on April 16, 2016, 08:24:44 pm
New Build:
changelog
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Arthanor on April 17, 2016, 01:09:08 am
Hi! So I'm going through your commits to implement the advanced scanner and I noticed on this commit (https://github.com/Xtendo-com/OpenXcom/commit/5fb820212653f22873fcdde02fc293b41a3bfaf0) that there was a line of code related to the autoequip that disappeared in src/Engine/Options.cpp.

I expect that's not intentional?
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Xtendo-com on April 17, 2016, 06:45:05 am
I expect that's not intentional?
My mistake, sorry about that.

Also If you want to port advanced scanner to extended, you can watch changelog directory > advanced scanner by redv. I made a list of changed files in readme.txt and a unique comment that allows you to find needed line of code.

--- posts merged - Solarius Scorch ---

I'm thinking about improving ability to easily merge a specific interested advanced option for other developers by reducing a manual works and improving visual diff. Currently you may found a specific advanced option by unique comment in source with included changed file lists in changelog directory but you need to do a lot of manual SEARCH/COMPARE/COPY/PASTE/ actions and also fix conflicts. I want to reduce manual works to minimum so you need to fix only conflicts instead.

I found two ways:
1) Include also a diff patch in changelog directory for every advanced option. Diff made from fresh openxcom nighty.
2) Make new branch from fresh openxcom nighty for every advanced option and use in github site a function to compare branch.

May be openxcom community may offer better ways?
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Arthanor on April 17, 2016, 11:06:14 pm
I just used git to find all the commits that related to the scanner, and picked the code changes related to that, to see what to implement. It wasn't too hard. Now I just have to figure out if it worked or not ;)

I initially made git patches for it, but the amount of conflicts (language files are different, code version is different because OXCE is pretty far behind by now) was just too much. It was much easier to just reproduce the changes. I think if you could have all your work on one feature be one branch that is then merged in your master (or at least if you want to work directly on your master branch, have all the commits related to a given feature in a row), it would make things easier as we wouldn't have to search in the logs for all the commits, but otherwise it works fine.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Xtendo-com on April 20, 2016, 06:22:13 pm
wasn't too hard.
Not many commits, but hundreds of commits will really make it more harder...

have all the commits related to a given feature in a row
How it's really possible without conflicts? For example I decided to fix something related to advanced option feature after hundreds of commits. I can't make this without breaking commit history.

I think with git features that is not possible to do it with convince without making crutches. With git is comfortable to revert change and start new branch, but I didn't notice any features that allows me easily group commits for specific advanced option feature.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Arthanor on April 20, 2016, 06:33:36 pm
I think the "proper way" of using git is:

1- create your master branch, with origin/master being the oxc code
2- For every new feature, create a new branch and work exclusively on that feature when on that branch
3- When satisfied with a feature, merge the branch into your master branch. Do not delete the branch
4- When finding a bug in a feature, go back into that feature's branch and fix it, then merge the branch again.

That way, you will always have all the commits of a feature together. This is how some people offer features to openxcom: They make a branch, and then they submit a pull request to the master code.

So if I want one of your features, I can just get the branch on which you developed it and I will get all the work you have done on it. This is far superior to working directly into your master.

It is also the way to work with multiple people on the same code: You all work on a different feature on different branches, and when you think you are done, the code master will merge your branch into the master code, thus adding the new feature. Meanwhile, others who are still working on their feature can keep their branch as is instead of suddenly getting their code updated.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Xtendo-com on April 20, 2016, 06:48:19 pm
Arthanor
Thanks! That thing stops for me implementing/porting other advanced options since it's difficult to pickup interesting advanced option. Later I will remake my git fork entirely that will use branch instead of commits with random positions.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: jgatkinsn on April 20, 2016, 07:12:40 pm
I think the "proper way" of using git is:

1- create your master branch, with origin/master being the oxc code
2- For every new feature, create a new branch and work exclusively on that feature when on that branch
3- When satisfied with a feature, merge the branch into your master branch. Do not delete the branch
4- When finding a bug in a feature, go back into that feature's branch and fix it, then merge the branch again.

That way, you will always have all the commits of a feature together. This is how some people offer features to openxcom: They make a branch, and then they submit a pull request to the master code.

So if I want one of your features, I can just get the branch on which you developed it and I will get all the work you have done on it. This is far superior to working directly into your master.

It is also the way to work with multiple people on the same code: You all work on a different feature on different branches, and when you think you are done, the code master will merge your branch into the master code, thus adding the new feature. Meanwhile, others who are still working on their feature can keep their branch as is instead of suddenly getting their code updated.

+1 great synopsis of git workflow
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Meridian on April 20, 2016, 07:44:56 pm
So if I want one of your features, I can just get the branch on which you developed it and I will get all the work you have done on it. This is far superior to working directly into your master.

So much for the theory... with which I 100% agree.

In reality, if you make more than 10 or 20 features, sooner or later they will depend on each other.
If you make more than 100, everything will depend on everything (I'm exaggerating now to make a point).

And I'm not even talking about any refactoring yet... which can break everything.

For example, if you want feature A from my OXCE+ branch, you'll most likely need feature B on which feature A depends; and also feature C, which is required for feature B.

Unless forks are periodically merged (or even better merged with cherry-pick strategy) upstream, they will eventually go their separate ways... rather sooner than later.

One example for illustration: yesterday I implemented a tiny feature (really just a few lines of code) for displaying accuracy and TUs for melee weapons in ufopedia... even such a tiny change cannot be used in OXC "as is", because it depends on (unknown number of) changes in OXCE.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Arthanor on April 20, 2016, 08:53:16 pm
Yes, well, maybe I missed one step of #4:

When encountering a bug, go back to that branch, merge master into it to update it with all the new stuff developed until now, then fix the bug and merge the branch back into master.

You might say: But once you merge master into the feature branch, then all the commits are mixed! Yes.. if you type "git log" and no.. if you type other commands (not 100% sure on the command line way) or use GitHub. git remembers which branch the commits were performed on and can list them for you. An example here (https://github.com/SupSuper/OpenXcom/pull/904/commits) where redv has multiple commits, including a merge and conflict fixes, which still shows only his commits.

Whenever you want a new feature, you checkout the most up to date version of master, and build your new feature on whatever is in master (including all the features that have been previously merged into it). Granted, if you use code from previous features, it will not be possible to just take that branch and merge it into some other repo that doesn't have the "basis features", but it will still be much easier than if you worked directly on your master since the merger can:

1 - Try to merge your branch
2 - Fail because it depends on another feature
3 - list all changes done to a file in which there is a conflict, to see what else was done
4 - figure out which feature is required and try to merge that (and so on until you reach "basic features" that don't depend on anything)

That's a lot of work, but it more manageable than trying to figure out what is happening when every commit is tagged as being done in master since you have extra information: what branch/feature each commit belongs to and you can approach the problem using branches/features instead of individual commits.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Xtendo-com on April 21, 2016, 09:07:30 pm
New version:
changelog
Remade github commits. Now I use one branch for one advanced option. I will try to do my best to group commits related to one feature/issue/fix and etc.
Fixed a bug in advanced scanner that prevents to draw a scan result in lower floors if scanned unit was in higher floor.
"High morale increase survivability" was renamed to "Increase survivability of x-com soldiers"
"Increase survivability of x-com soldiers" don't give you a granted chance to survive a mortal hit anymore even with high morale and health.
"Increase survivability of x-com soldiers" takes into a consideration a bravery stats, so your soldier are more likely to survive with high bravery stats.
"Increase survivability of x-com soldiers" takes into a consideration an overkill damage, so your soldier are less likely to survive with huge overkill.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Arthanor on April 21, 2016, 09:31:23 pm
Nifty! I noticed that scanner bug but hadn't gotten around to reporting it. I hadn't realized how it worked and expected it to be because I somehow had LoS to that level. I'm looking forward to the fix.

Great work on the git reorganization too!
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Xtendo-com on April 25, 2016, 05:55:49 pm
New version:

New advanced option "Extend civilians behaviour".
New advanced option "Alternate clip consumption" by Arthanor.
Fixed a bug in "Increase survivability of x-com soldiers" that was applied also for mind controlled aliens.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Xtendo-com on April 29, 2016, 05:23:08 pm
New version:
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Cooper on April 30, 2016, 12:50:36 am
Gotta try this out, "Extend civilians behaviour" seems really interesting!
However, all these different branches are a bit confusing :/
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Xtendo-com on May 02, 2016, 04:06:28 pm
However, all these different branches are a bit confusing :/
You mean you don't understand what advanced option does or an external links to github branch? Externals links that related to source codes I grouped to another drop-down list.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Xtendo-com on May 14, 2016, 05:15:03 pm
Updated binary.

Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: SIMON on May 15, 2016, 10:15:12 pm
Is this meant for just a vanilla game of open xcom or can it be used for some of the major mods out, for example FMP etc.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Solarius Scorch on May 16, 2016, 12:58:02 am
Is this meant for just a vanilla game of open xcom or can it be used for some of the major mods out, for example FMP etc.

The FMP uses normal nightly, so it should work no problem. Same with From the Apocalypse, Area 51 or Hardmode.
Piratez and X-Com Files, on the other hand, use custom .exe which probably aren't present in this version.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Xtendo-com on May 16, 2016, 05:53:38 pm
Is this meant for just a vanilla game of open xcom or can it be used for some of the major mods out, for example FMP etc.
It's depends from authors of mods. If they used a ruleset features from extended version or own customized source codes - no because my fork based on usual openxcom nightly not on extended or extended+.

which probably aren't present in this version.
Not present.

Currently I'm planning to see what I can do with android version because there are no android version of latest OXC, OXCE and OXCE+ and we have an abandoned (https://github.com/sfalexrog/openxcom-android) repository.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: hellrazor on May 24, 2016, 07:03:08 am
One of my testplayers just reported in haveing a crash useing your exe Mod.

He left a full crashreport, maybe you can elaborate the crashdump or so?

Can be found attached here (https://openxcom.org/forum/index.php/topic,3550.msg65430.html#msg65430)


Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Xtendo-com on May 24, 2016, 05:53:07 pm
hellrazor
Thanks, will try to find out what actually causes a crash.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: hellrazor on May 24, 2016, 08:07:17 pm
hellrazor
Thanks, will try to find out what actually causes a crash.

Was already resolved had to do with one of the additional mods.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: SIMON on June 04, 2016, 07:38:23 pm
Is there any update on the .exe that comes with highly advanced as I'm using the latest one-see picture but I've a sneaky feeling that the alien psi isn't working(see below link for my current game) as this issue was fixed in the nightly of 2016-05-25.

https://www.dropbox.com/s/ixo3rg2u26u4mo0/OPXCHA%202016.05.14%20HARDMODE%20V0.99.rar?dl=0
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Mr. Quiet on June 07, 2016, 05:58:39 am
This is awesome! Keep up the great work! I'll run it down the road when it gets more meaty.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: Thirsk on January 23, 2017, 11:11:17 am
Is this still being supported? I'd really like to use this with the latest nightlies.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: tkzv on October 31, 2017, 10:03:07 pm
Has anybody adapted "Extend civilians behaviour" for OXCE+ ? Or should I try to do it myself?
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: niculinux on November 14, 2017, 11:46:30 am
Is it capable to run in Lunux mods that are using openxcom extended/extended+? Needs dependencies to be installed first?
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: ohartenstein23 on November 14, 2017, 03:17:01 pm
Is it capable to run in Lunux mods that are using openxcom extended/extended+? Needs dependencies to be installed first?

This is the wrong place to ask about extended/extended+, you should check out the extended subforum (https://openxcom.org/forum/index.php/board,22.0.html). And yes, the extended/extended+ executables (OXCE/OXCE+) can be run on linux, Meridian has a link to some pre-built versions or you can compile it yourself with the same libraries you'd use for nightly openxcom (OXC).  Mods are just text files and resources, and so should be compatible with any OS without extra libraries, save for some GIF file weirdness on OS X.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: niculinux on November 14, 2017, 03:29:32 pm
This is the wrong place to ask about extended/extended+, you should check out the extended subforum (https://openxcom.org/forum/index.php/board,22.0.html). And yes, the extended/extended+ executables (OXCE/OXCE+) can be run on linux, Meridian has a link to some pre-built versions or you can compile it yourself with the same libraries you'd use for nightly openxcom (OXC).  Mods are just text files and resources, and so should be compatible with any OS without extra libraries, save for some GIF file weirdness on OS X.

Got it but i was referring to the particular and specific version by Xtendo-com, object of this thread. Thanks  and, my bad :)
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: ohartenstein23 on November 14, 2017, 03:41:10 pm
Got it but i was referring to the particular and specific version by Xtendo-com, object of this thread. Thanks  and, my bad :)

Ah, okay. In that case, you can't use OXCE/OXCE+ mods with this executable; they will at least be missing features, and at worst will cause crashes. You should be able to get this thread's executable to run on linux using either the binary in the first post or building it from the source on the github page. However, the last edit here is old enough that recent changes to the nightly are not included, and mods that depend on those changes may crash or not work correctly.
Title: Re: [EXE][WIP] OpenXcom Highly Advanced (OXCHA)
Post by: tkzv on November 16, 2017, 07:25:17 pm
Is it capable to run in Lunux mods that are using openxcom extended/extended+? Needs dependencies to be installed first?
In that case, you can't use OXCE/OXCE+ mods with this executable; they will at least be missing features, and at worst will cause crashes. You should be able to get this thread's executable to run on linux using either the binary in the first post or building it from the source on the github page. However, the last edit here is old enough that recent changes to the nightly are not included, and mods that depend on those changes may crash or not work correctly.
Yes, to combine this capability with new features one has to patch the new sources by hand. OXCE+ has renamed several variables, therefore these patches can't be applied automatically. Everything seems pretty straightforward, at least, and Xtendo even separated the patches, allowing to work with each feature separately. I didn't have time for that lately, but I'm going to try this weekend.

Status update for 2017-11-18: I managed to stick most of Xtendo's and yrizoud's code for "Extend civilians behaviour" into the latest OXCE+.

I don't think civilians should get any special treatment. They are humans, just like X-COM operatives, only weaker, frailer and unarmoured. Thus, I don't like the idea of "stun equals death", so I didn't add the corresponding fragments. I don't think they should get any special bonuses or penalties to the morale ­— let them panic and berserk as much as they want, but I may change my mind about that. Identifying all the morale-affecting lines proves harder than I expected :)

That said, OXCE+ compiles and works, at least without mods. There may be some troubles with lighting and visibility — the line
Code: [Select]
getTileEngine()->calculateUnitLighting() refused to compile. There is no method with a fitting signature, and the closest I found is private. I'll start by testing the game without it. I'll post the code on GitHub when I'm satisfied.

Update 2: I think, I broke "visibility" logic.

Update 3: Visibility works fine, it's just hard to understand. The only problem so far is losing control of civilians after pressing "next unit". I don't have time again, so I'm uploading the code to GitHub as it is. Stun no longer kills, but I left the morale-changing code untouched. The biggest change is replacing getMoraleModifier with getUnitMoraleModifier. Hope it's the same. https://github.com/tkzv/OpenXcom/commit/70122f48c343789a9f2dc4d75af89cb5077c24c9

Update 4: In a mission with many monsters and civilians, both controlled and not controlled, the game frequently hangs with 100% processor load after I press "End Turn".