Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Wed Apr 24, 2024 5:35 pm
All times are UTC + 0
Ai(md).ini editor
Moderators: Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [35 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
MadHQ
Commander


Joined: 07 Nov 2003

PostPosted: Sat Jun 13, 2015 11:22 am    Post subject:  Ai(md).ini editor Reply with quote  Mark this post and the followings unread

So I am trying to develop a little AI editor in javascript for fun...

http://zombapro.ppmsite.com/iniedit/aiedit.html

Now I am trying understand this comparator mess...

I have been reading through ModENC-comparator, and some things just are not adding up...

Code:
0A44F17C-G=Soviet Dog Refinery Guards,0A4520CC-G,<all>,2,0,SPY,0100000003000000000000000000000000000000000000000000000000000000,5000.000000,5000.000000,5000.000000,1,0,1,0,0A4520CC-G,0,1,1

first operand = SPY ?

eight chunks of eight hexadecimal characters
01000000 <-contains the second argument?
03000000 <-octet contains the operator? operator should be ">=" ?
00000000
00000000
00000000
00000000
00000000
00000000


Code:
0A452E5C-G=Soviet Terror D vs Allies,0A454B9C-G,<all>,4,0,MTNK,0800000003000000000000000000000000000000000000000000000000000000,70.000000,10.000000,70.000000,1,0,2,0,<none>,0,0,1

first operand = MTNK ?

eight chunks of eight hexadecimal characters
08000000 <-contains the second argument?
03000000 <-octet contains the operator? operator should be ">=" ?
00000000
00000000
00000000
00000000
00000000
00000000


If you run 01000000 or 08000000 through Here it returns the Little Endian value of 1 and 8...

Now I am not really sure 01000000 can be even run through some kind of converter...

I any case this just doesnt make since... How can the second argument be 1 or 8....

Does any one understand this mess?

_________________
MadHQ's Graveyard - Click here!
(Permissions) - (F.A.Q.)

Last edited by MadHQ on Tue Jun 16, 2015 1:10 pm; edited 1 time in total

Back to top
View user's profile Send private message Skype Account
E1 Elite
General


Joined: 28 May 2013

PostPosted: Sat Jun 13, 2015 12:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

08000000 should be reversed and read as 00 00 00 08 whose actual count in hex is same as 8 in decimal.

Those check for greater than or equal to condition. So enemy having 8 or more of MTNK will satisfy the
condition.

Back to top
View user's profile Send private message
MadHQ
Commander


Joined: 07 Nov 2003

PostPosted: Sat Jun 13, 2015 12:10 pm    Post subject: Reply with quote  Mark this post and the followings unread

AH!! Is that what that means!  Laughing

I did not realize that the second argument was a count of the first arguments objects.

If that's the case that makes allot of since!

Thanks!

_________________
MadHQ's Graveyard - Click here!
(Permissions) - (F.A.Q.)

Back to top
View user's profile Send private message Skype Account
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Sat Jun 13, 2015 12:21 pm    Post subject: Reply with quote  Mark this post and the followings unread

Are you aware of the contents of everything related to AITriggerTypes and friends?

Like TaskForces can only have 6 entries, reading from 0= to 5=, if '3=' is missing, the game stops reading 4= and 5=.
Same goes for ScriptTypes where the limit is 50, 0= to 49=.

If you're looking for more trivial lists that go in ScriptTypes, like facings, targets, etc. you can find some over here:
https://github.com/Palmke/Map_Editor_GUI/blob/experimental/Map_Editor_GUI/Editor.Engine/Lists/TrivialList.h
AlexB looked most of them up in the game's executable, I believe most of them are on YRPP, too.

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
MadHQ
Commander


Joined: 07 Nov 2003

PostPosted: Sun Jun 14, 2015 8:24 am    Post subject: Reply with quote  Mark this post and the followings unread

RP wrote:
Are you aware of the contents of everything related to AITriggerTypes and friends?

Like TaskForces can only have 6 entries, reading from 0= to 5=, if '3=' is missing, the game stops reading 4= and 5=.
Same goes for ScriptTypes where the limit is 50, 0= to 49=.

If you're looking for more trivial lists that go in ScriptTypes, like facings, targets, etc. you can find some over here:
https://github.com/Palmke/Map_Editor_GUI/blob/experimental/Map_Editor_GUI/Editor.Engine/Lists/TrivialList.h
AlexB looked most of them up in the game's executable, I believe most of them are on YRPP, too.


No I am not sure about everything related to AITriggerTypes and friends... Its been a wail since I modded Ra2/Yr...

I do remember the issue about missing index numbers creating problems.

I did not remember the limits, is that info out of the exe or the map editor or is the limits known to be that...? either thanks for the heads up!  Razz

Also does anyone know if the last 6 chunks are really unused?

Code:
eight chunks of eight hexadecimal characters
01000000 <-contains the second argument?
03000000 <-octet contains the operator? operator should be ">=" ?

????
[color=red]
????
00000000
00000000
00000000
00000000
00000000 [/color]


00000000


Also does anyone know if using Group=-2 is useful at all? I was reading up on it on ModENC and it just doesn't seem like it could be that useful...

Quote:

[08B961DC-G]
Name=1 Yuri Engineer
0=1,YENGINEER
Group=-1 ???????? -2 do anything ???????

_________________
MadHQ's Graveyard - Click here!
(Permissions) - (F.A.Q.)

Back to top
View user's profile Send private message Skype Account
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Sun Jun 14, 2015 5:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

Actually, here's more of those little factoids by DCoder:
https://web.archive.org/web/20090630154940/http://forums.renegadeprojects.com/archive/index.php/thread-938.html

He does state that, "I haven't yet located anything else about this, but it doesn't seem the latter ones are actually used, meaning multi-conditional triggers would be unfortunately impossible" with regards to the comperator.
If you can C++, I implemented the behavior of the game when it comes to TeamTypes, ScriptTypes and TaskForces.

The limits I linked you came from the game and are used in my map editor. If you want to join in you're more than welcome #Tongue

I'd also like to see more research done for Group, currently I gather all the Group IDs of the units on the map and fill a list with them, but the special indexes are unknown to me :/

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
MadHQ
Commander


Joined: 07 Nov 2003

PostPosted: Mon Jun 15, 2015 11:43 am    Post subject: Reply with quote  Mark this post and the followings unread



I guess I will have to look through all of that. Razz

Quote:
If you can C++, I implemented the behavior of the game when it comes to TeamTypes, ScriptTypes and TaskForces.


What?

Quote:
The limits I linked you came from the game and are used in my map editor. If you want to join in you're more than welcome


I would join but I have no idea how long my re-interest will last with RA2/YR... I just needed some thing to play around with javascript.

Quote:
I'd also like to see more research done for Group, currently I gather all the Group IDs of the units on the map and fill a list with them, but the special indexes are unknown to me :/


Ah, I guess i will eventually have a look at that and see if it does anything.


Anyways, another question from me.  Laughing

What the best way to handle the value "n" for flags such as Move To Enemy Structure "n"... It looks as though the "n" value is the rules index number +1, is that right?... And then there are values such as 196609 for some allied building... A long time ago I knew how that value was made but now I forgot... Laughing

Witch is better the ID num +1 or longer number? Or does it matter?

_________________
MadHQ's Graveyard - Click here!
(Permissions) - (F.A.Q.)

Back to top
View user's profile Send private message Skype Account
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Mon Jun 15, 2015 12:34 pm    Post subject: Reply with quote  Mark this post and the followings unread

As for the C++ part, it was supposed to say "if you can read C++". I implemented the parsing and reading of those types based off the game's behavior.

The indexes do matter. It is just the index in the list, no '+1' what so ever.
About those bigger numbers, those exist for selecting a more specific building, like so:

DCoder wrote:

Attack Enemy Structure, Move To Enemy Structure, ChronoSphere to Enemy Structure, Move To Friendly Structure:
argument is the building's index in the [BuildingTypes] list, with one flag having four possible values:
Values:
Value 0 - pick structure whose position poses the least threat
Value 1 - pick structure whose position poses the most threat
Value 2 - pick structure which is closest to you
Value 3 - pick structure which is the farthest away from you
In hexadecimal, the result is argument = flag * 0x10000 | buildingIndex.
In layman's terms, at first the argument is the building's index. Add (Value * 65536) to the index to get the final argument you should use. This sets a theoretical limit of max 65536 (#0 - #65535) BuildingTypes in the game, should you feel insane enough to try that.


Code:
argument = flag * 0x10000 | buildingIndex.
buildingIndex =

TYPE = 0, 1, 2, 3
CONSTANT = 65536

ACTUALINDEX = TYPE * CONSTANT + INDEX
131082 = 2 * 65536 + 10

INDEX = ACTUALINDEX - (TYPE * CONSTANT)
10 = 131082 - (2 * 65536)

INDEX = 131082 - (TYPE * 65536)
   
if(INDEX < 65536)
{
   ACTUALTYPE = TYPE
}

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
MadHQ
Commander


Joined: 07 Nov 2003

PostPosted: Tue Jun 16, 2015 1:01 pm    Post subject: Reply with quote  Mark this post and the followings unread

RP wrote:
The indexes do matter. It is just the index in the list, no '+1' what so ever.


Code:

Aimd.ini
[0A6E54EC-G]
Name=Allied Anti-Nuke Transport
0=54,0
1=14,0
2=43,0
3=47,54 <---- Shouldnt this be 55?
4=8,2
5=49,0
6=46,54 <---- Shouldnt this be 55?
7=0,2
8=0,1

rulesmd.ini
52=NEGLAMP
53=NEGRED
54=TESLA  <----- Not NukeSilo
55=NAMISL
56=ATESLA
57=CAMACH


That stuff is out of stock ini files... This is why I am thinking +1 on building index from from rules... Does the game engine ignore the ini files index number and start the index at zero?



anyways i am wondering if any one has any thoughts/ideas on this AI editor im working on... does it make since? I am trying to make it really easy to understand and use...
No download needed, runs through browser...
Link: http://zombapro.ppmsite.com/iniedit/aiedit.html

Still  things i need to change/add with the script sections...

So far it only loads the aimd.ini I have hosted. (I plan make it so the ini files can be loaded.)
Does not save anything yet...
Does not have any way to add trigger/team/task/script yet...

And there is still a few things I need finish like some of the team flags:
VeteranLevel
MindControlDecision
House
Priority
Max
TechLevel
Group <--- I think just -1 or -2

Im am just not sure what the inputs allow...

_________________
MadHQ's Graveyard - Click here!
(Permissions) - (F.A.Q.)

Back to top
View user's profile Send private message Skype Account
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Tue Jun 16, 2015 1:13 pm    Post subject: Reply with quote  Mark this post and the followings unread

MadHQ wrote:
That stuff is out of stock ini files... This is why I am thinking +1 on building index from from rules... Does the game engine ignore the ini files index number and start the index at zero?


Yes, you can put anything at the left hand sight of the equals character.

VeteranLevel
1 - Rookie
2 - Veteran
3 - Elite

MindControlDecision
0 - Don't care
1 - Add to TeamType
2 - Put in Grinder
3 - Put in Bio Reactor
4 - Go to Hunt
5 - Guard

House
This one is dynamic, as this is for the AI INI only, it should contain all available [Countries] entries, which for YR are:
ModEnc wrote:

0=Americans
1=Alliance
2=French
3=Germans
4=British
5=Africans
6=Arabs
7=Confederation
8=Russians
9=YuriCountry ;this country appears only in YR, it is not present in RA2
10=GDI
11=Nod
12=Neutral
13=Special


Priority
No clue, just an integer value I guess. The higher the priority, the more likely it is built?

Max
This defines how many of these teams can exist together I believe.

TechLevel
This should range from 0 to [Multiplayer/MPDialogSettings]TechLevel='s value in rules.ini
This is not hardcoded to 1 - 10!

Group
There are probably more unique ID's that can be used here, otherwise it could be all the Group ID's of units on the map (but you don't have those lol). So in short: not really a clue.

MadHQ wrote:
And theres still a few things i need to change/add with the script sections.

Is there anything you need from me to get that done?
Don't forget to add that thing from DCoder for targeting structures :p


PS. It's "equal", not "equil". Wink

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Wed Jun 17, 2015 3:07 am    Post subject: Reply with quote  Mark this post and the followings unread

MadHQ wrote:

Code:

Aimd.ini
[0A6E54EC-G]
Name=Allied Anti-Nuke Transport
0=54,0
1=14,0
2=43,0
3=47,54 <---- Shouldnt this be 55?
4=8,2
5=49,0
6=46,54 <---- Shouldnt this be 55?
7=0,2
8=0,1

rulesmd.ini
54=TESLA  <----- Not NukeSilo
55=NAMISL

This is correct, as far as the referencing... the numerical ID in rules.ini minus 1.

I know my rules.ini list is missing some items, so it's not a contiguous list, if they were all "re-numbered" from 0, then higher ID buildings would never match up to the (ID - 1) rule but they do.

Back to top
View user's profile Send private message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Wed Jun 17, 2015 7:02 am    Post subject: Reply with quote  Mark this post and the followings unread

Ugh... again? Really?

MadHQ, please disregard that.
G-E is contradicting himself by saying that the -1 rule applies, but not in his rules.ini... What?

Either way, look at this.
I believe this sums it up pretty nicely:
ModEnc wrote:
The object arrays ( [InfantryTypes] , [Movies] , [Tiberiums], etc. ) are internally 0-based. That means, the first item listed in such an array will always have index #0 ingame, the second one will be #1, and so on, regardless of what the text on the left of the equals sign says. You can have things like a^2+b^2=CSQUARED and the game would recognize CSQUARED and put it into the array correctly.
These internal indices are a way how the game refers to these objects, widely used by AI scripts and map triggers. So, a map trigger action that says "Play Animation #250 at waypoint 45" will play the animation that has the internal index of #250 in the [Animations] list, which is not necessarily [Animations]250=.


Any "-1" or "+1" rule only applies per INI, Mental Omega's rules.ini looks different than YR's and has a different list.

In this case the BuildingTypes list in YR's rulesmd.ini starts at 1. Internally it is remapped to index 0.
This means that the indexes are off by 1. But this only applies to this specific rulesmd.ini.
If I add something at the top with let's say "0=MYBLDNG", this whole rule is wrong. Same goes for removing an entry or adding one in between the lines.
So this is what it would look like for YR. It's the internal array that my map editor generates, http://pastebin.com/GTdnEM5k

EDIT: It's an old dump, so it could contain some inconsistencies.

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Wed Jun 17, 2015 7:41 am    Post subject: Reply with quote  Mark this post and the followings unread

On groups and recruitment (testing my understanding):

Unique Group id is used with Recruiter=no, to recruit from the same group units, thus avoid recruiting
from other groups. SP maps use 0, +ve and -ve numbers. AI ini typically use -1 (TS uses -40094 as well)
(Have tried -3, -4 etc. as well for uniqueness)

Refer: http://modenc.renegadeprojects.com/Group

Group=-1 is no group case used as default by the game (starting units, drop pods/paradrops/crates,
escape units from buildings etc.). Game recruits such free units whenever available and applicable by
default.

Group=-2 is any group case (even with Recruiter=no), it allows other groups to recruit from its team.

TeamType's group is used for checking except when Group=-1 where it checks for its task force's group.

Recruiter=yes allows inter-group recruitment without any group checks.

When a team finishes its script actions, they become available for recruitment. They loose the teamtype
attributes of Priority and AreTeamMembersRecruitable, but the game still checks the Group from its
teamtype first (if it is -1, then check taskforce). Max count of the teamtype are still obeyed. If all the freed
units from a team are recruited, then that teamtype gets a slot vacant for one more in the Max count.

In case of recruitment from active teams (when Recruiter and Group values permit them), where the team
hasn't completed its script actions, TeamType with higher Priority= can recruit team members from lower
Priority TeamType with AreTeamMembersRecruitable=yes. Equal Priority doesn't allow that. When only
partial of an active team is recruited, the remaining members continue their scripted mission.

On structure number: Refer DCoder's explanation.

Position in the [BuildingTypes] list should be taken, counting with 0.

Low/high threat case - Threat is cumulative. For example, if there are units near a building, its threat value
will be higher. When selecting from equal threat buildings, AI will choose the one which was constructed
first by the target side. (Threat is from enemy. Friendlies doesn't pose threat / becomes a case of equal
threat. e.g. Move to friendly structure)

When there are equidistant buildings (near/far case), the team may split and target more than one building.

Max - Max count for that team. -1 is unlimited. In some cases when recruitment is involved, there are
chances that 2-3 more than max team value could be produced.

House - Entry in AITriggerType should supercede in case they belong differently.

Higher Priority doesn't mean it will be built over low priority teams. Higher weight in AITriggerType gets
more chance, so is the team referred by it
-------------------------------
Typical AI Editor should be able to read rules ini so that unit name, building names etc. could be picked
up for drop downs and structure number could be computed. There is an open source AI Editor in CnC
Editing tools subforum by Askeladd.

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Wed Jun 17, 2015 8:16 am    Post subject: Reply with quote  Mark this post and the followings unread

RP wrote:
Ugh... again? Really?

MadHQ, please disregard that.
G-E is contradicting himself by saying that the -1 rule applies, but not in his rules.ini... What?

I didn't contradict myself, I said every BuildingType index is referenced as ID minus 1.

I said if I have 300 buildings, and I add a 301st with the index of 400=, to access it with ai.ini in an attack, I will have to reference 399 as the building number.

That's it.

Back to top
View user's profile Send private message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Wed Jun 17, 2015 8:25 am    Post subject: Reply with quote  Mark this post and the followings unread

G-E wrote:
I didn't contradict myself, I said every BuildingType index is referenced as ID minus 1.

I said if I have 300 buildings, and I add a 301st with the index of 400=, to access it with ai.ini in an attack, I will have to reference 399 as the building number.

That's it.


Right, you are saying something that is complete bullshit.
Read the article I linked in my previous post, or even the quote and you (and I pray to God that you do) understand how it works.

EDIT: Woops, missed E1's post.
The priority I meant was about TeamTypes. Don't the AITriggerType weights define which trigger has a greater priority?
I know it sounds wrong, but from what I read is that you have to give a trigger an extremely high weight to make sure it is built regularely/first.
I don't see the relationship between the priority in teams.
Basically you're saying that they aren't used because the AITriggerType already has a weight, thus the team attached to it automatically does, too.

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Wed Jun 17, 2015 8:31 am    Post subject: Reply with quote  Mark this post and the followings unread

Unless this was changed in YR, it's been functioning exactly like that for me since I started modding...

Until recently I had several of my added building's in the 300's, and moved them into the lower numbers. It didn't matter how many indexes were missing between 0 and the target.

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Wed Jun 17, 2015 8:34 am    Post subject: Reply with quote  Mark this post and the followings unread

I'm not going to discuss this further with you.
At least since Tiberian Sun this is how it works.

There are people who reverse engineered this for both TS and YR.
Either you had a perfect list, or you cannot remember exactly what you did back in the day.

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Wed Jun 17, 2015 9:03 am    Post subject: Reply with quote  Mark this post and the followings unread

RP wrote:

Basically you're saying that they aren't used because the AITriggerType already has a weight, thus the team attached to it automatically does, too.

Yes. Priority in TeamTypes is associated with recruitment.

When a AITriggerType gets triggered, its team gets created, so weightage in AITrigger comes into picture
for team creation indirectly.

Back to top
View user's profile Send private message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Wed Jun 17, 2015 9:08 am    Post subject: Reply with quote  Mark this post and the followings unread

Hmm, so it's legacy code then?
It is thus also not used when creating a team using a map action.

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Wed Jun 17, 2015 10:31 am    Post subject: Reply with quote  Mark this post and the followings unread

RP wrote:
I'm not going to discuss this further with you.
At least since Tiberian Sun this is how it works.

There are people who reverse engineered this for both TS and YR.
Either you had a perfect list, or you cannot remember exactly what you did back in the day.

Perhaps you're right about that, I actually did rearrange a lot of things...

When I got back into things I started with a fresh list and started moving things around again to clean up some inconsistencies and whatnot, maybe I just never noticed the symptoms of the few broken scripts. I did this because I had 2 forks of my ai.ini, one that I had iced with some unresolved issues, and one I had updated a bit after my crash from an older source, I did my best to eliminate all possible reasons for the crashes, including writing my checking scripts.

I'll verify this is the case tomorrow. I apologize if I'm wrong about this, don't be mad...

Back to top
View user's profile Send private message
Symphonic
Tiberian Fiend


Joined: 06 Jan 2009

PostPosted: Thu Jun 18, 2015 5:24 am    Post subject: Reply with quote  Mark this post and the followings unread

RP wrote:
G-E wrote:
I didn't contradict myself, I said every BuildingType index is referenced as ID minus 1.

I said if I have 300 buildings, and I add a 301st with the index of 400=, to access it with ai.ini in an attack, I will have to reference 399 as the building number.

That's it.


Right, you are saying something that is complete bullshit.
Read the article I linked in my previous post, or even the quote and you (and I pray to God that you do) understand how it works.

EDIT: Woops, missed E1's post.
The priority I meant was about TeamTypes. Don't the AITriggerType weights define which trigger has a greater priority?
I know it sounds wrong, but from what I read is that you have to give a trigger an extremely high weight to make sure it is built regularely/first.
I don't see the relationship between the priority in teams.
Basically you're saying that they aren't used because the AITriggerType already has a weight, thus the team attached to it automatically does, too.


Dude I mean no offense, but do you realize how much of a jerk you're being?  That dude has been around since the beginning of RA2 modding, be a little respectful at least.

_________________
PreRA2 Dev Lead

Back to top
View user's profile Send private message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Thu Jun 18, 2015 6:45 am    Post subject: Reply with quote  Mark this post and the followings unread

Out of all people you start bashing, Symphonic? You just made my day.
Or is it because I never did any of those maps for you because you never contacted me?

I'm not being a jerk, I'm just making it clear that when I come up with answer that is backed up with sources, and someone comes about and says things don't work like that for the third time in two days, I might be a bit irritated.
I don't give a damn how long you're about in the community, if you give bullshit answers like the scenario above, you can expect a reply like mine.
He didn't even read what I posted, otherwise he would not have said anything after that which contradicts my statements.

But for the rest though:

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Thu Jun 18, 2015 8:05 am    Post subject: Reply with quote  Mark this post and the followings unread

Well apparently I'm the only one who understands the 128k and 192k addition to the building numbers...

So excuse me if I don't assume everything people have said was correct, it's a filthy habit of mine, I question everything.

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Thu Jun 18, 2015 8:20 am    Post subject: Reply with quote  Mark this post and the followings unread

I may have overreacted a bit, but I get annoyed when this kind of things happen.
And then it's the workings of the internet and interpretation of plain text that does the rest.

I wasn't mad at you, just annoyed.

As for the 128k and 192k addition, are you referring to this?
DCoder wrote:
Attack Enemy Structure, Move To Enemy Structure, ChronoSphere to Enemy Structure, Move To Friendly Structure:
argument is the building's index in the [BuildingTypes] list, with one flag having four possible values:
Values:
Value 0 - pick structure whose position poses the least threat
Value 1 - pick structure whose position poses the most threat
Value 2 - pick structure which is closest to you
Value 3 - pick structure which is the farthest away from you
In hexadecimal, the result is argument = flag * 0x10000 | buildingIndex.
In layman's terms, at first the argument is the building's index. Add (Value * 65536) to the index to get the final argument you should use. This sets a theoretical limit of max 65536 (#0 - #65535) BuildingTypes in the game, should you feel insane enough to try that.

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Thu Jun 18, 2015 8:36 am    Post subject: Reply with quote  Mark this post and the followings unread

In my testing that's not how it manifests, and I did lots of tests with this, with engineers too.

What I found is that adding 192k is like telling your team to ignore everything else, and go attack/move to the target. This means that it will attack a structure where it's likely to get killed trying, or while it's being shot at.

Adding 132k did the opposite, it would not approach the target at all if there was a threat nearby, it would stop about 10 tiles away and sit there like a tree if it couldn't find a safe path around.

My tests consisted of placing 1 building of the type for the AI to go after, while I did various things to disturb it, like placing units in the path to block access, or actively trying to irritate them with passive units that only guard within their proximity.

64k didn't seem to have any effect on my single target tests, but seemed to have the effect of more randomly choosing a target on a fuller map with several matching targets, not necessarily the easiest one either.

This behaviour would override the TeamType's AvoidThreats= and other aggression modifiers.

Which means you can have a team follow it's usual behaviour, and explicitly force the behaviour in a given instance -- also handy when using the same script for various types of teams.

PS. Mad: 128k = 131072, 192k = 196608

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Thu Jun 18, 2015 10:32 am    Post subject: Reply with quote  Mark this post and the followings unread

With a single building as target, all the 4 structure number will select the same building. Your test is invalid.

The easiest way to test is to make a building with large adjacent value and in game, build 2/3 of them and
place them near and far from the AI base - for near/far case. And then observe the AI response.

For low/high threat case, build 2/3 of the same building and place some of your units near one of them.

The behaviour of not responding to attacks is achieved by Suicide=yes in its team type.

AvoidThreats=yes selects the path to its destination which avoids threat. This threat evaluation is done
periodically, rather than on every cell travelled by the units.

Target selection, path selection and unit engagement behaviour are different, so shouldn't be mixed.

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Thu Jun 18, 2015 11:08 am    Post subject: Reply with quote  Mark this post and the followings unread

My thought was that the 64k multiples mirrored those very options, just explicitly, for that action.

BTW did you miss the part where I said 128k won't approach? Surely that's not invalid too?

PS. Each group of tests used the same TeamType, and therefore used the same options across script changes...

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Thu Jun 18, 2015 11:31 am    Post subject: Reply with quote  Mark this post and the followings unread

G-E wrote:
BTW did you miss the part where I said 128k won't approach? Surely that's not invalid too?


I think it is, because if you have a BuildingType at the index of 0 in the internal array, that would be the index and thus be targeted.
Code:
ACTUALINDEX = TYPE * CONSTANT + INDEX
131072 = 2 * 65536 + 0


Did you happen to put GAPOWR on the map? Razz
Either that or it has some fallback to take some structure when the one that is supposed to be INDEX does not exist.

_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
Symphonic
Tiberian Fiend


Joined: 06 Jan 2009

PostPosted: Thu Jun 18, 2015 11:36 am    Post subject: Reply with quote  Mark this post and the followings unread

RP wrote:
Out of all people you start bashing, Symphonic? You just made my day.
Or is it because I never did any of those maps for you because you never contacted me?


I didn't bash you, and I frankly didn't even remember who you are.

_________________
PreRA2 Dev Lead

Back to top
View user's profile Send private message
MadHQ
Commander


Joined: 07 Nov 2003

PostPosted: Thu Jun 18, 2015 12:16 pm    Post subject: Reply with quote  Mark this post and the followings unread

#Crazy Well this will be an interesting read... I will have to read all that tomorrow... I am little tied and frustrated... Damn binary vxl files...  Mad

_________________
MadHQ's Graveyard - Click here!
(Permissions) - (F.A.Q.)

Back to top
View user's profile Send private message Skype Account
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Thu Jun 18, 2015 12:58 pm    Post subject: Reply with quote  Mark this post and the followings unread

RP wrote:
G-E wrote:
BTW did you miss the part where I said 128k won't approach? Surely that's not invalid too?


I think it is, because if you have a BuildingType at the index of 0 in the internal array, that would be the index and thus be targeted.
Code:
ACTUALINDEX = TYPE * CONSTANT + INDEX
131072 = 2 * 65536 + 0


Did you happen to put GAPOWR on the map? Razz
Either that or it has some fallback to take some structure when the one that is supposed to be INDEX does not exist.

No I clearly remember it would head towards it and stop, not pick some other building... It also applies to air attacks, they won't if there's AA defenses nearby. And no I wasn't using GAPOWR to test Smile

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Thu Jun 18, 2015 1:13 pm    Post subject: Reply with quote  Mark this post and the followings unread

Mad: Here's a chart of little-endian INT32 values for the trigger octet thingy...

1111000003...  is greater than or equal to 4369

4444000004...  is greater than 17476

9999000001...  is less than 39321

Does that help?

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Fri Jun 19, 2015 6:53 am    Post subject: Reply with quote  Mark this post and the followings unread

G-E wrote:
BTW did you miss the part where I said 128k won't approach? Surely that's not invalid too?

Structure number is used for target selection. It is not related to unit's threat response behaviour.

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Fri Jun 19, 2015 12:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

In my testing those descriptions are wrong, I don't know why, and I don't know how anyone derived that answer.

I remember having a brief chat with Deezire after I read his guide, his answer was basically like "we'll probably never be sure" and left it at that.

Do some tests, tell me what you find.

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Fri Jun 19, 2015 1:44 pm    Post subject: Reply with quote  Mark this post and the followings unread

Deezire's guide doesn't have the correct meaning for the structure number usage. Looks like you haven't
understood the concept.

Typically a base would have one instance of conyard or tech center. In such cases, any of the 4 structure
number reference would lead to the same building. In cases like power plants, there are usually multiple
instances of the same building. In such cases, the structure number gives AI the option to select the nearest
or farthest or with least or highest threat building out of the many instances of the same building.

Attaching the RA2 vanilla ini files modified to test these. Select America for both yourself and AI. There
are teams of 2 GIs and 3 GIs which are programmed to attack GAPILE based on the structure number option.
Have given large Adjacent value for GAPILE. Now build 2 barracks and place one nearer and farther from
the AI base and watch which barracks is selected for attack by the 2 GI team and the 3 GI team. I have put
the other options in comment in the AI ini file. You can edit them for the low/high threat case. Just
produce some infantry from one of the 2 barracks to make its threat higher and watch which team goes
where.



RA2StructNum.zip
 Description:

Download
 Filename:  RA2StructNum.zip
 Filesize:  104.97 KB
 Downloaded:  17 Time(s)


Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [35 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.2889s ][ Queries: 13 (0.0113s) ][ Debug on ]