Coder Social home page Coder Social logo

siegeengineers / auto-mods Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 11.0 62 KB

some data mods, generated programmatically, so they can be recreated automagically for every new patch

License: MIT License

CMake 1.19% C++ 61.97% Shell 13.08% C 23.76%

auto-mods's Introduction

auto-mods

some data mods, generated programmatically, so they can be recreated automagically for every new patch

We just do everything auto!ยซ - MbL, 2020

Published Mods

Build instructions

Cloning

NOTE: Remember that you need to clone this repository with its submodules!

git clone --recurse-submodules https://github.com/SiegeEngineers/auto-mods.git
cd auto-mods

Installing dependencies

You'll need:

  • cmake
  • gcc, g++
  • libboost-iostreams-dev
  • libboost-program-options
  • zlib
  • lz4

Dependencies

on Ubuntu (e.g. WSL)

sudo apt update
sudo apt install --fix-missing gcc g++ cmake \
libboost-iostreams-dev libboost-program-options-dev \
zlib1g-dev liblz4-dev

on OSX

xcode-select --install #this is to make sure xcode is installed for access to zlib1g-dev and liblz4-dev
brew install cmake
brew install boost
brew install gcc
brew install gdb

Compiling

Inside the repository root use the following commands:

mkdir build
cd build
cmake -DSTATIC_COMPILE=TRUE ..
cmake --build .

Note: You can also run ./scripts/build.sh from the project root.

You should now have an executable create-data-mod in the build folder. Hooray!

Debugging (GDB on Ubuntu)

  1. Ensure gcc tools are installed: sudo apt-get install build-essential gdb

Now we have two debug options:

  1. Debug via GDB on the terminal...
./buildForDebugger.sh  # make sure to run this from the project root
gdb build/create-data-mod
> b main
> run
  1. OR use the VSCode visual debugger, by going to the debug sidebar on the left, and running the (gdb) Build and Launch configuration. This will automatically make a debug build and run it. You can set breakpoints in the visual debugger.

Right now it runs create-data-mod with no parameters. For testing, you can add arguments to .vscode/launch.json in the args parameter.

Usage

Execute the executable without parameters to get usage instructions.

$ ./create-data-mod
Usage: ./create-data-mod <mod-identifier> source.dat target.dat
Where <mod-identifier> is one of the following, or multiple of the following joined by a +:
    community-games
    exploding-villagers
    exploding-villagers-extreme
    exploding-kings
    exploding-relic-monks
    rewarding-snipes
    flying-dutchman
    kidnap
    no-wall
    random-costs
    random-costs-light
    random-tech-costs
    random-unit-costs
    teamwork
    x3
    x9
    x256

For example, in order to patch the current dat file with the Flying Dutchman modifications, one might execute

./create-data-mod flying-dutchman ~/aoe/Aoe2DE\ proton/resources/_common/dat/empires2_x2_p1.dat ./empires2_x2_p1.dat

And then use the resulting empires2_x2_p1.dat in the current directory for whatever.

In order to patch the current dat file with the Flying Dutchman modifications AND the Exploding Villagers, execute

./create-data-mod exploding-villagers+flying-dutchman ~/aoe/Aoe2DE\ proton/resources/_common/dat/empires2_x2_p1.dat ./empires2_x2_p1.dat

And then use the resulting empires2_x2_p1.dat in the current directory for whatever.

auto-mods's People

Contributors

filmcoder avatar franciscoda avatar hszemi avatar simonsan avatar twise2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

auto-mods's Issues

CI/CD - Github Actions

Do we want to activate Github Actions in this repository and have some basic CI? For the beginning just to check if it still builds when people PR? In the future maybe even autoupdating mods and uploading them to the Mod workshop after a new update or so?

Usage:

  • Testing (does it build)
  • check code formatting
  • Autoupdating mods + uploading to modworkshop
  • Releasing binary and distribute it via Github Releases

[Teamwork] Byzantine castle HP overflow and trade carts getting stuck

Byzantine castle HP overflow occurs with 4 byzantine players or with 3 byzantine players and a fourth with hoardings and architecture. Easy fix would be to add hoardings to the banned shared tech list as that'll prevent the overflow from ever happening while still leaving Byzantines with the highest castle HP.

Trade carts keep getting stuck at the periphery of the market. Happens in every game once caravan is researched by 4 players. This needs some kind of collision avoidance. Haven't tested trade cogs or interactions with caravanserais. Easiest fix would be to make the market walkable. Well, I don't actually know how difficult that would be to script in TBH. Perhaps make only the center solid and leave the peripheries walkable? Either way, this would fix the problem without changing gameplay too much like making making trade carts themselves phase through each other. Docks and trade cogs probably need the same treatment but I haven't tested this...

Thanks!

Random cost mod discussion

@HSZemi thanks for the feedback! I have a couple of questions and notes.

My friends and I discovered the random mod a few weeks ago and have been avid fans. For the first few games, it was fun every time, but after a couple days we quickly noticed that most of random mod games had devolved into one or both of these two fairly predictable metas:

  1. Castles are cheap. Castles are normally 650 stone, so in the random mod if they are significantly cheaper (they almost always are) the game devolves to castle spam around your base with a race to a wonder.

  2. Discover spam unit with a very low cost as quickly as possible. In many scenarios, the random cost mod devolves into an aging up race to see who can discover a cheap spammy unit the fastest. If someone discovers a spam unit just slightly before someone else, the game is over, as they will overrun others without time to respond. Furthermore, the spam unit negates the need to maintain an economy, and so a major element of gameplay.

I believe random mod has a replay value problem. Those above metas are hilarious and a joy the first few times. After that, they become tedious and repetitive. I think a random mod, ultimately, should give a variety of random experiences and fresh strategies to players so they always need to think on their feet, but if the random mod usually falls into two metas this is no longer the case. I think one of the beauties of the random mod itself is that it DESTROYS the traditional AOE2 metas. Every day, there's a new meta. It feels fresh and new and it forces you to think out of the box, after you've been playing AOE for so long and dust has settled on your brain and you can basically play the game without thinking.

But I agree that the random mod is so fun at first that it should probably remain as it is. I propose a new mod, something like "Random Mod Balanced" targeted with some sane defaults, like preventing castle spam and units costing 1 wood, that players can transitions into if they become fans of the default random mod and want to transition into something more nuanced. Is this something you would considering publishing through Siege Engineers if I make the code mods for it? A lot of my friends have stopped playing Random Mod because of the metas and they said they'd be interested to come back if we there was a more balanced version that prevented those two metas I mentioned.

If not, do you mind giving me some information on how to set up a build system? Is it a lot of work to set up? Do ya'll have a server somewhere that publishes the new random mod every day? Is that script in the repo here? I don't see any devops scripts. And how do you detect when new AOE patches go out, and thus when a new fresh dat is available for moding? Does AOE provide an api or something for getting the fresh dat file?

Thanks for your time!

Originally posted by @FilmCoder in #12 (comment)

[Teamwork] Guilds and saracen market bonus

Researching guilds resets the market bonus to 15% and overrides the Saracen market bonus. Worse still, this happens for all the players including the Saracens. Probably should make both guilds not override the saracen market bonus or prevent sharing for both

(Suggestion) Add 50x mod

256x crashes way too many times. The reason as to why this behaviour occurs is unbeknownst to me. Oddly enough, 9x seems to function quite fine. Perhaps a middle ground of around 50x could guarantee enough chaos whilst minimizing the quantity of bugs brought to the game when using 256x?

New Civs don't have 9X Castle Techs

I'm not able to confirm this myself because I haven't bought the DLCs yet. But I have a bug report on my mod (which uses your 9x tech mod as a base), where the guy is saying Roman's castle techs are not 9x researchable. Just passing this message along, I would fix it myself but I only really know how to tweak tech values, I do not know how to make techs repeatedly researchable.

Make auto mods more auto

I just thought that we could give the possibilities to (automagically) create DAT file patches from a customized DAT in a mod and an original version. These patches we could store in a human-readable form (yaml, toml) and parse them in auto-mods to then reapply them after game patches. ๐Ÿค” We could get around some boilerplate with this for each mod-patch I guess?

Hmm, what do you people think? Is it just a brainfart and I'm overlooking something?

As the DAT-file patch in human-readable form is describing somehow the whole process, we can also use it to verify and therefore test what we did when applying our patch to a new DAT.

[9x Tech Mod] Researching supplies twice crashes game

Researching supplies a second time crashes the game with Armenians, Georgians, and Persians.

Also tested with Bulgarians and it did not crash with them, so it seems like its just the new/reworked civs.

EDIT: Also crashed with Celts so not just new civs.

Cannot be compiled on modern Ubuntu versions

genieutils/CMakeLists.txt requires libiconv-dev, however this library doesn't exist on modern Ubuntu versions, as libiconv-dev has since been merged with libc6-dev. CMake doesn't recognize the libiconv-dev section of libc6-dev, causing compile to fail with error

CMake Error at genieutils/CMakeLists.txt:19 (find_library):
  Could not find iconv using the following names:


-- Configuring incomplete, errors occurred!
See also "/media/imperatorstorm/Storage/auto-mods/build/CMakeFiles/CMakeOutput.log".

Output .dat file seems corrupted

Hello, I've been trying to run this script in order to create my own automated mod.

I followed the instructions on how to run this on Ubuntu, they worked great for installing the dependencies and compiling. However when I run it, I either encounter an error, or the code executes fine but then the output data file can't be opened with Advanced Genie Editor, whereas the original 'empires2_x2_p1.dat' can without problem.

Examples of what I tried:

  • ./create-data-mod x3 ../../empires2_x2_p1.dat ../../test.dat

Result:

Loading ../../empires2_x2_p1.dat...
Terrains: 200
Applying the following modifications in order:
x3
terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 3) >= this->size() (which is 0)
Aborted (core dumped)

  • ./create-data-mod random-costs ../../empires2_x2_p1.dat ../../test.dat

Result:

Loading ../../empires2_x2_p1.dat...
Terrains: 200
Applying the following modifications in order:
random-costs
terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 18446744073709538561) >= this->size() (which is 1701)
Aborted (core dumped)

  • ./create-data-mod + ../../empires2_x2_p1.dat ../../test.dat (I was trying to make it not apply any mod, just load and save)

Result:

Loading ../../empires2_x2_p1.dat...
Terrains: 200
Applying the following modifications in order:
Unknown mod identifier: ''
Unknown mod identifier: ''
Saving as ../../test.dat...
Terrains: 200
Done.

The execution seemed successful, but then I noticed that the saved 'test.dat' is different from the original 'empires2_x2_p1.dat'. The first one being at 3731Ko and the second one at 4065Ko, so clearly they're different. On top of that, when I try to open test.dat with the Advanced Genie Editor, this is what I get:
age

I'm wondering if you also encounter the same issue in your environment with the latest AOE2DE patch. I've tried running your code on both Windows and Ubuntu and some behaviors were different but the simple loading/saving gave the same result as shown above on both OS.

Do you have any idea of what I can try to make it work?

I appreciate your help.

How do I run this with a debugger?

@FranciscoDA Sorry, please excuse me if this question seems stupid. I can't seem to get create-data-mod running with the gdb debugger. Are there steps you all have taken to get that working? I tried building with debug flags:

cmake -DSTATIC_COMPILE=TRUE -DCMAKE_BUILD_TYPE=Debug ..
cmake --build .

And I also tried adding set(CMAKE_BUILD_TYPE Debug) to CMakeLists.txt

Is there something I'm missing? Shouldn't that add the -g flag to the g++ compiler under the hood so we can run gdb with symbol tables?

But when I do gdb create-data-mod I get: (No debugging symbols found in create-data-mod)

Once again I apologize if this question seems stupid, I'm pretty rusty with my c++ and makefiles

Burgundians - subsequent tech researches are not 33% cheaper food

Burgundians have a civ bonus that makes economic techs cost 33% less food. Chinese have a similar bonus that reduces costs on techs. For chinese all of 9x techs are reduced. Burgundian's cost reduction however only applies to the first tech.

Whatever means of implementing the chinese tech cost reduction bonus to work for all 9x techs should be used for burgundians as well for consistency.

Also, thank you for the quick fix on the last bug report I submitted

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.