Modding the official Nomad game mode

Hi, I wanted to mod the official Nomad game mode to add some more options to it such as an optional starting scout or a treaty period. I know there are advanced game settings but I think the official Nomad mod is better and more popular, too.

Unfortunately I couldn’t find a way to simply open the official Nomad game mode and apply some modifications to it. Instead I had to use the template or create an empty new game mode. I was able to look into the Advanced Game Settings on GitHub but it is a bit overwhelming, unnecessary complex and also not really what I wanted from a technical standpoint since it does some thing quite differently compared to the official Nomad game mode.

Is there a way for me or do I basically have to remake and mirror the entire Nomad game logic? I am super new to AoE4 modding, but quite experienced in modding or programming in general.

There’s no easy way to just open an existing game mode, I don’t think. You’d need to be able to open the archive itself (which for game modes is Data.sga - /scar/gamemodes).

At the end of the day you’re going to have to create a new standalone game mode with a new name, even if you’re able to copy logic across.

1 Like

Okay thanks for your reply!

Sorry if this is a stupid question: But is there at least some predefined prelude library or functionality to emulate the Standard or Normal game mode with its win conditions?

I honestly don’t know enough about SCaR / game mode scripting. You’d probably be able to get a yes / no for that from creating a new game mode mod in the Content Editor.

It looks like it comes with several templates - maybe pick the one with examples to get started (if you haven’t done so already):

image

I have based my mod so far on the template with examples but it is unfortunately very far from the Standard game mode and thus my best chance at emulating the Nomad game mode win conditions is to try to dissect Advanced Game Settings on GitHub which is unfortunate for reasons described above.

It would be cool if there were more templates to choose from besides royal rumble.

edit: I think I found the solution. It is actually quite simple. For sacred, wonder and conquest win conditions you simply have to import the following scripts:

import("winconditions/religious.scar")          -- Support for player winning by holding all sacred sites.
import("winconditions/wonder.scar")             -- Support for player winning by defending their wonder.
import("winconditions/conquest.scar")           -- Support for landmark victories.
1 Like

You are wrong, that mod is not really overcomplicated… It just follows much more reasonable and maintainable structure and programming practices then standard scripts…

If you want to have reliably working treaty you will need complex mode that implements own logic for all win conditions. Otherwise it won’t behave correctly…

On your questions how to create a copy of nomad:

  1. Create empty gamemode
  2. in .rdo for wincondition change settings to nomad (thus it will use nomad attributes)
  3. in winconfition scar file import nomad gamemode (as you really dont need to do anything differently)
  4. in .not define all necessary options, which can be again found in the gamemode scripts or compiled .rdo files, but these might be little bit hard to read

For scout:
A) either add him to tuning pack for each civ
B) borrow script that spawns unit from other mods, which means that you either use existing nomad random spawn script or you will write your own…

For treaty:
give up, that’s my advice… if you feel that AGS is overcomplicated then be prepared that’s exactly what you will need if you want it to work correctly… and even then it will not be perfect… or you can once again take it from the nomad mod… and never get idea of making treaty longer then few minutes (<5) as you will break the game as anyone can e.g. capture sacred site, build wonder during the treaty, if you implement naïve version.

So just ask yourself why ? It’s not really that one version is more popular then other. Most people just don’t bother with the mods…

Well on why the mod behaves differently… well official nomad is trash. It has multiple issues and is completely unsuitable for anything other than 3 vils start, which it itself break as HRE starts with prelate and there you can notice major issue. It has only 3 spawn per player… Also algorithm they use is everything but truly random spawn. All 3 spawn points that player has are on a single circumference and the distance is extremely small… Thus you end up with all villagers very close to each other, instead of the nomad mods or AoE2 nomad where spawn are completely random…

1 Like

@Woprok thank you for your elaborate reply!

With “unnecessarily complex” I meant that it has way more features than I need for my own version of nomad and thus is too complex to be used as template. When looking at its code I also saw that it was kind of well engineered with lots of helper functions etc which is nice for maintenance and feature development but not so nice if you do not even have a fully developed picture of how AoE4 mods work.
One can clearly see that the dev(s) behind the Advanced Game Settings clearly know what they were doing.

I didn’t know it was possible to change settings in .rdo to nomad. Will try that out once I am working on the mod again.
I have not found a way to import a nomad gamemode in my .scar file but maybe that is connected to the point above?
I also have not yet seen a .not file. So far I have kind of successfully populated my .rdo file with the custom options I wanted to add. So I have all the options I need but they have no functionality so far. :sweat_smile:

I already worked on the scout and kinda made it work. It was pretty easy given the examples template that spawns a bunch of spearman.

I didn’t know that treaty was such a mess. Generally I just wanted to allow for a treaty time between 0 and 5 minutes so probably most of what you mentioned would not be affected. That’s also a way of how to simplify things. :smiley: The idea behind treaty is to help noob players to setup their town centers without disruptions and nothing more.

I used to use the Advanced Game Settings to host Nomad FFA games and found it to be nice, however, some things are in my opinion better in the official nomad mode. These are:

  • The aforementioned spawning locations. Most player like the way the official nomad mod spawns units in a bit closer proximity.
  • Also starting villagers in the official mod seem to be way less likely to be stuck. I don’t know if this is just a feeling or if devs made some pathing checks to secure that. E.g. test if each villager can properly path to the other villagers and only then spawn it there.
  • The starting town center costs no resources which has some advantages. E.g. attacking a town center under construction won’t lose resources to build a new one. Obviously starting resources have been adjusted for that.

Since I am talking to an expert here: I had an idea for another option to make the host select the civilizations for all players. The enumerated options are “selected”, “random” and “unique random” where “selected” allows each player to pick their civilization, “random” ignores player civilization selections and overwrites the civilization with a random one and “unique random” is the same as “random” but asserts that each player is assigned a unique civilization. Unfortunately I am not even sure if an option like that is workable since I have never seen it anywhere before. However, it would be a really cool option to diversify the civilizations in a game.

That’s a typo, it was supposed to be .rdo :smiley:

this is needed to turn on nomad starting condition from civ tuning data

and the options are defined right under it…
data:scar\winconditions\nomad.bin contains all options present in the nomad, but thats compiled file in binary, thus readable only as hexdump
important part is behind the numbers as it contains option keys (I will leave the hexdump as last part of this comment), Some of them are present also in standard_mode.scar or other script files

well and about the script data:scar\gamemodes\standard_mode.scar is used, thus all you need is to replace all imports with single import(“standard_mode.scar”) as your gamemode will want to use eventually custom script (setup part will reference name of your gamemode script)

00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000020 00 00 00 00 00 00 00 00 00 00 00 00 49 0A 00 00 …I…
00000030 00 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 …
00000040 FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 …
00000050 00 00 00 00 20 0A 00 00 00 00 00 00 01 00 00 00 … …
00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000070 00 00 00 00 FC 09 00 00 00 00 00 00 00 00 00 00 …
00000080 00 00 00 00 D4 09 00 00 00 00 00 00 17 00 00 00 …
00000090 00 00 00 00 C3 09 00 00 00 00 00 00 00 00 00 00 …
000000A0 00 00 00 00 F6 9B AB 00 00 00 00 00 00 00 00 00 …
000000B0 00 00 00 00 00 00 00 00 01 9C AB 00 00 00 00 00 …
000000C0 00 00 00 00 00 00 00 00 00 00 00 00 51 09 00 00 …Q…
000000D0 00 00 00 00 39 00 00 00 00 00 00 00 05 09 00 00 …9…
000000E0 00 00 00 00 3B 00 00 00 00 00 00 00 D3 08 00 00 …;…
000000F0 00 00 00 00 21 00 00 00 00 00 00 00 00 00 00 00 …!..
00000100 00 00 00 00 68 00 00 00 00 00 00 00 02 00 00 00 …h…
00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000140 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 … …
00000150 00 00 00 00 3B 7E 9A 28 CA 3E 62 8C 00 00 00 00 …;~.(.>b…
00000160 00 00 00 00 00 00 00 00 00 00 00 00 36 08 00 00 …6…
00000170 00 00 00 00 1C 00 00 00 00 00 00 00 46 54 AA 00 …FT…
00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000190 01 00 00 00 78 06 00 00 00 00 00 00 03 00 00 00 …x…
000001A0 00 00 00 00 45 06 00 00 00 00 00 00 1B 00 00 00 …E…
000001B0 00 00 00 00 4A 54 AA 00 00 00 00 00 00 00 00 00 …JT…
000001C0 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 …
000001D0 00 00 00 00 05 00 00 00 00 00 00 00 A0 05 00 00 …
000001E0 00 00 00 00 D8 03 00 00 00 00 00 00 08 02 00 00 …
000001F0 00 00 00 00 90 00 00 00 00 00 00 00 08 00 00 00 …
00000200 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 …X…
00000210 00 00 00 00 19 00 00 00 00 00 00 00 73 2B AB 00 …s+…
00000220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000230 76 2B AB 00 00 00 00 00 00 00 00 00 00 00 00 00 v+…
00000240 00 00 00 00 76 2B AB 00 00 00 00 00 00 00 00 00 …v+…
00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000260 00 00 00 00 72 65 76 65 61 6C 5F 66 6F 77 5F 6F …reveal_fow_o
00000270 6E 5F 65 6C 69 6D 69 6E 61 74 69 6F 6E 00 00 00 n_elimination…
00000280 00 00 00 00 00 00 00 00 00 00 00 00 58 01 00 00 …X…
00000290 00 00 00 00 0A 00 00 00 00 00 00 00 9E A3 AA 00 …
000002A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
000002B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
000002C0 00 00 00 00 AD A7 AA 00 00 00 00 00 00 00 00 00 …
000002D0 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 …
000002E0 00 00 00 00 03 00 00 00 00 00 00 00 E5 00 00 00 …
000002F0 00 00 00 00 12 00 00 00 00 00 00 00 51 54 AA 00 …QT…
00000300 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000310 ## ## AA 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000320 00 00 00 00 01 00 00 00 00 00 00 00 92 00 00 00 …
00000330 00 00 00 00 12 00 00 00 00 00 00 00 52 54 AA 00 …RT…
00000340 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000350 F3 A6 AA 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000360 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 …@…
00000370 00 00 00 00 11 00 00 00 00 00 00 00 53 54 AA 00 …ST…
00000380 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000390 F4 A6 AA 00 00 00 00 00 00 00 00 00 00 00 00 00 …
000003A0 00 00 00 00 00 00 00 00 00 00 00 00 6F 70 74 69 …opti
000003B0 6F 6E 5F 66 6F 77 5F 72 65 76 65 61 6C 00 6F 70 on_fow_reveal.op
000003C0 74 69 6F 6E 5F 66 6F 77 5F 65 78 70 6C 6F 72 65 tion_fow_explore
000003D0 00 6F 70 74 69 6F 6E 5F 66 6F 77 5F 63 6F 6E 63 .option_fow_conc
000003E0 65 61 6C 00 6F 70 74 69 6F 6E 5F 66 6F 77 00 00 eal.option_fow…
000003F0 00 00 00 00 00 00 00 00 00 00 00 00 AC 01 00 00 …
00000400 00 00 00 00 10 00 00 00 00 00 00 00 91 A3 AA 00 …
00000410 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000420 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000430 00 00 00 00 AC A7 AA 00 00 00 00 00 00 00 00 00 …
00000440 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 …
00000450 00 00 00 00 04 00 00 00 00 00 00 00 39 01 00 00 …9…
00000460 00 00 00 00 12 00 00 00 00 00 00 00 4D 54 AA 00 …MT…
00000470 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000480 EE A6 AA 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000490 00 00 00 00 01 00 00 00 00 00 00 00 E6 00 00 00 …
000004A0 00 00 00 00 12 00 00 00 00 00 00 00 4E 54 AA 00 …NT…
000004B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
000004C0 EF A6 AA 00 00 00 00 00 00 00 00 00 00 00 00 00 …
000004D0 00 00 00 00 00 00 00 00 00 00 00 00 93 00 00 00 …
000004E0 00 00 00 00 12 00 00 00 00 00 00 00 4F 54 AA 00 …OT…
000004F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000500 ## ## AA 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000510 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 …@…
00000520 00 00 00 00 12 00 00 00 00 00 00 00 50 54 AA 00 …PT…
00000530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000540 F1 A6 AA 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000550 00 00 00 00 00 00 00 00 00 00 00 00 6F 70 74 69 …opti
00000560 6F 6E 5F 73 74 61 72 74 5F 61 67 65 5F 34 00 6F on_start_age_4.o
00000570 70 74 69 6F 6E 5F 73 74 61 72 74 5F 61 67 65 5F ption_start_age_
00000580 33 00 6F 70 74 69 6F 6E 5F 73 74 61 72 74 5F 61 3.option_start_a
00000590 67 65 5F 32 00 6F 70 74 69 6F 6E 5F 73 74 61 72 ge_2.option_star
000005A0 74 5F 61 67 65 5F 31 00 6F 70 74 69 6F 6E 5F 73 t_age_1.option_s
000005B0 74 61 72 74 5F 61 67 65 00 00 00 00 00 00 00 00 tart_age…
000005C0 00 00 00 00 A4 01 00 00 00 00 00 00 10 00 00 00 …
000005D0 00 00 00 00 4B 54 AA 00 00 00 00 00 00 00 00 00 …KT…
000005E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
000005F0 00 00 00 00 00 00 00 00 00 00 00 00 A9 A7 AA 00 …
00000600 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000610 00 00 00 00 10 00 00 00 00 00 00 00 04 00 00 00 …
00000620 00 00 00 00 31 01 00 00 00 00 00 00 12 00 00 00 …1…
00000630 00 00 00 00 9F A3 AA 00 00 00 00 00 00 00 00 00 …
00000640 00 00 00 00 00 00 00 00 70 9E 00 00 00 00 00 00 …p…
00000650 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 …
00000660 00 00 00 00 E2 00 00 00 00 00 00 00 0E 00 00 00 …
00000670 00 00 00 00 A0 A3 AA 00 00 00 00 00 00 00 00 00 …
00000680 00 00 00 00 00 00 00 00 71 9E 00 00 00 00 00 00 …q…
00000690 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
000006A0 00 00 00 00 8E 00 00 00 00 00 00 00 13 00 00 00 …
000006B0 00 00 00 00 A1 A3 AA 00 00 00 00 00 00 00 00 00 …
000006C0 00 00 00 00 00 00 00 00 AA A7 AA 00 00 00 00 00 …
000006D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
000006E0 00 00 00 00 40 00 00 00 00 00 00 00 0D 00 00 00 …@…
000006F0 00 00 00 00 56 2B AB 00 00 00 00 00 00 00 00 00 …V+…
00000700 00 00 00 00 00 00 00 00 57 2B AB 00 00 00 00 00 …W+…
00000710 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000720 00 00 00 00 72 65 73 6F 75 72 63 65 73 5F 6D 61 …resources_ma
00000730 78 00 72 65 73 6F 75 72 63 65 73 5F 76 65 72 79 x.resources_very
00000740 5F 68 69 67 68 00 72 65 73 6F 75 72 63 65 73 5F high.resources
00000750 68 69 67 68 00 72 65 73 6F 75 72 63 65 73 5F 73 high.resources_s
00000760 74 61 6E 64 61 72 64 00 6F 70 74 69 6F 6E 5F 72 tandard.option_r
00000770 65 73 6F 75 72 63 65 73 00 00 00 00 00 00 00 00 esources…
00000780 00 00 00 00 58 00 00 00 00 00 00 00 0C 00 00 00 …X…
00000790 00 00 00 00 72 2B AB 00 00 00 00 00 00 00 00 00 …r+…
000007A0 00 00 00 00 00 00 00 00 74 2B AB 00 00 00 00 00 …t+…
000007B0 00 00 00 00 00 00 00 00 00 00 00 00 75 2B AB 00 …u+…
000007C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
000007D0 00 00 00 00 00 00 00 00 00 00 00 00 6F 70 74 69 …opti
000007E0 6F 6E 5F 73 63 6F 72 65 00 73 65 63 74 69 6F 6E on_score.section
000007F0 5F 73 74 61 72 74 69 6E 67 5F 63 6F 6E 64 69 74 starting_condit
00000800 69 6F 6E 73 00 00 00 00 00 00 00 00 18 01 00 00 ions…
00000810 00 00 00 00 90 00 00 00 00 00 00 00 08 00 00 00 …
00000820 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 …X…
00000830 00 00 00 00 1B 00 00 00 00 00 00 00 49 54 AA 00 …IT…
00000840 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000850 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000860 00 00 00 00 41 70 AA 00 00 00 00 00 00 00 00 00 …Ap…
00000870 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 …
00000880 00 00 00 00 6F 70 74 69 6F 6E 5F 77 69 6E 5F 63 …option_win_c
00000890 6F 6E 64 69 74 69 6F 6E 5F 77 6F 6E 64 65 72 00 ondition_wonder.
000008A0 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 …X…
000008B0 00 00 00 00 1E 00 00 00 00 00 00 00 48 54 AA 00 …HT…
000008C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
000008D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
000008E0 00 00 00 00 40 70 AA 00 00 00 00 00 00 00 00 00 …@p
000008F0 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 …
00000900 00 00 00 00 6F 70 74 69 6F 6E 5F 77 69 6E 5F 63 …option_win_c
00000910 6F 6E 64 69 74 69 6F 6E 5F 72 65 6C 69 67 69 6F ondition_religio
00000920 75 73 00 00 00 00 00 00 00 00 00 00 58 00 00 00 us…X…
00000930 00 00 00 00 1D 00 00 00 00 00 00 00 47 54 AA 00 …GT…
00000940 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000950 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
00000960 00 00 00 00 3F 70 AA 00 00 00 00 00 00 00 00 00 …?p…
00000970 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 …
00000980 00 00 00 00 6F 70 74 69 6F 6E 5F 77 69 6E 5F 63 …option_win_c
00000990 6F 6E 64 69 74 69 6F 6E 5F 63 6F 6E 71 75 65 73 ondition_conques
000009A0 74 00 73 65 63 74 69 6F 6E 5F 69 6E 6E 65 72 5F t.section_inner

000009B0 77 69 6E 5F 63 6F 6E 64 69 74 69 6F 6E 73 00 69 win_conditions.i
000009C0 6D 61 67 65 73 5C 6D 75 6C 74 69 70 6C 61 79 65 mages\multiplaye
000009D0 72 5C 67 61 6D 65 6D 6F 64 65 5F 6E 6F 6D 61 64 r\gamemode_nomad
000009E0 00 69 6D 61 67 65 73 5C 69 6C 6C 75 73 74 72 61 .images\illustra
000009F0 74 69 6F 6E 73 5C 63 72 65 61 74 65 5F 67 61 6D tions\create_gam
00000A00 65 5C 67 61 6D 65 5F 6D 6F 64 65 5F 6E 6F 6D 61 e\game_mode_noma
00000A10 64 5F 75 6E 73 65 6C 65 63 74 65 64 00 69 6D 61 d_unselected.ima
00000A20 67 65 73 5C 69 6C 6C 75 73 74 72 61 74 69 6F 6E ges\illustration
00000A30 73 5C 63 72 65 61 74 65 5F 67 61 6D 65 5C 67 61 s\create_game\ga
00000A40 6D 65 5F 6D 6F 64 65 ## ## 6F 6D 61 64 5F 73 65 me_mode_nomad_se
00000A50 6C 65 63 74 65 64 00 00 47 61 6D 65 4D 6F 64 65 lected…GameMode
00000A60 73 2F 73 74 61 6E 64 61 72 64 5F 6D 6F 64 65 00 s/standard_mode.
00000A70 00 00 00 00 09 6E 6F 6D 61 64 00 …nomad.

impossible with current tools

@Woprok Thanks so much for the detailed answer!

I will have to digest what you said and try it out in the editor as soon as I get to it and will reply to you afterwards. :slight_smile:

impossible with current tools

That’s sad. :frowning: I really hope Relic will make it possible in the future. However, with more and more civilizations it is probably less of a big deal in general.