Jump to content
Sign in to follow this  
H4mster

Walrus AI mod (Steam Only for now)

Recommended Posts

The hardest part of it is that we want to mod the AI for pathfinding, but the "level 2" pathfinder, the solver for navigating around terrain obstacles, isn't in the Enforce script - it's buried in the main code. If you trace the carrier.exe using a debugger, you can see where it calls an ai routine by attaching a behaviour class to the Parent scriptable object. I've tried to override the inner-core scripting, by creating partial classes in ailib.h and modifying the function bodies in the hope that the dynamic loading would overlay them on top of the core functions:-

class DefaultMotionDataBatch
{
proto native void ClearBehaviour();

proto native void AddBehaviour(int iBehaviour);

proto native void UsePath(bool bShouldUsePath);

proto native void SetSpeed(float fSpeed);

proto native void SetFaceTarget(vector vTarget);

proto native void SetOrientation(vector vOri);

proto native void SetPoint(vector vPoint);

proto native vector GetAnchor();

proto native bool WasHit();

}


class AssistAction
{
void AssistWalrus(DefaultMotionDataBatch b, float f)
{
	//.. do nothing;
}

}

class FormationSlot
{
 proto native vector GetPosition();

}

class SquadHandler extends MultiObjectHandler
.
.
.

But none of it has any effect. CCGM is compeletely happy with having the classes and prototypes added there, but whenever I try to override them, not a jot happens. So, I'm going to give up trying to tinker with it until :-

* An Enforce3.pdb is distributed which matches the enforce3.dll

* Some kind of hint about how to tinker with the scripting is given out... perhaps a class tree, callback list, or whatever.

* A way to bring up a debug console or something is given...

It'd also be nice if someone was to re-organise the scripts, and perhaps put in more comments, cos they need a jolly good tidy. I'd offer to do it, but with a potential patch coming, it'd be a bit of a waste of time, my changes'd get overwritten.

Don't feel too bad, though H4mster... It's a damn good scripting language, but with no manual, we're kind of punching fog here..

Share this post


Link to post
Share on other sites

About making changes,

Notepad ++ has a compair plugin to make it easyer to find out what changed in scripts.

Share this post


Link to post
Share on other sites

I use a old version of textpad that can also compare changes and search for words in folders and its subdirectorys and throws out a list you can click, handy for modding and worth mentioning to new modders.

Share this post


Link to post
Share on other sites
How did you get them to attack with units, do you have to capture all islands to trigger it? Can you send me any mod files you have.

For all the tweaks I have done my enemy carrier still runs off, I can't get it to attack with anything.

Dunno if I did something exceptional, I just copied the scripts and the physics folders from the walrus AI Mod V1.1 into the game directory, put the difficulty on most hard and set caputured island count to lowest. In the first game hours I ran into enemy nose towards nose and he deployed full and agressed... :confused:

Möbius

Share this post


Link to post
Share on other sites

Depending on what the enemy carrier was doing at the time, it /should/ launch all units. The AI files are clearest about what the tactics should be when attacking an island and suddenly you turn up.... drop everything and attack, unless it's "Panicking" (a state set by some internal process), in which case, run away. Pretty much any "subunit container" (i.e. carrier and islands) has the same tactic. The only reasons why it /wouldn't launch all units are because:

* It doesn't have any units to launch (maybe it abandoned them when fleeing?)

* The code to harvest the list of enemy objects within telemetry range is broken in some way

- I was wondering about what it would do if attacking an enemy island - Do the island's defenders (which are also enemy units from the AI's perspective) add to the list of objects in the list? In which case, the enemy carrier is always HOPELESSLY outnumbered when it meets you at one of your own islands, hence the reason it might be panicking and running away?... Just a thought... So perhaps the cases where it stays and fights are because it's already wiped out the defender units, so it can meet you on a more level playing field? Who knows. If I could get up a debug console, I could print the number of enemies in the Object[] enemies array. ho hum.. Just have to wait, I guess.

Share this post


Link to post
Share on other sites

I noticed there is an enemy telemetry range and I put it up to the same level as the players and I did see the way the AI works, it just seems to be panicking on most occasions. Might try to disable the panic part.

In productionadvisor there are sections about building units and I'm sure the resources are handled there, so I am trying to make the AI purchases free so it always has stuff.

Share this post


Link to post
Share on other sites

Cant get this mod to work on latest stem patch 1.3 beta (0011).

Also tried the other mod where you can set number of islands and with manual timewarp but with no luck.

Kalle

Share this post


Link to post
Share on other sites

No it crashes when you use any modded files from 1.02 version with 1.03. The files will need to be redone using the 1.03 files as a base. Since h4mster is gone, I guess I'm the only one still tweaking and working on it so I will sort of officially take over. Sadly though my files are still 1.02 until patch is no longer a beta.

Share this post


Link to post
Share on other sites

Is there a NON-Steam version of this? Not all of are on, or wish to be, tied to Steam. Good game by the way. Hope a proper Patch 1.04 will add further fixes.

Thanks in advance.

Share this post


Link to post
Share on other sites
Is there a NON-Steam version of this? Not all of are on, or wish to be, tied to Steam. Good game by the way. Hope a proper Patch 1.04 will add further fixes.

Thanks in advance.

This was before the AI improvements of the latest patch, which improves things more than this.

Share this post


Link to post
Share on other sites
This was before the AI improvements of the latest patch, which improves things more than this.

Oh, ok. Just got CC and noticed that the Walrus had some WP issues. It`s not too bad though, although I had to take over at one point.

I think it`s an excellent remake by the way, being an oldschooler of the original! :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×