I want to create a new AI player, how to?

Get some help with creating maps or modding.
Need a map editor or other tools, look here!
DvDmanDT
Rookie
Rookie
Posts: 20
Joined: 13 Apr 2012, 16:51

Re: I want to create a new AI player, how to?

Post by DvDmanDT »

WTF!? I did so not see that one coming. So WZ adds ALL maps to it's physFS filesystem? That just seems wrong in every way possible. I'll change it, but the real issue here is not my map.

As for the oil.. I had that but removed it to decrease scavenger resources and hopefully their numbers. Though now that I think of it, I'm not sure it has the desired effect.

I'll try 1.21 today or tomorrow.
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: I want to create a new AI player, how to?

Post by aubergine »

WZ does a scan of the entire physFS when the application first loads in order to locate mods. So when you then start a game, if WZ already spotted an AI in your map mod, it assumes that AI is available to all maps.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
DvDmanDT
Rookie
Rookie
Posts: 20
Joined: 13 Apr 2012, 16:51

Re: I want to create a new AI player, how to?

Post by DvDmanDT »

I understand what it's doing, I just don't understand why. This'll cause ALOT of problems for alot of people. I mean, I can just create a map with some modified js or whatever, host a game, and it'll (potentially) break mp for all maps for those who joined the game, and unless they are part of the dev team/modding community, they'll probably have a hard time figuring out why it doesn't work.
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: I want to create a new AI player, how to?

Post by aubergine »

Yup. Not sure of what the best way is to resolve that.

I guess scripts should only go global when they are put in the mods/autoload folder?

Any scripts in a map should only apply to that map... or collection of maps? (can you have more than one map in a map mod wz?)
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
DvDmanDT
Rookie
Rookie
Posts: 20
Joined: 13 Apr 2012, 16:51

Re: I want to create a new AI player, how to?

Post by DvDmanDT »

Only one map.wz should be part of the virtual filesystem at any time, and that's the map being played. If you want multi-map collections (which is probably a bad idea since it'll mess with map sending anyway if I understood some other topic here correctly) it should be in mods/autoload. All stuff in mods/autoload should be loaded at startup.. It would probably require some changes to the code building the map list though. Currently I guess it just loops through all files in the virtual filesystem map folder. To do what I suggest, it would need to iterate through all of those first and add them to a list (real-path, name, players, ...), then open one map.wz file at a time and add that as well to the list.

(EDIT: sorry about all the "should" and "shouldn'ts", no disrespect intended. Read it as "I think it would be better if..")
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: I want to create a new AI player, how to?

Post by NoQ »

Boys don't panic. Right now, after the "map-mod support" is introduced, maps with extra scripts and mods inside don't break the whole game and work correctly. This was finally settled around 2.3.8, opening the path to making some cool stuff.

As far as i understand, every file is the one picked from the current map.
But if the map adds files instead of replacing, then the files added will be globally visible (AI .ai files or challenge .ini files, none of which break the game, but some can be unwanted anyway). Trying to continue this talk here.

P.S. Right now, the easiest way to install nullbot is to just throw the mod into the maps folder.