I am trying to create an exponential increase in production based on population size. I tested the following code with https://sqliteonline.com/ and it produces the expected table with the expected values. However, the rest of the mod (that updates the database with this code) fails. My improvised debug strategy is to set the combat strength of the Warrior to 250 and then move that code down until it fails to modify the game. It works before this chunk of code but not directly after. Does anyone know why?
SQL:
CREATE TABLE IF NOT EXISTS Population_Bonus
(
Population_Size INT,
Production_Bonus REAL
);
WITH RECURSIVE pop_bonus(pop, bonus)
AS (
VALUES(1,1)
UNION ALL
SELECT
pop + 1 AS pop,
POWER(pop, 1.17) - POWER(pop-1, 1.17) AS bonus
FROM pop_bonus
WHERE pop <= 250
)
INSERT INTO Population_Bonus (Population_Size, Production_Bonus) SELECT pop,bonus FROM pop_bonus;
Last edited: