Author Topic: Playable Aliens mod incompatible with OpenXcom  (Read 1205 times)

Offline Tamamo-no-Bae

  • Squaddie
  • *
  • Posts: 6
    • View Profile
Playable Aliens mod incompatible with OpenXcom
« on: January 27, 2021, 05:17:40 am »
I wasn't sure where to post this, but the original Playable Aliens mod I made a long long time ago for the originals seem to be incompatible with OpenXcom.
They cause a crash, I will post the mod packs and a crash dump, I hope this can be fixed in a future version.

In the original X-Com, Aliens are defined as armor. Thus having an armor value above the default changes you into an Alien.
Likewise Aliens use an unused internal rank called "Units in Entrance"

This can be seen in the TFTD save with the accurate Tasoth Soldier recreation or if you used the Tentaculat/Chryssalid bug to get one on your team.

So why does this require a mod? Because inventory data for those armor are missing, thus causing a crash.
However in Openxcom it's possible the support for the Alien armors are missing entirely.

Here's hoping this can be fixed!

EDIT:

I have also submitted this to the bug tracker after I found it ^^'
« Last Edit: January 27, 2021, 05:22:25 am by Tamamo-no-Bae »

Offline Yankes

  • Commander
  • *****
  • Posts: 2518
    • View Profile
Re: Playable Aliens mod incompatible with OpenXcom
« Reply #1 on: January 27, 2021, 07:13:08 pm »
OXC do not support in any way modded UFO data, you need only use original data from game (+ optionally patch fix)

If you want mode it, you should do it in OXC using its modding capabilities.

Offline Tamamo-no-Bae

  • Squaddie
  • *
  • Posts: 6
    • View Profile
Re: Playable Aliens mod incompatible with OpenXcom
« Reply #2 on: January 27, 2021, 08:36:15 pm »
OXC do not support in any way modded UFO data, you need only use original data from game (+ optionally patch fix)

If you want mode it, you should do it in OXC using its modding capabilities.

You do not understand, the "mod" just adds some basic spk files for the alien enstries.
The underlying functionality however that existed in Vanilla X-Com is missing here, which is the problem.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1930
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Playable Aliens mod incompatible with OpenXcom
« Reply #3 on: January 27, 2021, 09:20:45 pm »
So you're saying that something you had to mod data values in the original game to do shouldn't require a mod in OXC?

This just sounds like its a cosmetic thing, which is exactly why simple modding capability is part of OXC. This doesn't belong on the bug tracker for the source code, as modding functionality easily allows for it. If you want a mod that makes your soldiers look like the aliens, you can just ask for assistance in making that happen.

Offline Yankes

  • Commander
  • *****
  • Posts: 2518
    • View Profile
Re: Playable Aliens mod incompatible with OpenXcom
« Reply #4 on: January 27, 2021, 09:56:28 pm »
You do not understand, the "mod" just adds some basic spk files for the alien enstries.
The underlying functionality however that existed in Vanilla X-Com is missing here, which is the problem.
OXC was designed to read unaltered data, any changes not made by official release are not supported (and I doubt that SupSuper or WarBoy will try implements it).

Even in games that have official support for mods when new version is released old mods can break, and we have this case here, your mod was for "old" version of UFO and "new" version of UFO (aka OXC) require different mod format to work.
Overall I would suggest taking ohartenstein23 proposition and try implementing your mod in OXC as it have A LOT of more capabilities than in original game was even possible (especially OXCE fork that I started).

Offline Tamamo-no-Bae

  • Squaddie
  • *
  • Posts: 6
    • View Profile
Re: Playable Aliens mod incompatible with OpenXcom
« Reply #5 on: January 27, 2021, 10:30:07 pm »
So you're saying that something you had to mod data values in the original game to do shouldn't require a mod in OXC?

This just sounds like its a cosmetic thing, which is exactly why simple modding capability is part of OXC. This doesn't belong on the bug tracker for the source code, as modding functionality easily allows for it. If you want a mod that makes your soldiers look like the aliens, you can just ask for assistance in making that happen.

Let me try to explain more thoroughly.
The "modding data values" causes a crash here because the underlying data is missing.

This is the equivalent of the Power Suit causing a crash because the entry is missing from the code.
You can't "mod" this away, nor is it cosmetic.

The "mod" here simply adds the missing .spk files to prevent crashes, all the inherent files remain in the game.

You can read more here:
https://www.ufopaedia.org/index.php/SOLDIER.DAT

Since Openxcom is emulating the original, it should contain the internal entries, otherwise any original savegame using these unused entries will crash.



Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 6960
  • OXCE developer
    • View Profile
    • My Wiki
Re: Playable Aliens mod incompatible with OpenXcom
« Reply #6 on: January 27, 2021, 10:53:39 pm »
Since Openxcom is emulating the original, it should contain the internal entries, otherwise any original savegame using these unused entries will crash.

OpenXcom does not emulate the original.
It does not contain all the "internal entries" of the original.
OpenXcom only uses the maps, graphical and audio resources from the original ... everything else has been replaced by new different internal representations in OpenXcom format.

OpenXcom can load only unmodded original saves (by converting them into OpenXcom format), anything modded will crash (or at least not work).
And they must be Geoscape saves too, Battlescape saves cannot be loaded at all.
« Last Edit: January 27, 2021, 10:58:45 pm by Meridian »

Offline Tamamo-no-Bae

  • Squaddie
  • *
  • Posts: 6
    • View Profile
Re: Playable Aliens mod incompatible with OpenXcom
« Reply #7 on: January 27, 2021, 11:12:46 pm »
OpenXcom does not emulate the original.
It does not contain all the "internal entries" of the original.
OpenXcom only uses the maps, graphical and audio resources from the original ... everything else has been replaced by new different internal representations in OpenXcom format.

OpenXcom can load only unmodded original saves (by converting them into OpenXcom format), anything modded will crash (or at least not work).
And they must be Geoscape saves too, Battlescape saves cannot be loaded at all.

Opensource clones usually emulate the functionality of the originals but are coded from scratch.
This is a simply a functionality that is missing, and it is indeed a Geoscape save that cannot load.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 6960
  • OXCE developer
    • View Profile
    • My Wiki
Re: Playable Aliens mod incompatible with OpenXcom
« Reply #8 on: January 27, 2021, 11:45:00 pm »
Opensource clones usually emulate the functionality of the originals but are coded from scratch.
This is a simply a functionality that is missing, and it is indeed a Geoscape save that cannot load.

It is pretty pointless to argue with OpenXcom developers about what they have developed, don't you think?

As an OpenXcom developer, I can tell you that the functionality you are trying to use here is modded and explicitly unsupported by OpenXcom.

The crash happens on this line: https://github.com/OpenXcom/OpenXcom/blob/master/src/Savegame/SaveConverter.cpp#L1078
when the game finds a non-existing armor reference in your save.
The original contains only 4 armors (jumpsuit, pers armor, power suit and flying suit) and your save contains also a 5th armor (judging by the SPK files even more than 5 actually, but it crashes already on the fifth).

This is not a bug, and also not a missing functionality... everything works as expected and as intended.
The only correct way to introduce this modded behavior is to use OpenXcom's own modding features.

Offline Tamamo-no-Bae

  • Squaddie
  • *
  • Posts: 6
    • View Profile
Re: Playable Aliens mod incompatible with OpenXcom
« Reply #9 on: January 28, 2021, 08:38:02 am »
It is pretty pointless to argue with OpenXcom developers about what they have developed, don't you think?

As an OpenXcom developer, I can tell you that the functionality you are trying to use here is modded and explicitly unsupported by OpenXcom.

The crash happens on this line: https://github.com/OpenXcom/OpenXcom/blob/master/src/Savegame/SaveConverter.cpp#L1078
when the game finds a non-existing armor reference in your save.
The original contains only 4 armors (jumpsuit, pers armor, power suit and flying suit) and your save contains also a 5th armor (judging by the SPK files even more than 5 actually, but it crashes already on the fifth).

This is not a bug, and also not a missing functionality... everything works as expected and as intended.
The only correct way to introduce this modded behavior is to use OpenXcom's own modding features.

It is technically a missing functionality as the original X-Com has native support for 16 armors, it's just missing SPK files for them, Openxcom does not support any armors above 4.

But fine, then please tell me, how do I mod the other armors in? I want to continue my game with the heroic Maria Evans, the Sectoid defector.

Or my TFTD game with Emilio Carlos, the Calcinite.

I've never modded anything for Openxcom and I was honestly just hoping to plop in the files and continue playing.

Also do note:
The unused armors are automatically translated as Aliens in the Battlescape in the originals.
This is to a point where a save editor like "X-Com Hack V3" will kill or knock out my own units if I use the "Stun Aliens" or "Kill Aliens" option, so they're not just cosmetic skins.
If you get a Bio-Drone in TFTD, upon death it will violently explode just like the real deal for example.

« Last Edit: January 28, 2021, 09:15:15 am by Tamamo-no-Bae »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 6960
  • OXCE developer
    • View Profile
    • My Wiki
Re: Playable Aliens mod incompatible with OpenXcom
« Reply #10 on: January 28, 2021, 09:25:18 am »
It is technically a missing functionality as the original X-Com has native support for 16 armors, it's just missing SPK files for them, Openxcom does not support any armors above 4.

OpenXcom has native support for unlimited number of armors.

But fine, then please tell me, how do I mod the other armors in?

I have attached a sample mod that adds a new armor called "Sectoid armor", with all stats of a real Sectoid armor.
Battlescape graphics used are from the vanilla Sectoid spritesheet.
All other things like inventory sprite, corpse sprite, sounds, etc. are from a vanilla jumpsuit... they can of course all be changed if you want.
The best way to learn OpenXcom modding is to download and study some existing mods.
The reference guide helps as well: https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)

I want to continue my game with the heroic Maria Evans, the Sectoid defector.

As I said it will not be possible to load your save in OpenXcom in its current state, fullstop.

What you can do is:
1/ either start a new game in OpenXcom
2/ or modify your original save to only contain the 4 vanilla armors... then load this save in OpenXcom... and then change the armors of your soldiers in OpenXcom
« Last Edit: January 28, 2021, 09:27:26 am by Meridian »

Offline Tamamo-no-Bae

  • Squaddie
  • *
  • Posts: 6
    • View Profile
Re: Playable Aliens mod incompatible with OpenXcom
« Reply #11 on: January 28, 2021, 09:56:30 am »
OpenXcom has native support for unlimited number of armors.

I have attached a sample mod that adds a new armor called "Sectoid armor", with all stats of a real Sectoid armor.
Battlescape graphics used are from the vanilla Sectoid spritesheet.
All other things like inventory sprite, corpse sprite, sounds, etc. are from a vanilla jumpsuit... they can of course all be changed if you want.
The best way to learn OpenXcom modding is to download and study some existing mods.
The reference guide helps as well: https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)

As I said it will not be possible to load your save in OpenXcom in its current state, fullstop.

What you can do is:
1/ either start a new game in OpenXcom
2/ or modify your original save to only contain the 4 vanilla armors... then load this save in OpenXcom... and then change the armors of your soldiers in OpenXcom

Alright, I'll try this...Thanks!