[BA] Chicken defense needs some help !

[BA] Chicken defense needs some help !

Classic game design, maintained to please you...

Moderator: Content Developer

Post Reply
User avatar
FabriceFABS
Posts: 354
Joined: 28 Jul 2010, 16:20

[BA] Chicken defense needs some help !

Post by FabriceFABS »

Hi players,

With 84.0 new spring version, BA Chicken 2.25 based on BA 7.50 no-loger works.
Because I didn't see anyone doing a fix on it except dcore that did some // job with me, I'm preparing a BA Chicken 2.30 based on BA 7.62.

I took old BA Chickens 2.25 with BA 7.50
- I change it to use BA 7.62
- I did the following :

<<1st job >>
In /LuaRules/Gadgets/unit_spawner_defense.lua

Code: Select all

for i=1,vicinity['n'],1 do

Code: Select all

for i=1,proximity['n'],1 do
REPLACED BY

Code: Select all

for i=1,#vicinity,1 do

Code: Select all

for i=1,#proximity,1 do
<<2nd job (for test) >>
In /LuaRules/Gadgets/unit_spawner_defense.lua

Code: Select all

      for i=1,vicinity['n'],1 do
        if (GetUnitTeam(vicinity[i]) ~= chickenTeamID) then

Code: Select all

      for i=1,proximity['n'],1 do
        if (GetUnitTeam(proximity[i]) ~= chickenTeamID) then
REPLACED BY

Code: Select all

      for index,value in ipairs(vicinity) do
        if (GetUnitTeam(vicinity[index]) ~= chickenTeamID) then

Code: Select all

      for index,value in ipairs(proximity) do
        if (GetUnitTeam(proximity[index]) ~= chickenTeamID) then
Gives same result, seems working +/-, it differs from :

1/ Running MOD on spads autohost
- Game stop immediately after comgate
The spads autohost returns :
.../var/infolog.txt
[DedicatedServer] starting server...
Binding UDP socket to IP (v6) :: port 8453
[UDPListener] successfully bound socket on port 8453
[DedicatedServer] recording demo: demos/20111204_111557_Chicken_Nuggets_v4_84.0.sdf
[DedicatedServer] using mod: BA Chicken Defense V2.35 (BA7.62)
[DedicatedServer] using map: Chicken_Nuggets_v4
[DedicatedServer] GameID: 6c48db4e0b9bc7dc23e9dbf0f270f133
.../var/log/spads.log .../var/log/spads.log (1 players vs 1 chicken kbot)
20111204111612 - INFO - [SPADS] Game started
20111204111617 - WARNING - [PerlAutoHostInterface] Control character #0 encountered while parsing a string received from spring server
20111204111617 - WARNING - [PerlAutoHostInterface] Control character #0 encountered while parsing a string received from spring server
20111204111617 - INFO - [SPADS] End of game
20111204111619 - INFO - [SPADS] Spring server shutting down (running time: 23 seconds)...
.../var/log/spads.log (2 players vs 1 chicken kbot)
20111204154206 - INFO - [SPADS] Spring server started
20111204154236 - INFO - [SPADS] Game started
20111204154241 - WARNING - [PerlAutoHostInterface] Control character #1 encountered while parsing a string received from spring server
20111204154241 - WARNING - [PerlAutoHostInterface] Control character #0 encountered while parsing a string received from spring server
20111204154241 - INFO - [SPADS] End of game
20111204154241 - WARNING - [PerlAutoHostInterface] Control character #0 encountered while parsing a string received from spring server
20111204154241 - WARNING - [PerlAutoHostInterface] Control character #0 encountered while parsing a string received from spring server
20111204154241 - INFO - [SPADS] End of game
20111204154246 - INFO - [SPADS] Spring server shutting down (running time: 40 seconds)...



NEXT ARE PLAYED IN 32 bits mode
2/ Running MOD on SpringLobby SinglePlayer MODE
Game seems working well (tested with low time chicks values), I have time to see chickens & queen.
However, at the end of the game when com died :
.../Spring/infolog.txt
[f=0000000] small digital clock is disabled!
[f=0000000] frames-per-second indicator is disabled!
[f=0000000] Connection attempt from Player
[f=0000000] -> Version: 84.0
[f=0000000] -> Connection established (given id 0)
[f=0000000] Player Player finished loading and is now ingame
[f=0000000] GameID: d675db4ecb38f1745964e77a1cdf4421
[f=0000001] Skirmish AI "Bot1" (ID:0, Short-Name:"Chicken: Very Hard", Version:"<not-versioned>") took over control of team 0
[f=0000002] Player added point: Start 0
[f=0000239] Buildings set to face South
[f=0001335] Arm has taken the lead with 1 kills.
[f=0002504] Error: LuaRules::RunCallIn: error = 2, UnitIdle, [string "LuaRules/Gadgets/unit_spawner_defense.lua"]:508: Bad unitID parameter in GetUnitDefID()
After, this following message is repeating 3 times :
stack traceback:
[C]: in function 'GetUnitDefID'
[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:508: in function 'ChooseTarget'
[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:832: in function 'UnitIdle'
[string "LuaRules/gadgets.lua"]:1266: in function <[string "LuaRules/gadgets.lua"]:1264>
(tail call): ?
[f=0002504] Error: LuaRules::RunCallIn: error = 2, UnitIdle, [string "LuaRules/Gadgets/unit_spawner_defense.lua"]:508: Bad unitID parameter in GetUnitDefID()
After, this message repeats, until game stops :
stack traceback:
[C]: in function 'GetUnitDefID'
[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:508: in function 'ChooseTarget'
[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:832: in function 'UnitIdle'
[string "LuaRules/gadgets.lua"]:1266: in function <[string "LuaRules/gadgets.lua"]:1264>
(tail call): ?
[C]: in function 'GiveOrderToUnit'
[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:1081: in function 'GameFrame'
[string "LuaRules/gadgets.lua"]:931: in function <[string "LuaRules/gadgets.lua"]:929>
(tail call): ?
[f=0002510] Error: LuaRules::RunCallIn: error = 2, UnitIdle, [string "LuaRules/Gadgets/unit_spawner_defense.lua"]:508: Bad unitID parameter in GetUnitDefID()
And when game stopped :
[f=0002512] Team 1 (lead by Player) is no more
[f=0002512] Ecostats: widget now in spectator mode.
[f=0002520] <DefenseRange> Spectator mode. Widget removed.
[f=0002520] <GhostRadar> Spectator mode. Widget removed.
[f=0002520] <Ghost Site> Spectator mode. Widget removed.
[f=0002528] <autoquit> Automatically exiting in 5 seconds. Move mouse to cancel.
[f=0002529] <autoquit> Autoquit canceled.
[f=0002692] Statistics for RectangleOptimizer: 18%
[f=0002692] Path cache hits 49 28%
[f=0002692] Path cache hits 232 31%
[f=0002692] Statistics for local connection:
Received: 6213 bytes
Sent: 29853 bytes
3/ Running MOD on SpringLobby by creating a host
Game seems working well (tested with low time chicks values), I have time to see chickens & queen.
However, at the end, see :
.../Spring/infolog.txt
[f=0000000] Finalizing
[f=0000000] small digital clock is disabled!
[f=0000000] frames-per-second indicator is disabled!
[f=0000000] Connection attempt from [ACE]FabriceFABS
[f=0000000] -> Version: 84.0
[f=0000000] -> Connection established (given id 0)
[f=0000000] Player [ACE]FabriceFABS finished loading and is now ingame
[f=0000000] GameID: b17adb4e31d5b077026794791cdf4421
[f=0000001] Skirmish AI "Bot1" (ID:0, Short-Name:"Chicken: Very Hard", Version:"<not-versioned>") took over control of team 0
[f=0000002] [ACE]FabriceFABS added point: Start 0
[f=0000036] Buildings set to face West
[f=0003647] Arm has taken the lead with 1 kills.
[f=0004124] Error: LuaRules::RunCallIn: error = 2, UnitIdle, [string "LuaRules/Gadgets/unit_spawner_defense.lua"]:508: Bad unitID parameter in GetUnitDefID()

stack traceback:
[C]: in function 'GetUnitDefID'
[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:508: in function 'ChooseTarget'
[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:832: in function 'UnitIdle'
[string "LuaRules/gadgets.lua"]:1266: in function <[string "LuaRules/gadgets.lua"]:1264>
(tail call): ?
[f=0004128] Team 1 (lead by [ACE]FabriceFABS) is no more
[f=0004128] Ecostats: widget now in spectator mode.
[f=0004140] <DefenseRange> Spectator mode. Widget removed.
[f=0004140] <GhostRadar> Spectator mode. Widget removed.
[f=0004142] <Ghost Site> Spectator mode. Widget removed.
[f=0004144] <autoquit> Automatically exiting in 5 seconds. Move mouse to cancel.
[f=0004145] <autoquit> Autoquit canceled.
[f=0004392] Statistics for RectangleOptimizer: 13%
[f=0004392] Path cache hits 167 9%
[f=0004392] Path cache hits 264 12%
[f=0004392] Statistics for local connection:
Received: 10170 bytes
Sent: 49101 bytes
I really regret BA Chickens dying, that why I make a request to those who wants to help.

I can't continue, lua is not too hard to understand but I can't learn spring game structure in 1 hour or 1 day or 1 month...

MOD Available here : http://springfiles.com/spring/games/ba- ... 230-ba-762

You can also have a try on (spads) [ACE]Serveur_II

Good luck & thx
User avatar
FabriceFABS
Posts: 354
Joined: 28 Jul 2010, 16:20

Re: [BA] Chicken defense needs some help !

Post by FabriceFABS »

Up ?! :/

Some news :

1/ Running MOD on spads autohost
Autohost from unstable to testing => Same result (game immediatly stops after com gate)

However, with NO com gate, game starts (with Spads Unstable / testing).
It is real close to the case 2 / & 3 / of the above message.
Seems errors below are the same than playing Singlemode or SpringLobby's autohost

~~~A lot of LUAui msgs are shown at the end of the game ~~~
In SpringLobby's infolog.txt :

1.

Code: Select all

[f=0072176] Team 1 (lead by [ACE]FabriceFABS) is no more
[f=0072176] Ecostats: widget now in spectator mode.
[f=0072176] updateStatics
[f=0072176] updateStatics
[f=0072182] <DefenseRange> Spectator mode. Widget removed.
[f=0072183] <GhostRadar> Spectator mode. Widget removed.
[f=0072183] <Ghost Site> Spectator mode. Widget removed.
[f=0072191] Commanders Remaining: 0
[f=0072193] Error: LuaRules::RunCallIn: error = 2, UnitIdle, [string "LuaRules/Gadgets/unit_spawner_defense.lua"]:526: attempt to perform arithmetic on local 'x' (a nil value)
stack traceback:
	[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:526: in function 'ChooseTarget'
	[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:832: in function 'UnitIdle'
	[string "LuaRules/gadgets.lua"]:1266: in function <[string "LuaRules/gadgets.lua"]:1264>
	(tail call): ?
[f=0072193] Error: LuaRules::RunCallIn: error = 2, UnitIdle, [string "LuaRules/Gadgets/unit_spawner_defense.lua"]:526: attempt to perform arithmetic on local 'x' (a nil value)
stack traceback:
	[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:526: in function 'ChooseTarget'
	[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:832: in function 'UnitIdle'
	[string "LuaRules/gadgets.lua"]:1266: in function <[string "LuaRules/gadgets.lua"]:1264>
	(tail call): ?
[f=0072193] Error: LuaRules::RunCallIn: error = 2, UnitIdle, [string "LuaRules/Gadgets/unit_spawner_defense.lua"]:526: attempt to perform arithmetic on local 'x' (a nil value)
stack traceback:
	[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:526: in function 'ChooseTarget'
	[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:832: in function 'UnitIdle'
	[string "LuaRules/gadgets.lua"]:1266: in function <[string "LuaRules/gadgets.lua"]:1264>
	(tail call): ?
[f=0072200] Error: LuaRules::RunCallIn: error = 2, UnitIdle, [string "LuaRules/Gadgets/unit_spawner_defense.lua"]:526: attempt to perform arithmetic on local 'x' (a nil value)
stack traceback:
	[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:526: in function 'ChooseTarget'
	[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:832: in function 'UnitIdle'
	[string "LuaRules/gadgets.lua"]:1266: in function <[string "LuaRules/gadgets.lua"]:1264>
	(tail call): ?
	[C]: in function 'GiveOrderToUnit'
	[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:1081: in function 'GameFrame'
	[string "LuaRules/gadgets.lua"]:931: in function <[string "LuaRules/gadgets.lua"]:929>
	(tail call): ?
[f=0072200] Error: LuaRules::RunCallIn: error = 2, UnitIdle, [string "LuaRules/Gadgets/unit_spawner_defense.lua"]:508: Bad unitID parameter in GetUnitDefID()

stack traceback:
	[C]: in function 'GetUnitDefID'
	[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:508: in function 'ChooseTarget'
	[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:832: in function 'UnitIdle'
	[string "LuaRules/gadgets.lua"]:1266: in function <[string "LuaRules/gadgets.lua"]:1264>
	(tail call): ?
	[C]: in function 'GiveOrderToUnit'
	[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:1081: in function 'GameFrame'
	[string "LuaRules/gadgets.lua"]:931: in function <[string "LuaRules/gadgets.lua"]:929>
	(tail call): ?
[f=0072200] Error: LuaRules::RunCallIn: error = 2, UnitIdle, [string "LuaRules/Gadgets/unit_spawner_defense.lua"]:508: Bad unitID parameter in GetUnitDefID()
Stack traceback repeats many many more.

2. Near end of file

Code: Select all

stack traceback:
	[C]: in function 'GetUnitDefID'
	[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:508: in function 'ChooseTarget'
	[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:832: in function 'UnitIdle'
	[string "LuaRules/gadgets.lua"]:1266: in function <[string "LuaRules/gadgets.lua"]:1264>
	(tail call): ?
	[C]: in function 'GiveOrderToUnit'
	[string "LuaRules/Gadgets/unit_spawner_defense.lua"]:1081: in function 'GameFrame'
	[string "LuaRules/gadgets.lua"]:931: in function <[string "LuaRules/gadgets.lua"]:929>
	(tail call): ?
[f=0072200] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072202] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072208] Team 2 (lead by drbobbin) is no more
[f=0072208] updateStatics
[f=0072208] updateStatics
[f=0072208] Team 0 (lead by [No]Pallino) is no more
[f=0072208] updateStatics
[f=0072208] updateStatics
[f=0072210] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072210] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072210] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072213] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072215] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072216] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072218] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072224] <autoquit> Automatically exiting in 5 seconds. Move mouse to cancel.
[f=0072225] <autoquit> Autoquit canceled.
[f=0072226] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072229] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072231] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072232] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072234] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072242] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072245] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072247] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072248] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072250] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072258] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072261] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072263] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072264] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072266] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072274] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072277] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072279] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072280] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072282] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072286] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072290] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072293] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072295] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072296] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072298] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072299] Spectator drbobbin left the game:  normal quit
[f=0072306] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072309] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072311] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072312] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072314] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072322] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072325] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072327] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072328] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072330] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072338] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072341] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072343] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072344] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072346] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072354] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072357] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072359] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072360] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072362] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072370] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072373] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072375] Error: Received a Fight command with less than 3 params on Spiker in MobileCAI
[f=0072376] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072378] Error: Received a Fight command with less than 3 params on Basilisk in MobileCAI
[f=0072380] Server shutdown
[f=0072380] Error: Failed closing UDP conection: Transport endpoint is not connected
[f=0072380] Ally Resource Bars: No allies, unloading
[f=0072380] Get data.capcolors :
[f=0072380] true
[f=0072380] Statistics for RectangleOptimizer: 0%
[f=0072380] Path cache hits 2604 27%
[f=0072380] Path cache hits 16809 31%
[f=0072380] Statistics for UDP connection:
Received: 567248 bytes in 20882 packets (27.1644 bytes/package)
Sent: 1277595 bytes in 38338 packets (33.3245 bytes/package)
Relative protocol overhead: 0 up, 0.220877 down
1 incoming chunks had been dropped, 1 outgoing chunks had to be resent
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: [BA] Chicken defense needs some help !

Post by knorke »

Use pastebin fo real yo!
Did not look at mod, quick&dirty ways to fix some things would be:

All the error with "blabla (a nil value)" eg
attempt to perform arithmetic on local 'x' (a nil value)
add
if (x) then ... end
So simply skip all the stuff that uses x, when x is nil.
You will probally want
if (x and y and z)
when its related to something like GetUnitPosition()
Bad unitID parameter in GetUnitDefID()
similiar, add
if Spring.ValidUnitID(unitID) then ... end

That way you can "solve" the error spam. It does not really fix the errors though, that would require looking more closely.
Important parts of code might be skipped and then others things might not work correctly.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: [BA] Chicken defense needs some help !

Post by Jools »

If it's related to something like getUnitPosition(), isn't it enough to check for a valid x? To conserve code I mean, because can x be valid if y or z isn't?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: [BA] Chicken defense needs some help !

Post by knorke »

can x be valid if y or z isn't?
no idea. maybe when x is out of map but z is not.
Post Reply

Return to “Balanced Annihilation”