NFSAddons Forums

Oct 04, 2023, 7:20 AM

NFSHS AI basics/tutorial

This is a discussion for the topic NFSHS AI basics/tutorial on the board General NFS.

Author Topic: NFSHS AI basics/tutorial  (Read 1674 times)

11 Replies on NFSHS AI basics/tutorial
on: Jun 02, 2023, 1:35 PM
Rookie Member
Posts: 14 Joined: November 03, 2005

  • *
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 cannot slower faster, it's very rare when stronger braking works better.

AI lines
- lines 80,96,112 and 128 always exist
- lines 48, 64, 144 and 160 exist on some wider tracks sections
- lines 16, 32, 176 and 192 are extremely rare and have problematic use

You can test it, if line exist. For example, on section where u want to know, if line 144 exist, set around this section AI speed to 15 m/s, line to 128 and Float numbers to -0,1 then watch where AI drive. After that switch line to 144, and watch it again. IF AI drive same position or driving in waves, line did'nt exist. Same for left side but with 0,1 float numbers. You can't add AI line. Right now only way, to add line, is replace block with another block where line exist and remodel it.

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 numbers are
- 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 u set Float number outside of AI line width, opponents will drive on the defined AI line, but ignore float numbers.

VRoad Edge - dark purple lines, its limit for AI ( opponenst, trafics and cops ), AI driving between them and refuse go outside.

Cops - they are ignore speed limit, float numbers an AI lines. Cops are controlled by Vroad nodes line 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 AI can't be Ace, Gotha or Scream ( they are the winnig AI and drive better than others ). 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:)
« Last Edit: Aug 12, 2023, 2:49 AM by PomFrit »

Reply #1
on: Jun 02, 2023, 1:36 PM
Rookie Member
Posts: 14 Joined: November 03, 2005

  • *
ADVANCED TIPS AND TRICKS

CREATING NEW MAPS
If you making whole new map, i recomend use block 177 from Lost Canyons ( 6 AI lines on right side and 5 on left ) or block 123 from Red Rock ( it seems, it has 6 AI lines on both sides ). Test and backup a lot. For copying blocks use T3ED 4.3.0.400 or older. I have bad experience with newer versions, instability and often data mismatch.

LONG TURNS AND U TURNS
If you want AI to drive on the yellow line, you cant put same float number and AI line all the time. It works only on low speed, AI keeps drifting away from the intended route. Best way how to do it, is drive on the AI line edge and switch between inner and outer line. Most of the time i use 2 nodes inner line, 4 nodes outer line and constant speed ( not full throttle ). Sometimes u need more inner or outer, it depends on the turn and speed. Line switch is for AI like signal to turn, 2 nodes inner line - turn little or 4 nodes inner line - turn harder.


« Last Edit: Jun 16, 2023, 4:09 AM by PomFrit »

Reply #2
on: Jun 03, 2023, 2:28 AM
Sr. Member
Posts: 197 Joined: June 09, 2018

  • ****
If u set float number outside of AI line width, opponents will drive on the defined AI line, but ignoring float numbers.
Now i may understand why my AI drives into the middle road pollars all the time. Very interesting topic

Reply #3
on: Jun 06, 2023, 12:01 AM
Sr. Member
Posts: 248 Joined: February 04, 2009

  • ****
Good explained, but shouldn't this be better in the NFS:HS Workshop?
Get T3ED, Stock & Expansion Pack from Magenta Cloud.

Reply #4
on: Jun 06, 2023, 2:36 PM
Sr. Member
Posts: 197 Joined: June 09, 2018

  • ****
ADVANCED TIPS AND TRICKS

CREATING NEW MAPS
If you making whole new map, i recomend use block 177 from Lost Canyons. Its propably the widest track section and it has 6 AI lines on right side and 5 on left side, witch should be enough for almost everything you want to create.
So you're saying that one can't create new AI lines with T3ED, but instead one should use a track block which has a large number of AI lines already?

Reply #5
on: Jun 08, 2023, 1:00 AM
Rookie Member
Posts: 14 Joined: November 03, 2005

  • *
Good explained, but shouldn't this be better in the NFS:HS Workshop?

Maybe, but i'm not Team RSR member.

Quote
So you're saying that one can't create new AI lines with T3ED, but instead one should use a track block which has a large number of AI lines already?

Yes, if you need more lines, you can't add, but you can replace block with block, witch has more AI lines.

I tested this on Celtic Ruins, where i try navigate AI between trees on S curve before finish, but there are no AI lines, only 3 in original track. So i replace whole section with block from Landstrase ( where i know lines exist ), remodel back vertex by vertex and now i have 6 lines on that section.

Missing lines may be problem for AI ( its like hole where AI don't want to drive ), but more lines can be simple limited by Vroad Edge, AI refuse go behind it.
« Last Edit: Jun 08, 2023, 1:56 AM by PomFrit »

Reply #6
on: Jun 08, 2023, 4:32 AM
Sr. Member
Posts: 197 Joined: June 09, 2018

  • ****
Good explained, but shouldn't this be better in the NFS:HS Workshop?

Maybe, but i'm not Team RSR member.

Quote
So you're saying that one can't create new AI lines with T3ED, but instead one should use a track block which has a large number of AI lines already?

Yes, if you need more lines, you can't add, but you can replace block with block, witch has more AI lines.

I tested this on Celtic Ruins, where i try navigate AI between trees on S curve before finish, but there are no AI lines, only 3 in original track. So i replace whole section with block from Landstrase ( where i know lines exist ), remodel back vertex by vertex and now i have 6 lines on that section.

Missing lines may be problem for AI ( its like hole where AI don't want to drive ), but more lines can be simple limited by Vroad Edge, AI refuse go behind it.
Ok so i think we can summarize that there is A LOT more hidden track data than expected? :D

Reply #7
on: Sep 05, 2023, 9:05 AM
Sr. Member
Posts: 197 Joined: June 09, 2018

  • ****
Good explained, but shouldn't this be better in the NFS:HS Workshop?

Maybe, but i'm not Team RSR member.

Quote
So you're saying that one can't create new AI lines with T3ED, but instead one should use a track block which has a large number of AI lines already?

Yes, if you need more lines, you can't add, but you can replace block with block, witch has more AI lines.

I tested this on Celtic Ruins, where i try navigate AI between trees on S curve before finish, but there are no AI lines, only 3 in original track. So i replace whole section with block from Landstrase ( where i know lines exist ), remodel back vertex by vertex and now i have 6 lines on that section.

Missing lines may be problem for AI ( its like hole where AI don't want to drive ), but more lines can be simple limited by Vroad Edge, AI refuse go behind it.
Are you really modeling each block polygon by polygon? How is this supposed to even work?
And what is the maximum width for a polygon lane? Can it be something like 25? Because there are tracks like Lake Diabolo or Monolithic Studios which need either a lot more AI lane polygons or they have to be wider because if there are only 2 on each side, those 2 have to be really wide for AI not to drive into objects placed right in the middle of the road like Redrock Ridge or Durham Road. Do you have any new findings about this?

Reply #8
on: Sep 05, 2023, 9:07 AM
Sr. Member
Posts: 197 Joined: June 09, 2018

  • ****
And i think you're wrong about the 112 AI lane selection, you show in your picture that it is the first right line, but the AI drives on the middle of the road! They drive on the virtual road points, not on the first right lane. I only wanted to be sure about that, it would be nice if you could test this on your side

Reply #9
on: Sep 05, 2023, 11:59 AM
Rookie Member
Posts: 14 Joined: November 03, 2005

  • *
Quote
Are you really modeling each block polygon by polygon? How is this supposed to even work?

I copy original block as new object ( call it fake object ), change belongings to block near by ( same for all object belonging to block what will be replaced or objects will be deleted ), replace intended block with new one and then merge proper vertex by vertex with fake object. After that i delete fake object. Its hard to explain, but its prety fast, problem is shadows and road lines, that is vertex hell :). I didn't do whole track, just 1 or 2 blocks.

Quote
AI not to drive into objects placed right in the middle of the road like Redrock Ridge or Durham Road.

Im not sure with this, but navigate AI between columns on original track is often impossble. Sometimes polgons on the middle have set Virtual Road Boundary, but it won't help if i uncheck this. Propably unknown polygon data.

Quote
And what is the maximum width for a polygon lane? Can it be something like 25?

Maximum what i tested is 15 i think, but you can't set where AI should drive if doesn't follow float numbers ( mostly on middle AI line ), its propably part of unkown data. Width 4 or 5 is best for making fast AI.

Quote
And i think you're wrong about the 112 AI lane selection, you show in your picture that it is the first right line, but the AI drives on the middle of the road! They drive on the virtual road points, not on the first right lane.

You have partialy right, line 112 is first on the right, but AI may act weird, if doesn't follow float numbers. I think, EA can set where AI should drive without float numbers, propably unknown polygon data too.

If you have specific problem, maybe i can help. I give up writing advanced tips, there isn't universal way how to make AI and i don't have time to write a book.

Reply #10
on: Sep 05, 2023, 5:12 PM
Sr. Member
Posts: 197 Joined: June 09, 2018

  • ****
If you have specific problem, maybe i can help. I give up writing advanced tips, there isn't universal way how to make AI and i don't have time to write a book.
I totally agree with you. Well i just want to get the AI to drive past objects in the middle road and not drive right into them.. But i'm done with my latin. I fixed Monolithic Studio's virtual road completely and there's this one pole in the middle of the road after the star wars deathstar straight line, but i can't get traffic nor opponents to drive around it. They drive right into the pillar. And i can't even get it to work like EA did in tracks like Durham Road or Redrock Ridge, they just don't drive past the road objects.

Reply #11
on: Sep 06, 2023, 1:01 AM
Rookie Member
Posts: 14 Joined: November 03, 2005

  • *
I had the same problem when i was doing the Scorpio7 AI, AI just won't see the new obstacles on the tracks if they weren't in the original track. Maybe you can try rebuilding the blocks around the pillar with a block from Durham Road (or another track) with a divided section. That unknown data will be maybe transmitted.

 


Support NFSAddons: