Jump to content

asdfcyber

Members
  • Posts

    176
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by asdfcyber

  1. On 8/7/2023 at 1:21 PM, bifohe6676 said:

    I don't think the current map is Mercator, it looks way more like Equirectangular which doesn't suffer the projection issues as much.

    Yes, it's a modified equirectangular projection which removes Antarctica and also goes a bit further north than the north pole.

    I'm trying to make a mod that corrects flight paths and hopefully also other things like day/night and radar range, but trying to calculate predicted interception points is really hard in spherical coordinates

  2. On 8/15/2023 at 1:20 PM, PinkPanteRus said:

    Read this topic and don`t understand how to start modding.

    How do you open compiled game for changes?

    Do you use Unity Editor or what?

    No unity editor is involved, I edited the game's compiled code to make it load my own code (I explained my setup earlier in this thread). It's not exactly beginner friendly. As for replacing assets, it's probably possible to do it at runtime this way but I've never done it.

  3. On 5/8/2023 at 8:58 PM, Gijs-Jan said:

    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?

    Definitely! You can find it on github.com/asdfcyber/geoshape. Most of the work is figuring out how the code works (in particular, I'm not sure what the difference is between GeoscapeNavigationSystem and GeoscapeMovementSystem - I think the first sets future velocities/rotations that get applied in the second?). I'm not used to the level of abstraction in the code which adds some extra difficulty but so far I haven't encountered any showstoppers. Currently I'm trying to figure out how to find interception points, and after that I want to try to tackle radar range and accurate day/night cycles.

    Edit: oh, and the setup: I have a post-build event set up that copies the .dll to My Games/Xenonauts 2/Mods/Geoshape/Geoshape.dll and starts the game, and I modified the original Assembly-CSharp.dll to scan that mods directory for any modname/modname.dll that implements Xenonauts.IMod to load. These are all the modifications I made (I didn't care about code style here btw, this has to be reapplied every time there's a patch anyway and the compiler will replace certain things such as inverted conditions):

    public interface IMod
    {
        void Initialise();
    }
    
    public sealed class XenonautsMain : bunchofstuff
    {
        public static List<IMod> ActiveMods;
    
        public void LoadMods()
        {
            if (this.ActiveMods == null)
            {
                this.ActiveMods = new List<IMod>();
            }
            foreach (string dir in Directory.GetDirectories(Environment.ExpandEnvironmentVariables(
              "%USERPROFILE%\\Documents\\My Games\\Xenonauts 2\\Mods")))
            {
                string modname = Path.GetFileName(dir);
                Debug.Log("LoadMods is checking if mod '" + modname + "' exists");
                string modfile = dir + "\\" + modname + ".dll";
                if (File.Exists(modfile))
                {
                    foreach (Type type in Assembly.LoadFile(modfile).GetExportedTypes())
                    {
                        if (type.IsClass && typeof(IMod).IsAssignableFrom(type))
                        {
                            IMod mod = (IMod)Activator.CreateInstance(type);
                            if (mod != null)
                            {
                                this.ActiveMods.Add(mod);
                                mod.Initialise();
                                Debug.Log("LoadMods loaded '" + dir + "'  succesfully");
                            }
                        }
                    }
                }
            }
        }
      
        static XenonautsMain()
        {
          	// bunch of stuff
          	LoadMods();
        }
    }

    To get this compiled some compiler-generated things need to be turned into valid C#, so I rename fields like <>f__mg$cache0 fields to cache0 and delete most of the new LoadLocalizationFiles because anonymous types also become something weird

    • Like 1
  4. 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

    • Like 1
  5. 22 hours ago, Chris said:

    I guess I'm casting around to see if there's anything in the second category that I might have missed.

    Being able to parallelize research is the only thing that comes to mind in that category right now, but I don't think that would particularly well as an option. A free camera might also be nice (but also quite moddable, not sure how useful it would be tough).

    22 hours ago, Chris said:

    The option to reveal the entire map at the start of the battle is possibly one that might be worth looking at. It's probably not hard to do and while I think it would make the game less fun, I'm not necessarily against allowing players to play the game that way if they really want to.

    As a third option, would it be possible to keep building interiors hidden while revealing the rest?

    9 hours ago, Alienkiller said:

    The Quantum-Thing need only an stable Bugfix to work like it should

    No, it has been confirmed that per-base is how it is supposed to work right now:

    9 hours ago, Alienkiller said:

    That don´t need such Options [the most Gamers would cheat]

    There is a thin line between 'easy' and 'cheating' that every player should be allowed to define for themselves imho.

  6. Specifically options related to difficulty?

    • Option to let the quantum building thing reveal information globally instead of per base
    • Multipliers for a lot of things:
      • Building cost
      • Building base stats (storage space, power generated, radar range, etc)
      • Engineering cost
      • Item cost, airplane cost, build time
      • Damage taken and damage dealt
      • Soldier base stats
      • Aircraft fuel use
      • Ground combat rewards
      • Monthly report rewards
      • Panic
      • Amount of terror missions / base assaults / other 'hard' missions
      • Base survival rate
      • And probably a lot of other things
    • Option to reveal ground combat maps fully on landing
  7. In previous versions I have been able to reproduce it somewhat consistently, but I don't remember how exactly. I think it had something to do with moving the ARES a long distance and either alt-tabbing or moving another unit at the same time.

    Edit: the saves/logs here might help?

  8. The location of an Entity is stored as an Address object, which contains coordinates as i, j and floor (all integers) so you could call it a grid. Moving an entity from A to B is then as simple as setting the location to B. Unity is only used for rendering in this game, so this is all implemented outside of Unity. There's nothing stopping you from doing something like this in Unity though.

    By the way, don't underestimate the effort of making a game, especially if you want to make it multiplayer.

×
×
  • Create New...