Oni Central Forum

A Community-driven Forum discussing Bungie's Oni

You are not logged in.

#26 17/5/12 12:31

Lukas Kreator
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

I like the idea of having half of the enemies in Konoko's team and half of them on Hayate's team, but I fear they would fight themselves.

Offline

#27 20/5/12 10:06

Loser
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

Tried the "alarm behavior powered" race in Airport Cargo Hangars. Works like a charm. Minimal scripting, maximal efficiency. Of course a couple of issues appeared, but only one of them is directly connected with alarm behavior.

Issues:
Poor pathfinding grid design, especially around doorframes and on more complex staircases. Artificial Intelligence gets stuck in corners and around staircase railings more than just "sometimes", it gets stuck there almost everytime. Given the fact that Alarm behavior has allowed only a limited number of five repaths before the run is cancelled, this issue gets quickly annoying. Also, A.I. often collides with doors as they are opening, which makes the A.I. character waste one repath attempt and also slows it down as it performs the circle-motion-anti-wall-collision maneuver.

Only three types of sprint: Female dash, male dash, ninja dash. Whole race reduces to who starts ahead, what class (s)he is and who can utilize some sort of a cheap trick to outrun the competition.

Bug in Alarm behavior which is possibly connected with pathfinding diffculties on custom EdT's maps. Normally, when A.I. has a destination to go to, the engine computes through which BNVs (called "nodes") this A.I. will travel. For example, the debug message can read as follows:

"A.I. is travelling from BNV "100" to BNV "169", currently in node 1 of total 10 nodes".

However, under certain circuumstances, A.I. sometimes stops its movement right at the interface of two BNVs and analysis tells that A.I. is currently in node 1 (first node) out of total 0 (zero nodes). Obviously a bug. Solution is to somehow break A.I. character out of Alarm behavior, which  probably clears its BNV array.
Known circuumstances for the bug to occur  - A.I. is executing Alarm behavior. The player runs in close proximity ahead of A.I. character, just so BNVs used by the player are quickly utilized by the A.I. (that is maybe root of the bug?). That is all. At certain BNV intarfaces, A.I. will repeatedly get bugged. Also, at some BNV interfaces, player running in front of the A.I. is not required for the bug to appear (the bug appears randomly at those interfaces).


In video thread there is posted a link to the race showcase. Please note that pathfinding issues were fixed manually, sprint issue was handled by giving A.I.s a head start and Alarm issue occured, but is visible only for a fracture of a second ^_^.


"I am just a mere reflection of what I would be."

Offline

#28 20/5/12 10:36

EdT
Moderator

Re: Old China Level Mod - Final - Oct 17 2012 Update

Thanks for the race video, that was awesome!  PLEASE DON"T DELETE THE FILES!!!  Please release the files so I can see how it is done.

Can you tell me how you manually fixed the pathfinding issues.  Also, what command did you use to get the debug message.

I am currently fixing the china level.  The model was slightly rotated and that made making the bnvs harder.  So I have to fix the rotation and remake all the bnv, hopefully, that will fix my pathfinding issues.  I have seen the AI stop at the interface of two bnvs and sometimes in the middle of the bnv for no reason.

Offline

#29 20/5/12 12:11

Loser
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

Add this CMBT profile to BINACJBOCOmbat:

<CMBT Id="10150">
            <Header>
                <Flags></Flags>
                <Position>170.240768 -15.1207123 76.80492</Position>
                <Rotation>0 0 0</Rotation>
            </Header>
            <OSD>
                <Name>EdT_Lukas_race</Name>
                <CombatId>17</CombatId>
                <Behaviors>
                    <LongRange>FiringCharge</LongRange>
                    <MediumRange>RunForAlarm</MediumRange>
                    <ShortRange>Melee</ShortRange>
                    <MediumRetreat>RunForAlarm</MediumRetreat>
                    <LongRetreat>FiringCharge</LongRetreat>
                </Behaviors>
                <Combat>
                    <MediumRange>41</MediumRange>
                    <MeleeOverride>ShortRange</MeleeOverride>
                    <NoGunBehavior>RunForAlarm</NoGunBehavior>
                    <ShortRange>40</ShortRange>
                    <PursuitDistance>200</PursuitDistance>
                </Combat>
                <Panic>
                    <Hurt>600</Hurt>
                    <GunFire>900</GunFire>
                    <Melee>600</Melee>
                    <Sight>1200</Sight>
                </Panic>
                <Alarm>
                    <SearchDistance>50000</SearchDistance>
                    <EnemyIgnoreDistance>50</EnemyIgnoreDistance>
                    <EnemyAttackDistance>25</EnemyAttackDistance>
                    <DamageThreshold>600</DamageThreshold>
                    <FightTimer>10</FightTimer>
                </Alarm>
            </OSD>
        </CMBT>

This CMBT profile is a total alarm running coward. No Gun in hand = trip alarm behavior. Participate in a hand to hand duel and approach = trip alarm behavior. Short Alarm fight timer and small EnemyAttackDistance ensure that the A.I. will resume its alarm run even in the middle of combat, if it gets further than 25 units from the enemy.

Next, in CHAR file of the selected level, give all racers this combat ID (17, 0x11 in hex). Next, Add some Console with IsAlarm flag. You can add more if you wish, AI will always choose the closest one. Also be aware that if there are more accessible consoles with IsAlarm flag within Search Distance, A.I. will attempt to use all of them, one by one. Which can be also used for race purposes.

That is all. Spawn race participants (Combat ID 17), and make them aware of some enemy. Happy racing, the first one who uses the console is a winner.



The magical command is ai2_report_verbose "name". Since you have access to *certain assets*, you can fix the command for yourself so it won't produce annoying crashes for you. In order to use the command in its unfixed beauty and be not welcomed by BLAM! message, you have to ensure that the character in question is either active or drawn, is not in melee (crash) is not standing at patrol path point (crash) and generally is not doing anything unusual (crash).


I manually fixed issues by noting IDs of malfunctioning BNVs (chr_show_bnv=1), then backtracking them in AKVA file, noting addresses of corresponding pathfinding strips in RAW file. In RAW file, needed grids were altered manually, byte after byte. Feel the power of good ol' HEX editing ^_^.

It would be generally welcome if there was a tool for manual pathfinding grid processing. As I wrote: corners, doors, railings. AIs are getting stuck all the time for no reason. Autogenerated patfinding grids are fine, but there is a bleeding need for several touches in order to make AI really shine.

Also, have you resolved the issue with floors? In lair level, one can observe "hopping" of characters and you wrote somewhere that there were problems with characters falling through floor and the chosen solution is to add another floor right under the first one. I am asking because that could be one of our AI problems. I ran a test on lair using ai2_showpathfindingerrors. It shows that almost all BNV interfaces are labeled as a pathfinding error. No wonder AI will behave goofy ^_^

Last edited by Loser (20/5/12 12:12)


"I am just a mere reflection of what I would be."

Offline

#30 20/5/12 17:46

EdT
Moderator

Re: Old China Level Mod - Final - Oct 17 2012 Update

Loser:  I would still like to have the level6_final files and the bsl for it.  I'm sure Neo would like to see how you modified the pathfinding grids.  It may help in his algorithm for automatically generating the grids.

Making BNVs correctly is a difficult process.  I have been making quick and dirty bnvs which is fine for melees, but for patrol paths and pathfinding they are not.  I'm waiting for OniSplit to automatically generate the bnvs tongue

The falling through the floor issue was related to an object having too many polygons and the player getting in contact with it.  The solution is to surround the complicated object with an invisible cube

When you said the characters in the Lair level was "hopping" I'm not sure what you mean by that.  I know if the ground's polygon is too large, the player will start bouncing up and down in that section.

Offline

#31 21/5/12 13:03

Lukas Kreator
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

Alpha preview of the flags version, just so you can see I'm making progress, albeit slowly...
http://cl.ly/0N1p412i1u0y2y2N0Z0p

Offline

#32 21/5/12 20:06

EdT
Moderator

Re: Old China Level Mod - Final - Oct 17 2012 Update

Lukas, Very nice, take your time, I'm having a hard time getting the pathfinding grids working right.

Offline

#33 21/5/12 20:50

Lukas Kreator
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

Speaking of, I have quite some problems related to doors. The AI seems "confused" when I tell them to go to a flag in another room, as soon as they reach a door.
Also, telling the AI to go to a room above the room he currently is makes him run towards that point, but not "vertically", if you know what I mean.

Offline

#34 22/5/12 13:17

EdT
Moderator

Re: Old China Level Mod - Final - Oct 17 2012 Update

Lukas: Loser mentioned the poor pathfinding grids, so that's why they have problems with doors.  Going to the room above can also be related to pathfinding grids.  Well at least with the Old China level, there are no doors to worry about smile

Offline

#35 22/5/12 16:17

Loser
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

Lukas: do you mean one of these kinds of behavior:
1.) A.I. runs to the door, hits door as they are opening. Stops, starts twitching in place, rotating, doing goofy actions. Finally, abandons the objective of running to the flag.

2.) A.I. runs to the door which manage to open in time. A.I. then tries to pass through the door very closely to one side of the doorframe and gets stuck. Start twitching, rotating, behaving goofy. Finally, abandons the run.

If one of these describes your problem, then welcome in Oni Beta number 5 ^_^.

In Oni, there is one really, really painful problem with A.I. pathfinding. That is - pathfinding process does not take character's collision spheretree dimensions into an account when searching the path. Oni A.I. system blindly generates the shortest route based solely on pathfinding grids.

To pour more fuel in the doomfire, Bungie used some sort of automatic generation tool for pathfinding grids creation. Now while that is for sure pretty convenient, in reality something went wrong with that tool. Pathfinding grids are often randomly shifted to one side, thus allowing the A.I. code to happily navigate characters right into corners, doorframes or walls. Another issue is that while doors (in opened or closed state) have collision, they don't have any sort of special dynamic pathfinding grid. That means doors are de-facto invisible fatal obstruction for A.I.s, since A.I. does not see any problems with passing through the door area because the automated grid generation didn't count with door objects and usually marked those areas where door objects are present as "free to go thorugh".


Solution for this problem is to rework pathfinding grids so they reflect all actual possible colliding geometries. A good touch would be also to add safe-zone gaps into pathfinding grids in corner areas and around doorframes and railings, ensuring that A.I. code will try to navigate characters through these areas with some extra safety-space to prevent majority of random unexpected collisions.

Last edited by Loser (22/5/12 16:28)


"I am just a mere reflection of what I would be."

Offline

#36 22/5/12 16:25

Lukas Kreator
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

Yes, exactly. I have seem both behaviours. Even when there is a rectangular hole in the wall, but no door itself, they still have issues with the corners.

Offline

#37 22/5/12 16:26

Loser
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

Can I ask which level are you playing with and which area are you talking about? I am asking so I can try to fix those issues manually. Just for You, because we share a same name ^_^

Last edited by Loser (22/5/12 16:30)


"I am just a mere reflection of what I would be."

Offline

#38 22/5/12 19:35

Lukas Kreator
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

Oh, well, quite an honor, actually big_smile

Well, there's two places, both in ACC Interior (Power II):

1- The first room. I tell the AI to go to a flag which is beyond the door (not a physical door itself, but the lack of a wall), and it takes some time for it to stop bumping the sidewall and resume his way to the flag.
2- The door between the big open room and Shinatama's room. No matter what, the AI won't go through this door.

Also, is it possible to lower the reaction time of enemies? It takes far too much time for them to realize they have been issued the order to go towards a flag...

Thanks.

Last edited by Lukas Kreator (22/5/12 22:08)

Offline

#39 23/5/12 14:23

EdT
Moderator

Re: Old China Level Mod - Final - Oct 17 2012 Update

Loser:  I chatted with Neo, and he could work on a tool to manually edit the pathfinding grids smile  I'll keep you posted.   BTW, still waiting for the level6_Final files with the fixed pathfinding grids...

Also, can you give me the bsl script for the console.  I like how it gives the winner of the race.

Offline

#40 24/5/12 16:09

Loser
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

EdT
I had to repack some level and I forgot Installer repacks all levels in the process. But to compensate for that, I can give you THIS RAR ARCHIVE. It contains pathfinding grids for first three rooms of Acc Processor Interior level (level 10) in Onisplit TGA format. Thus you can see for yourself what kind of changes were done in order to stop AI characters from unneccessary wall collisions.

These grids also contain a little experiment - areas with jumpable obstacles are not marked with red/green tiles, but with orange/blue tiles. Thus with properly set MELE profile, AI has some limited ability to jump over these obstacles or to at least jump and punch/kick the player down from the obstacle. In the first room (grid 000) I also left a line of red grids inside furniture, but such a design was proven to take away desired result - AI characters being able to act even when on top of furniture. Other "furniture-like" obstacles use strictly orange/blue tiles. Effect is then quite satisfactory.

Lukas
HERE YOU ARE. Unpack level 10 with Onisplit, replace your AKEV with AKEV from the rar, repack the level.
It is quite laborious to produce these grids (even with help of Onisplit), so I reworked only the First room, Big hall, Shinatama Hall and first cubicle with console 1. Electrified tube and the rest of the level are left unchanged.

A.I. characters should not run into walls anymore. However, as a side effect, they sometimes stop at sharp U-turns to make a turn. To reduce this behavior, please increase turing rate of the A.I. (in ONCC file) to the value 2.0. That should be enough to minimize unwanted stops.
There is also an issue of doors not opening fast enough, so A.I. collides with them. Quick and dirty fix to this problem is to enlarge door activation distance in "BINACJBODoor". Default is 900, I recommend 2500 for race purposes.

Also Lukas, I have investigated ai2_movetoflag and ai2_doalarm commands a bit. With my apologies, these commands are not good for a race-like purposes. These two commands work almost 100% only on short-to medium travel distance. On longer routes, A.I. usually meets repath attempts quota. That means two things - first, A.I. obviously stops the run for a flag/console. AND second, A.I. character becomes very sensitive to any more repaths attempts on its future travels. That is probably a coding bug, because the number of allowed repaths should be IMO cleared when the run is abandoned (but obviously it is not). Anyway, that means even more random stopping for seemingly no reason -_-.

In conclusion, alarm behavior is the safest bet in my opinion. But feel free to experiment with flags, now even without A.I. getting stuck at each second corner ^_^.


EDIT: Pathfinding grids can be edited as TGA images. However, it would be most welcome if Onisplit didn't add extra (and totally unneccessary) collisions to "fake stairs" and other decoration geometry. Because of that, one has to use Onisplit to edit TGAs and pack/repack levels, then after needed changes are done, one has to get all the pathfinding grid data in raw form and HEXmanually (since grids have various lengths) insert them into "clean" level file.

Last edited by Loser (24/5/12 16:21)


"I am just a mere reflection of what I would be."

Offline

#41 24/5/12 17:34

Lukas Kreator
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

Hmm, true, but we have nothing aside from these two commands.
Besides, I've been been experimenting with low-medium distances only, and maybe I can shorten paths by dividing them into smaller distances.
After I am done with/discard the flags idea, it won't take much for me to turn it into the alarms approach.
I've been actually scripting something quite different from the original idea, but I plan to make it more like what you guys described if this works well.

Also, thanks again for the modified level 10, the experimentation and the information.

Offline

#42 24/5/12 22:42

EdT
Moderator

Re: Old China Level Mod - Final - Oct 17 2012 Update

Loser: I got this OniSplit from Neo today: http://edt.oni2.net/OniSplit/OniSplit_68.zip

He changed some of the pathfinding grid creation code, based on your comments I shared with him.  This may or may not address your issue about the unnecessary collisions.

I got some basic pathfinding grids working in the level, here is a test with 3 AIs racing through it:
http://youtu.be/ed9gFJyaRFg

I used the command ai2_doalarm for all of them without changing their combat ID to the racer ID.

Offline

#43 26/5/12 5:51

Loser
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

Nice run EdT and congrats to finally working A.I. pathfinding. What was the issue? Ghost quads?
I haven't yet tried the newest Onisplit pathfinding grid generation. What I tried instead was to simply perform AKEV -> "DAE files" conversion and subsequently "DAE files" -> AKEV conversion. Repacked the level, ran the game.

Result is unfortunately again the same. Oni uses a simple plane with fake stairs (stairs have no collision) as a staircase. When model is imported via Onisplit, collision is added to each and every stair, resulting in an impassable staircase (well, it can be jumped, but A.I. characters cannot do that).

But I guess the mistake is on my side and I should add some parameter when creating AKEV, right ^_^ ?

Last edited by Loser (26/5/12 5:52)


"I am just a mere reflection of what I would be."

Offline

#44 26/5/12 9:40

EdT
Moderator

Re: Old China Level Mod - Final - Oct 17 2012 Update

Loser:  Neo says "the problem is not the plane but the stairs, the stair need "no character collision" unfortunately i'm not sure how to set that automatically"  If you look at the AKEV in a 3D program, the invisible plane is not on top of the stairs but actually slightly underneath, so you are actually colliding with the stairs.

The issue was both, correctly making the bnvs and ghost quads.

So what bsl script did you use with the alarm console, do give different messages when either the player or AI triggered it?

Offline

#45 26/5/12 11:41

Samer
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

so much technical stuff tongue ... i just wanted to fight hayate in the china level sad


Join our Oni Facebook Group
Check My YouTube Channel for my Oni Videos.
Check My Wiki page for all my stuff

Offline

#46 26/5/12 12:13

Lukas Kreator
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

Speaking of, EdT, I'm unsure how to detect when either the player or the enemy racer wins the race.
Is there a list for trigger volumes in each level, or a command to actually see them?

Offline

#47 26/5/12 14:26

Loser
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

func void function_called_by_the_console(string ai_name)
{
  if( chr_is_player(ai_name) )
  {
    dmsg player_won_the_race
  }
  else
  {
    dmsg player_lost_the_race
  }
  sleep 180
  message_remove
}

Precise recognition (aka which one of AI characters used the console) could be possible via ai_name parameter. So far unproven, I had to completely reinstall the laptop. Will try to explore this matter when Oni and tools are back alive and kicking.

I know there is no issue with hidden sloped plane but with stairs. Well, either another candidate for handjob...or we have to wait till Neo comes with some solution. Maybe attach a special material to stairs? Onisplit then wouldn't add char collision to quads with this chosen material.



Lukas Kreator, I don't have Oni installed right now, but TrigVolumes are stored in "BINACJBOTrigvolumes" file (or something like that). Easily convertible to XML with Onisplit. You can set position and dimensions of the trigger volume, when it should trigger (entry, inside, exit), which teams (TCTF, Syndiocate, Neutral etc) can trigger it and so on. Ideal for the race would be to have it around the FINISH flag and have it set to fire upon entry of any race participant. In that moment you should disable it ( trigvolume_enable *name of the TrigVolume* 0 ) and use string ai_name to distinguish who won the race.

Last edited by Loser (26/5/12 14:29)


"I am just a mere reflection of what I would be."

Offline

#48 26/5/12 14:29

EdT
Moderator

Re: Old China Level Mod - Final - Oct 17 2012 Update

EDIT:  Thank you for the code.  chr_is_player is very useful smile

I'm lousy with coding, so how would you write the code to produce the message "string ai_name" has won the race?

Offline

#49 27/5/12 10:02

Loser
Member

Re: Old China Level Mod - Final - Oct 17 2012 Update

EdT, your request to have a sentence "ai_name" won the race! printed on screen is kind of hard to fulfill, because BSL does not allow joining of strings (BLAM! Oni crashed). I tested this possible solution which should be quite close to your desired effect:

func void function_called_by_the_console(string ai_name)
{
  if( chr_is_player(ai_name) )
  {
    dmsg "[y.Player won the race!]"
  }
  else
  {
    dmsg "[y.Player lost the race. The winner is:]"
    dmsg (ai_name)
  }
  sleep 180
  message_remove
}

In case of AI character winning the race, Following is printed:

Player lost the race. The winner is:
"ai_name"

If you really insist on displaying the sentence "ai_name" won the race!, then the code will have to look a bit different and will probably be a lot more complex, since BSL does not allow string comparsion (so it cannot be "if-elsed" who used the console).


"I am just a mere reflection of what I would be."

Offline

#50 27/5/12 11:07

EdT
Moderator

Re: Old China Level Mod - Final - Oct 17 2012 Update

Loser: Thank you, that works fine.

Offline

Board footer