Both Lobbies Bork LuaAI tests
Moderator: Moderators
Both Lobbies Bork LuaAI tests
Both SpringLobby and TASClient fail to load a SP game vs. LuaAI properly.
TASClient's SP interface is Byzantine- it appears that when you set a AI player, it's being Allied to the player, not automatically set as the enemy- yet there doesn't seem to be a way to fix that, nor a way to save a setup.
SpringLobby just plain fails to operate. It crashes, claiming there will be an Infolog, but there's nothing.
So, I set it up in SpringLobby as a MP game.
Still failed. No explanation, just quits. It's like it's not writing the script correctly.
Giving up on SpringLobby, I try TASClient in MP.
Ah, it runs. But, like the previous test, the Units just stand around. They're following orders, but aren't able to attack. It's almost like they don't have Energy, which is ludicrous, because I'm testing Pylon Wars and the Pylon side should never have resource problems.
Anyhow, I'm left with a lot of wtf. I'm using NullAI, and I should see exactly the same results as when I'm running the engine. But I don't.
TASClient's SP interface is Byzantine- it appears that when you set a AI player, it's being Allied to the player, not automatically set as the enemy- yet there doesn't seem to be a way to fix that, nor a way to save a setup.
SpringLobby just plain fails to operate. It crashes, claiming there will be an Infolog, but there's nothing.
So, I set it up in SpringLobby as a MP game.
Still failed. No explanation, just quits. It's like it's not writing the script correctly.
Giving up on SpringLobby, I try TASClient in MP.
Ah, it runs. But, like the previous test, the Units just stand around. They're following orders, but aren't able to attack. It's almost like they don't have Energy, which is ludicrous, because I'm testing Pylon Wars and the Pylon side should never have resource problems.
Anyhow, I'm left with a lot of wtf. I'm using NullAI, and I should see exactly the same results as when I'm running the engine. But I don't.
Re: Both Lobbies Bork LuaAI tests
generated script and why you think it's wrong please
Re: Both Lobbies Bork LuaAI tests
Uhm, are you testing LuaAI or NullAI? Topic suggests the first, post suggest the second...
LuaAI (C.R.A.I.G.) works fine for me, using SpringLobby.
LuaAI (C.R.A.I.G.) works fine for me, using SpringLobby.
Re: Both Lobbies Bork LuaAI tests
Yeah, the two Kernel Panic LuaAI works for me, both in TASClient and SpringLobby. I am using the multiplayer lobby though. Or for SpringLobby, the single player tab. But I am never using the special single player menu with image background they both have.
Re: Both Lobbies Bork LuaAI tests
NullAI, with LuaRules performing AI duties. Haven't tested LuaAI yet, but isn't that pretty much the same thing?
Again, works when tested with the engine.
Script is attached.
P.S., ignore the "modoptions", they're just leftovers from Skirmish Module that I haven't cleaned up yet. Shouldn't have an impact on the outcome.
Again, works when tested with the engine.
Script is attached.
P.S., ignore the "modoptions", they're just leftovers from Skirmish Module that I haven't cleaned up yet. Shouldn't have an impact on the outcome.
- Attachments
-
- script.txt
- (1.42 KiB) Downloaded 110 times
Re: Both Lobbies Bork LuaAI tests
I don't know, I never use NullAI, but, at this point, worth trying.Argh wrote:NullAI, with LuaRules performing AI duties. Haven't tested LuaAI yet, but isn't that pretty much the same thing?
If you have a way that work, and a way that doesn't, compare the generated script files, then gradually merge them, to see at which point is the difference that makes one not work.
Re: Both Lobbies Bork LuaAI tests
I'll give it a shot, when I'm done with the code. I mean, meh, it shouldn't be this much of a pain in the arse, though. If it's a NullAI, then, by definition, it shouldn't do anything, and script settings shouldn't magically cause problems with resources, etc. That was the problem I found the weirdest- even when I got the scenario running, it was still screwy- the Units were clearly trying to Do Stuff, but it was like they didn't have Energy available, which is ludicrous, the Pylons in Pylon Wars produce (for all practical purposes) unlimited Energy.
- BrainDamage
- Lobby Developer
- Posts: 1164
- Joined: 25 Sep 2006, 13:56
Re: Both Lobbies Bork LuaAI tests
noArgh wrote:NullAI, with LuaRules performing AI duties. Haven't tested LuaAI yet, but isn't that pretty much the same thing?
Re: Both Lobbies Bork LuaAI tests
OK. So, what's the difference? I mean, I'm staring at the "AI" code over here, and it's just some config strings.
It was the same way in BA's port of Chickens- it's just config. It doesn't *do* anything, and it shouldn't magically interfere with, say, the resource economy (as I stated, in the case where something "worked" the game state was still clearly borked, and it looked like a resource problem).
LuaRules does all of the actual behavior right now.
And even if that was some major hurdle, a NullAI in the Lobbies with LuaRules performing all the gamecode operations for the "ai" players should perform 100% like it does in engine testing. This is a whole lotta wtf, guys. Since I don't get a script output when running directly from the engine, I have no idea what differences there might be- but I don't see anything in that MP script mentioning screwing around with gameplay variables (other than unit limit... Gaia really should not be limited to 500 by default, but that's a side issue). Yet that has to be what's happening here- I see Units attempting to Attack, going through the motions, but they don't ever attack.
[Big, fat EDIT]I've checked and re-checked. Whatever's wrong, it's not just Energy- I tested with the Space Chickens in Pylon Wars, now that I have them set up... and nope, it's not Energy. They simply attack, but nothing happens. Yet I'm not Allied with the AI players, and the Script doesn't say that, either.[/EDIT]
It was the same way in BA's port of Chickens- it's just config. It doesn't *do* anything, and it shouldn't magically interfere with, say, the resource economy (as I stated, in the case where something "worked" the game state was still clearly borked, and it looked like a resource problem).
LuaRules does all of the actual behavior right now.
And even if that was some major hurdle, a NullAI in the Lobbies with LuaRules performing all the gamecode operations for the "ai" players should perform 100% like it does in engine testing. This is a whole lotta wtf, guys. Since I don't get a script output when running directly from the engine, I have no idea what differences there might be- but I don't see anything in that MP script mentioning screwing around with gameplay variables (other than unit limit... Gaia really should not be limited to 500 by default, but that's a side issue). Yet that has to be what's happening here- I see Units attempting to Attack, going through the motions, but they don't ever attack.
[Big, fat EDIT]I've checked and re-checked. Whatever's wrong, it's not just Energy- I tested with the Space Chickens in Pylon Wars, now that I have them set up... and nope, it's not Energy. They simply attack, but nothing happens. Yet I'm not Allied with the AI players, and the Script doesn't say that, either.[/EDIT]
- Attachments
-
- script.txt
- (1.24 KiB) Downloaded 107 times
- BrainDamage
- Lobby Developer
- Posts: 1164
- Joined: 25 Sep 2006, 13:56
Re: Both Lobbies Bork LuaAI tests
afaik nullai is not an "active" player(team), that's why players can take it's units, and it would explain why it wouldn't behave correctly when you'd try to use as one.
Re: Both Lobbies Bork LuaAI tests
Hmm, really?
The attached hand-edited script worked just fine. No borks... until it was time for combat, and then un-allied Teams magically can't shoot at each other, which doesn't happen when I run the NullAI state in the engine
I'm not sure I buy that theory. Something's seriously borked here. >1 NullAI == bork. I'll test just one here in a moment. My guess is that it's something being mis-set. NullAI != can't attack, when run directly from the engine. Hell, my Missions are all using NullAI, and they're all working, as of the last time I tested them (about a week ago).
However, let me add more to this, because it looks like I'm turning up bugs wherever I poke:
I get this result:
[ 0] AI Teams: 1, overmind
[ 0] AI Teams: 1, overmind
[ 0] AI Teams: 2, astrum gallina
From this Lua:
..which should be totally impossible. There should be exactly two entries. Not three.
The attached hand-edited script worked just fine. No borks... until it was time for combat, and then un-allied Teams magically can't shoot at each other, which doesn't happen when I run the NullAI state in the engine

I'm not sure I buy that theory. Something's seriously borked here. >1 NullAI == bork. I'll test just one here in a moment. My guess is that it's something being mis-set. NullAI != can't attack, when run directly from the engine. Hell, my Missions are all using NullAI, and they're all working, as of the last time I tested them (about a week ago).
However, let me add more to this, because it looks like I'm turning up bugs wherever I poke:
I get this result:
[ 0] AI Teams: 1, overmind
[ 0] AI Teams: 1, overmind
[ 0] AI Teams: 2, astrum gallina
From this Lua:
Code: Select all
function GameStart()
--GET ALL TEAM STATES, AND DETERMINE THEIR TYPE
for a = 0,32,1 do
local aiState = Spring.GetAIInfo(a)
if aiState ~= nil then
_,_,_,_,mySide = Spring.GetTeamInfo(a)
table.insert(GG.aiTeams,{teamNum = a,mySide = mySide,myAnger = 0})
for i,k in ipairs(GG.aiTeams) do
Spring.Echo("AI Teams: "..k.teamNum,k.mySide)
end
end
end
end
- Attachments
-
- 001SP_PYLON_WARS_EASY.txt
- (1.03 KiB) Downloaded 10 times
Re: Both Lobbies Bork LuaAI tests
Lol, check your debugging code.
You're printing the entire list (up to that point) for every AI, so no wonder it prints the first AI twice.
(Guess what, with 3 AI it would print the 1st AI 3 times, the 2nd AI 2 times, and the last AI 1 time.)
You're printing the entire list (up to that point) for every AI, so no wonder it prints the first AI twice.
(Guess what, with 3 AI it would print the 1st AI 3 times, the 2nd AI 2 times, and the last AI 1 time.)
Re: Both Lobbies Bork LuaAI tests
Yeah, yeah. And this is more elegant anyhow:
But that's a side issue.
One of the borks is that Spring is screwing around with resources.
Somehow, magically, if you give people enough resources in scripted mode, Spring makes the Team incomes negative. This doesn't happen in un-scripted mode.
I'll see what happens when I make the Pylons give less E/M. Maybe that will fix it all up, IDK.
Code: Select all
function GameStart()
--GET ALL TEAM STATES, AND DETERMINE THEIR TYPE
for a = 0,32,1 do
_,_,_,aiState,mySide = Spring.GetTeamInfo(a)
if aiState == true then
table.insert(GG.aiTeams,{teamNum = a,mySide = mySide,myAnger = 0})
end
end
end
One of the borks is that Spring is screwing around with resources.
Somehow, magically, if you give people enough resources in scripted mode, Spring makes the Team incomes negative. This doesn't happen in un-scripted mode.
I'll see what happens when I make the Pylons give less E/M. Maybe that will fix it all up, IDK.
Re: Both Lobbies Bork LuaAI tests
Nope, doesn't do a damn thing, but the resources are magically OK now that make doesn't exceed storage by 10:1 
So, wtf is wrong here? I'm scared to go test the Skirmish Module, but I guess I need to find out how much has been fubar'd. And then go read through KP to see what, if anything, is different. Of all the bizzarre things I've seen with this engine, the spectacle of two non-ally groups of Units aiming at each other, but refusing to fire... really takes the cake. It's not my Lua, people. The pylons work, the Units go where they're programmed to, I can see them attempting to fight. They just don't.

So, wtf is wrong here? I'm scared to go test the Skirmish Module, but I guess I need to find out how much has been fubar'd. And then go read through KP to see what, if anything, is different. Of all the bizzarre things I've seen with this engine, the spectacle of two non-ally groups of Units aiming at each other, but refusing to fire... really takes the cake. It's not my Lua, people. The pylons work, the Units go where they're programmed to, I can see them attempting to fight. They just don't.
Re: Both Lobbies Bork LuaAI tests
It's (probably) because in the built-in start scripts there will be two active teams no matter what, and when using a script.txt startup the NullAI will fail to join the team (by design of the NullAI), so the team will be considered empty/dead by engine, with whatever side effects that may have.
(Like, 0 energy, triggering the bug that no unit can fire if you have exactly 0 energy, even if the weapon doesn't cost energy to fire.)
(Like, 0 energy, triggering the bug that no unit can fire if you have exactly 0 energy, even if the weapon doesn't cost energy to fire.)
Re: Both Lobbies Bork LuaAI tests
That may be part of the problem.
But I've obviously also made some sort of <facepalm> worthy error. Skirmish scripts are still working. Dunno how, dunno why, but a Skirmish game results in dead things. So, off to review what's in Skirmish Module's LuaRules that is allowing it (and Missions, which also continue to function) to work... and breaks Pylon Wars.
But I've obviously also made some sort of <facepalm> worthy error. Skirmish scripts are still working. Dunno how, dunno why, but a Skirmish game results in dead things. So, off to review what's in Skirmish Module's LuaRules that is allowing it (and Missions, which also continue to function) to work... and breaks Pylon Wars.
Re: Both Lobbies Bork LuaAI tests
I'm still not at the bottom of this, but I can confirm something: the AI team's resources read -20/1.
The Pylons have storage of 10000. This isn't happening
Soooo... I'm going to take a wild guess, and see what happens if I don't delete the initial Commanders... like I don't in Skirmish. Maybe it thinks we're playing Commander Ends.
The Pylons have storage of 10000. This isn't happening

Soooo... I'm going to take a wild guess, and see what happens if I don't delete the initial Commanders... like I don't in Skirmish. Maybe it thinks we're playing Commander Ends.
Re: Both Lobbies Bork LuaAI tests
AHA.
Not deleting the Commanders == magical fix (with that custom script, that is).
So, that problem's resources. I probably made a big "whoops" somewhere. OK.
Now for multiple LuaAIs...
Not deleting the Commanders == magical fix (with that custom script, that is).
So, that problem's resources. I probably made a big "whoops" somewhere. OK.
Now for multiple LuaAIs...
Re: Both Lobbies Bork LuaAI tests
OK, that works. Now back to the Lobbies.
Re: Both Lobbies Bork LuaAI tests
Score thus far:
SP Mode.
SpringLobby: 0. Crashes upon game start, probably writing a bad script.
TASClient: 0.5. Launches, and game functions, but does not seem to use Fixed or Random start positions, which is necessary for anything other than a game like Pylon Wars to work right (Pylon Wars doesn't care, so long as stranding us in the corner 0,0 doesn't mean we can't spawn or move).
MP Mode.
SpringLobby: 0. Crashes upon game start.
TASClient: 1.0. Ran perfectly, in Fixed or Random, all scripts operated, game appears to be fine.
So, basically, we're back to Lobby issues; I've un-borked the gamecode; if it will run the game, then it all works in Spring, even with multiple "AI" players.
SP Mode.
SpringLobby: 0. Crashes upon game start, probably writing a bad script.
TASClient: 0.5. Launches, and game functions, but does not seem to use Fixed or Random start positions, which is necessary for anything other than a game like Pylon Wars to work right (Pylon Wars doesn't care, so long as stranding us in the corner 0,0 doesn't mean we can't spawn or move).
MP Mode.
SpringLobby: 0. Crashes upon game start.
TASClient: 1.0. Ran perfectly, in Fixed or Random, all scripts operated, game appears to be fine.
So, basically, we're back to Lobby issues; I've un-borked the gamecode; if it will run the game, then it all works in Spring, even with multiple "AI" players.