1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Civilization II MGE User Interface Additions (CIV2UIA)

Discussion in 'Civ2 - Technical Support' started by FoxAhead, Oct 18, 2017.

  1. FoxAhead

    FoxAhead Chieftain

    Joined:
    Sep 7, 2017
    Messages:
    81
    Gender:
    Male
    Hi!

    I am glad to present you my new program. This time it is a set of useful enhancements to the game interface and a set of different fixes and tweaks.

    Description


    It is not a patch but launcher which means that the CIV2.EXE file will remain untouched. It uses DLL Injection technique to provide changes to the code on the fly.

    At the beginning of the project provided features were primarily aimed at improving the interface and displaying game data, but in no case on changing vanilla game rules or restrictions. But later the project gained additional features fixing some bugs and even tweaking game rules. Some of the improvements were taken from civ2patch project.

    So far only version Multiplayer Gold Edition 5.4.0f (Patch 3) is supported.
    Tested on Windows 98 SE, Windows 7 x64, Windows 10 x64.

    Features


    Here is what was implemented.

    1) First of all, it is support for the mouse wheel and middle button. Scrolling works in all sorts of lists. Scrolling the wheel while mouse pointer is over the specialists in city window changes specialists in both directions. Taxes can be changed in Shift-T window: just hover mouse pointer over corresponding bar and scroll the wheel. Also holding Ctrl while scrolling will zoom map in and out. Ctrl + middle button sets normal zoom level. Clicking with middle button on map centers map on that spot. Also map can be panned with middle mouse button.

    2) Scrollbar was added to Activate Unit popup dialog with more than 9 units in stack.
    upload_2017-10-19_5-40-12.png
    Now you can select any unit in stack even beyond limit of 9 units. You can scroll the list with the mouse wheel or by clicking on the scrollbar. But not using a keyboard, because in fact, the scrolling is emulated by redrawing the entire list of 9 units. This still can be improved, but now the only insignificant in my opinion the drawback is the flickering of the list when scrolling.

    3) For Settlers and Engineers internal work counter is shown over the unit sprite. This means that you can see how much work is exactly accumulated in unit. This and previous feature are very useful for rush terraforming.
    upload_2017-10-19_5-38-5.png
    For more information about how this counter works see links:
    https://forums.civfanatics.com/threads/90129/
    https://apolyton.net/forum/civiliza...ilization-ii/31110-info-settlers-engineers-gl

    4) Click-bounds of specialists sprites were corrected in city screen. In the original game, if you click as it seems almost to the center of the sprite, then the adjacent one on the right changes. This is especially noticeable in large cities.

    5) Game turn added to the status sidebar.
    upload_2017-10-19_5-39-12.png
    This is useful for making a decision about the beginning of the revolution according to the rules of the Oedo years. Revolution starts when the number of the turn is a multiple of four.

    6) In the Science Advisor screen current numbers of beakers progress is shown. This could be useful for precise control of research.
    upload_2017-10-19_5-41-37.png

    7) Correct CD audio tracks looping and displaying play progress
    CDAudioTrackProgress.png

    8) Game icon fix (visible in Alt+Tab popup)

    9) Resetting city name prompts, when restarting a new game without closing program

    10) Show buildings even with zero maintenance cost in Trade Advisor
    upload_2018-9-3_1-54-54.png

    11) Scrollbar for supported units in the city window. And a number of total supported units.
    upload_2018-9-3_1-53-10.png

    12) Also correction for 64 bit systems is included. Exactly the same version as I posted previously.
    https://forums.civfanatics.com/threads/civilization-ii-64-bit-editbox-patcher.622154/
    This means correct work of all input fields.

    13) No-CD patch is included.

    14) Enable multiplayer for Windows 8, 10 (should also work on an older OS)

    Also some enhancements from civ2patch project included:
    • reducing CPU usage when the application is idle
    and patches that affect some game rules and limitations:
    • AI hostility
    • Retirement year
    • Population limit
    • Gold limit
    • Map size limit

    Download and source code


    As usual it is all open source. You can check it at GitHub.
    https://github.com/FoxAhead/Civ2-UI-Additions/releases/latest
    Unzip 2 files to game's folder:
    1) Civ2UIA.dll
    2) Civ2UIALauncher.exe
    Run Civ2UIALauncher.exe.
    Click Play.
    If all is correct then game will start and launcher will close.
    This launcher will search for CIV2.EXE and CIV2UIA.DLL in its current folder and try to set all paths automatically. If you unzip these two files elsewhere then you have to provide correct paths to game and DLL. Also you can click "Create shortcut..." to create shortcut to launch game with UI Additions.
     
    Last edited: Sep 2, 2018
  2. catalin72

    catalin72 Chieftain

    Joined:
    Oct 31, 2008
    Messages:
    462
    Gender:
    Male
    Location:
    Romania
    Hello.I have Windows 7 32b and starting the launcher I have this error:

    Features added:
    - Mouse wheel support wherever possible
    - Ability to choose any unit in stack beyond limit of 9
    - Work counter for Settlers/Engineers is displayed
    - Click-bounds of specialists sprites corrected in city screen
    - Number of the game turn is displayed
    - Current research numbers are displayed in Science Advisor
    - 64 bit patch included
    This launcher will search for CIV2.EXE and CIV2UIA.DLL in its current folder and try to set all paths
    automatically.
    You can create shortcut to start game immediately. All selected paths are saved in shortcut.
    Game version Multiplayer Gold Edition 5.4.0f (Patch 3) supported only.
    BytesWritten 269
    Error: Dll not loaded
    Maybe need that DLL in system32 or system?
     
  3. DaringPaw

    DaringPaw Chieftain

    Joined:
    Sep 6, 2016
    Messages:
    35
    You do not address any of the network or connection issues for playing multiplayer games on Win 8 or Win 10. Does the game run on Win 8 or Win 10 with your patch and allow network connections? As far as I noticed, Civ 2 MGE MP did not work because of connection issues, moste likely because Win 8 and Win 10 might have different network adapter priority settings or management. Could you address this issue in your next launcher version, too, please? Or did you already, but didnt mention it? Or does Multiplayer mode work for you under Win 8 or Win 10 anyway? If so, please explain, how? Thank you a lot for this nice peace of work anyway.
     
  4. FoxAhead

    FoxAhead Chieftain

    Joined:
    Sep 7, 2017
    Messages:
    81
    Gender:
    Male
    catalin72, I tried very hard to reproduce your situation. Tested on several machines with Windows 7 (32 and 64 bit) but all is working fine.
    However, I added more checks in the game launch code, which may clarify the reason for the DLL not loading.
    You can try please download this new version 1.1 (build 42) and provide feedback.
    No, you don't have to put Civ2UIA.dll to the system's folders. Just put this two files next to CIV2.EXE and all must be fine. In addition, once you received such a message "Dll not loaded", it means that all files were detected correctly and start sequence was initialized.
    Launcher starts civ2.exe process, injects little code that must load DLL and then waits 5 seconds for response from DLL. This error message means that after 5 seconds no response was received.
    I can assume several reasons for this error. First, try to execute launcher "As administrator". Second, check logs of your antivirus/firewall software: may be it is preventing such little hacking actions as writing to process memory.
    Also I remember having bad experience with MS Game Explorer (GameUX.dll) interfering with old games like civ2.exe. When you run old game then this Game Explorer starts additional process rundll32.exe trying to connect Internet, and if it can't then this process hangs forever.
    If nothing helps then zip and send me your civ2.exe.

    DaringPaw, no, sorry, this is another big challenge for me. I did not touch any network part of the game and I believe it is much harder.
    Yes my patch (launcher) works at Windows 10 (tested on VMware) but it doesn't offer solution for multiplayer game issues. I' aware of patch from deeves (aka vinceho?) that does this.
    https://forums.civfanatics.com/threads/help-test-multiplayer-on-windows-8-10.572280/
    https://forums.civfanatics.com/threads/mge-civ-2-patch-project.570939/
    Did that Civ2 Patch Project works for you? May be later I will have time and courage to study this topic.
     
  5. catalin72

    catalin72 Chieftain

    Joined:
    Oct 31, 2008
    Messages:
    462
    Gender:
    Male
    Location:
    Romania
    Thank you for your efforts.Using my XP(32b) from a partition,no problems,I played few turns.In Windows 7(32b),without anti-virus and running launcher as administrator(before version 42 I used too these), now I have this message:

    BytesRead 512
    BytesWritten 269
    Error: Dll not loaded
     
  6. DaringPaw

    DaringPaw Chieftain

    Joined:
    Sep 6, 2016
    Messages:
    35
    Helllo FoxAhead, thank you for your reply. As I wrote in the other thread, the patch didnt work for me. I worked around all issues (including network connection issues) by installing an Oracle Virtual Box, running Windows XP + SP3 and some Intel Driver Package on it. It worked perfectly well. But it would be of course much more convenient to be able to just install and play Civ 2 MGE MP on Win 10 64 bit systems (if it doesnt crash, like it used to on 64 bit systems, when certain notifications popped up, e.g.). Well, would be awesome to see your launcher address the network connection issues Civ 2 MGE MP is facing on Win 8 and Win 10 systems, while also addressing those of 64 bit systems. That would be the perfect solution. Though I dont expect you to do this or that you will do this soon. So I will just stick with my workaround. But thank you for your great peace of work. Its one more step into the direction of a totally functioning Civ 2 MGE MP under Win 8 / Win 10 - and the other features are quite helpful. Great work!

    Oh, one more question comes to my mind: Does your launcher allow the use of the "unlimited patch"? Or some ai tweaks like "non-hostile ai patch"? I am not sure if I will use your patch just because of its additional practical features, since I think the advantages of the "unlimited patch" or the "non-hostile patch" might outweight the advantages of the practical features your launcher adds. Maybe you can also integrate or addess the issues the "unlimited patch" and the "non-hostile patch" address with your launcher? That would be great, too.

    Thank you again and all the best for you!
     
  7. FoxAhead

    FoxAhead Chieftain

    Joined:
    Sep 7, 2017
    Messages:
    81
    Gender:
    Male
    catalin72,
    thank you for your patience. This error does not give me rest. I fixed one potential place which could lead to this behavior. Could you kindly try again (v1.2 build 43)? If it does not help then I have to look at your civ2.exe - drop it somewhere on filesharing service.


    DaringPaw
    ,
    I knew this question will come sooner or later. As I mentioned my goal was to not change vanilla rules and limitations. Mostly because changing limits is more than just changing few bytes in memory. For example, you cant change more than 16 specialists in city because their state is stored in double word (32 bits). And actually those beyond 16 are "dummy" and don't affect any calculations. If you want to change this limit you have to find a way to store specialists data somewhere beyond this 32 bits and to find all places in exe-file that are using this data and patch them too. You cant just insert some extra bytes because all addresses are fixed and compiled. Also you have to patch code for saving and loading and that means incompatibility with the original game. And also that means deviating from original game rules because more than 16 specialist will bring you surplus (imagine SSC with 50 scientists).
    But despite my thoughts I'm totally agree with you that it would be nice to compile all those enhancements in one place. And since Civ2 Patch Project is open source I think it should be easy to adapt those features in my project.
     
  8. DaringPaw

    DaringPaw Chieftain

    Joined:
    Sep 6, 2016
    Messages:
    35
    Hello FoxAhead, thank you for your answer, again! It sounds at least like we could be somewhat confident that you will do it sooner or later. The "unlimited patch" doesnt address the specialists in cities, in fact it changes only very view things, i.e. individual and total limit of gold, cities and units (if I havent forgot anything), since computer memory is not an issue for Civ 2 anymore. Though the unlimited patch introduces a minor launcher itself as well. Hence, I was wondering if it is compatible with your launcher, too. It also offers an option like "no cd" and works for Test of Time, too. Maybe there were a few other options, but I do not remember them straight from the back of my head. But the important changes address only the individual and total limit of gold, cities and units, maybe even the upper limit of map size. Cheers!
     
  9. catalin72

    catalin72 Chieftain

    Joined:
    Oct 31, 2008
    Messages:
    462
    Gender:
    Male
    Location:
    Romania
    Hello.With 43,too,same error:
    BytesRead 512
    BytesWritten 269
    Error: Dll not loaded
    This is my exe,uploaded in MEGA:
    https://mega.nz/#!x4lCCALL!LQu40zU-NFXR7LGpEAdqsaNufDPUZxnbp2QgmE7G0i0
     
  10. FoxAhead

    FoxAhead Chieftain

    Joined:
    Sep 7, 2017
    Messages:
    81
    Gender:
    Male
    catalin72,
    Thank you for feedback! I looked at your civ2.exe and it is totally OK.
    The problem could be in GameUX and compatibility system.
    Try the folowing:
    Rename (or copy) civ2.exe to something like civ2_.exe.
    Then start launcher and choose manually this new file by clicking "Browse..." on the right of input field for "Game".
    Click Play.
    If this workaround works then the problem is in GameUX system. Renaming civ2.exe fools this system and starts game straight away.
    To ease launching game with UI Additions and not choosing every time new path to civ2_.exe you can create shorcut by clicking button "Create shortcut...". You should do this after choosing path. All paths selected will be saved in created LNK-file. Then you can just run this LNK.
     
  11. catalin72

    catalin72 Chieftain

    Joined:
    Oct 31, 2008
    Messages:
    462
    Gender:
    Male
    Location:
    Romania
    Good idea! :) It's OK now,thanks!
     
  12. FoxAhead

    FoxAhead Chieftain

    Joined:
    Sep 7, 2017
    Messages:
    81
    Gender:
    Male
    catalin72,
    I received another feedback that problem could be because of too little timeout for 5 seconds of waiting DLL to load. I released new version (1.3 build 44) with timeout set to 20 seconds and it helped other users without any renaming tricks. You could try this new version too.
     
  13. DaringPaw

    DaringPaw Chieftain

    Joined:
    Sep 6, 2016
    Messages:
    35
    Cant your workaround be used to start with Civ 2 with a modified exe or even the unlimited patch?
     
  14. FoxAhead

    FoxAhead Chieftain

    Joined:
    Sep 7, 2017
    Messages:
    81
    Gender:
    Male
    If I understood you correctly, you want to use my launcher to start already somehow patched/modified civ2.exe? I did not test it but I believe it should work as soon as civ2.exe is of correct version (5.4.0f Patch3) and has correct size of 2489344 bytes. I believe that my in-memory patches should not interfere with other changes in EXE like cd-patch, limits changes.
    Speaking of Civ2 Patch Project from deeves, it has the same technique of in-memory patching without changing EXE. So if you are saying about starting these two launchers together - no it is impossible.
    They are just two different projects built using different languages. But since Civ2PP is open source I could study work of deeves and adapt his solutions to my project.
     
    Last edited: Nov 11, 2017
  15. DaringPaw

    DaringPaw Chieftain

    Joined:
    Sep 6, 2016
    Messages:
    35
    Ok, as soon as I have installed everything again, I will test it - I mean the first option, you mentioned: Using some modified Civ2.exe. I did not refer to the Patch of deeves, though. To make this perfectly clear. Thx.

    For future development I really suggest focussing on Win 10 multiplayer network connection issues, and integrating it all in one patch or launcher, i.e. better ai attitude calculation, unlimited cities, gold, units totally and individuallly, 64 bit patch, etc.
     
  16. catalin72

    catalin72 Chieftain

    Joined:
    Oct 31, 2008
    Messages:
    462
    Gender:
    Male
    Location:
    Romania
    Yes,OK too for me.Thank you!
     
  17. FoxAhead

    FoxAhead Chieftain

    Joined:
    Sep 7, 2017
    Messages:
    81
    Gender:
    Male
    Hi!
    New version 1.5 (build 52) is out.
    Added:
    correct CD audio tracks looping and displaying play progress (since Vista there is a bug: cd-tracks just ended without starting next track),
    map panning with middle mouse button,
    no-CD patch,
    little fix for game icon in Alt+Tab popup.
    Added some features from civ2patch project: AI hostility, retirement year, population, money, map size limits.
    All options can be set and switched in launcher.

    Updated first post.

    Download:
    https://github.com/FoxAhead/Civ2-UI-Additions/releases/tag/v1.5
     
  18. Lord_Hill

    Lord_Hill Chieftain

    Joined:
    May 10, 2004
    Messages:
    15
    Location:
    London, UK
    Just wanted to chime in and say thanks for making this. Previously, I was using mastermind's patch, the Civ II unlimited patch and a separate AI aggression patch just to get this working on Windows 7, which was a bit of a pain. Much cleaner to just have all of that functionality in a single patch and the UI improvements are nice to have. No issues/bugs to report so far. I think you've got the right idea adding features from the various other patches floating around, perhaps the fix to stop the game hogging an entire CPU would be a good one to take a look at (he says despite having 0 knowledge of how difficult that would be!).
     
  19. FoxAhead

    FoxAhead Chieftain

    Joined:
    Sep 7, 2017
    Messages:
    81
    Gender:
    Male
    Lord_Hill,
    thank you! I'm glad that this project turned out to be useful for someone. It's very motivating!

    As you requested, fix for limiting CPU usage was adapted from civ2patch project.

    New version 1.6 (build 54) is released.

    Download:
    https://github.com/FoxAhead/Civ2-UI-Additions/releases/tag/v1.6
     
  20. FoxAhead

    FoxAhead Chieftain

    Joined:
    Sep 7, 2017
    Messages:
    81
    Gender:
    Male
    Hi!

    New version 1.7 (build 56) released.
    This time I managed to fix multiplayer game for Windows 8 and 10. Older OS must work also.
    The problem was in new big default value for socket buffer length of 0x10000 bytes. The multiplayer fix restricts this value back to the old default 0x2000 value that the game expects.
    I tested multiplayer on VM and was able to play several turns between Win98, Win7 and Win10. All seems to work correctly.

    Please test and provide some feedback if possible.

    Download:
    https://github.com/FoxAhead/Civ2-UI-Additions/releases/tag/v1.7
     
    Last edited: Nov 25, 2017

Share This Page