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 - Phezzan

Pages: [1]
1
Programming / Many bases with many workshops
« on: July 19, 2013, 07:37:58 pm »
One thing I do all the time is check to make sure my Engis are busy.

popping out to base view, clicking a new base, clicking Manufacture - repeat x 7.

That was driving me nuts.
So I made it better.

Any interest in a pull request?

2
Programming / How to code the AI
« on: July 08, 2013, 12:40:49 am »
I'm interested in tweaking, or perhaps overhauling the AI to make X-Com scare me as much as it did back when I was 13.

So far, I've managed only to tweak the formula that attempts to find and retrieve weapons.  (hooray - stun damage is no longer instant win)

While banging my head against that - I noticed the game seems to have 'AI states' and that these operate for a while, and then it maybe decides to pick a new state - perhaps on the same turn as it picked the last one...  Additionally there doesn't seem to be any alien group consciousness.

The melee AI will target flying or otherwise unreachable targets. (like the rear tile of a tank despite the fact that it's within a blocked entrance)
The AI does attempt to hit units from the rear (less armor), but it doesn't choose targets based on armor.
(a Chryssalid will wail on a Tank it can't hurt rather than take two steps and hit a soldier in personal armor.)

Aliens do not react as a group - ie: they will not stop patrolling and come help defend the UFO, but they will retreat from visual range until they are pressed against the edge of the map.
Even Sectopods will retreat despite being nearly invincible on their front armor.

Aliens act individually, they do not come in 'teams' or squads -
If Aliens prepare ambushes, I haven't seen that yet - and I bet they wouldn't wait long before attempting a patrol anyway.

Somehow I want to fix some or all of these things

I imagine that 'threat to tile' can be tweaked to keep a 'max power' estimate so that heavily armored units can ignore the 'threat' of 20 troops with LasPistols.
The 'find cover' logic perhaps could be tweaked to allow units to hide behind large units.
The 'choose target' logic might weigh armor, hit probability, and cover (with a double penalty for cover from our own units).

But maybe I'm wrong and this stuff is implemented (or implemented and turned off)?

Phez

3
What this bug affects:
   Affected items cannot be transferred unless the receiving base has Alien Containment.
   For me - I couldn't send a custom Tank.

Currently this source file determines what is 'alive' by checking the index against the number of items that were not live aliens during initialization.

Unfortunately it doesn't attempt to reorder items before any live aliens it already added.
(probably because a reordered list would desync the index with a string vector or something)

I wrote a  couple little private functions to simplify determining which index is what type, and then asked the RuleItem itself everytime I needed to know.

It worked for me - hopefully I didn't miss anything.

Let me know if I screwed up the patch - alternatively I could learn how to make pull requests.

PS: I believe this change compiles clean with -Wall and -Wextra

4
There is no 'REAR' on the front tile of a tank.

Edit: Fixed a crash if we hit a unit that doesn't exist.

Details:
BUG:
 A large unit takes up four tiles, but a hit calculates
 the position hit on a single tile and BattleUnit::damage assumes
 that each tile has every side, which is not true for a large unit.

FIX:
 Calculate the relative direction of the hit and then
 classify it as one of 8 cardinal directions.
 Then rotate it according to unit.direction.
 Since direction is relative to the center of the unit instead of the tile,
 large units work fine.

Notes:
 I think I might have gotten the Z calculation correct for body parts.
 I'm still terrible at using git and making patches.

5
Work In Progress / Help with ExtraSprites and the tank.
« on: June 24, 2013, 07:15:37 pm »
I've been pulling my hair out for hours trying to figure out
why my tank's main body is transparent under the turret.

It's almost as if "_part 3" isn't being drawn, but the width changes based on the turret rotation (width of the turret)

Background - I extracted TANKS.PCK and recolored the default tank using colormap shenanigans. (There's probably a much better way, but it worked)
I had to replace all the index 254 color values with 0.
I dumped these files into Resources/TANK_2 and added an 'extraSprites' chunk for them similar to the Combat Armor (awesome mod btw).
Then I tell my new 'Advanced Laser Tank' to use that.

The left and right parts and the turret show up fine, but all the pixels 'below' the turret are not rendered.
If I remove the turret (in the debugger set it to -1) the body shows up fine.

Thanks for reading.

Phez

6
Programming / SoldierName look control
« on: June 23, 2013, 11:04:55 am »
Hi all.

I've been tweaking.  One thing bothering me is the evenly random distribution of appearance regardless of nationality.

So I added an optional 'look' array in SoldierName files.

Code: [Select]
maleFirst:
... https:// skipped a bunch
maleLast:
... https:// skipped a bunch
  - Svensson
  - Lindgren
look:
  - 0
  - 0
  - 0
  - 0
  - 0
  - 1
  - 1
  - 1
  - 2

The net result is decent control over Soldier Appearance.
If I can figure out git diffs I'll post a patch after I sleep.

Phez

Pages: [1]