Page 1 of 1

Packing AIs into maps as map-mods

Posted: 08 Feb 2012, 14:52
by NoQ
Suppose i want to make a map with challenges with custom AIs.

The easiest way is to pack both the challenge .ini file and the AI script file(s) inside the map.

But packing AIs doesn't seem to be map-mod-safe in the following sense: you are able to select the custom AI for any map in any skirmish or multiplayer game, instead of being able to select this AI on this map only.

Now suppose human X has my map-mod with custom AIs, while human Y doesn't.

Situation 1: Humans X and Y try to play a multiplayer game on a completely different map with no AIs involved at all. What will happen? Will one of the players get kicked for incompatible data? If not, is it a bug or a feature? That is, will it stay that way?

Situation 2: Human X hosts a game on a totally different map and sets a few custom AI that is only found inside my map-mod. Human Y joins the game; he downloads the different map, but he doesn't acquire the source code of the AI from player X. What will happen when the game starts? Will player Y get kicked for incompatible data? If not, will there appear a desync because of incompatible AI behavior, or AI will run only on player X's machine and sync properly? If everything will work fine, is it a bug or a feature? I mean, will it stay that way?

Re: Packing AIs into maps as map-mods

Posted: 08 Feb 2012, 14:58
by aubergine
NoQ wrote: But packing AIs doesn't seem to be map-mod-safe in the following sense: you are able to select the custom AI for any map in any skirmish or multiplayer game, instead of being able to select this AI on this map only.
If I understand correctly, by that you mean..

"I have an AI designed for a specific map when played in campaign challenge mode. That AI should not be available on normal skirmish or MP games, it should only ever get used on the defined campaign challenge."

Is that correct?

Re: Packing AIs into maps as map-mods

Posted: 08 Feb 2012, 15:03
by NoQ
This is a good point, but i'd also add the opposite: "I've made a super duper AI suitable for all maps, so i want it to be easily shared in online games within map-mods, since maps are auto-downloaded".

Also, rather not "campaign" but "challenge". Challenge is a sort of skirmish rather that campaign.

Obviously, those two statements are contradictory. I'd prefer to resolve the contradiction by limiting the AIs to the maps they are packed into.

Re: Packing AIs into maps as map-mods

Posted: 08 Feb 2012, 15:07
by aubergine
sorry - i made a typo, I meant challenge.

Re: Packing AIs into maps as map-mods

Posted: 08 Feb 2012, 17:59
by Per
Hmm. I think packaging an AI with a map is very short-sighted and wrong. Unless that map is a total conversion of sorts (like a customized challenge), and then you want to replace everything and only for that map. Still thinking about good ways to make such big mods easier to run for players.

I am also thinking about adding an "AI" directory to the user write directory, where players can drop in AI files (maybe even not .wz, just .ai and .js files?), and then make them available without needing any command line magic.

If all players do not have the same AI files, this does not matter. Only the host runs AIs, and sends the results to everyone else. Note that 'rules.js' operates differently - it is run simultaneously on all clients and must be the same.

Re: Packing AIs into maps as map-mods

Posted: 08 Feb 2012, 20:16
by NoQ
Hmm. I think packaging an AI with a map is very short-sighted and wrong. Unless that map is a total conversion of sorts (like a customized challenge), and then you want to replace everything and only for that map. Still thinking about good ways to make such big mods easier to run for players.
Hmm, so how exactly are we supposed to use custom AIs in challenges if we can't bundle them with maps these challenges are bundled with?

Upd: What about restricting AIs to a certain map via a special directive inside the .ai file?

Re: Packing AIs into maps as map-mods

Posted: 09 Feb 2012, 00:09
by Per
Oh, bundling custom AIs with custom maps for challenges is quite right. Bundling custom AIs with ordinary skirmish maps would be a bad idea. You put the AI in the same directory ("challenges/") as the challenge, to avoid it being made available for skirmish.

Re: Packing AIs into maps as map-mods

Posted: 09 Feb 2012, 04:20
by effigy
In 2.3.x Challenge maps show up in the map chooser for normal skirmish and MP. This has changed for 3.1.x?

Also, FWIW, when I had the map with nullbot I was able to host with nullbot filling a slot. The only issue I detected was that my joiners saw an empty slot (the AI name was not transmitted to the player list in the lobby).

Re: Packing AIs into maps as map-mods

Posted: 09 Feb 2012, 06:36
by NoQ
You put the AI in the same directory ("challenges/") as the challenge, to avoid it being made available for skirmish.
Yep! That's exactly what i've been looking for (:
In 2.3.x Challenge maps show up in the map chooser for normal skirmish and MP. This has changed for 3.1.x?
No, i don't think so. Though it sounds like a good thing to implement :3

Re: Packing AIs into maps as map-mods

Posted: 11 Feb 2012, 09:07
by NoQ
Oops.

Saved games don't work when the map is packed this way (even though they work fine when they are regular skirmish games with JS AIs loaded as a mod)

AI just stop doing things at loading, and the stderr says

Code: Select all

info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 2 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 3 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 4 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
info    |11:06:28: [findEngineForPlayer] Script context for player 1 not found
info    |11:06:28: [findEngineForPlayer] Assert in Warzone: qtscript.cpp:490 (false), last script event: '<none>'
(that's for this challenge)

Re: Packing AIs into maps as map-mods

Posted: 11 Feb 2012, 09:18
by Berg
I think packing AI in maps is fine as long as it does not modify the game balance and or show player info to the maker of the AI .Using them in a challenge or a campaign scenario great!

However packing mods into maps is out of line.

I have had to clean out maps I receive while playing multi player as they have cheat mods inside.

If these maps end up in my map folder with cheats in them thats not good who ever is doing it should stop.

Re: Packing AIs into maps as map-mods

Posted: 11 Feb 2012, 09:20
by NoQ
I have had to clean out maps I receive while playing multi player as they have cheat mods inside.
That used to be thousands of years ago. Map-mod support was finally fixed in 2.3.8 (and in fact was fixed around 2.3.6 i think), so now different map's extra data doesn't interfere with games on other maps.

Re: Packing AIs into maps as map-mods

Posted: 11 Feb 2012, 18:11
by Iluvalar
I found a way to go around in 2.3.6 I think and used it mainly in 2.3.7 in my "X-T1-" maps. But it was fixed and SO MUCH EASIER to do in 2.3.8 yeah :) .

Sooner or later, we'll need to be able to select mods as we select maps. With the same GUI and the same download system, I don't believe it will be so hard. This will allow to load AI and other set of rules.

Re: Packing AIs into maps as map-mods

Posted: 11 Feb 2012, 18:30
by Rman Virgil
Iluvalar wrote:......

Sooner or later, we'll need to be able to select mods as we select maps. With the same GUI and the same download system, I don't believe it will be so hard. This will allow to load AI and other set of rules.
One of the first things NEWST did was make exactly all that possible for v.1.10 begining in Dec. '99 & upgraded through '04. It was last called "WZS" for "WZ Starter" and it was a joy to use. :)

No doubt it would be great to have such for the current WZ. :)
.

Re: Packing AIs into maps as map-mods

Posted: 11 Feb 2012, 18:40
by Emdek
Ekhm. ;-)
In game addons manager idea topic.
Current plan is to replace current widgets with something SDL / OpenGL based (not dependent on Qt for now) and then we can go with things like that...