In the AI files numerous functions refer to calls such as
_____:MovetoLocation()
_____:Getbrain()
_____:Stop()
etc.........
Does any modder have an idea where the code of these commands or functions are located and in what language.
if they are not accessible is there a list somewhere of these commands with what arguments/parameter they accept and in what format, their purpose and expected behaviour.
some are quite straightforward but i have to admit it is becoming tedious to 'guess' or retro engineer these functions using only the code of the funnctions where they are used.
the most tedious are probably the input commands
it can be very silly in the end to program functions
for example sometimes you end up calling
self:getbrain() -> aibrain
blablabla
GetArmyIndex(aibrain) -> Army
and then use the Army variable in some command function where you need it.
finally you have no way to know wether aibrain is a string an array or a number or a number. then same for army you just pick variables and hand them over to other functions.
the problem comes when these commands handle a lot of parameter and when these parameters have to be modified between the time you fetch them and the time you hand them to a command function. like vectors or arrays of arrays.
a concrete example where i was confronted to this was when i tried to include negative proximity parameter to the building behaviour like telling the AI to stop building pack of T1 energyproduction, which usually ends up into having its energyproduction being blown all at once and getting therefore immediately owned.
basically you start to dig in EngineerBuildAI function that calls Aiexecutebuilding,Adjacencybuilding function etc....
so you dig in those with 10 parameters changing names
to finally end up on a command that chooses the position for the building and you say hurray gotcha to finally discover that you have no clue how it works.
so you decide to replace the whole chosing position from the ground up and loses precious time retro engineering functions and designing something that has been done already just to workaround a probably usefull command but something that has to be tuned.
when i started doing this i was all about making the AI take decisions in a new fashion and combinig pieces of the AI together following an intricate and unpredictable learning 'brain'.
I ended up spending 1 weeks getting a glimpse of how the AI is architectured, greatly helped only by sorians tutorial and stuff on supcom wiki,
Then 2 weeks trying to make an AI competent at rushing bluntly a single opponent on a 5x5 map
then came the point when i realised that even that is too much for the current functions for the AI, Sorians' functions go a long way making the Ai behave better but sorian did not redesigned all of them.
at the point where i am the Ai crushes any other AI opponent on a small enough map and does fare okay even against cheating AI beating them occasionnaly.
i am still far though from creating a script that can compete with me at base layout and hence at economy passed the first 3 minutes . now when you factor that my rating is merely 1600 you start to realise that the AI is a long way from being competitive enough....
that is puting a human player under pressure during the first 10 minutes with land force. One stereotype that was to be embedded into an Ai swapping between stereotypes to get his way on and surprise human players of my level.
at the moment i am still wasting time trying to code that very basic stereotype at economy and building level, not even speaking of attack behaviours. so it is still a long way from completion. and mind you i have to code a fair bunch of other stereotypes before the Ai gets intresting to play with.
I would be very gratefull if someone could tip me on how to get these commands mastered because i need to master them to go forward.
Even better i dearly hope that the kind of things i am doing now is going to be useless in FA with the AI being finally competent at basic stuff like building or microing.|||MoveToLocation, GetBrain, etc are part of the game engine and not editable.
As far as a list, there is an SC lua wiki: http://supcom.wikia.com/wiki/LUADOC_1.1.3251
Also, there is a mod support forum that is very helpful.
Quote:|||thanks a lot sorian for both the answer and the workaround, it is a idea i did not thought about i ll give it a go and see if the results get this rock out of my shoe and if i can move on with the next thing
No comments:
Post a Comment