Ideas on speeding up history generation process?

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

Ideas on speeding up history generation process?

Post 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.
Attachments
some log output for those curious ;)
some log output for those curious ;)
Screenshot_2021-07-16-19-28-07.png (715 KiB) Viewed 8951 times
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
FreezyDude
Prole
Posts: 33
Joined: Sat May 08, 2021 11:58 am

Re: Ideas on speeding up history generation process?

Post by FreezyDude »

Untitled.png
Untitled.png (98.89 KiB) Viewed 8938 times
you're lowkey a genius :O
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Ideas on speeding up history generation process?

Post 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...
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Ideas on speeding up history generation process?

Post 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
Attachments
Screenshot_2021-07-21-11-34-01.png
Screenshot_2021-07-21-11-34-01.png (679.97 KiB) Viewed 8551 times
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
milon
Party member
Posts: 472
Joined: Thu Jan 18, 2018 9:14 pm

Re: Ideas on speeding up history generation process?

Post by milon »

Wow, ambitious! I think this is basically how Dwarf Fortress got started. ;)
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
Yozzaxia
Prole
Posts: 10
Joined: Fri Jul 16, 2021 3:36 pm

Re: Ideas on speeding up history generation process?

Post 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.
Last edited by Yozzaxia on Thu Jul 22, 2021 2:35 am, edited 1 time in total.
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Ideas on speeding up history generation process?

Post 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
Last edited by Gunroar:Cannon() on Thu Jul 22, 2021 10:17 pm, edited 1 time in total.
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
togFox
Party member
Posts: 764
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: Ideas on speeding up history generation process?

Post 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.
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Ideas on speeding up history generation process?

Post 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:
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests