Civ5-Artificial-Unintelligence-DLL icon indicating copy to clipboard operation
Civ5-Artificial-Unintelligence-DLL copied to clipboard

Please provide some basic info on how to participate/work with the code/get started.

Open rtwo opened this issue 9 years ago • 4 comments

Hi,

I hate the Stupidity of the Civ5 AI so much that I could imaging spending time working on this mod.

Can you provide some pointers on how to get started?

Specifically I would be interested in:

  • How do I build/install the dll? ** I saw a civfanatics.com post, and could probably find it again. ** Is there anything better? ** Do I need to know anything in particular?
  • Is there any way to simulate/tests this without building the dll and running the game? ** How do you verify that your changes are working as expected?
  • What is the state of the experimental branch?
  • Are you working on this allone?

rtwo avatar May 20 '15 18:05 rtwo

How to compile the DLL http://forums.civfanatics.com/showthread.php?t=479374

Simulating/Tests for me is building the DLL, and running the game with it using a mod - modbuddy. I often test with the development line of code, which can be frustrating if Delnar is in the middle of changes, so up to you there.

I use IGE mod and Firetuner to have the AI play against itself, and watch and validate what's happening as well as using the logs. All logs need to be turned on in config.ini

State of experimental branch changes depending on what Delnar is working on.

Delnar is working on it alone, but there are contribution and testing from others as far as I know.

Best, Nathan

On Wed, May 20, 2015 at 11:06 AM, Martin Hoch [email protected] wrote:

Hi,

I hate the Stupidity of the Civ5 AI so much that I could imaging spending time working on this mod.

Can you provide some pointers on how to get started?

Specifically I would be interested in:

  • How do I build/install the dll? ** I saw a civfanatics.com post, and could probably find it again. ** Is there anything better? ** Do I need to know anything in particular?
  • Is there any way to simulate/tests this without building the dll and running the game? ** How do you verify that your changes are working as expected?
  • What is the state of the experimental branch?
  • Are you working on this allone?

— Reply to this email directly or view it on GitHub https://github.com/DelnarErsike/Civ5-Artificial-Unintelligence-DLL/issues/1 .

notque avatar May 20 '15 18:05 notque

Well, if you aren't already familiar with Civ5's DLL source code, my primary piece of advice is to get familiar with it. It can be quite opaque and convoluted at times, especially when it comes to the AI-specific code, so spending that extra time just exploring how the functions fit together is worth it. "Find all References", "Go to Definition", and the back button are your best friends. I spent about 6 weeks just reading the source code before I even made my first DLL change, and even then it took me another 8 weeks or so just to get familiar with systems I was messing with; even now, after ~7 months, there are plenty of functions that I only have a vague understanding about. Take it slowly. It may even be worth it to read the original, unmodified source code instead of my modded and slightly messier one.

As for the specifics you asked about, notque's reply is on point. I've only got a couple more things to add:

  • When it comes to compiling the DLL, only the Visual Studio 2008 compiler works, so compiling with Clang or with Intel's compiler is out of the question. This is because the DLL relies on a couple engine libraries that were compiled with Visual Studio 2008.
  • Once you compile the DLL, you must include it in a mod created with ModBuddy, a tool in the Civ5 SDK. Do not forget to enable VFS for the DLL, otherwise it will not overwrite the original DLL. Once built, the mod can be enabled in-game just like a mod downloaded from the Workshop.
  • Don't forget to generate a new GUID if you're starting from scratch! Open up CvDllVersion.h for instructions on how to do so.
  • The only way to really know whether your changes work as intended is by testing them. Like notque, I tend to just run AI vs. AI games with the help of FireTuner and take notes as things progress. Occasionally when I'm trying to fix a specific bug, I will use IGE to help set things up so I can test them without going through AI autoplay turns.
  • The experimental branch is, well, experimental. I use it primarily to keep track of my own changes as I work on the next version of the mod. It contains a lot of new revamps, fixes, and tweaks, but it changes all the time: it's basically AuI's Nightly. If you're OK with having to deal with my annoying fixes that may or may not invalidate your entire week's work, working with the Experimental branch should make sure you aren't working with code that I may have already abandoned for the next version. Otherwise, fork your own version from the Master branch.
  • I am working on AuI alone, but I've been getting a lot of direct and indirect help from other modders, as well as the occasional minidump from a user that helps me hone in on bugs. I couple I can think of off the top of my head are notque, Gazebo and other developers of the Community Patch Project, and Ninakoru with his Smart AI project. Indirect help has come from JdH, WHoward, and BlouBlou in the form of mods that help point out problems that I would like to fix. Also, I know that a few people have taken interest in Civ5's AI code besides you; sharing notes with ThorHammerz might not be a bad idea.

DelnarErsike avatar May 20 '15 19:05 DelnarErsike

Thanks guys! I already spend some time reading the source code and I am not to worried about that part directlty. Indirectly, however, I feel that the approach of messing with stuff and then starting AI only games sounds really really anoying, time consuming and error prone. ;-(

I try to spend some time on this and see if I can get involved in one way or another. Is there an irc chat, mailinglist or anything else where people who colaborate on this hang out?

rtwo avatar May 21 '15 08:05 rtwo

It is time consuming, error prone, and possibly quite annoying, but that honestly doesn't stop me. Modifying the AI is like trying to herd a pack of retarded cats: if it works as intended, you're smiling internally, and if it doesn't work as intended, you might be annoyed, but also slightly entertained with seeing a dumb machine do something absolutely stupid at your behest without realizing its mistake.

Since I'm the only developer of the mod (on paper?), there are no mailing lists, IRC channels, or anything of the sort where people who want to contribute will meet to discuss things in private. When I want to communicate with someone or vice versa, we tend to either stick with the CivFanatics forums and the mod's main thread specifically, or occasionally have 1-on-1 conversations via CivFanatics' PM system, Steam chat, or something similar. I also tend to browse a lot of discussion boards and am willing to start up a conversation whenever I stumble upon a thread where either I can help someone or they can help me.

DelnarErsike avatar May 21 '15 15:05 DelnarErsike