project reality header
Go Back   Project Reality Forums > PR:BF2 Mod Forums > PR:BF2 Community Modding
17 Dec 2017, 00:00:00 (PRT)
Register Forum RulesDeveloper Blogs Project Reality Members List Search Today's Posts Mark Forums Read
PR:BF2 Community Modding Making or wanting help making your own asset? Check in here

Reply
 
LinkBack Thread Tools Display Modes
Old 12-06-2017, 10:22 PM   #1
dnamro
Default My AI toolkit

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.
dnamro is offline Reply With Quote
Old 12-07-2017, 01:15 AM   #2
B4rr3l
Default Re: My AI toolkit

Quote:
Originally Posted by dnamro View Post
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.
B4rr3l is offline Reply With Quote
Old 12-07-2017, 10:58 AM   #3
[R-DEV]Outlawz7
PR:BF2 Developer

[R-DEV]Outlawz7's Avatar
Default Re: My AI toolkit

This sounds awesome, I'll try and give it a go ASAP.

[R-DEV]Outlawz7 is offline Reply With Quote
Old 12-07-2017, 02:57 PM   #4
Valmont
Default Re: My AI toolkit

Legendary lord dnamro, founding God of BF modding!

We thank thee for all your blessings!

=)
Valmont is offline Reply With Quote
Old 12-10-2017, 12:55 PM   #5
dnamro
Default Re: My AI toolkit

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.
dnamro is offline
Last edited by dnamro; 12-10-2017 at 09:24 PM..
Reply With Quote
Old 12-12-2017, 11:53 PM   #6
B4rr3l
Default Re: My AI toolkit

Quote:
Originally Posted by dnamro View Post
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.
B4rr3l is offline Reply With Quote
Old 12-14-2017, 05:25 PM   #7
dnamro
Default Re: My AI toolkit

...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.ph...torial_Navmesh
dnamro is offline Reply With Quote
Old 12-15-2017, 10:33 PM   #8
B4rr3l
Default Re: My AI toolkit

Quote:
Originally Posted by dnamro View Post
...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.ph...torial_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.
B4rr3l is offline Reply With Quote
Reply


Tags
toolkit
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 03:36 PM.


Powered by: vBulletin. ©vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.1
All Content Copyright ©2004 - 2015, Project Reality.