My AI toolkit

Making or wanting help making your own asset? Check in here
Post Reply
dnamro
Posts: 29
Joined: 2014-07-27 00:47

My AI toolkit

Post by dnamro »

What started out as a navmeshing script helper is turning into a set full AItoolkit. You can check out the fully functional WIP here:

Dnamro Navmeshing script v3 - Battlefield SinglePlayer Forum

I wanted to learn to code in Python so I started by adding to the DICE navmesh scripts and then continuing to expand. The next major task will be to optimize it and make it easier to use for those that are new to creating SP and COOP support for maps.

(I plan to update the tutorial after the next release. It has not been updated since the first release).

Here is a list of features:

Features:
- Menu based tool to automate many of the processes.
- Allows a map selection from a list of maps in the mod folder.
- The create navmesh process will move the GTSdata files from the map to the
navmesh work area.
- Fix Navmesh process will clean the infantry.obj or vehicle.obj files after
editing during the Fix navmesh process. This fixes most obj file export issues from
Blender and 3dsmax and includes creating a standard materials.mtl and setting up the obj
file with the appropriate line in the file.
- Fix Navmesh routine also copies the output files to the map automatically.
- The largest navmesh islands can be copied over and used for infantry and/or vehicle obj files and
are cleaned as they are copied.
- The Strategic Area file neighbored automatically.
- navmeshes are backed up automatically with a date-time stamp in the name and moved to
the \backup folder in maps's navmesh work area.
- Logfiles are backed up automatically with a date-time stamp in the name
- The Check AI function checks for AI.AI file and updates if it is missing or lacking key info, letting the user select for BF2 or BF2142 settings.
- The Check AI function also checks for a missing overgrowth file and creates a blank one if needed.
- The Editor can be launched for the map/mod selected with several options
- BF2142 convertor changes problematic vehicle spawns to BF2 versions based on conversion list that can be edited with a text editor. This can be edited for other purposes besides just for BF2142 to BF2. It can be used to convert to other mods by creating your own conversion list. The editor_conv.txt can be found in the navmesh folder.
- The staticObject updater function will convert the staticobject file based on a list of nav mesh stand-ins. This conversion list is Nav_Stand_in_conv.txt, located in the navmesh folder and can also be user edited with any text editor. There is also a function to create this list based on the list of folders in the [mod_name]\objects\nav_static folder, which is where I keep my navmesh stand-ins. The navmesh stand-ins were created by the project reality and all have _nav at the end of name. These have working AImeshes that allow the the static object to be properly navmeshed.
B4rr3l
Posts: 259
Joined: 2017-01-19 20:44

Re: My AI toolkit

Post by B4rr3l »

dnamro wrote:What started out as a navmeshing script helper is turning into a set full AItoolkit. You can check out the fully functional WIP here:

Dnamro Navmeshing script v3 - Battlefield SinglePlayer Forum

I wanted to learn to code in Python so I started by adding to the DICE navmesh scripts and then continuing to expand. The next major task will be to optimize it and make it easier to use for those that are new to creating SP and COOP support for maps.

(I plan to update the tutorial after the next release. It has not been updated since the first release).

Here is a list of features:

Features:
- Menu based tool to automate many of the processes.
- Allows a map selection from a list of maps in the mod folder.
- The create navmesh process will move the GTSdata files from the map to the
navmesh work area.
- Fix Navmesh process will clean the infantry.obj or vehicle.obj files after
editing during the Fix navmesh process. This fixes most obj file export issues from
Blender and 3dsmax and includes creating a standard materials.mtl and setting up the obj
file with the appropriate line in the file.
- Fix Navmesh routine also copies the output files to the map automatically.
- The largest navmesh islands can be copied over and used for infantry and/or vehicle obj files and
are cleaned as they are copied.
- The Strategic Area file neighbored automatically.
- navmeshes are backed up automatically with a date-time stamp in the name and moved to
the \backup folder in maps's navmesh work area.
- Logfiles are backed up automatically with a date-time stamp in the name
- The Check AI function checks for AI.AI file and updates if it is missing or lacking key info, letting the user select for BF2 or BF2142 settings.
- The Check AI function also checks for a missing overgrowth file and creates a blank one if needed.
- The Editor can be launched for the map/mod selected with several options
- BF2142 convertor changes problematic vehicle spawns to BF2 versions based on conversion list that can be edited with a text editor. This can be edited for other purposes besides just for BF2142 to BF2. It can be used to convert to other mods by creating your own conversion list. The editor_conv.txt can be found in the navmesh folder.
- The staticObject updater function will convert the staticobject file based on a list of nav mesh stand-ins. This conversion list is Nav_Stand_in_conv.txt, located in the navmesh folder and can also be user edited with any text editor. There is also a function to create this list based on the list of folders in the [mod_name]\objects\nav_static folder, which is where I keep my navmesh stand-ins. The navmesh stand-ins were created by the project reality and all have _nav at the end of name. These have working AImeshes that allow the the static object to be properly navmeshed.
Holly bots!

Amazing man! I've done 2 navmeshs by my own and gave up of doing for all the maps and grabbed some at BF2-Games.net, probably a lot from you lol

You just brought a really nice map expansion pack for BFHD, thank you very much for keep supporting this community.
Outlawz7
Retired PR Developer
Posts: 17261
Joined: 2007-02-17 14:59

Re: My AI toolkit

Post by Outlawz7 »

This sounds awesome, I'll try and give it a go ASAP. :)
Image
Valmont
Posts: 159
Joined: 2014-10-21 13:43

Re: My AI toolkit

Post by Valmont »

Legendary lord dnamro, founding God of BF modding!

We thank thee for all your blessings!

=)
dnamro
Posts: 29
Joined: 2014-07-27 00:47

Re: My AI toolkit

Post by dnamro »

Thanks Guys!

My goal is to make adding SP/COOP easier for modders.

One feature not mentioned above is the ability to only work on Infantry or Vehicle navmeshes. This can save a lot of time since generating the navmesh can take anywhere from a hour to several days for large complex maps. Being able to redo or focus on one navmesh at a time can save a lot of time.

Feedback from modders is that the current processes for adding COOP/SP to a map is overwhelming, for both old and new modders. Also, requiring modders to use 3d modelling software to edit the navmesh is a step beyond those new to modding. After all, the appeal to BF modding is that, for the most part it is relatively easy to get started and pick up as you go along. But, SP/COOP support is very complicated and most give up in frustration after making the attempt. Currently the tool has a lot of separate functions. My goal is to eventually make this a more streamlined, easier to use process that will work for most maps without needing any special skills.

To that end the next thing I will need to create is a option to take the generated AI files and set them up for use in the map. That will be a bit more involved than anything I have done so far, with the current tool. It will involve copying the AI files setting up the GPO files and folder and updating the info.desc file. I could also have it unzip the map's server.zip and then zip it back up using the open source 7zip tool. The loadmap and preview pics could be copied from the CQ versions.

I am currently playing around with Worldlife123's info map generator tool to update/create the map's info desc file based on the gamemodes, with his permission, of course. Once I have that working, then I can use that functionality to be able to update the desc file for the sp/coop game modes in my tool.

BF2 & BF2142 style info map generator V1.1:
vBF2 & BF2142 style info map generator V1.1 addon - Battlefield 2 - Mod DB

Also, if there is anything that you would like to add to the tool, let me know and I will see what I can do.
Last edited by dnamro on 2017-12-11 01:24, edited 1 time in total.
B4rr3l
Posts: 259
Joined: 2017-01-19 20:44

Re: My AI toolkit

Post by B4rr3l »

dnamro wrote:Thanks Guys!

My goal is to make adding SP/COOP easier for modders.

One feature not mentioned above is the ability to only work on Infantry or Vehicle navmeshes. This can save a lot of time since generating the navmesh can take anywhere from a hour to several days for large complex maps. Being able to redo or focus on one navmesh at a time can save a lot of time.

Feedback from modders is that the current processes for adding COOP/SP to a map is overwhelming, for both old and new modders. Also, requiring modders to use 3d modelling software to edit the navmesh is a step beyond those new to modding. After all, the appeal to BF modding is that, for the most part it is relatively easy to get started and pick up as you go along. But, SP/COOP support is very complicated and most give up in frustration after making the attempt. Currently the tool has a lot of separate functions. My goal is to eventually make this a more streamlined, easier to use process that will work for most maps without needing any special skills.

To that end the next thing I will need to create is a option to take the generated AI files and set them up for use in the map. That will be a bit more involved than anything I have done so far, with the current tool. It will involve copying the AI files setting up the GPO files and folder and updating the info.desc file. I could also have it unzip the map's server.zip and then zip it back up using the open source 7zip tool. The loadmap and preview pics could be copied from the CQ versions.

I am currently playing around with Worldlife123's info map generator tool to update/create the map's info desc file based on the gamemodes, with his permission, of course. Once I have that working, then I can use that functionality to be able to update the desc file for the sp/coop game modes in my tool.

BF2 & BF2142 style info map generator V1.1:
vBF2 & BF2142 style info map generator V1.1 addon - Battlefield 2 - Mod DB

Also, if there is anything that you would like to add to the tool, let me know and I will see what I can do.
A really nice feature would be multi-thread support it seems it only uses 1 core while generating navmeshs, multithread would make thing lots faster.
dnamro
Posts: 29
Joined: 2014-07-27 00:47

Re: My AI toolkit

Post by dnamro »

...yeah....um.....about that....

The Navmesh generator is a separate tool, codded in C++, which is over 10 years old. DICE did make the code available in the navmesh folder, but is uses libraries that are not available anymore.

It uses the GTS library, which is a UNIX/LINUX Graphic coding library.
GTS - The GNU Triangulated Surface Library

DICE was using a port to Windows of the GTS library which is no longer available. Oh, and everything is done with GTSdata. The editor converts every object and heightmap into a GTSdata object and then the navmesh generator manipulates the GTSdata objects into the navmesh. It also creates an obj version of the GTSdata, but the navmesh generator does not use anything obj format. The best I can tell, is that the obj versions are only to help the DICE programmer to troubleshoot when he was writing the code. And the code is is lacking of any useful documentation. So, the code is pretty worthless now.

It would be easier to start from scratch to create new code. But now there are better libraries and tools available anyway. One example:
https://www.creationkit.com/index.php?t ... al_Navmesh
B4rr3l
Posts: 259
Joined: 2017-01-19 20:44

Re: My AI toolkit

Post by B4rr3l »

dnamro wrote:...yeah....um.....about that....

The Navmesh generator is a separate tool, codded in C++, which is over 10 years old. DICE did make the code available in the navmesh folder, but is uses libraries that are not available anymore.

It uses the GTS library, which is a UNIX/LINUX Graphic coding library.
GTS - The GNU Triangulated Surface Library

DICE was using a port to Windows of the GTS library which is no longer available. Oh, and everything is done with GTSdata. The editor converts every object and heightmap into a GTSdata object and then the navmesh generator manipulates the GTSdata objects into the navmesh. It also creates an obj version of the GTSdata, but the navmesh generator does not use anything obj format. The best I can tell, is that the obj versions are only to help the DICE programmer to troubleshoot when he was writing the code. And the code is is lacking of any useful documentation. So, the code is pretty worthless now.

It would be easier to start from scratch to create new code. But now there are better libraries and tools available anyway. One example:
https://www.creationkit.com/index.php?t ... al_Navmesh
Very interesting! yeah put it all together, lol! just kidding m8 but if that seems possible for you maybe worth a shot, for me that is like another dimension stuff.
Outlawz7
Retired PR Developer
Posts: 17261
Joined: 2007-02-17 14:59

Re: My AI toolkit

Post by Outlawz7 »

I can't find anything saying where to extract the files? PRBF2 root folder? Navmesh folder? And honestly the only thing I'd like to use from this is the staticObject updater function because that takes the most time and I usually always miss something.
Image
dnamro
Posts: 29
Joined: 2014-07-27 00:47

Re: My AI toolkit

Post by dnamro »

Install it to the same navmesh folder as the DICE navmesh scripts. Sorry to take so long to get back. I reinstalled the OS on my system and am just now getting everything set back up.
B4rr3l
Posts: 259
Joined: 2017-01-19 20:44

Re: My AI toolkit

Post by B4rr3l »

dnamro wrote:Install it to the same navmesh folder as the DICE navmesh scripts. Sorry to take so long to get back. I reinstalled the OS on my system and am just now getting everything set back up.
This is a pain in the *** I moved to Windows 10 Enterprise early in this year, Blender, 3DMax and photoshop settings all gone... lot's of scripts missed, but the computer is getting in shape again and with Full SSD again lol.
Post Reply

Return to “PR:BF2 Community Modding”