Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 7 8 [9] 10 11 ... 21

Author Topic: Iron Testament - an ancient "open world roguelike" (pre-alpha)  (Read 81977 times)

Clownmite

  • Bay Watcher
    • View Profile
Re: Iron Testament - an ancient "open world roguelike" (pre-alpha)
« Reply #120 on: September 01, 2013, 03:01:33 pm »

I don't know if dictionaries would work for my purposes. I'll need to eventually sort on a bunch of attributes, like "all female characters between ages 20 and 30, who are not of Dynasty X, and who are not married." I'll look into ZODB later today when I have more time, but is this something ZODB would be able to handle? 
Logged

HopFlash

  • Bay Watcher
    • View Profile
Re: Iron Testament - an ancient "open world roguelike" (pre-alpha)
« Reply #121 on: September 01, 2013, 03:48:20 pm »

ah...ok...if dicts are not enough then ZODB will be neither.

then look into MongoDB (http://www.mongodb.org/) with PyMongo (https://pypi.python.org/pypi/pymongo/).
I'm not familiar with it but read about it and it looks very promising.

A friend of mine suggested Elastic Search (http://www.elasticsearch.org/) which uses Lucene under the hood. But I'm not sure if it can fit in your project.
Logged
GENERATION 11: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

Inactive Therian Saga Char: Stormhead
Dominions: 4.03 Berytos; 4.06 Pangaea; 4.08 Arcoscephale; 4.11 Shinuyama
Inactive Wurm Online Char: Stormhead

Killjoy

  • Bay Watcher
    • View Profile
Re: Iron Testament - an ancient "open world roguelike" (pre-alpha)
« Reply #122 on: September 04, 2013, 12:57:55 am »

I don't know if dictionaries would work for my purposes. I'll need to eventually sort on a bunch of attributes, like "all female characters between ages 20 and 30, who are not of Dynasty X, and who are not married."

Dicts would work fine for this, just create a defaultdict for each attribute you want to be able to select by:
Code: [Select]
from collections import defaultdict
select_by_age = defaultdict(set)
select_by_dynasty = defaultdict(set)
...
#Creating, or updating any entity
select_by_age[self.age].add(self)
select_by_dynasty[self.dysnasty].add(self)
#and so on
....

#When you need to find all entities by age / dynasty
all_in_agerange = {select_by_age[i] for i in range(20, 31)} #The hidden set comprehension syntax
of_specific_dynasty = select_by_dynasty[dynasty]
... select by a bunch of more attributes
entities_you_want_to_find = all_in_agerange & of_specific_dynasty #etc etc

# Sets implement set intersection using the set intersection operator '&'.
# Since they work by hashing, it is very fast
Logged
Merchants Quest me programming a trading game with roguelike elements.

lemmily

  • Bay Watcher
    • View Profile
    • BatFinchBears
Re: Iron Testament - an ancient "open world roguelike" (pre-alpha)
« Reply #123 on: September 05, 2013, 02:35:30 pm »

Dicts would work fine for this, just create a defaultdict for each attribute .....


Thanks for this piece of info :) it'll help me when I'm doing a similar thing in my project!

P.s killjoy - do you think you'll be returning to work on the merchants quest again? I really enjoyed seeing the progression :)

 
Logged
I make furry things - BatFinch Bears

Clownmite

  • Bay Watcher
    • View Profile
Re: Iron Testament - an ancient "open world roguelike" (pre-alpha)
« Reply #124 on: September 05, 2013, 07:24:21 pm »

Interesting on the defaultdict, I will look into it.


In other progress, dynasties now have emblems. Only major figures get associated with dynasties. Here's a screenshot of the still-terrible UI, which shows the dynasty emblems next to the figures' names:



The game now generates passable cities, although there is a LOT of work to be done. One cool thing is that all of the historical figures have houses and places where they work, which can be visited on the city map. I hope to have people's location change based on time of day, so in the morning you'll find them at work, and in the evening, in a tavern or at home.




Logged

mastahcheese

  • Bay Watcher
  • Now with 20% less sanity and trans fat!
    • View Profile
Re: Iron Testament - an ancient "open world roguelike" (pre-alpha)
« Reply #125 on: September 05, 2013, 08:43:16 pm »

I just found out about this.

Is there a playable demo of this? This looks absolutely amazing.
Logged
Oh look, I have a steam account.
Might as well chalk it up to Pathos.
As this point we might as well invoke interpretive dance and call it a day.
The Derail Thread

Clownmite

  • Bay Watcher
    • View Profile
Re: Iron Testament - an ancient "open world roguelike" (pre-alpha)
« Reply #126 on: September 05, 2013, 09:11:02 pm »

Is there a playable demo of this? This looks absolutely amazing.

Hey, thanks! There is no demo at the moment. I am a total amateur programmer doing this on and off in my free time. The game is still pre-alpha - basically there's nothing to do and not that many gameplay elements in yet. I'd like to get something out soon but I can't promise anything, there's still a long way to go.
Logged

mastahcheese

  • Bay Watcher
  • Now with 20% less sanity and trans fat!
    • View Profile
Re: Iron Testament - an ancient "open world roguelike" (pre-alpha)
« Reply #127 on: September 05, 2013, 09:16:55 pm »

Ok, well good luck! I'll be watching.
Logged
Oh look, I have a steam account.
Might as well chalk it up to Pathos.
As this point we might as well invoke interpretive dance and call it a day.
The Derail Thread

Killjoy

  • Bay Watcher
    • View Profile
Re: Iron Testament - an ancient "open world roguelike" (pre-alpha)
« Reply #128 on: September 06, 2013, 07:03:00 am »

Dicts would work fine for this, just create a defaultdict for each attribute .....


Thanks for this piece of info :) it'll help me when I'm doing a similar thing in my project!

P.s killjoy - do you think you'll be returning to work on the merchants quest again? I really enjoyed seeing the progression :)

I really want to get back into game programming, posting and documenting progress is very fun and extremely rewarding.

For some time I have contemplated reviving MQ, but as something totally different. But it is on hold for now, I've gotten into way to much freelance work, so my hobby project time is now work time too.
Logged
Merchants Quest me programming a trading game with roguelike elements.

lemmily

  • Bay Watcher
    • View Profile
    • BatFinchBears
Re: Iron Testament - an ancient "open world roguelike" (pre-alpha)
« Reply #129 on: September 06, 2013, 12:46:13 pm »

The screens look great :) I don't remember if you said - are you using libtcod?

I think it's funny how much work these type of games take before anything actually seems to *happen* :) but it's very satisfying when they do! :)

I tried making cities before - Yours look a lot better than what I had got before I scrapped it and did something else! :P

Edit:

Oh and killjoy, well I enjoyed watching MQ develop over the few days :) so I imagine I'll enjoy following whatever you decide to work on!
« Last Edit: September 06, 2013, 01:17:38 pm by lemmily »
Logged
I make furry things - BatFinch Bears

Clownmite

  • Bay Watcher
    • View Profile
Re: Iron Testament - an ancient "open world roguelike" (pre-alpha)
« Reply #130 on: September 06, 2013, 10:51:55 pm »

The screens look great :) I don't remember if you said - are you using libtcod?

Thanks! And yes I am.
Logged

Clownmite

  • Bay Watcher
    • View Profile
Re: Iron Testament - an ancient "open world roguelike" (pre-alpha)
« Reply #131 on: September 09, 2013, 08:08:36 pm »

I am about to add actual historic figure death, but I realized that this is much harder than it sounds. At any time, a character is in the list of all created characters, but it can also be in a bunch of other lists, and some of those lists are not necessarily linked to that person. When the person dies, it's going to need to be removed from those lists, but there's no way I can just check through every single list in the game to see if that person is in it. Furthermore, if the person is by themselves when they die (killed by bandits while on a journey or something), others may not necessarily know about the death. I think I can eventually deal with this but I'm guessing this will get buggy and weird pretty quickly. Anyway, I'll see how this goes, and additionally adding marriages, births, and actual successions in too, and have some basic form of simulation going on.
Logged

Killjoy

  • Bay Watcher
    • View Profile
Re: Iron Testament - an ancient "open world roguelike" (pre-alpha)
« Reply #132 on: September 10, 2013, 08:25:26 am »

If you go for the psedo relational approach a outlined in the previous post using python dicts you can simply add a relation called ALIVE that can be used to keep track of this kind of stuff with.
Removing entities from this relation will mark them as dead. I will give you one more example advocating the approach.


Code: [Select]
#Stuff you want to relate entities to, like age or gender
ALIVE = defaultdict(set)
AGE = defaultdict(set)
GENDER = defaultdict(set)
DYNASTY = defaultdict(set)
CITY = defaultdict(set)
MARRIED = defaultdict(set)
# ... and so on
# Make sure a solid interface between the entity and the outside world exists, so these relations are changed accordingly
# Use python properties
class Entity(object):
    ...
    @property
    def age():
         return self._age

    @property.setter
    def age(x):
         AGE[self._age].remove(self)
         self._age = x
         AGE[x].add(self) #Make sure to update entity relation
   
    #Etc..

# Complex search example, why sets are awesome.
# Find all MALE entities that are ALIVE between ages 20-70 that are not MARRIED
entities = (ALIVE[True] & GENDER[MALE]) & {AGE[i] for i in range(20, 71)} & MARRIED[False]

Logged
Merchants Quest me programming a trading game with roguelike elements.

Clownmite

  • Bay Watcher
    • View Profile
Re: Iron Testament - an ancient "open world roguelike" (pre-alpha)
« Reply #133 on: September 10, 2013, 11:57:01 pm »

Does the constant updating the dicts have any performance impact?

I added in some basic marriage, birth, and death stuff today. Parts of the code are a mess and there are a few bugs left to hunt down, but amazingly I did a test run of 40 years without any crashes. People married, had kids, died, and succession for the city governors went without a hitch. Of course, the figures don't actually do anything yet, but I got up to 1000 figures without any noticeable performance hit.

Even more amazingly, there were still merchants running around at the end of the 40 years. My earlier tests showed that they had stopping moving pretty quickly, which was a sign that nobody was buying the stuff that they were offering, or nobody was offering any stuff that they needed. This happened in the current test, but after a few years they started picking up and moving around again.

What's puzzling though is that by the end of the test, it seemed like every city almost exclusively had farmers as workers. A city who was a major copper exporter, for example, only had a single copper miner agent type, and about 40 farmers. While all cities should have a large farmer population, there should be a lot more miners and smiths for a town that exports copper.

Also, at the end of the test, one city had food prices of 37 gold, while another's was 2500 gold. There should be some differences in food prices from city to city, but 2500 gold is a lot in this simulation. So, although it appears as though some of the economy stuff is functioning, I'm going to have to revisit it in-depth at some point.

Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Iron Testament - an ancient "open world roguelike" (pre-alpha)
« Reply #134 on: September 11, 2013, 12:02:12 am »

Clearly the merchants aren't doing their job correctly.
Or maybe someone cornered the food market ;D
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward
Pages: 1 ... 7 8 [9] 10 11 ... 21