The Forums Are Now Closed!

The content will remain as a historical reference, thank you.

Over Level 20 AI?

By on February 7, 2010 1:51:45 AM from Demigod Forums Demigod Forums

Lo all,

 

Ive been crafting a mod for quite some time, with a lot of content lifted from the other mod makers.

 

One thing thats been stumping me, is that once AI players get above level 20 they just.. stop. They will return fire, but no longer move or attack of their own volition.

 

Im sure its an AI flag somewhere like when level is betwen 15 and 20 do such and such, with no over arching goals past 20.. i just need to add one up to my current cap of 75.

The problem is in hook\lua\sim\AI somewhere, but where?

Thanks

0 Karma | 4 Replies
February 7, 2010 10:28:10 AM from Demigod Forums Demigod Forums

 

Start a game with them at level 20 and let them get a level to trigger the failure, then you can end the game and go to:

"C:\Users\username\Documents\My Games\Gas Powered Games\Demigod" open: DemigodLog.txt

If it is a big enough error to kill thier movement it should be in the log as 'lua script error' with traceback information of the function that may have cuased the error.

 

You can post the error here or troubleshoot on your own.

February 7, 2010 11:37:34 AM from Demigod Forums Demigod Forums

The first AI error i see in that log is this:

 

warning: 00:08:40: Error running lua script: ...ta.zip\lua\sim\ai\strategic\assets\friendlyasset.lua(1198): attempt to concatenate local `returnSkill' (a nil value)
         stack traceback:
             ...ta.zip\lua\sim\ai\strategic\assets\friendlyasset.lua(1198): in function `PickSkillUpgrade'
             ...ock games\demigod\dgdata.zip\lua\sim\ai\herogoap.lua(2697): in function <...ock games\demigod\dgdata.zip\lua\sim\ai\herogoap.lua:2694>

 

There are several of them.

Then this:

warning: 00:22:18: *AI ERROR: Could not find a valid skill
warning: 00:22:19: *AI ERROR: Could not find a valid skill
warning: 00:22:21: *AI ERROR: Could not find a valid skill
warning: 00:22:25: *AI ERROR: Could not find a valid skill
warning: 00:22:28: *AI ERROR: Could not find a valid skill

 

 

So, it looks like perhaps the AI is trying to buy a new skill when it spawns, fails, so then it crashes? Perhaps adding a return statement in the "buy new upgrade" function will work. Ill give it a go later when i have time.

February 7, 2010 4:49:13 PM from Demigod Forums Demigod Forums

 

Yep that is the basics of it.   You have pretty descriptive error, so you should be able to go right to that function or the function or two before/after it and find a good spot to mod a fix for the section that picks skills.

I've modded this area of the code for my AI.   By default it has pre-configured builds that sets out how to use skills 1-20.  Each level a skill counter is increased and when it has a skill point to spend it spends it and increments the counter.   There is no protections on the function, so it will call to the build it has selected and the start of the game and ask for the 21st skill.   

You can either extend the AI skill plans/builds to the levels you expect them to reach or when that function would return an error have it fail over to the selecting skill by weights function instead of picking skills by a build.

February 7, 2010 11:36:47 PM from Demigod Forums Demigod Forums

good tutorial there peppe! +1

Stardock Forums v1.0.0.0    #108435  walnut2   Server Load Time: 00:00:00.0000046   Page Render Time:

Stardock Magazine | Register | Online Privacy Policy | Terms of Use

Copyright ?? 2012 Stardock Entertainment and Gas Powered Games. Demigod is a trademark of Gas Powered Games. All rights reserved. All other trademarks and copyrights are the properties of their respective owners. Windows, the Windows Vista Start button and Xbox 360 are trademarks of the Microsoft group of companies, and 'Games for Windows' and the Windows Vista Start button logo are used under license from Microsoft. ?? 2012 Advanced Micro Devices, Inc. All rights reserved. AMD, the AMD Arrow logo and combinations thereof are trademarks of Advanced Micro Devices, Inc.