Search found 1390 matches

Go to advanced search

by sven
Sun Apr 15, 2018 3:42 am
Forum: Modding
Topic: Memoization
Replies: 16
Views: 1134

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: 1509
Views: 302911

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: 16
Views: 1134

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: 16
Views: 1134

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: 16
Views: 1134

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: 16
Views: 1134

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...
by sven
Sat Apr 14, 2018 2:33 am
Forum: Modding
Topic: Memoization
Replies: 16
Views: 1134

Re: Memoization

I have a question about how the memoization functions work in the game. So suppose I wanted to cache the number of inhabited planets the current empire has this turn, to avoid iterating through empire.planets to count them every time. Would the following work? Yes, that should work. How does the me...
by sven
Fri Apr 13, 2018 5:41 pm
Forum: Modding
Topic: Determine the distance a ship can move in 1 turn
Replies: 19
Views: 1295

Re: Determine the distance a ship can move in 1 turn

harpy eagle wrote:Which revision is the change on? Just want to know when it reaches the public branch.


I've just pushed r22135 to Steam and GoG.com -- it's primarily a hotfix update, but, it also happens to include these updates to the low-level tactical AI motion functions.
by sven
Thu Apr 12, 2018 10:51 pm
Forum: Testing
Topic: Report - Current Bugs and Issues
Replies: 1509
Views: 302911

Re: Report - Current Bugs and Issues

Captainspire wrote:Food - starvation bugs
I've been sending uploads to try to pinpoint the cause


I *think* both of these ought to be fixed as of r22135 (though you need to replay the whole of stardate 1524 to avoid any errors). Please keep sending in bug reports as they pop up.
by sven
Thu Apr 12, 2018 7:01 pm
Forum: Testing
Topic: Report - Current Bugs and Issues
Replies: 1509
Views: 302911

Re: Report - Current Bugs and Issues

zolobolo wrote:Visual bug for cloaked Military Transport in tactical battle or when underway between start systems


Should be fixed as of r22131. Thanks for the report.
by sven
Thu Apr 12, 2018 6:07 pm
Forum: Testing
Topic: Report - Current Bugs and Issues
Replies: 1509
Views: 302911

Re: Report - Current Bugs and Issues

harpy eagle wrote:If marauders capture an outpost, an error occurs when their monster economy attempts to update the population of the planet if it is unpopulated (which is usually the case with outposts).


Thanks for the report. This one should be fixed as of r22127.
by sven
Wed Apr 11, 2018 8:29 pm
Forum: Testing
Topic: Report - Current Bugs and Issues
Replies: 1509
Views: 302911

Re: Report - Current Bugs and Issues

Latest update had an error at startup using sis64.exe. Seems when one issue is fixed, something else has to break. I'll look into the other .exe startups It looks like the game may have crashed earlier while attempting to do an autosave, leading to a corrupt save game. Please try deleting SaveGames...
by sven
Wed Apr 11, 2018 8:20 pm
Forum: Modding
Topic: Stars in Shadow Modding Support
Replies: 6
Views: 1463

Re: Stars in Shadow Modding Support

harpy eagle wrote:It would be really nice if enemies() could accept an empire as an argument, so you could do things like call enemies(ship, current_side())


It's slightly awkward, but I believe you can call

Code: Select all

  Battle.enemy(ship.empire,current_side())

to do checks of this sort.
by sven
Tue Apr 10, 2018 8:41 pm
Forum: Modding
Topic: Tactical Combat AI Mod
Replies: 174
Views: 9235

Re: Tactical Combat AI Mod

Close in and attack error when engaging a large fleet of Harpies via Super Dred This one is almost certainly due to the fact that under the hood, try_use_electrocyte uses find_max_boarding_move to close in on it's target, and you can't board fighters/missiles. However, you can electrocyte them. The...
by sven
Tue Apr 10, 2018 7:27 pm
Forum: Modding
Topic: Tactical Combat AI Mod
Replies: 174
Views: 9235

Re: Tactical Combat AI Mod

While it would be solved by moving ships together, there's no way I know of to tell when a ships movement is blocked by another ship, so I'm not sure what could be done. Actually... If it's possible to determine whether a ships desired position as returned by get_min_facing_move_L2() overlaps with ...

Go to advanced search