Categories
AI Blog Shard

Shard 0.25

This release is mainly maintenance, and bug fixes, as well as minor performance improvements. I’ve also added new API functions and call outs!

Bugs:

  • Fixed a bug causing the spring API call for UnitDamaged to be sent to Shard as a UnitIdle call. UnitDamaged calls should now work correctly, and phantom UnitIdle calls should no longer exist.
  • UnitDamaged calls were never passed along from the AI object to all units and behaviour objects
  • Removed numerous debug messages
  • AttackHandler now maintains attack group sizes above a minimum value to prevent attack group sizes degrading to that of a single unit or two
  • Minor fixes to task queue management and certain failure cases that were never accounted for

Optimizations:

  • Checks added to prevent processing after the game has finished
  • Attack targeting now only checks for targets every 6 frames not every single frame
  • LUA_PATH is now set up correctly. Instead of calling game:ExecuteFile(file) or ai:ExecuteGameFile(file), you can now use the standard Lua library functions/keywords:
    • require – note if this fails the AI will exit and take the engine with it after printing a stacktrace to infolog.txt
    • include

Features:

  • Added game:IsPaused()
  • UnitDamaged now has a second parameter indicating the attacker. If the attacker isn’t available, nil will be passed and must be checked for
  • Added game:MinimumWindSpeed()
  • Added game:MaximumWindSpeed()
  • Added game:TidalStrength()
  • Added unit:IsCloaked()
  • Added game:GetResource(idx)
  • Added game:GetResourceCount()
  • Added game: GetResource(name)
  • Added Resource object

    Resource {
    name,
    income,
    usage,
    capacity, -- how much we can store (-1 for unlimited)
    reserves, -- how much is stored
    gameframe, -- the game frame these stats were recorded at
    },
  • Added a new api.lua with a proxy object implementing game
  • Added a preload folder, and moved api.lua, class.lua, and aibase.lua into it
  • game:GetEnemies() now returns the enemy units in a normal lua table
  • game:GetFriendlies() now returns friendly units in a normal lua table
  • game:GetMapFeatures() now returns features in a normal lua table

Functionally, the game play should be near identical to 0.21, with only tiny improvements, however, performance should increase slightly, as well as stability. I’ve also added a lot of things that were requested by content developers using Shard, which allows them to do even more things!

Download it here

2 replies on “Shard 0.25”

Great looking site…

RE: Shard 0.25.. It crashes with XTA96 and CA mods….

Also AI commander strays too close to enemy bases and gets killed too easily…

Apart from those 2 issues its the best AI i have played so far, Works great with BA712.

There are some issues, but these are fixed in the next version, I just have to finish one or two things, and I’ve been delayed several weeks by a licensing issue with the spring engine which is now resolved.

Leave a Reply

Your email address will not be published. Required fields are marked *