Problems with AI in my MOD, need help...

Get some help with creating maps or modding.
Need a map editor or other tools, look here!
Post Reply
User avatar
Doruletz
Trained
Trained
Posts: 115
Joined: 17 Sep 2015, 06:00
Location: Tennessee, USA

Problems with AI in my MOD, need help...

Post by Doruletz »

Hello, everybody. It's been a while since I posted or commented anything here, and for that I apologize...
I am using the latest version of the game, which is Warzone 2100 v4.5.1, built 2024-08-05 at the date of this post.
For my own enjoyment, I have made an ARTILLERY ONLY multiplayer MOD, in which I wanted to remove all Tanks with DIRECT FIRE WEAPONS such as Machine Guns, Cannons, Rockets, Lancers, Missiles, Rail Guns, Flamers, Lasers, etc.
I would love to use this ARTILLERY ONLY multiplayer MOD when playing Skirmish Games against an AI.

What I did to create this MOD is I edited the file "/stats/weapons.json" by removing the following line from all the DIRECT FIRE WEAPONS:

Code: Select all

		"designable": 1,
Therefor, a player should be able to only build Tanks armed with the following indirect weapons:
From the rocket-missile family: MRL Rockets, Heavy MRL Rockets, Seraph Missile, IDF Ripple Rockets & Archangel Missile. Plus all the Mortars and Howitzers.
When I play any skirmish game, I get the restrictions mentioned above, but the AI does not.
You can imagine my frustration when they show up with MG Tanks, Cannon Tanks, Lancers, etc. I mention that this bug applies to any AI, as I already tried Bone Crusher, Cobra and the old default one, Nexus.
Needless to say, I don't like this at all.
If any of you guys knows what do I need to do to make the AI play by the same rules set forth in this MOD, please help me.
Thank you.
What do I think about Window$ ??? Just see my AVATAR...
User avatar
Doruletz
Trained
Trained
Posts: 115
Joined: 17 Sep 2015, 06:00
Location: Tennessee, USA

Re: Problems with AI in my MOD, need help...

Post by Doruletz »

Hmmm...
That's odd, to say the least.
A full day went by, in which some 70+ people viewed this thread. But not even one of them had anything to say. 🤔️🧐️😕️☹️
What do I think about Window$ ??? Just see my AVATAR...
User avatar
Tzeentch
Trained
Trained
Posts: 324
Joined: 14 Oct 2012, 14:24

Re: Problems with AI in my MOD, need help...

Post by Tzeentch »

I'm not fully certain but have a few ideas that may help:

Try testing this with Nullbot as well, it has a few lines of code that disables producing units before a given design is available to it.
"Being able to build units before designing them"
I don't think the others have this type of code, so effectively are bypassing entirely.

Nullbot and a few others are using some kind of body weapon pairs from a predefined list and Cobra does something similar with using "sub-Personalities". This is where defined weapon stats are taken into account and chosen from an initial weapon to research path.

Not the cleanest method.... but one way that might work, is to either modify CobraStandard.js under "weaponStats" by each aliased weapon i.e. mg and either removing or changing the weapons it has in those lists.

Or better yet, within Cobra.js under subPersonalities just change primary and secondary weapons to weaponStats.mortars, weaponStats.fireMortars etc.
and set "useLasers" to false. May want to look around or at artilleryTactics in tactics.js as well.

I have seen on our forums and even played against an "arty bot" some time ago, an artillery only bot but it was... rather lacking overall.
Having an artillery only game mode as an option, with native AI support could be an idea.
The Turtle Nullbot AI should be like this IMO but isn't ... yet. Let me know how that goes.
User avatar
Tzeentch
Trained
Trained
Posts: 324
Joined: 14 Oct 2012, 14:24

Re: Problems with AI in my MOD, need help...

Post by Tzeentch »

Here you go. I was surprised while testing that it is quite competitive against Cobra.

As the name implies... it is a simple bot hack but gets you 95% there. Does build very few, but some MG tanks.
Game on T2 or higher only, as on T1 you have no mortars so it defaults to MG spam.

Ideally we need a simple condition in the game menu to choose with a click "Artillery only" without needing to hack or make mods for this.
Attachments
arty-hackbot.js
(8.7 KiB) Downloaded 35 times
arty.json
(325 Bytes) Downloaded 35 times
User avatar
Doruletz
Trained
Trained
Posts: 115
Joined: 17 Sep 2015, 06:00
Location: Tennessee, USA

Re: Problems with AI in my MOD, need help...

Post by Doruletz »

Tzeentch wrote: 02 Sep 2024, 15:28 Here you go. I was surprised while testing that it is quite competitive against Cobra.

As the name implies... it is a simple bot hack but gets you 95% there. Does build very few, but some MG tanks.
Game on T2 or higher only, as on T1 you have no mortars so it defaults to MG spam.

Ideally we need a simple condition in the game menu to choose with a click "Artillery only" without needing to hack or make mods for this.
Thank you for your reply.
It seems things tend to get far more complicated in this approach.
My intention was not to MOD the AI behaviors, since I'm not that far advanced in coding.
I was thinking more along the line of "we all should play by the same rules"...
I might give it a try, but not anytime soon.
What do I think about Window$ ??? Just see my AVATAR...
Post Reply