Search found 1339 matches

Go to advanced search

by sven
Tue Apr 17, 2018 6:46 pm
Forum: Modding
Topic: More Varied AI Research Paths
Replies: 4
Views: 76

Re: More Varied AI Research Paths

The AI's research desires aren't totally random. I've implemented some logic so to ensure that e.g. phidi always value economy techs to at least a certain degree, and the same for orthin and energy weapons/shields etc. I think going this route with 'static', entirely canned paths is probably suffic...
by sven
Mon Apr 16, 2018 10:16 pm
Forum: Testing
Topic: Report - Current Bugs and Issues
Replies: 1434
Views: 202692

Re: Report - Current Bugs and Issues

harpy eagle wrote:I did some searching and the mission type was 'outpost', created from outpost_fleets.lua


Oops, that a bug in my debugging tool then. I'll fix it ;)
by sven
Mon Apr 16, 2018 9:58 pm
Forum: Testing
Topic: Report - Current Bugs and Issues
Replies: 1434
Views: 202692

Re: Report - Current Bugs and Issues

attempt to call local 'color' (a nil value) Looks like you've created a new fleet mission type, but haven't defined a color for it when used with the ai debugging overlays. Um, there's a couple ways one could fix that :) Either extend the table, or just change line 166 to something like: local colo...
by sven
Mon Apr 16, 2018 7:01 pm
Forum: Testing
Topic: Report - Current Bugs and Issues
Replies: 1434
Views: 202692

Re: Report - Current Bugs and Issues

harpy eagle wrote:EDIT: Yep, still no damage numbers.


In 'Developer Options' do you have 'battle info text' turned off? (When they first went in, the fly-out numbers were an optional feature, and so for historical reasons devs/modders still have a button that turns them off.)
by sven
Mon Apr 16, 2018 6:31 pm
Forum: Modding
Topic: Strike Fighters
Replies: 1
Views: 44

Re: Strike Fighters

I guess you could consider this a fix, since I don't see any reason why strike fighters don't already behave like this. Although I guess researching the multi-role fighters tech before getting fusion warheads is pretty rare. Yeah, that's a sensible little diff. I'll roll it into vanilla in the next...
by sven
Mon Apr 16, 2018 6:22 pm
Forum: Modding
Topic: Strategic AI Mod
Replies: 40
Views: 354

Re: Strategic AI Tweaks

The other topic I asked you about on the other thread was if we could see the rest of the resource values of the other empires like food, total production, and trade root usage/capacity - we can already see some of them when selecting them, but not all of them. This makes it more difficult to see w...
by sven
Mon Apr 16, 2018 6:16 pm
Forum: Modding
Topic: Strategic AI Mod
Replies: 40
Views: 354

Re: Strategic AI Tweaks

I think the second condition emulates a faction with a strong force, but limited resources to grow with. Like Japan in WW2. They need to strike outward to grow before their warship power is overrun by others Right, I hadn't considered that. Although, since it reflects current production instead of ...
by sven
Sun Apr 15, 2018 8:41 pm
Forum: Modding
Topic: Tactical Combat AI Mod
Replies: 143
Views: 1951

Re: Tactical Combat AI Mod

It's like object center is returning the distance between the target and where the carrier was before it moved. Maybe it's related to the game merging movement of different ships? When you call them in the AI script, tactical actions should execute immediately; so after a call to action.move_ships,...
by sven
Sun Apr 15, 2018 4:04 am
Forum: Modding
Topic: Memoization
Replies: 11
Views: 79

Re: Memoization

I guess I can just use strong memoization then? Well, AIContexts can be tricky. Read the comment at the start of @AIContext.lua first, if you haven't yet. Then consider that the rules around accessing functions defined in AIContexts are actually dangerously permissive. When I write: _ENV = AIContex...
by sven
Sun Apr 15, 2018 3:42 am
Forum: Modding
Topic: Memoization
Replies: 11
Views: 79

Re: Memoization

Ok, so putting it all together, does this seem like a good use case for memoization? Yup. That will avoid repeated calculations of Design.clone() and design.update_hull_specs() when ship_power_score is repeatedly called for the same ship. That said, it does look suspiciously like you're expecting t...
by sven
Sun Apr 15, 2018 12:08 am
Forum: Testing
Topic: Report - Current Bugs and Issues
Replies: 1434
Views: 202692

Re: Report - Current Bugs and Issues

Sometimes when a planet is set to city planning, when going to the next turn it will be taken off city planning and a report issued stating that "We were unable to continue city planning at..." despite there being ample food. I believe this one should have been fixed in today's patch (r22...
by sven
Sat Apr 14, 2018 9:17 pm
Forum: Modding
Topic: Memoization
Replies: 11
Views: 79

Re: Memoization

Do they check if a table has been cached and only return copies? If you don't hit the cache, you'll rerun the whole function, which will generally create a new table from scratch. However, if you get a cache hit, the memoizer will return exactly the same table it returned previously. Thus: local f ...
by sven
Sat Apr 14, 2018 8:38 pm
Forum: Modding
Topic: Memoization
Replies: 11
Views: 79

Re: Memoization

But strong memoization is fine for stuff being used by AI code. Yeah. Basically, at the start of an AI function call, you can add anything you like to the _ENV, and be confident that the variables you've created will only exist until the AI call completes. This includes creating new strong_memoized...
by sven
Sat Apr 14, 2018 8:32 pm
Forum: Modding
Topic: Memoization
Replies: 11
Views: 79

Re: Memoization

Since it sounds like all weak caches get flushed by the GC, what happens if a weakly memoized function returns a table that isn't discarded in time? Well, as long as any reference to the table is still around, it will still exist after the GC call. But (assuming you're using the n-return value memo...
by sven
Sat Apr 14, 2018 2:57 am
Forum: Modding
Topic: Memoization
Replies: 11
Views: 79

Re: Memoization

Would the following work? If you're inside a situation where weak memoization isn't particularly safe you may need to use a different pattern. Because the AI executes inside a "throw away" temporary environment, you can actually use strong memoizers there to store temporaries that will on...

Go to advanced search