Page 1 of 1

Ideas on speeding up history generation process?

Posted: Fri Jul 16, 2021 6:40 pm
by Gunroar:Cannon()
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. :P .

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.

Re: Ideas on speeding up history generation process?

Posted: Fri Jul 16, 2021 7:51 pm
by FreezyDude
Untitled.png
Untitled.png (98.89 KiB) Viewed 8978 times
you're lowkey a genius :O

Re: Ideas on speeding up history generation process?

Posted: Sun Jul 18, 2021 4:55 pm
by Gunroar:Cannon()
FreezyDude wrote: Fri Jul 16, 2021 7:51 pm you're lowkey a genius :O
Hahah, :rofl:, 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. :P

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 :ultrahappy:
Still open to any suggestions...

Re: Ideas on speeding up history generation process?

Posted: Wed Jul 21, 2021 10:57 am
by Gunroar:Cannon()
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 :P

Re: Ideas on speeding up history generation process?

Posted: Wed Jul 21, 2021 3:15 pm
by milon
Wow, ambitious! I think this is basically how Dwarf Fortress got started. ;)

Re: Ideas on speeding up history generation process?

Posted: Thu Jul 22, 2021 2:33 am
by Yozzaxia
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.

Re: Ideas on speeding up history generation process?

Posted: Thu Jul 22, 2021 10:09 pm
by Gunroar:Cannon()
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 :rofl: . 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 :huh: . 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...?) :ultrahappy: .Okay, story not that long. :P

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. :P

Re: Ideas on speeding up history generation process?

Posted: Thu Jul 22, 2021 10:17 pm
by togFox
I think a simple yes/no might be comforting. Sometimes I long for a very simple interface that doesn't require much thinking.

Re: Ideas on speeding up history generation process?

Posted: Fri Jul 23, 2021 10:11 am
by Gunroar:Cannon()
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 :P . 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 :P. 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! :awesome:
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 :P :rofl: