Jump to content

Gijs-Jan

Development Team
  • Posts

    329
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Gijs-Jan

  1. Cheers for the repro case! It's been fixed and we hope to release a hotfix for it soon.
  2. Cheers, thanks for the save - I'll have this one fixed quickly!
  3. 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.
  4. You can find the details around logs & saves here: (My Documents/My Games/Xenonauts-2/) Locally I can enable the example mods, so I'd love to see the logs to check if anything is going wrong.
  5. 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.
  6. 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.
  7. Could you provide us with the save game on the Strategy prior to starting the map?
  8. Thank you for providing the save game, I'll jump right on it!
  9. Do you maybe have a save file during the mission you could share?
  10. 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...
  11. 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)
  12. 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: 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 ```
  13. 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.
  14. 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?
  15. Excellent, thank you! I'll try to take a look as soon as possible. Is the bug reproducible for you when loading from the start of turn? And what are the steps to reproduce the bug?
  16. 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?)
  17. Pretty much spot on for both! We still have code for injuries and I suspect that modding it back in will be straightforward.
  18. 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!
  19. 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} };
  20. > 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 :')
  21. 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.
  22. 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
  23. Support for runtime code-centric mods has been built in from the start. The game has been programmed from a "hook" perspective and I will make sure we release documentation on how this works once we fully release. I've also already looked into Harmony / other runtime patchers in the past to check compatibility and we're explicitly keeping things in C# (as opposed to IL2CPP) to provide mod support for this. My plan is to release a public example project that shows how to use it.
×
×
  • Create New...