Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions


Renderware AI **How it works**

Recommended Posts




It's been 3 months since i started working in renderware.


It was very interesting and it was quite impressive to see how game engines have evolved.


Back then you had to pretty much do everything.So it was quite amusing to see how game developers used to code games back then.Especially Rockstar North with Gta vice city ,San Andreas etc,



Disclaimer **3,Vice City,San Andreas, etc,** Uses a modified version and Tweaked version of the renderware engine.


Disclaimer ** Liberty City Stories and Vice City Stories** uses the rockstar games leeds engine.Which is derived from RenderWare.



Rockstar Leeds Engine: Most of the functions have the same name except Rw/Rp/... are replaced by Rsl. Also some RW objects were renamed:


.Furthermore RslGeometry conatains no platform independent data like RwGeometry does but only PSP or PS2 specific data. The iOS/Android versions of GTA Liberty City Stories use PS2 geometry that is converted to OpenGL geometry at runtime. Unlike RW Rsl has no plugin system, instead all data that is stored in RW plugins is hardcoded in the respective object's struct.


While the stream file formats (DFF and TXD) are similar to the real RenderWare formats, they're not the same, especially since RslGeometry and RwGeometry are so different. The PSP and PS2 versions don't ship with DFF and TXD files (and many other files for that matter). Instead

they use files in relocatable format which are raw compacted memory contents with relocated pointers. All versions of these games use relocatable chunks for the world system, which is unique to GTA Liberty City Stories and GTA Vice City Stories.




Now what really caught my eye it was how the AI worked.


It's simple it worked like this 


Perception ---> Decision --> Action


Perception: NPCs first need to understand world topology, identify obstacles, enemies, locate sounds, etc.

Decision: Once situation is perceived, NPCs decide what to do.

Action: Once decision is made, it is translated into actions.


And the Behavior Paradigm has two main consequences:


Decision is only a part of NPC behavior. A.I. is more than only decision making.

Perception is behavior foundation: Without good perception, there is no relevant decision or action (garbage in, garbage out).


It's logic.


In Renderware Ray Casting is not really used for main reasons:


Today NPCs perception is based almost exclusively on ray casting. Not only does ray casting give NPCs a very poor understanding of their environment, but they also severely affect performances.

You have to cast many rays to get an answer to such a simple question as “where should I go to hide from an enemy?”

Very often developers have to limit the number of NPCs as well as the number of ray casts per NPC


So in order to compensate NPC's poor 3D perception.


In order to compensate NPCs poor 3D perception, developers also manually add topological data into the world. For example, they position hiding places, activation zones, etc. However this data does not constitute an acceptable solution to limited perception, because:


Manual data generation is not exhaustive ; 

Manual data generation is time consuming ;

Data generated might not be compatible with game engine collision and movement models

Data tuning makes production process more complex


There is also another way to overcome poor 3d perception:


Another way to overcome poor 3D perception is to script every single event of the game. Very limited 3D perception leads to extremely detailed, case by case, decision scripting. Again scripting is not the best approach to compensate for poor perception, because:


It is time consuming

Interactivity means you cannot forecast everything

Scenarios become linear

It is complex to script rich behaviors including team coordination, fine positioning, etc.


So with next generation game need even more advanced 3d perception:


With next generation games, workarounds to overcome poor 3D perception will not work anymore. Map sizes will probably be multiplied by a hundred, as well as number of active NPCs.

As a consequence:


With more and more NPCs, ray casting will just become too CPU consuming ;

Map sizes will probably make manual generation just impossible ;

For large maps with lots of NPCs, only high level scripting will be acceptable. Very detailed scripts will turn into nightmares ;

Large maps perception data will need streaming to optimize memory consumption.





Advanced 3D perception

Advanced 3D topology dynamic analysis

Accurate description of local environment


Let's begin with Path Data


3D Perception must rely on a specific modeling of the world. It cannot come directly from rendering and physic data (ray casting). Game developers need a world modeling from a rendering perspective (polygons) or a physics perspective (collision meshes). They also need a modeling from a behavior perspective. RenderWare A.I. proposes such a modeling called the PathData. It is then used for advanced 3D perception and pathfinding.


RenderWare A.I. offers an Automatic PathData Generator tool to extract automatically this modeling. The generation process takes into account game engine specificities such as collision models and movement models. A manual edition of PathData is then possible for local customization.


PathData are compatible with streaming mechanisms in order to optimize memory consumption for large maps:


PathData streaming manages NPCs priorities (all data do not need to be available at the same time for all NPCs)

NPCs data requests are anticipated in order to avoid blocked NPCs.


Advanced 3D perception


Once PathData are available, they constitute the foundation for advanced 3D perception. NPCs need two different types of 3D perceptions:


Advanced 3D topology dynamic analysis ;

 Accurate description of local environment.


Advanced 3D topology dynamic analysis


-NPCs need to understand the 3D topology of their environment. RenderWare A.I. includes the 3D topology dynamic analyzer. It identifies, at runtime, places relative to a NPC, with interesting topological properties. For example:


- To kill a monster, an NPC wants to adopt a "shoot & hide" strategy. The 3D topology dynamic analyzer will identify, at runtime, all potential locations from where NPCs can easily shoot at and hide from the monster.


- 3 body guards protect a VIP. The 3D topology dynamic analyzer will identify, at runtime, all potential locations from where one can shoot at the VIP. Body guards will then position themselves in order to cover these threats.


- To attack enemies, NPCs organize an opposite flank assault. The 3D topology dynamic analyzer will identify, at runtime, the different ways to access enemies. NPCs will then know if an opposite flank assault is possible (there are at least two distant enough access ways). They will then be able to position properly for the attack.


- To properly position a camera into a room, the 3D topology dynamic analyzer is a must. Typically, you do not want the camera to look at a wall. The best method is to choose the location that maximizes the number of visible ways to access the room.


And finally there is Accurate description of local envrionment


A high level understanding of the environment is key, but not sufficient. The 3D topology analysis will not always give NPCs the required perception level of detail. For example, a team is progressing in an urban hostile environment. The 3D topology dynamic analyzer will identify zones from where danger can come. However, to minimize exposure, team members should move along the walls from one corner to the other. The team therefore needs a local analysis to locate walls, obstacles and corners.


RenderWare A.I.  includes new functionality specifically designed for local topology analysis. The static environment will be pre-processed via is a two step analysis:


First step: extraction of relevant local topological shapes ;

Second step: classification of extracted shapes.


Thanks to this preliminary analysis, game developers will be able to give (at runtime) an accurate and reliable local perception without consuming CPU. They will know exactly where the surrounding walls are, where the interesting corners are, etc.


And there you go that's how A.I in renderware works.


I found it quite interesting and impressive to see how things worked back then.I had to do extensive research and spend allot of time doing trial and error to come to these conclusion.


I am also learning Renderware Physics ,audio and Vision FX


Renderware Physics

Renderware Audio

Renderware Vision FX etc,

Share this post

Link to post
Share on other sites

It sounds interesting, however I barely understand anything. Could you please post maybe an example which is triggered in game? Because in VC, afaik every ped group is in some relation with the player i.e. when the player shoots, depending on if they fear him or not, they will either run away or attack him. If they will run, they simply follow some paths stored in-game. If they attack, they will go using the same in-game paths or go straight to the player if no path exists.

Share this post

Link to post
Share on other sites


Sorry for responding to your message so late.

I was in vacation etc,

Well this was the first part.

I will post the second part where i show what is triggered etc,

then a third part etc,


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.