## Ideas on speeding up history generation process?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Gunroar:Cannon()
Party member
Posts: 520
Joined: Thu Dec 10, 2020 1:57 am

### Ideas on speeding up history generation process?

I started something that generates history by making a bunch of people from different species(100 each), and letting them run around and reproduce(in a "simple" context, the map is literally just a 1D array with list of places, and actions are printed out to a log file) and do actions and fight, until it stops after 100(?) years so the player can play with those people and weapons. It runs the iteration for each creature in each clan, after that .25 decades pass. .

Code: Select all

for clan in clans:
for creature in clan:
updateLineage(creature)

It worked well, for a while, but then after they reproduce and population goes up, the iteration takes longer(starts at 500, goes to 4900, takes longer). It's not really lagging cause their no graphics to lag on and I understand the problem.
I can think of ways to improve it but I'm just asking if anyone has any ideas to improve the algorithm, and smart ways to make cuts that don't affect the simulation that much.
Attachments
some log output for those curious ;)
Screenshot_2021-07-16-19-28-07.png (715 KiB) Viewed 6058 times
Why can't pirates code in lua? Because they spend to much time at C!

-It might look like nonsense but there's so much proof.
-Some more if you pls... .
It has to be real then, all that talk about the end .
-How to be saved
FreezyDude
Prole
Posts: 31
Joined: Sat May 08, 2021 11:58 am

### Re: Ideas on speeding up history generation process?

Untitled.png (98.89 KiB) Viewed 6045 times
you're lowkey a genius :O
Check out Star Quest, the game I'm making!
https://love2d.org/forums/viewtopic.php?f=14&t=91181
Gunroar:Cannon()
Party member
Posts: 520
Joined: Thu Dec 10, 2020 1:57 am

### Re: Ideas on speeding up history generation process?

FreezyDude wrote: Fri Jul 16, 2021 7:51 pm you're lowkey a genius :O
Hahah, , thnx alot, I guess. But I can't take that much credit because it's not that complicated tho...probably. Just loading up a bunch of creatures interacting with the world which is just made up of a set of rules, then they just do their own thing.

I thought of a different way which was to load up history for a character once it spawns in the game so that no unnecessary loading is done (like rimworld) but I see the disadvantages of that(I think) like inconsistency and conflicts in world history. Plus that might actually be harder than the whole history generating, so for now I have reducing the "lust" increase rate and the amount of babies per person
Still open to any suggestions...
Why can't pirates code in lua? Because they spend to much time at C!

-It might look like nonsense but there's so much proof.
-Some more if you pls... .
It has to be real then, all that talk about the end .
-How to be saved
Gunroar:Cannon()
Party member
Posts: 520
Joined: Thu Dec 10, 2020 1:57 am

### Re: Ideas on speeding up history generation process?

Decided to reduce population drastically at start (10 per clan/species), might still change it. Population increases to around 75(from 40) in the next 3 years or so. Currently it seems I have drakons(dragons) losing to elephants, elephants as canibals and elves(elfs?) equipping chairs as clothing
Attachments
Screenshot_2021-07-21-11-34-01.png (679.97 KiB) Viewed 5658 times
Why can't pirates code in lua? Because they spend to much time at C!

-It might look like nonsense but there's so much proof.
-Some more if you pls... .
It has to be real then, all that talk about the end .
-How to be saved
milon
Party member
Posts: 184
Joined: Thu Jan 18, 2018 9:14 pm

### Re: Ideas on speeding up history generation process?

Wow, ambitious! I think this is basically how Dwarf Fortress got started.
Yozzaxia
Prole
Posts: 6
Joined: Fri Jul 16, 2021 3:36 pm

### Re: Ideas on speeding up history generation process?

Like you said, load history when a character spawns, but have an individual store the history of other characters in itself, so they can react individually from there.
Last edited by Yozzaxia on Thu Jul 22, 2021 2:35 am, edited 1 time in total.
Gunroar:Cannon()
Party member
Posts: 520
Joined: Thu Dec 10, 2020 1:57 am

### Re: Ideas on speeding up history generation process?

milon wrote: Wed Jul 21, 2021 3:15 pm Wow, ambitious! I think this is basically how Dwarf Fortress got started.
Haha, yeah, thnx, ambitious . Maybe that's a little how it started (but I do know the whole history idea started with the creator keeping track of killed goblins and kills made by goblins in one of his younger games). My goal is alot simpler so that the gameplay interface will be more casual. I plan to use this as a game where you're a manager of a certain place and can only answer "yes" and "no".
Though the way to choose yes or no is pretty lame, just tapping a big green yes button and a big red no button when someone comes to you for a request.
Any one with ideas on how to make it ... better?

I fixed the problem with chair clothes and elephant canibals. Found out that unnaturally large health is due to an unnatural increase in morale gotten from liking the"movement" action . Hah! Long story...the elephant gets knocked out and then has a chance to get back up depending up on its willpower. But then its willpower is based on morale and health so it then gets a boost equal to around half its willpower when it struggles for life successfully. Kind of like creating super human-I mean elephant-blood that's only gotten from surviving death(not wanting to mention anime but...sayain power...?) .Okay, story not that long.

Anyway, next is (besides improving) disease and disasters. Plan to add plants and war after this. If anyone also has any ideas they want me to add(like species, effects, fruit juice) I'm all ears.
Last edited by Gunroar:Cannon() on Thu Jul 22, 2021 10:17 pm, edited 1 time in total.
Why can't pirates code in lua? Because they spend to much time at C!

-It might look like nonsense but there's so much proof.
-Some more if you pls... .
It has to be real then, all that talk about the end .
-How to be saved
togFox
Party member
Posts: 345
Joined: Sat Jan 30, 2021 9:46 am

### Re: Ideas on speeding up history generation process?

I think a simple yes/no might be comforting. Sometimes I long for a very simple interface that doesn't require much thinking.
Gunroar:Cannon()
Party member
Posts: 520
Joined: Thu Dec 10, 2020 1:57 am

### Re: Ideas on speeding up history generation process?

Yozzaxia wrote: Thu Jul 22, 2021 2:33 am Like you said, load history when a character spawns, but have an individual store the history of other characters in itself, so they can react individually from there.
(Sorry, missed this)
That's pretty neat, storing history of other characters, but may actually be harder than generating an actual history :ultrahapphy: . And only certain character's should know certain other character's history, and then not all of it, like if a person doesn't like talking about, and hides the fact that their great grandfather who murdered half a clan . I wonder, maybe I could use character archetypes for the creation of historical figures... I could even get rid of some boring characters in history to cut down on loading time so that only characters with a marked goal/chose ones have real history while the rest are background fodder . But then the history gen class seems like I can put in the yes/no gameplay when I'm ready.
Thanks for the idea, I like others' views on things, it makes my system more dynamic!
togFox wrote: Thu Jul 22, 2021 10:17 pm I think a simple yes/no might be comforting. Sometimes I long for a very simple interface that doesn't require much thinking.
Hmmm...Though I liked it and had that exact reason to do it the whole imagined gameplay looks a lot like reigns, but not with swiping, just buttons. Thag made me uncomfortable. Maybe I'll still find a way to differentiate it from Reigns.

Edit:*That made me uncomfortable, wow...sprry, thag wes a mjstake
Why can't pirates code in lua? Because they spend to much time at C!

-It might look like nonsense but there's so much proof.
-Some more if you pls... .
It has to be real then, all that talk about the end .
-How to be saved

### Who is online

Users browsing this forum: No registered users and 46 guests