Jump to content

Gijs-Jan

Development Team
  • Posts

    330
  • Joined

  • Last visited

  • Days Won

    7

Posts posted by Gijs-Jan

  1. Thank you for taking the time to get us the error report.
    For some reason it seems to want to create a tooltip for the mod, trying to access the contents which crashes the game.
    So it doesn't seem there's an issue with how you've setup the mod.

    I'm going to card this up and try to see if I can spend some evening hours getting it fixed for next week.

  2. The only thing you should have to do with a mod is define it's manifest:

    ```
    {
        "version": "0.0.4",
        "asset": {
            "Name": "Xenonauts Basic Cover Mod",
            "UID": "56bbba8a-7fb5-44c3-a6d3-834a2fb2d977",
            "Description": "A basic mod for Xenonauts 2 that changes cover values on the full cover master to 80%.",
            "Author": "Goldhawk Interactive",
            "Website":"http://www.goldhawkinteractive.com/",
            "Tags":["Official", "Mod"],
            "Version": "1.0.0",
            "$type": "Common.Content.DataStructures.ContentPackManifest"
        },
        "$type": "Common.Content.DataStructures.VersionedAsset"
    }
    ``` 

    The primary things that are crucial in the above are the name, and the UID - which need to be unique.
    Our plan is to release a modding tool that automates the creation of the above, for now you could use an online generator (https://www.guidgenerator.com/) or simply change the UID yourself.

    The second thing is that the structure of the mod needs to follow the directory structure in the Xenonauts folder - which only has the templates for now.

  3. We're in the process of adding in support but we had to refocus on the Unity 2022 migration and 3.0 milestone sadly :(.
    At the moment the game only really supports swapping out values in the Templates - texture swaps (runtime loading of textures) needs to be implemented still unless you use Unity's asset bundle loading.

    Could you post the mod as a zip, that way I can delve a bit into it and I'll try to help debug it!

    I do need the logs of the game of the crash to better help see what's going on.

    We're going to consolidate all info needed for modding here once we continue work on it: https://github.com/GoldhawkInteractive/X2-Modding?tab=readme-ov-file#getting-started
    However, this is under construction and aside from the example mods doesn't contain anything yet.

    • Like 1
  4. Thanks for the follow up - feel free to tag me in posts again if you encounter it; in the most ideal case with a save!
    I will starting hunting for this from this side!

    What might be happening is that the outcome of a grenade blast "leaks" the information of the units it doesn't have sight on - as part of the routine that uses grenades to "tactical advantage" (I.e. blasting open choke points, etc), which might give that tile a "score" because it hits units... :confused:

    • Sad 1
  5. On 6/28/2023 at 12:16 AM, silencer said:

    Can be the same AI behaviour as in X-COM/XCOM - If Aliens spot one of your units, they see everyone.

    This is definitely the case in this game. 

    Going from the screenshot, I'd say the AI was doing something I wouldn't expect it to do. 
    As in, I don't see any enemy unit having sight on your unit. 

    But I'd need the save game to give more insight. 
    If an AI unit moves and at any point gets LOS onto units of yours, all AI units will know about this unit, and they'll retain LOS according to the game's sight rules (i.e. till end of turn)

    • Like 1
  6. Except for the Unity development console which lists errors, which we've hidden, there's none.
    There are minimal developer tools that are in the released game except for some cheats and debug information in GC. 
    Given that we work in Unity, most development tools are exposed through that.

    public static readonly string SHOW_FPS = "-showFPS";
    public static readonly string CHEAT_MODE = "-cheatmode";
    public static readonly string SHOW_DEBUG_UI = "-showDebugUI";
    public static readonly string DEBUG_AI = "-debugAI";

    The above are the command line arguments you can give the program. cheatmode & showDebugUI enable the cheats in GC & visualization.

    The GC has a grid data visualizer:

    Option B: Slot View

    List of GC cheats:

    ```

    • ALT-RMB: Select the entity represented by the GameObject under the cursor in the hierarchy.

    • ALT-SHIFT-RMB: Select the GameObject under the cursor in the hierarchy.

    • CTRL+SHIFT+V: Kill all aliens and win the mission.

    Health

    • M: Set entity under the cursor to full health.

    • B: Report mission state.

    • CTRL+SHIFT+M: Stun Vips and kill enemies.

    • N: Set entity under the cursor to 25% health

    • SHIFT+U: Set selected unit to 1000 HP

    • U: Set selected unit to Max Hp

    Time Units

    • Shitft+T: Set selected unit to 1000 TU

    • T: Set selected unit to Max Tu

    Others

    • O: Enable/Disable corner peeking

    • R: Refill ammo clip

    • K: Kill unit under the cursor

    • Y: Teleport selected unit

    • ALT+L: Toggle wall hiding

    • [: Switched to ConnectedAdjacentCoverFinder

    • ]: Switched to AdjacentCoverFinder

    ```

    • Thanks 1
  7. Very nicely done!

    If you do have specific questions, feel free to ask. I can't promise I'll reply in a timely fashion given that we're laser focused on the upcoming deadline, but I'll do what I can.

    The GeoscapeMovementSystem is best seen as a very trivial physics system (apply velocity, etc), the NavigationSystem indeed is the system that given a target converts it into a target velocity, etc. 

    This was done so we can have different strategies driving the movement (AI, physics, etc) - and is mostly a hold over from when we had different designs.

  8. On 4/26/2023 at 11:28 PM, asdfcyber said:

    I managed to do something:

    20230426231646_1.thumb.jpg.4ec85b3de6d9a9b455cb7b99717e04fe.jpg

    Not entirely correct though, 0° latitude isn't in the middle because Antarctica has been cut off and there might be other issues as well

    image.thumb.png.45c42d285467dd516cd69bd0fd1e2d46.png

     

    Edit: fixed it, though now it behaves weirdly around the north pole where the geoscape map goes higher than is physically possible.

    image.thumb.png.6736f978dc2587aaf1b5a248806ee40e.png

    Very nicely done! 
    Would you mind sharing the code & setup as I'm very interested in keeping track of what issues people run into during more complex modding.

    Also, are there any particular issues you ran into while rummaging around the codebase?

  9. Great to hear that it just works. I think some of the issues (CTRL-click) will be solveable once we move more things into configurable keybindings.
    In general we already allow rebinding 95% of the keys, so I think you should be good. 

    The moving between strategy screens using hotkeys I'll note down, I think it might be interesting for PC users as well - and then you can use it using configurable keybinding. 
    The default accept for a dialog might already be in the game, I think. (By default bound to Enter maybe?)

  10. On 2/10/2023 at 3:40 PM, Kamehamehayes said:

    Just so I'm reading this correctly, the first table is the chance that any ahot hit will hit a given body part and the second table is damage modfiers for said body part right?

    I remember that a soldier injury system was supposed to be tested where taking damage to certain body parts was supposed to hinder a soldier in specific ways. Is this system also original part of that mechanic but got grandfathered when it did not make it in?

    Pretty much spot on for both! We still have code for injuries and I suspect that modding it back in will be straightforward. 

    • Like 1
  11. 4 hours ago, SE_Weed said:

    What a fantastic job you guys are doing! This demo has me so excited, I cannot wait for the game or early access.

    Please forgive me if things mentioned here are already on the feature list or planned. I did do a search, but can't seem to find a list.

    Some minor observations:

    Armory screen.

    • It is not obvious that you can move between the solders using A and D keys.
    • Will there be a tab feature to go through the other parts of this screen, e.g. selecting load out types, gear, etc.?
    • Renaming the soldiers is always awesome, but the double-click to engage that edit was not obvious. Maybe a little pencil/edit symbol next to the name/picture?
    • More custom load out icons. :)
    • BIG feature ask here. when hovering over some equipment in the list, it would be great to see a comparison to the already equipped gear, with green text for better, red text for worse attributes.

    Manage Soldiers screen - love this window and the ability to sort by any column.

    • Maybe some popup tool tips on all the abbreviations?

    Storeroom Items screen

    • Maybe a right click on the item will bring up the Xenopedia explanation of what it is? or the stats on any item?
    • Are there plans to show capacity for each item, or just the total number of each item as it is now?

    Air Combat

    • Agreeing with other observations, it seems to need twitch reflexes. slowing it down somehow may help?
    • goes by too fast. I did not see the opportunity to move plane lines of attack, just rolls, etc.
    • Since we know the angle of fire for the UFOs, it would seem the fighters would/should attack from different angles to try to get to the rear, etc. Having the ability for flight engagement tactics?
    • If the air combat is just a vehicle for getting to the tactical combat, I guess emphasizing the benefits for air upgrades and their stats more so than now?

    Tactical Combat

    • Indirect fire - I could not figure out how to get my grenadier or the MARS unit to fire for effect, on an area or wall or whatever. They would only fire on alien targets.

    Steam Deck?

    • Are there plans to support the Steam Deck? If so, I have one and would love to test the demo there and report back on anything. However, if there are no plans to support the Steam Deck, I am not going to spend the time. :) It would be awesome, but there are only so many things you guys can tackle at one time. I totally get it.

     

    Overall, I just want to say thanks for all the care and love you are putting into the game. I really got that original XCOM feel, and that.... just one more turn feeling. I am not sure if any of this is helpful, but I appreciate the opportunity to post.

    Thanks!

     

    We haven't looked into Steam Deck support at all and there's no guarantee - but it would be helpful to maybe have an indication of what issues currently exist!

     

  12. Damage localization works by determining what part of the body got hit according to this table: 

    (First is Chance to Hit -> Location,  Second is Location -> Modifier on Damage)
     

    /// <summary>
    /// Provides the hitchance table for locational damage, per https://trello.com/c/aYcOD0N3/303-locational-damage
    /// Used in <see cref="SingleTargetDamage"/>.
    /// </summary>
    public static readonly OddmentTable<DamageLocation> DAMAGE_LOCATION_HIT_CHANCE = new OddmentTable<DamageLocation> {
        {15f, DamageLocation.Head()},
        {15f, DamageLocation.Neck()},
        {40f, DamageLocation.Body()},
        {4f, DamageLocation.LeftArm()},
        {4f, DamageLocation.RightArm()},
        {4f, DamageLocation.LeftLeg()},
        {4f, DamageLocation.RightLeg()},
        {14f, DamageLocation.Graze()},
    };
    
    /// <summary>
    /// Provides the modifiers to locational damage, per https://trello.com/c/aYcOD0N3/303-locational-damage
    /// Used in <see cref="SingleTargetDamage"/>.
    /// </summary>
    public static readonly Dictionary<DamageLocation, float> DAMAGE_LOCATION_MODIFIER =
        new Dictionary<DamageLocation, float> {
            {DamageLocation.Head(), 1.5f},
            {DamageLocation.Neck(), 1.25f},
            {DamageLocation.Body(), 1},
            {DamageLocation.LeftArm(), 0.75f},
            {DamageLocation.RightArm(), 0.75f},
            {DamageLocation.LeftLeg(), 0.75f},
            {DamageLocation.RightLeg(), 0.75f},
            {DamageLocation.Graze(), 0.5f}
        };
  13. I hadn't encountered that before in Unity games, but I suppose it makes sense. Wouldn't that make it easier to upgrade though?

    Yes, it does in general, however the issue is mostly in the third party plugins we use that also then need to be upgraded. Personally I would like to upgrade, even if just for the tooling and speedups that Unity now has. The problem is mostly that we simply don't have the budget at the moment and given the length of development the focus is and was on finishing the game. 

    About the hooks: if I want to have code execute every time the game uses a specific method I'd need to patch that method, and I haven't found many hooks in that native C# part. For instance, I would like to execute something when the strategy screen is loaded, but there is not something like an event I can subscribe to (or is there?)

    The core of our game is an ECS framework I developed that you will find under the Artitas namespace. The `World` class in this namespace is the general entry point to managing an ECS instance. This framework has two aspects: high level communication through messages inheriting from `IEvent`, which any `System` can listen to by annotating methods with `Subscriber`  - and low-level event handling based on changes to entities through `Family`.  In general we setup mechanics in `System`s, with each System listening to certain events and setting up various Family-s to respond to events. A System can listen to any event, define its priority, and if needed stop event propagation.

    To get an overview of compositions of entities we use, look into the classes that end in `Archetypes`.

    tl;dr: look at the inheritance of `IEvent` for all the high level communication you can hook into.

    A `World` can have `System`s registered and unregistered at runtime - the main way in which we want to support modding.

    The core entry point of the game is `XenonautsMain`, with `StrategyScreen` & `GroundCombatScreen` being the core entry points for each section of the game. In those Screen classes you'll find the setup of the World and its Systems.

    Executing Harmony.PatchAll gave a System.MissingMethodException about System.Reflection.PropertyInfo.op_Inequality. But for some reason I was being quite dumb and was building against .NET Framework 4.8 instead of 3.5 (Harmony luckily still supports that), so changing the build target actually solved it :)  

    Yeah, that'll be it :D. I'd love to be able to upgrade :')

    • Like 1
  14. Xenonauts 2 uses Unity predominantly as a rendering and authoring engine - most of the logic is actually unobfuscated, native C# (not inheriting from Monobehaviour) and all the hooks that the programmers have are exposed to modders.
    It did not make much sense to go with a scene-based approach because most content is not static - Ground Combat is fully generated at runtime, there are no separate Scenes.
    It's mostly UI or visual aspects which use Monobehaviour based inheritance, the rest is full native C#.

    I will provide an outline with an example once we are further along how to create proper mods using injection, which to my recollection does work but it has been some time since I last tested it.
    Can you be more detailed in what issues you ran into getting Harmony to work? 

    At the moment we are completely focused on the early access release though, so I can't commit any resources to helping you out, but if you can provide the information then I have it available when I will.

  15. On 10/13/2022 at 6:21 PM, Solver said:

    (For the tech team I guess) - is there something unexpected going on like using LINQ to log stuff over collections of game entities, or even reflection anywhere? Asking because we also log a fair bit in Old World but the perf impact of that is negligible, and we made several unpleasant discoveries with just how much LINQ murders perf in Unity.

    It's purely a result of extremely excessive logging (with I/O) we're doing during loading because we're trying to pin down a multithreaded bug inside Unity Engine when it comes to loading from asset bundles. Besides that, the level creation process hasn't been optimized yet because the structure of the level was very much still being changed (even now). 
    The primary problem with LINQ in Unity is the memory allocation & subsequent GC that's just terribly slow - a good resource with regards to that (and allocationless LINQ libraries): https://www.sebaslab.com/zero-allocation-code-in-unity/.

    With Old Worlds I hope that you're on 2021 LTS so you can at least use C# 9 & Span, sadly we're stuck on an old version of Unity :D

×
×
  • Create New...