Search

Search found 153 matches

by lamer
18 Sep 2020, 11:04
Forum: Off Topic Discussion
Topic: AI Interface: GetLosMap() might be broken (or wrong usage?)
Replies: 5
Views: 9491

Re: AI Interface: GetLosMap() might be broken (or wrong usage?)

Tricky decision about moving to new cpp interface. I'd recommend doing so after planned initial big PR with AAI. Things to consider about new cpp interface: +) more up-to-date, bugfixes likely to go here; +) evey ID is an object. unit->GetPos() looks better than callback->GetUnitPos(unitID); -) evey...
by lamer
17 Sep 2020, 10:28
Forum: Off Topic Discussion
Topic: AI Interface: GetLosMap() might be broken (or wrong usage?)
Replies: 5
Views: 9491

Re: AI Interface: GetLosMap() might be broken (or wrong usage?)

Actual engine-side fix should look like : const unsigned short* springLegacyAI::CAIAICallback::GetLosMap() { if (losMap.empty()) { losMap.resize(sAICallback->Map_getLosMap(skirmishAIId, nullptr, 0)); } std::vector<int> tmpMap(losMap.size()); // required because of short -> int -> short sAICallback->...
by lamer
17 Sep 2020, 01:21
Forum: Off Topic Discussion
Topic: AI Interface: GetLosMap() might be broken (or wrong usage?)
Replies: 5
Views: 9491

Re: AI Interface: GetLosMap() might be broken (or wrong usage?)

Legacy GetLosMap: https://github.com/spring/spring/blob/maintenance/AI/Wrappers/LegacyCpp/AIAICallback.cpp#L777 It is bugged: one-time function, i see no way to reset empty state of internal temporary holder. Luckily you can write and execute similar code to what's inside brackets. https://github.co...
by lamer
03 Sep 2020, 15:13
Forum: Engine
Topic: What command must be given to cloak units? (for AI players)
Replies: 7
Views: 5886

Re: What command must be given to cloak units? (for AI players)

General rule is that you really don't want to write generalist AI. So old-school approach: AI consists of rules and data. Make scriptable rules (lua/squirrel/angelscript) for economy system, unit behaviours; configs for data. And general cpp backend (tools/framework) for AI to work, that includes te...
by lamer
31 Aug 2020, 23:05
Forum: Engine
Topic: What command must be given to cloak units? (for AI players)
Replies: 7
Views: 5886

Re: What command must be given to cloak units? (for AI players)

> Why do mods overwrite game internal behavior like command IDs? Some commands. Engine's CMD_CLOAK=95, but either it's too slow to cloak, or too fast, or uses only energy for upkeep but not metal so it doesn't satisfy mod's needs. Or maybe there was a bug that no mod-dev could fix in cpp so they rew...
by lamer
31 Aug 2020, 18:28
Forum: Engine
Topic: What command must be given to cloak units? (for AI players)
Replies: 7
Views: 5886

Re: What command must be given to cloak units? (for AI players)

This works for BAR's commanders for example (BAR latest git and spring 104.0.1-1553-gd3c0012 maintenance)
Command c(37382, 0, state ? 1 : 0);
ai->ct->GiveOrder(unitID, &c);
Tested with KAIK.
by lamer
31 Aug 2020, 16:39
Forum: Engine
Topic: What command must be given to cloak units? (for AI players)
Replies: 7
Views: 5886

Re: What command must be given to cloak units? (for AI players)

Most recent AIs use NewOO API (like native Shard did). There cloak command is simple as unit->Cloak(true); where unit is of springai::Unit* class provided by NewOOAPI. It is possible to track down how newOO wraps command as in the end both legacy and newOO interfaces use engine's CAICallback::GiveOr...
by lamer
04 Sep 2016, 12:20
Forum: AI
Topic: Java AI crashes with external libraries
Replies: 4
Views: 7135

Re: Java AI crashes with external libraries

WRT 'kinda': On Nuclear_Winter map Bla1AI built only eco and constructors till 10th minute, then spammed military units, ok so far. But after mexing half of the map and when scout didn't find NullAI in corner Bla1AI seized its activity - constructors, scout, everything went idle. I had to /cheat and...
by lamer
04 Sep 2016, 02:03
Forum: AI
Topic: Java AI crashes with external libraries
Replies: 4
Views: 7135

Re: Java AI crashes with external libraries

Probably just messed up installation (wrong version of AIInterface.jar + JavaOO-AIWrapper.jar)? Compiled Bla1AI+spring103.0 from link above and it kinda even killed NullAI. (Tested with basic replacement of NullOOJavaAI stuff by Bla's SkirmishAI.jar + AIInfo.lua) Checkout other working spring103 AI ...
by lamer
09 Jul 2016, 16:06
Forum: Mac OS X
Topic: MacOS SpringRTS OSX Build
Replies: 142
Views: 116035

Re: MacOS SpringRTS OSX Build

Code: Select all

Undefined symbols for architecture x86_64:
...boost...bla...boost...
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
Seems compiled but error at link-time.
Miscompiled boost? wrong boost's gcc options?
by lamer
27 May 2016, 08:22
Forum: Mac OS X
Topic: MacOS SpringRTS OSX Build
Replies: 142
Views: 116035

Re: MacOS SpringRTS OSX Build

Code: Select all

Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
CMake Error at /opt/local/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find Java (missing: Java_JAVA_EXECUTABLE Development)
Install JDK?
by lamer
08 Mar 2016, 20:25
Forum: Mac OS X
Topic: MacOS SpringRTS OSX Build
Replies: 142
Views: 116035

Re: MacOS SpringRTS OSX Build

Faster-rate LOS update requires OpenGL 3+. Mac OS X doesn't have OpenGL compatibility profiles for 3+ version and thus operates only in 2.1. See https://www.opengl.org/wiki/Core_And_Compatibility_in_Contexts, "Platform Issue (MacOSX)" section. Also Mac drivers are too strict and may result...
by lamer
07 Feb 2016, 16:18
Forum: Community Blog
Topic: [engine] Spring update February 2016
Replies: 9
Views: 3326

Re: [engine] Spring update February 2016

I don't think I've made the functions to grab that info, but essentially that depends on the game and how often it makes use of this feature. That'll make AIs utterly blind to dynamic units. Consider Zero-K and its dynamic commanders. If the game doesn't use it, current AIs should function the same...
by lamer
07 Feb 2016, 01:03
Forum: Community Blog
Topic: [engine] Spring update February 2016
Replies: 9
Views: 3326

Re: [engine] Spring update February 2016

Lua
Lots of new things here as well, I'll mention the new ability to change the damage table of a unit’s weapons (previously only possible in the WeaponDefs) or even projectiles in flight!
Any pitfalls for native AIs?
by lamer
01 Jan 2016, 22:08
Forum: Feature Requests
Topic: Better Teams Interface for AI
Replies: 6
Views: 2260

Re: Better Teams Interface for AI

I have concerns about ongoing work . Developed implementation: a) Add new Ally(Created|Finished|Destroyed|Damaged) events. I think it brings inconsistency: Unit(Given|Captured) is already sent to allies. My opinion about proper implementation: b) New Ally(Created|Finished|Destroyed|Damaged) events a...
by lamer
29 Dec 2015, 02:21
Forum: AI
Topic: [Java] Clear factory build queue [solved]
Replies: 4
Views: 3697

Re: [Java] Clear factory build queue [solved]

From what i see alt and control should be sufficient, e.g. 192 (tested)

Code: Select all

getUnit().executeCustomCommand(2, cmds, 192, frame + 50)
by lamer
28 Dec 2015, 12:45
Forum: Feature Requests
Topic: Better Teams Interface for AI
Replies: 6
Views: 2260

Re: Better Teams Interface for AI

awk scripts are responsible for generation of newOO wrappers (for any language). Search for *.awk inside spring/AI/.
As long as you followed naming conventions with some specific comments new events should be autogenerated.
Don't forget to test it!
by lamer
22 Dec 2015, 11:56
Forum: AI
Topic: Issues using OpenGL with an AI
Replies: 13
Views: 6215

Re: Issues using OpenGL with an AI

You can only have one context active in a thread, and each context can only be active in one thread at a time. Not exactly, threads has nothing to do with context. In simple case: there is GPU controled by OpenGL which is a state machine. Context describes its state. All there is to do is properly ...
by lamer
22 Dec 2015, 00:41
Forum: AI
Topic: Issues using OpenGL with an AI
Replies: 13
Views: 6215

Re: Issues using OpenGL with an AI

I think mantis issue is related. The heck glfwMakeContextCurrent(NULL) for? Try

Code: Select all

previousContext = glfwSomethingGetCurrentContext();
...init...
glfwMakeContextCurrent(previousContext);
Regardless, CircuitAI's DebugDrawer.cpp proves that context switch works.
by lamer
16 Dec 2015, 13:53
Forum: AI
Topic: Sensor maps
Replies: 5
Views: 3890

Re: Sensor maps

Logic in IsPosInRadar is not for native AI either (checks for jammers?). Ended up with additional sensor maps only.
PR

Go to advanced search