Hi,
I've just finished the general
modularization approach.
So the hard part of wrapping all 267 function calls is done.
This means anyone who wants it can now start changing and improving the AI without breaking compatibility with Retail!
Now we only have to decide how a new AI can be hooked into the existing code.
Lets use a launcherflag ... ;-) (just kidding, I know thats a bad idea).
At the moment I think of a global mission, mod or campaign flag, which does a static:
if (AICode == "new")
{
aicode_new_setup_hooks();
}
This _new_ AI code could then be extended to again branch into fighter or bomber or ... specific AI based on AI Class for example.
The ai_evade hook could then for example be written like:
if (aip->class == "special")
ainew::special.evade(params)
else
{
// do some new stuff
// now call the _old_ code
aicode_old_ct->ai_evade(params);
}
With that kind of polymorphic approach, one can slowly extend and rewrite the existing AI. (and perhaps finally fix the collision avoidance ;-) )
One thing needed for sure for a new AI is a custom field in aip, where it can store its data, but besides that and the decision where to setup the hooks, its done.
Let me know what you think.
cu
Fabian
PS: Sorry for the delay, but I was very busy.
[attachment deleted by admin]