Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Yankes

Pages: [1] 2
1
Fan-Stuff / Room of "Real" X-Com commander
« on: June 17, 2018, 11:51:24 pm »
Probably most accurate real life place to X-Com command room:
https://www.youtube.com/watch?v=lVWw628Mkac

2
Programming / Some bugs find in code
« on: April 27, 2018, 06:02:36 pm »
Doing other work I find couple dodgy parts in this function implementation.

First it not support multi purpose buildings because of `else if` (it will ignore cleanup of other functions)

Another is usage of `(*facility)->getCraft()` that look it should only be used for display purpose. What will happen when you use multiple crafts per hangar or craft is on mission when base was attacked?

[ps]
`getUsedHangars()` is call for each `_productions` even if do not need this value because type `getCategory()` is not craft. This is very heavy function and in each iteration value is same (until you remove something but then `break;` is done and you do not call it any more).

3
Help / [Request] Map with maximum move graphic glitchs
« on: April 17, 2018, 02:42:14 am »
Right now I finishing code that improve draw order of unit when its is moving.
I would need some condensed map that have multiple places where current drawing routine bugs out.
Another thing is that I need test my code if I do not introduce new bugs.

Is anyone have or create maps that could fit this purpose? I would need work with basic OXC, OXCE+ will be done when basic game is fix.

5
OpenXcom Extended / [Documentation] OXCE Script examples
« on: January 29, 2017, 05:11:23 pm »
Parrot animation:
Code: [Select]
armors:
  - type: PARROT_ARMOR
    drawingRoutine: 4
    scripts:
      selectUnitSprite: |
        #this script will always run move animation of unit.
        var int temp;
        var int walking;
        unit.isWalking walking;
        if eq walking 0;
          unit.getId temp;
          offsetmod temp 11 0 8; #desync animation of different units
          add temp anim_frame;
          wavegen_saw temp 8 8 7;
          mul sprite_offset 8;
          add sprite_offset 8;
          add sprite_offset temp;
          set sprite_index sprite_offset;
        else;
          add sprite_index sprite_offset;
        end;
        return sprite_index;

2x2 unit animation:
Code: [Select]
armors:
  - type: TANK_ARMOR
    drawingRoutine: 20
    movementType: 1
    spriteSheet: FDEAMON.PCK
    scripts:
      selectUnitSprite: |
        var int temp;
        var int walking;
        var int floating;
        unit.isWalking walking;
        unit.isFloating floating;
        if and eq walking 0 eq floating 1;
          unit.getId temp;
          offsetmod temp 11 0 8; #desync animation of different units
          add temp anim_frame;
          wavegen_saw temp 4 4 4;
          add sprite_offset 1;
          add sprite_offset temp;
          add sprite_index sprite_offset;
        else;
          add sprite_index sprite_offset;
        end;
        return sprite_index;

Hit confirm by red "flash":
Code: [Select]
extended:
  tags:
    BattleUnit:
      LAST_HIT_FRAME: int

  scripts:
    damageUnit:
      - offset: 10
        code: |
          var int temp;
          battle_game.getAnimFrame temp;
          unit.setTag Tag.LAST_HIT_FRAME temp;
          return;

    recolorUnitSprite:
      - offset: 10
        code: |
          var int temp;
         
          unit.getTag temp Tag.LAST_HIT_FRAME;
          if neq temp 0;
            sub temp anim_frame;
            if gt temp -3; #only 3 frames after hit have changed color
              set_color new_pixel 2; #red color
            end;
          end;
         
          return new_pixel;
         

6
OpenXcom Extended / OXCE Future plans
« on: January 29, 2017, 04:50:33 pm »
Current plans

For 5.0 version

setting ammo count in scripts.
script that disable weapons.
weapon/throw accuracy scripts.
hangar types
scripts events on item uses.
script events for moving items in inventory (this will allow e.g. ring with +10hp).


For some future version

directional flashlight.
change border of hand items in inventory based on usability.
script that disable weapons.
new script arguments for recolor and select graphic script with information about unit selection or cursor hovering over it.
Ability to draw custom graphic over any unit/item by script.
script for calculation unit recovery time.
script handling of behavior of end of grenade countdown (explosion, removal, postponing, unpriming).
script recoloring for explosions and hit animations.
reaction multiplier accessible by script.
toggleable  fly popery for unit.
dynamic globe terrain.


7
Programming / Memory leak in resize map script
« on: December 24, 2016, 02:25:39 am »
In my branch I find bug that I think originate from master:
https://openxcom.org/forum/index.php/topic,2915.msg76063.html#msg76063

In my version it crash game but in master it overwrite pointer without deleting it first.

8
Programming / OpenXcom 1.1
« on: December 20, 2014, 03:27:45 pm »
Isn't this time to warp thing up and create new milestone?
Most mods don't work with 1.0 if it work with Nightly and vice versa.
Lot of new stuff was added, and probably recent SupSuper patch (loading original saves) could be "selling point".

Another this is that Warboy is now focusing on TFTD it could introduce breaking changes that break mods (like recent map changes).
New milestone could create new environment for mods authors to work in without worrying about changes in nightly builds.

9
OpenXcom Extended / Old OXCE discussion thread
« on: September 07, 2014, 06:50:34 pm »
Extended version of OpenXcom
Mod version 4.0a
OpenXcom date:   Nightly 2018-08-17
OpenXcom commit: a6d2d32495d9a2efa5b3460a284b7be33629129d
Extended date:   2018-09-09
Extended commit: 5fb565cd9d7b31978b4a152a38b55cd389b1ffb0


Ubuntu required libs
sudo apt-get install libsdl1.2debian libsdl-mixer1.2 libsdl-gfx1.2-4 libsdl-image1.2 libyaml-cpp0.5


Behavior change

Hyper-Wave Decoder can have less than 100% chance to detect aliens.
Explosions don't remove unconscious unit if they can't kill them first.
Craft weapon equip screen is a bit rearranged.
Fixed "weapons" like the Medikit are now equipped by unit.
Psi-Amp use 3d range, not 2d.
Psi-Amp can use weapon power.
Fixed ammo are added after weapons in armor and unit (armor items are before unit items).
Corpses, items and Chryssalids are not spawned when unit is killed by weapons with overkill.
Stunned units can be hited by bullets and fire.
Big groups of aliens (20+) get less morale losses from casualties.
Terror units can now spawn with any built-in weapon, not only one defined by name.
While loading and unloading weapons you must pay the cost of moving the item to hand.
You can unprime granade for half of prime TUs cost.
Support for Ufo2000 armor damage type.
Psi-Amp can now obey maximum weapon range.
Psi-Amp can now deal direct damage using special attack type in popup menu.
Throwing now requires a healthy arm to do it (if the item is two-handed, then it requires both).
You can hit aliens in the head using any item you like, not only firearms stock.
Items can now be non-throwable.
Rewriten handling of alien psi attacks to handle new features of Psi-Amp.
Building, manufactures and research can now have special requirements for buildings available in base.
Throwing and hitting using two-handed weapons have the same penalty as with shooting.

1.6:
You can train your solders basic skills.
Aliens weapon types/weapons can have different turn restriction.
You can rename weapon slot names in geoscape craft info.

1.7:
Rewritten item use cost. Now is possible to spend HP, Morale or grain stun damage from using items.
You can't use old `energy*` properties in item, they are removed and replaced by new one in `cost*`.
Item have now range threshold unit they start calculating range power reduction.
Damage type can now change default power change per tile in explosion.

1.8:
Option for custom weapon deploy for alien missions and ufos.

1.9:
Options for customizing retaliation mission after shooting dow ufo.
Options for adding custom dodge chance or unit psi defence.

2.0:
Breaking change: Psi-Amp use now weapon dropoff and aimRange for attack chance.
Breaking change: Drop support for Regeneration stat in armor. Use new regen stats now.
Inventory screens can now have up to 128 backgrounds.
Unit sprites recolors can now support up to 128 values.
Option for custom change of TU, HP, Energy, Morale or Stun after next turn based on unit stats.
New stat bonus based on stun level of unit.
Option for changing fuse type in granades and flare.
Option for pre-priming granades on map spawn.
Option for dodge chance based on direction of attack.
Oprion for bonus morale recovery when using medkit.
Option for self heal using medikit.

2.1:
Craft can now have up to 4 different wepon type per slot.
Oprion for overriding shape of alien base.
Option for setting chance of special effect of item.
Moving can trigger all close proxy not only one.
Corpse explosion now can have bonus based on unit stats.
Grenades now can explode at once without destroying each others.

2.2:
Option for custom sound and animation for miss attack and psi weapons.

2.3:
Option for defining percent of all action cost stats. Old use of `flatPrime` and `flatThrow` is deprecated.
Facilities can now require items to build.
Medikit can now be used without UI and can use `hitSound`.

2.4:
Option for defining bonus and damage type for melee in range weapons.
Option for big explosion sound for each items.
Option for showing fixed weapons on unit.

2.5:
Update to nightly and bug fix.

2.9:
Scripting support in unit graphic (more info in game log with debug on).
`bigSpriteAlt` and `floorSpriteAlt` is now obsolete, will be replaced by scripts in next version.
New property `refNode` used to shared values between items/solders/armors etc.
Option for setting numbers of melee hits done by AI.
Control space usage of soldiers with 2x2 armors in crafts.

3.0:
Backported game machanic changes from Meridian OXCE+.
Fix stun damage calculation and add random for random option for final stats change by damage.
Refactored script handling.
Script support in reaction atack chance calculations.
Some light handling improvments.
New recolr and replace script graphic option for items.
Option for global events shared by scripts.
Custom tags that have user defined values.

3.1:
Base building can now prevent building other buildings.
New tag type that store other mod id.
Option for changing defualt unit light radius.
New functions exposed to script.
Reaction scripts have now information about runing or strafing of target.

3.2:
New functions exposed to script.

3.3:
New light system.
Option for reserving more space for mod in common surface/sound sets.
Visibility scripts that determine visibility of targets.

3.5:
Update to buildin script functions.
Update to recent nightly OpenXcom.

3.6:
Config for new lighting system.
New map script options made by ohartenstein23.
New scripts for items and units.
Add option for grenades to explode in hand.
Changes in handlig items with prime.
Primed granades are not recoverable if consumable property is set.

3.6a:
Fix couple of bugs.
Add some missed scripts.
Add damage type param to unit damage script.

3.6b:
Fix critical bug in unit damage function.

3.7:
New params with shooting weapon and shooter to damage and hit script.
Merge chagnes from master.
Random functions in script.
Vertical map generation support.

3.8:
Add multi ammo weapons.
New param with battle action for unit hit and damage script.

3.8a:
Bug fix.

3.9:
Bug fix.
Improvments in displaying multiple ammo items in inventory.
Script altering experience grain.

3.9a:
Bug fix.

3.9b:
Bug fix.

3.9c:
Bug fix.

3.10:
Bug fix.
Update nightly.
New grenade fuse config.

3.10a:
Bug fix.
Update nightly.

3.10b:

4.0:
Damage script can now alter zombie transformation chance.
Add access to current difficulty level in scripts.
Add base function requirmets to buy items, crafts and solders.
Add access to geoscape soldier in scripts.
Add script that is run at end of mission.
Add arcing shoots per attack type (by ohartenstein23).
Breaking change: Renamed `action` to `battle_action` in reaction scripts.
Add battle action to `awardExperience` script.
Breaking change: Renamed access function to statis in armor (added prefix `Stats.`).

4.0a:
Bug fix.




Links

Current working branch:
https://github.com/Yankes/OpenXcom/tree/OpenXcomExtended

Download available on mod site (require latest nightly):
http://www.openxcom.com/mod/openxcom-extended

Backup:
https://www.mediafire.com/folder/w07p0ibc985kd/OXCE

Forum thread:
http://openxcom.org/forum/index.php?topic=2915.msg31641#msg31641



Credits

Meridian for OXCE+ :)
stiansel for FOV speedup.
redv & WarBoy1982 for a couple of commits.
SolarusScorch for fixing language in readme.
SupSuper & WarBoy1982 & Daiky for OpenXcom :)

10
Work In Progress / [CRAFT] 4 weapon aircraft
« on: June 24, 2014, 08:14:41 pm »
I made some mockup of possible placing 2 new weapons on intercept window:

What you think about this placement?

[edit]
Code is available at:
https://github.com/Yankes/OpenXcom/tree/MoreCraftWeapons

11
Tools / Recoloring Script
« on: April 27, 2014, 06:23:46 pm »
This is mod tool (modified OpenXcom source) for recoloring unit sprites on runtime.
To use it you need compile exe using src from https://github.com/Yankes/OpenXcom/tree/ColorScript
Then you can alter ruleset to add scripts.

Some example in action:
https://www.youtube.com/watch?v=_G34PHMiBv0
https://www.youtube.com/watch?v=85A8eSGpO5Q

Features:
  • Reuse same graphic for multiple armors with altered colors
  • Alter look of unit based on stats (e.g. different color based on rank)
  • Special effects (e.g. show blood or fatal wounds on unit arm or leg)
  • Direct control on light shading

Syntax:
Every armor ruleset have new field "recolorScript" in "armors".
Code: [Select]
    recolorScript: |
      #this script is used to recolor solders hair/face colors based on nationality
      get_color r0 in;
      get_shade r1 in;
      test r0 color_hair;
      skip_eq hair;
      test r0 color_face;
      skip_eq face;
      ret in;
     
      hair:
      add r1 soldier_hair;
      ret r1;
     
      face:
      add r1 soldier_face;
      ret r1;
Syntax based on assembler, every line contains
Code: [Select]
label: op arg0 arg1 arg2 arg3;label is optional and number of args depends on op.
Code: [Select]
#"Reg" is one of: "r0", "r1", "r2", "r3", "in"
#"Data" can be Reg, const value (eg "-1", "0x1F"), data from unit
#"Label" is label defined somewhere in script
#"in" reg have value of current pixel

exit; #exit script, value retunded will be from reg "in"

ret Data; #exit with value
ret_gt Data; #exit with value if test is greater
ret_lt Data; #exit with value if test is less
ret_eq Data; #exit with value if test is equal
ret_neq Data; #exit with value if test is not equal

skip Label; #skip to label
skip_gt Label; #skip to label if test is greater
skip_lt Label; #skip to label if test is less
skip_eq Label; #skip to label if test is equal
skip_neq Label; #skip to label if test is not equal

set Reg Data; #set reg
set_gt Reg Data; #set reg if test is greater
set_lt Reg Data; #set reg if test is less
set_eq Reg Data; #set reg if test is equal
set_neq Reg Data; #set reg if test is not equal

Test Data Data; #test two values

swap Reg Reg;  #swap value of two regs
add Reg Data; #add value to reg
sub Reg Data; #subtract value from reg
mul Reg Data; #multiple value of reg

muladd Reg Data Data; #multiple and add in one opeartion
muladdmod Reg Data Data Data; # Reg = (Reg * D1 + D2) % D3

wavegen_rect Reg Data Data Data; #create repeating sequence, args: x, period, rect width, rect height
wavegen_saw Reg Data Data Data; #create repeating sequence, args: x, period, sawtooth width, sawtooth cut out height
wavegen_tri Reg Data Data Data; #create repeating sequence, args: x, period, triangle width, triangle cut out height

div Reg Data; #division reg by value
mod Reg Data; #modulo reg by value

shl Reg Data; #left shift reg by value
shr Reg Data; #right shift reg by value

get_color Reg Data; #extract pixel color form value to reg
set_color Reg Data; #set pixel color in reg to value
get_shade Reg Data; #extract pixel shade form value to reg
set_shade Reg Data; #set pixel shade in reg to value
add_shade Reg Data; #add value to pixel shade in reg

All available data for script:
Code: [Select]

#enum
blit_part #what sprite part is now edited

#posible values:
blit_torso
blit_leftarm
blit_rightarm
blit_legs
blit_collapse #dying animation and corpse on ground
blit_inventory #corpse in inventory screen


anim_frame #number of current frame
shade #0 - light, 16 - dark


health
health_max
energy
energy_max
stun
stun_max
morale
morale_max


fatalwounds #sum of fatalwounds
fatalwounds_head
fatalwounds_torso
fatalwounds_leftarm
fatalwounds_rightarm
fatalwounds_leftleg
fatalwounds_rightleg


armor_front
armor_left
armor_right
armor_rear
armor_under


unit_id
unit_rank
unit_float #is floating
unit_kneel #is kneeling

soldier_hair #solder hair color based on soldier_look
soldier_face #solder face color based on soldier_look


#enum
soldier_look #current solder look

#posible values:
soldier_look_blonde
soldier_look_brownhair
soldier_look_oriental
soldier_look_african


#enum
soldier_grender #current solder grender

#posible values:
soldier_grender_male
soldier_grender_female


#const colors
color_hair #color group of hair color in solder sprite
color_face #color group of hair color in solder sprite

color_null
color_yellow
color_red
color_green0
color_green1
color_gray
color_brown0 #equal color_face
color_blue0
color_blue1
color_brown1 #equal color_face
color_brown2
color_purple0
color_purple1
color_blue2
color_silver
color_special

Possible future extensions:
Recolor scripts for weapons.
Recolor scripts for paperdoll in inventory.
Use script for selecting different sprite index e.g.:
Code: [Select]
    spriteScript: |
      test blit_part blit_torso;
      ret_neq in;
      test soldier_grender soldier_grender_female;
      ret_neq in;
      ret sprite_female_torso;


12
Programming / Replacing Text::paletteShift
« on: November 25, 2013, 02:17:42 am »
Nice job, surprised to see it actually works. :)

I noticed your text colors seem off though. You probably need to update Surface::paletteShift to copy SDL_Color's new alpha field. There might be other places where you need to check this (I assume you already corrected the palettes to be fully opaque).
how about dropping `Surface::paletteShift` all together? I have test branch that replace it with custom blit function.
I dont publish it because of feature freeze before 1.0 and low performance grain (new function is faster that old one but because paletteShift isnt used offten, its hard to see difference).

Mod Edit: Split discussion since it's not Android-related.

13
Offtopic / Good blogs about programing
« on: April 30, 2013, 09:32:32 pm »
series of post about improving performance of render engine
https://fgiesen.wordpress.com/2013/02/17/optimizing-sw-occlusion-culling-index/

some post about developing big titles like WarCraft & StarCraft
https://www.codeofhonor.com/blog/

blog about creating procedural world
https://procworld.blogspot.com/

14
Work In Progress / Interactive programing
« on: March 31, 2012, 05:29:16 pm »
I saw recently interesting idea: and some implementation of this: https://gabrielflor.it/water
Its have some flaws (hard to archive in languages like C/C++) but still this can be useful.
Many times I had to recompile code couple of times to get for some variable right value. Editing it in debugger is pain in a%$ because you need  stop program and edit it every time it get changed.

My idea is to create function that will allow you to inject new value to program using key press.
some example:
we have some variable that need be change and you dont know what is correct one.
Code: [Select]
int var = 1;https://is it 42 correct??now we have new function that will do it for us.
Code: [Select]
int var = spec_func<key_inc, key_dec>(Def_value, Min_value, Max_value);after compiling and ruining OpenXcom you can press key `key_inc` to increase this value or `key_dec` to reduce.
(this is simplest possible function, I can create more function that have more complex effects)
You will not be forced to change any thing else in code to get it working.
Additional to get some feedback, you will get this value printed under fps counter.
After finding correct value you will simply replace this code with it:
Code: [Select]
int var = 42;https://is it!
With this system you can test every value you want only recompiling 2 times one `.cpp` file.
This function will be fast, cost of using it will be near cost of calling normal function that do some simple operations.


15
Offtopic / Xcom on steam
« on: January 05, 2012, 09:35:41 pm »
only today on steam Ufo & Xcom & Apoc are only for 5 euro (+2 another parts that nobody want playing :D ).
if you dont have original version yet, you should buy it now :)

Pages: [1] 2