NFSAddons Forums

Mar 28, 2024, 7:57 AM

Show Posts - PomFrit

Welcome to NFSAddons Forums - Add your own description in your admin center.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - PomFrit

Pages: [1]
1
General NFS / NFSHS AI basics/tutorial
« on: Jun 02, 2023, 1:35 PM »
I did'nt find a track with AI made right, so here is how High Stakes AI should be done. I hope this helps make better AI.

For understanding look on the picture.



Speed - is maximum AI speed in m/s for Champion + MADLAND difficulty. Each difficulty, AI ( Ace, Gotcha, Scream - fastest, Sleepy and Bully - slowest ), weather and surface automaticaly lowers the limit. Weather + snow surface reduce speed limit a lot. For acceleration a i recommend use 111 ( it's 400km/h and easy to find ), for braking use doubled numbers reduced by 2 ( 60,60,58,58,56,56,54,54, ... ), it works best. AI can't slow faster, it's very rare when stronger braking works better.

AI lines
- 112, 128, 144, 160, 176, 192 for the right side 
- 96, 80, 64, 48, 32, 16 for the left side
- lines 16, 32, 176 and 192 may have problematic use

AI lines can be edited through "unknown data", most used are this:

Right side ( column 0 and 8 ):

80 - 1 line ( 112 )
C0 - 2 lines ( 112,128 )
E0 - 3 lines ( 112,128,144 )
60 - 3 lines with obstacle in line 112 ( 128,144 )
F0 - 4 lines ( 112,128,144,160 )
70 - 4 lines with obstacle in line 112 ( 128,144,160 )
F8 - 5 lines ( 112,128,144,160,176 )

Left side ( column 1 and 9 ):

01 - 1 line ( 96 )
03 - 2 lines ( 96,80 )
07 - 3 lines ( 96,80,64 )
06 - 3 lines with obstacle in line 96 ( 80,64 )
0F - 4 lines ( 96,80,64,48 )
0E - 4 lines with obstacle in line 96 ( 80,64,48 )
1F - 5 lines ( 96,80,64,48,32 )

I add more numbers, when i will be sure.

Float numbers - practicly Vroad Node offset. It's distance ( in meters ) from Vroad Node to point, where you want AI to go, negative numbers left side and positive numbers right side.

AI lines have limited width ( 96 and less - negative numbers, 112 and more - positive )

If line width is 4, float and AI lines are bounded like this:
- 96/112 is for 0,1 to 4
- 80/128 is for 4,1 to 7,9
- 64/144 is for 8-12
- 48/160 is for 12,1-15,9
- 32/176 is for 16-20
- 16/180 is for 20,1-23,9

If its 5
- 96/112 is for 0,1 to 5
- 80/128 is for 5,1 to 9,9
...

Thanks to JimDs T3ED update, its possible to change AI line width, but i recommend set AI line width to road width. Traffics drive on middle of AI lines.

AI lines and Float numbers are bouned, but AI lines are priority for AI if float numbers are outside defined AI line or too far! If u set Float number outside of AI line width, opponents will drive on the defined AI line, but ignore float numbers. Also you just can't set float to 0 and switch only AI lines, that didn't work. AI always try to ride the floats even if the AI lines are wrong.

VRoad Edge - dark purple lines, its limit for AI ( opponenst, trafics and cops ), AI driving between them and refuse go outside. You can have 6 AI lines defined, but if VRoad Edge is for example between 3rd and 4th line, AI wont use 4th 5th and 6th line.

Cops - they drive automaticaly and cant be controled. Cops are controlled by Vroad nodes line, existed AI lines and VRoad edge.

IMPORTANT

AI can't drift or slide like player, they need use brakes before turning. For this reason, opponents will never be fast as player, but if you are not like EAOAgent, they can be competitive.

Before testing, you need put all float numbers 2 Vroad nodes sooner than u want ( make backup ), because AI reacts too late. If you did'nt do this, AI may turn too late or crash. It works on 90% cases.

TRACK TEST
First lap around first 8 blocks AI ignore float numbers and drive only on defined AI lines !
I recomend test track with F1 and CLK-GTR ( what works for F1 may not work wor CLK-GTR ), Champion difficulty and Madland cheat for proper speed limit. Also you need test the track with SLK 230, PRO diffiulty, weather set ON and slow AI ( not ACE, SCREAM or GOTCHA ). Pro diffiulty with weather and slow AI may crash where Champion won't. This will show 90% problems.

Sorry for the grammar, I've never studied English. This is my games/movies/translator English:)

Pages: [1]

Support NFSAddons: