tomjn / Shard

A reprogrammable AI framework for the Spring Engine
https://shard.tomjn.com
17 stars 13 forks source link

my personal unstable dev status #123

Closed pandaro closed 7 years ago

pandaro commented 7 years ago

At moment I'm a bit lost, My situation is this: i have installed springlobby 2 years ago; then installed engine 103.0 via springlobby now the source code of shard is behind the dev version. So in order to test myself PR and your upgrading at the code to see what is change and understand the situation, i try to put the last data/ai folder inside my engine installation. The predictable result was a complete fail: when i try to launch a game i receive the fallow error:

Loading Skirmish AIs
[f=-000001] <SkirmishAI: Shard dev (team 0)>: ....spring/engine/103.0/AI/Skirmish/Shard/dev/ai/ai.lua:1: attempt to call global 'class' (a nil value)
stack traceback:
        [C]: ?
        [C]: in function 'class'
        ....spring/engine/103.0/AI/Skirmish/Shard/dev/ai/ai.lua:1: in main chunk
[f=-000001] SkirmishAI (ID = 0, team ID = 0) is using cheats!
[f=-000001] ResourceMapAnalyzer by Krogothe, initialized for resource 0(Metal)
PANIC: unprotected error in call to Lua API (attempt to index a nil value)
AL lib: (EE) alc_cleanup: 1 device not closed
pure virtual method called
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >'
  what():  boost: mutex lock failed in pthread_mutex_lock: 
Segmentation fault (core dumped)

this is happened with shard dev version, with shardLua bundled with BA work as well.

What do you suggest to do? My goal is try myself PR in order to improve it

pandaro commented 7 years ago

Update: i have download last dev spring from git fresh&clean compiling all work fine without shard but if i add shard there are problem spring crash with this error: [f=-000001] Loading Skirmish AIs [f=-000001] <SkirmishAI: Shard dev (team 1)>: ShardCPP: Error: Shard CPP tried to boot up a Shard instance, but there was a problem loading boot.lua. There may be errors or issues from this point as a result. [f=-000001] SkirmishAI (ID = 0, team ID = 1) is using cheats! PANIC: unprotected error in call to Lua API (attempt to index a nil value) AL lib: (EE) alc_cleanup: 1 device not closed Errore di segmentazione (core dump creato) EDIT: there are a debug mode? cant see what going wrong inside boot.lua

tomjn commented 7 years ago

Can you run the game in isolation? Running multiple copies of Shard makes it harder to diagnose. And full infolog.txt stack traces

That last message implies that the lua files aren't in the correct location and Shard couldn't find them

pandaro commented 7 years ago

running only shard native + BA 9.46 paste EDIT

Can you run the game in isolation?

what mean?

tomjn commented 7 years ago

Some of the games you've tried so far has had multiple AIs, which makes it difficult to figure out what went wrong

tomjn commented 7 years ago

The infolog says Shard couldn't find boot.lua, are you sure you put the lua code in the correct place? Remember, Shard native can't read inside game archives, it has no access to the VFS.

pandaro commented 7 years ago

it's all in the right place, i run: last dev spring with last dev shard; whatever BA(9.46 BAR5866); with shard native, without any modification (vanilla) i have the error; with shardLua, bundled with the game itself i have no error and all work fine so i think the error is inside your recently update.

tomjn commented 7 years ago

can you show me the folder structure of your copy of Shard?

pandaro commented 7 years ago

mi folder structure is the one become with pr inside a vanilla spring compiling anyway: here

tomjn commented 7 years ago

hmmm I made some adjustments to the code that tries to load boot.lua, it should try to output where it was expecting the file now

pandaro commented 7 years ago

i have just update and run error seem fixed, but shard actually do nothing issues can be close, my dev status is up to date, i can follow the development and give you feedback

pandaro commented 7 years ago

wait, the system don't crash, but the error persist, new infolog: here

tomjn commented 7 years ago

hmmm yes:

[f=-000001] <SkirmishAI: Shard dev (team 0)>: ShardCPP: Error: Shard CPP tried to boot up a Shard instance, but there was a problem loading boot.lua. There may be errors or issues from this point as a result. Shard tried to load from:
[f=-000001] <SkirmishAI: Shard dev (team 0)>:
[f=-000001] <SkirmishAI: Shard dev (team 0)>: ShardCPP: This is usually caused by putting the AI lua files in the wrong place, or putting them inside a game archive where Shard cannot see them.

This is being output by the changes in https://github.com/tomjn/Shard/commit/6737907835529d768237ee872627d0b770c38594

Making it output som more debug information would be useful

pandaro commented 7 years ago

After last updates i try to replace the whole things inside BAR related to spring with the last dev i catch a erroro when loading shardLua: Error: Failed to load: ailoader.lua (error = 2, luarules/gadgets/ai/boot.lua, [string "luarules/gadgets/ai/boot.lua"]:4: attempt to call global 'require' (a nil value)) can not understand why require is not available EDIT: i search to fix this problem, a solution is replace require with VFSInclude(), it works. After this, raise another problem, Shard crash with this error: error loop

tomjn commented 7 years ago

Ah, I'll switch it to use VFSInclude, that log also explains what the fakeos thing was I commented out. Looks like it's another thing to port over from Eronoobos' fork

tomjn commented 7 years ago

As an aside, I haven't tested AILoader.lua myself yet, I couldn't get spring running on my Mac last night and didn't have time to power up my desktop, I'm going to do that later today though

pandaro commented 7 years ago

I couldn't get spring running on my Mac last night and didn't have time to power up my desktop, I'm going to do that later today though

no problem, this was just a info

pandaro commented 7 years ago

anyway this is the code i have made that cause the loop but resolve the require problem: BAR5868.sdd/luarules/gadgets/ai/ if ShardSpringLua then VFS.Include("luarules/gadgets/ai/preload/spring_lua/boot.lua") elseif game_engine then require "spring_cpp/boot" else require "preload/shard_null/boot" end VFS.Include( "luarules/gadgets/ai/ai.lua" ) -- create and use an AI if ShardSpringLua then return ShardAI() else ai = ShardAI() end

tomjn commented 7 years ago

Pushed 2 commits that should help, there's likely to be other errors though, the stuff in shard.lua needs wrangling still

tomjn commented 7 years ago

we've both moved on to a common point so I'm going to close this issue out