aliens

Author Topic: Battlescape development  (Read 290526 times)

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Battlescape development
« Reply #120 on: March 05, 2011, 02:47:54 pm »
i have another bug. this time with guns :)
when you fire gun when your solder standing on highest point of ramp from Skyranger you will always hit your feet (probably this is some kind of rocket jump :> )
tested on last git build
[ps]
anoter bugs
when i shoot ground couple of times  its disappear and leave black square, then i cant shoot that spot again
when i target my shooter, he shoot i different direction
explosion in ufo dont generate smoke
« Last Edit: March 05, 2011, 03:04:46 pm by Yankes »

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Battlescape development
« Reply #121 on: March 11, 2011, 03:54:18 pm »
Although most bugs in the git build are due to work in progress, anyway thanks for the bug reports.

I'm currently refactoring a few classes and relations. Because I now have some new insights that I didn't have earlier on. For everyone who is interested... read on.

Removing:
UnitSpriteRule - since this data is directly linked to graphics it makes no sense to have it configurable for now, it just complicates things.
MapModel - there is not really an added value to keep track of all individual models of map objects after all, voxel data will be looked up directly in the loftemps data.
Adding:
RuleArmor - holds armor value for different types of armor, including aliens' armor
RuleUnit - holds initial stats and other unit specific data for both xcom and aliens
RuleSoldier - RuleAlien :)
Unit - abstract class that is used as an interface to both Soldier and Alien
Alien - the counterpart of Soldier, but for aliens. It doesn't hold any data, but looks it up in the associated RuleUnit
Changing:
Soldier - implements Unit, although this changes nothing on the geoscape side.
BattleUnit - holds pointer to Unit.

The philosophy behind this construction is driven by the idea that an x-com soldier is a unique entity, existing both outside and on the battlescape. An alien is just a pointer to a ruleset.
The advantage of using the abstract Unit class, is to simplify the usage on the battlescape. For example you want to get a unit's name, you do: unit->getName(); and depending whether it's an Alien or a Soldier, it will call the appropriate function.

Note that BattleUnit is not a descendant of Unit, this is intentional. Otherwise if a Soldier enters a battlescape, the Soldier class should be "morphed" into a BattleSoldier class, this is tricky business and especially hard to maintain - if new attributes are added to the Soldier class. So for each Unit participating in battle a BattleUnit instance is created which holds it's corresponding Unit pointer.

As a rule the Alien class counts for all NPC units: so including civilians. The type of class does not define whether a unit's AI is hostile towards x-com. This is taken care of with a "faction" attribute : friendly, neutral or hostile.
« Last Edit: March 11, 2011, 08:06:13 pm by Daiky »

Offline liamdawe

  • Sergeant
  • **
  • Posts: 27
    • View Profile
Re: Battlescape development
« Reply #122 on: March 14, 2011, 11:54:47 am »
I am still lurking watching your working, coming along really well mate super job!!

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Battlescape development
« Reply #123 on: March 22, 2011, 12:08:39 am »
I am still lurking watching your working, coming along really well mate super job!!

Thank you.

Meanwhile I'm on a business trip for work. But at the hotel we have internet, so I can still push stuff I have been working on :)

- Added the basic "unit dies" logic (from direct hit or explosion).
So, units can be hit, but it's just the weapon damage -  front armor which gets subtracted from their HP at the moment. If health reaches 0, the unit dies with appropriate scream sound and animation. The unit however then disappears...

- Turning and walking consume the right amount of timeunits.
I think this one is pretty much finished. I probably need to add the energy functionality next.

- The "end turn" button: add basic end-of-turn logic.
The button will, if in debug mode, allow you to play with the aliens, otherwise it just replenishes your timeunits.

- Added debug mode "d" which reveals map and allows to play alien side.

alienjon

  • Guest
Re: Battlescape development
« Reply #124 on: March 22, 2011, 12:55:59 am »
Quote
Changing:
Soldier - implements Unit, although this changes nothing on the geoscape side.
BattleUnit - holds pointer to Unit.

[...]

Note that BattleUnit is not a descendant of Unit, this is intentional. Otherwise if a Soldier enters a battlescape, the Soldier class should be "morphed" into a BattleSoldier class, this is tricky business and especially hard to maintain - if new attributes are added to the Soldier class. So for each Unit participating in battle a BattleUnit instance is created which holds it's corresponding Unit pointer.

As a rule the Alien class counts for all NPC units: so including civilians. The type of class does not define whether a unit's AI is hostile towards x-com. This is taken care of with a "faction" attribute : friendly, neutral or hostile.

Should a more abstract name be derived from these 2 concepts? (UnitPointer/UnitHandle, Creature<-{Civilian, Alien, Soldier})

I know that the class translation isn't exactly how I described it above, but I feel that the nomenclature is a little confusing (a Civilian is also an Alien?)

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Battlescape development
« Reply #125 on: March 24, 2011, 11:10:01 pm »
You'll have to see the word "Alien" as "foreigner/stranger/outsider". Or in other words a non-x-com-employee.
Then you see that a civilian also falls under this term :)

alienjon

  • Guest
Re: Battlescape development
« Reply #126 on: March 24, 2011, 11:18:01 pm »
Fair enough  :)

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Battlescape development
« Reply #127 on: April 12, 2011, 11:38:23 am »
working on:
- the red visible enemy units icons on the right side of the screen
- the red battlescape error message "not enough time units, etc"

The work behind the scenes for these features was already done, so it's a logical step to finish it off now.

Offline liamdawe

  • Sergeant
  • **
  • Posts: 27
    • View Profile
Re: Battlescape development
« Reply #128 on: April 12, 2011, 11:55:56 am »
Great work, what is still left to be done until it's finished?

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Battlescape development
« Reply #129 on: April 12, 2011, 01:34:39 pm »
The action menu is probably my next little project. (the menu that pops up when you click a weapon).
SupSuper agreed to work on the Soldier Equip screen.
And I will implement the throwing trajectory in the mean time.

When that's done, 0.3 probably will be finished.

I think 0.3 is a big step for the battlescape. Probably the only other big piece missing from the battlescape is the AI.
« Last Edit: April 12, 2011, 01:41:56 pm by Daiky »

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: Battlescape development
« Reply #130 on: April 12, 2011, 01:53:44 pm »
I think 0.3 is a big step for the battlescape. Probably the only other big piece missing from the battlescape is the AI.

What about 2x2 units? Won't it require many changes to pathfinding? Or will it be simple?

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Battlescape development
« Reply #131 on: April 12, 2011, 03:15:20 pm »
I think 0.3 is a big step for the battlescape. Probably the only other big piece missing from the battlescape is the AI.

What about 2x2 units? Won't it require many changes to pathfinding? Or will it be simple?

Not "many" changes, pathfinding for 2x2 units is like pathfinding for 4 units in parallel, the first unit is the master, the other 3 are dummy units.  The master does a step in a certain direction, if the step succeeds, the other 3 units try a step in the same direction, if one of them fails, the step is marked as failed and we try in another direction.

Offline liamdawe

  • Sergeant
  • **
  • Posts: 27
    • View Profile
Re: Battlescape development
« Reply #132 on: April 13, 2011, 11:09:16 am »
Will you be doing the AI or will that be sup's job?

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Battlescape development
« Reply #133 on: April 13, 2011, 01:25:24 pm »
I'll do the Geoscape AI and he'll do the Battlescape AI.

Offline liamdawe

  • Sergeant
  • **
  • Posts: 27
    • View Profile
Re: Battlescape development
« Reply #134 on: April 13, 2011, 01:32:31 pm »
Sweet honestly can't wait for that, it's the biggest thing i am looking forward to :D