Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AgingMinotaur

Pages: 1 ... 50 51 [52] 53 54
766
Other Announcements / Re: Which roguelike have you played the most?
« on: September 23, 2009, 10:14:26 PM »
Nethack and LambdaRogue are the only roguelikes I play sometimes.
And Kaduria, I hope ;)

As always,
Minotauros

767
Programming / Re: Inept question about probability
« on: September 18, 2009, 05:57:57 PM »
Also, repetitions are not very useful if you want some items to be extremely rare (in the given conditions) -- you would have to replicate the usual ones, say, thousands of times.

Yes, that's what started happening to my list-based scheme. Some of the lists would be several hundred thousand instances long ...

As always,
Minotauros

768
Programming / Re: Inept question about probability
« on: September 16, 2009, 12:34:04 AM »
wow, where did you come up with that scheme?
I guess I'm just a natural 8)

I did something simular but mine is somewhat more basic. 
I have a list that I add things to multiple times, depending on its probablility.  I.e 'sword' will be added once, 'knife and fork' will be added 4 times.  Then I randomly choose an integer between 0 and size-1 of the list.
Then I select element at that place.
This is basically what I used to do, as well. It still seems like a natural approach. The reason I wanted to redo it, was that it ran slightly slow as my lists-of-stuff became bigger. I guess this has to do in part with the slowness of sorted lists in python, but mainly of course it's due to my subhuman coding skillz (my horns get in the way as I type). The new piece of code takes up less space in my source, and runs several times faster, sometimes knocking a few tenths of a second off of map building times.

As always,
Minotauros

769
Programming / Inept question about probability
« on: September 15, 2009, 05:46:53 PM »
EDIT: some crude testing suggests that my code works just as it should. Sometimes it's better to think things over twice before posting for help. Ah, well ...

Sometimes I'm feeling very stupid. Like ... just about now. Someone with a clearer mind should be able to help me out with this one.

I'm reworking the parts of my code that picks a random element from a set (of monsters, or items, or something else). First, the possible choices are put in a python dictionary, where the key is the name/identifier of the element, and the value is the relative probability of that element showing up. Something like this, in other words: {'sword':1, 'croquet club':2, 'knife and fork':4} In this example, croquet clubs should be twice as probable as swords, and cutlery four times as probable. Here's what I'm uncertain about:

Code: [Select]
def draw_lot(pd): # pd is the dictionary of stuff
    full_prob=reduce(lambda x,y : x+y, pd.itervalues()) # adds all values,
            # ie. sets full_prob to 7 in the example with the weapons
        choice=random.randint(1,full_prob) # a number between 1 and full_prob
        while 1:
            k=pd.popitem() # pops a random key+value from the pd dictionary
            if k[1]>=choice: # k[1] is the value, ie. 1, 2, or 4
                return k[0] # returns name of picked item
            else:
                choice-=k[1]

This works pretty fast, but I'm unsure as to whether it produces the intended effect. Will it actually return clubs twice as often as swords, and cutlery twice as often as clubs? I feel like I've a short circuit here somewhere, but I can't wrap my mind around it. So, any help regarding this would be appreciated.

As always,
Minotauros

770
Classic Roguelikes / Re: ADOM - tips & strategies
« on: September 15, 2009, 12:59:31 AM »
Grey elf wizard is the optimal choice for magic users, I think. Other combos I can think of, that I like: orcish priest, dwarven druid/wizard/priest (tougher than elves), hurthling/human/gnomish druid, drakeling druid/wizard, gnomish wizard/elementalist, trollish wizard (weirdly fun). I'm no big fan of elementalists or necromancers, but I like druids. Animals don't attack them, they tend to get good spells, and they're not as frail as wizards. Other interesting choices include elvish/drakish bards, and weaponsmiths (who have the needed skill (Concentration) to become good casters). As far as I gather, smithing is all about grinding, though, so it's up to you ...

Any magic user needs to get Concentration to 100% as soon as possible. Literacy is also very important. Important stats are Learning (how good do you memorize), Mana (amount/regeneration of mana) and Willpower (strength of magic). Choose the "Potent aura" talent as soon as possible.

As always,
Minotauros

771
Programming / Re: Representing agility
« on: August 22, 2009, 05:06:17 AM »
There are solutions to this problem. In my system, the game always remembers which direction the player is facing. Whenever s/he moves in any other direction, if there is a hostile monster adjacent in the current facing direction, it gets a free turn

Does the player get a free turn too if the monster changes direction? Or are these npc-exceptions only (which i really dislike).
At the moment, npc-only, since I didn't design the AI to exploit scummy tactics. But the system might as well apply to all critters. It could have some weird side-effects, as time would in effect occationally speed up around battle. However, the ways the player could exploit it would be a lot less bullet-proof and demand more finesse than "attack once, retreat once", eg. attacking a weak monster (just to scare it away) as a feint to get two successive attacks against another creature.

As always,
Minotauros

772
Programming / Re: Representing agility
« on: August 21, 2009, 10:35:02 PM »
I made a prototype once that had a speed system, where there was a type of monster that moved half as fast as my character (I had two turns per turn the monster had). I found it a little cheap when I figured out how to damage the monster without getting hit myself.

There are solutions to this problem. In my system, the game always remembers which direction the player is facing. Whenever s/he moves in any other direction, if there is a hostile monster adjacent in the current facing direction, it gets a free turn, which it will almost invariably use to attack the player. This means that a higher speed still lets you run away or get extra attacks, but it thwarts the "attack once, retreat once" tactic, which I guess is what you have in mind.

An alternative system might be better for you, but I just thought I would share this, since it works well in my game.

As always,
Minotauros

773
Programming / Re: Things monsters would say!
« on: July 23, 2009, 11:27:05 AM »
Here is my list of random chitchat from humanoids (for variety, I always string two random lines together, resulting in stuff like: "Take only salt and water as food. I am looking to see where you throw up." (almost makes sense) and: "Where are the fish? Very well." (utter hogwash)) For taunting and hostile speech, I'd probably lift some lines from Shakespeare ("Draw blank, you rascal!") and Rabelais ("I'll make you skin the fox!"). Anyway, I've no list of hostile speech bubbles compiled yet, so I submit this one instead:

    "every day I want to get on my camel and ride!",
    "nothing is funnier than unhappiness.",
    "You're new here, aren't you?",
    "I am running for prime minister!",
    "(weeps with gratitude to God for not making me hideous as a toad.)",
    "I'd rather not!",
    "it is for the best ...",
    "I am going to sow salt.",
    "I have thought of the same thing, too.",
    "it is better that they speak ill of me on an empty stomach than on a full one.",
    "the wound has healed, but the pain of harsh words still remains.",
    "if I had one and got two more, I should have three.",
    "I must run through the village a couple times more.",
    "in the morning I take a drink of rum and afterwards four or five little drinks.",
    "so am I; let's have a drink.",
    "I appeal!",
    "you soon will see ...",
    "what is the life of man?",
    "pure butter!",
    "now the devil has him.",
    "did I say that?",
    "fat or lean, here he is!",
    "don't eat too greedily.",
    "cannibalism is out of vogue.",
    "pay your old debts.",
    "I can't hear you.",
    "he has performed no new miracles.",
    "I've performed some new miracles since last.",
    "clothes are being auctioned off in Hell.",
    "that is a lie.",
    "I have no time to lie today.",
    "the sea has burned up.",
    "and many fried fishes.",
    "boo!",
    "how fat you are!",
    "I ate the porridge, the bowl, and the ladle.",
    "good morning.",
    "why are you up so early?",
    "the fat cat.",
    "we three.",
    "for gold.",
    "that's right.",
    "ah, me.",
    "did you know?",
    "yes.",
    "no.",
    "very well.",
    "i went out to get a breath of air.",
    "shall we fall, or shall we not?",
    "don't you know the custom?",
    "sell my golden teeth and pay me a decent burial.",
    "I shall soon be a hundred years old.",
    "I have seen the forest grow up three times.",
    "ho, ho, ho! My Daddy's come!",
    "if a long beard indicates sanctity, the goat is a saint.",
    "just wait till I get fat.",
    "it is now too late to think of God.",
    "why do you glare so?",
    "I am looking to see where you throw up.",
    "whoever would tell the truth now, is likely to have his head smashed.",
    "what is the sense in that?",
    "I am just thinking, that on earth there are more crooked trees than straight ones ... more hills than plains ... more water than land ...",
    "I have no care.",
    "what is the difference between you and an ass?",
    "what is the difference between you and a cushion?",
    "thank you.",
    "maybe.",
    "never wager more than a groat.",
    "never greet anyone.",
    "always wear new shoes.",
    "have a black look.",
    "have a nice day.",
    "bite the ear.",
    "bite the hand that feeds you.",
    "if you have to go to a prostitute, go early in the morning.",
    "when you go to the market, eat your breakfast first.",
    "never plant a thorny tree.",
    "a mother should always check and never forgive.",
    "a father should never check and always forgive.",
    "take only salt and water as food.",
    "not too long and not too short.",
    "so don't draw your sword against the innocent.",
    "do not make a horse run down hill.",
    "don't be too greedy in making a trade.",
    "don't keep bad company.",
    "move stool before sitting on it.",
    "when in a strange place, look around you.",
    "he will even claim that I am wearing his coat.",
    "do not travel without money.",
    "don't require honor from a strange country.",
    "the wolves are coming!",
    "return my ass, I shall return your money.",
    "it is dog's dung.",
    "thank God they weren't peaches!",
    "I sold them as they run; and they're running.",
    "Get out of my tobacco!",
    "drink up the river, you shall then have fish.",
    "all the fishes are mine!",
    "come back tomorrow.",
    "those others did it!",
    "never mind the fly, guard against the cow.",
    "what a course bundle of flax.",
    "and they cut one ear off!",
    "and they gave him a box on the ear.",
    "consumatus es.",
    "that patch is mine.",
    "those are the dirty clothes I've been washing.",
    "soak me in the pond, so that I will be juicy.",
    "do your worst, only don't throw me over the fence.",
    "don't eat your nephews.",
    "have you seen such a one?",
    "get the stick.",
    "show me how.",
    "peace!",
    "I don't believe you have a gold coin.",
    "that is the first.",
    "who are you?",
    "I am a miserable hog.",
    "my father stole the priest's cow.",
    "I will do nothing of the kind.",
    "bear the ordeal in peace.",
    "hit them if they wander.",
    "had you denied it, I would have killed you.",
    "the dogs have not heard of the new law.",
    "shoot any thief who comes!",
    "I have poor eyesight.",
    "you take one and I'll manage the rest.",
    "dogs are chasing you.",
    "is the big cat still living?",
    "why not the whole forest?",
    "now you do the same thing.",
    "surely you jest.",
    "a country not examined in disguise will always be ruined.",
    "shall I throw this fellow down stairs?",
    "all of these are mine.",
    "poor crabs!",
    "alas, poor Jorick.",
    "do not trust the over-holy.",
    "fame is more enduring than life.",
    "my mother was a throughbred horse.",
    "my father was a miserable ass.",
    "may the devil take me.",
    "devil whet my scythe!",
    "if you wish to hang yourself, yonder tree seems fitting.",
    "may your bread turn to stones!",
    "may you always be eating!",
    "I have already waited for you here three days.",
    "do not act when angry.",
    "whoever eats this mushroom.",
    "that's the one I'll marry!",
    "what is this, a log?",
    "do not prolong a friendly visit.",
    "consider the end.",
    "a poor slobbering fellow.",
    "in a moment I should have confessed all.",
    "every step will remind you of your virtue.",
    "I won't need money then, but I could use some now.",
    "pay me back when you become arch bishop.",
    "you are mine, and I am yours.",
    "where are the fish?",
    "what fish?",
    "pound him well.",
    "I am a terrible sinner.",
    "I intend to go there myself as soon as I get well again.",
    "I'd take a camel over a horse any day.",
    "what is whiter than a swan?",
    "what is swifter than a bird, the wind or lightning?",
    "what is the sweetest song?",
    "what is best?",
    "what is softest?",
    "what is dearer than gold?",
    "monsters, eh?",
    "no need to worry about my hygiene.",
    "I bathed this morning, and used enough cologne for a horse.",
    "I should be running this place!",
    "is that so?",
    "you rascal!",
    "draw blank!",
    "I'll make you skin the fox!",
    "that's what you think.",
    "what, then, is life?",
    "I grant you that.",
    "a mother's kiss.",
    "what is the hardest thing to hold?",
    "a snake by the tail.",
    "a wolf by the eyebrows.",
    "what is the best fowl?",
    "a goose.",
    "what is the hardest to skin?",
    "the male member.",
    "who are the best painters?",
    "women!",
    "men!",
    "what is the best time to eat?",
    "a bald-headed daughter!",
    "a wood-pecker.",
    "also: a tin tear drop.",
    "that was the second.",
    "zounds!",
    "ring it, swing it!",
    "break the janglers, make fire flies!",
    "it will break its neck.",
    "now there's a nice surprise.",
    "I'd forgotten I even had one.",
    "the stupefaction of the penis ...",
    "but first: breakfast.",
    "what's for lunch?",
    "what is softest for wiping you arse?",
    "a mailed gauntlet.",
    "a barrister's wig.",
    "a downy goose.",
    "a woman's handkerchief.",
    "about five o'clock, when you start broiling things for dinner.",
    "is that what you heard?",
    "I have no time to lie today!",
    "I dreamt I found a treasure, and marked the spot with my excrements."

As always,
Minotauros

774
Programming / Re: Artificial intelligence
« on: July 14, 2009, 08:49:01 AM »
I think an important advice for implementing npc intelligence, is to try and keep things as simple as possible. It's easy to get caught up in very subtle implementations, that the player won't experience as enrichening. Ie. something like: "Orcs have a greed value of 75, as opposed to farmers' greed value of 25, making orcs exponentially more likely to pick up gold." If, on the other hand, farmers never go for gold, and orcs always do, it gives the player a much clearer illusion of personality and intelligence. I think this was epitomized by a debate on rgrd, about wand wielding monsters. Posters were discussing how to calculate cost/gain ratios etc., when Jeff Lait said that in POWDER, if a tool capable monster is carrying a wand, there's simply a fixed probability of it zapping the wand.

The best place to start is probably to have a more or less clear idea of what you want your npcs to be able to do, and try to tailor a system to meet your needs without becoming unnecessarily complex. Your idea of a point-driven system sounds like it may work. I think Incursion uses something like this, combining it with a "gravitational value", so that closer foes attract more than foes that are further away. This should probably help circumvent erratic monsters.

And, even though I'm sure you already read Bear's article series on AI, I think it's so enlightening that it cannot be linked to enough: http://roguebasin.roguelikedevelopment.org/index.php?title=Roguelike_Intelligence

For my own project, I'm currently using a statemachine, something like what Bear describes. Put briefly, a monster is always in a certain state of mind towards a certain target. Each state contains a set of switches. The basic offensive state is something like: if can_attack: attack ; else if can_approach: approach. Switches can even point to new states, so that a casual state (the one where orcs pick up gold and farmers cultivate a garden) can contain switches to enter a combat state if an enemy comes into sight. I find it slightly messy to use (no doubt owing to my implementation), but it does mean I can make monsters do mostly anything: lock a door, sound an alarm, pray at an altar, eat some carrion ...

As always,
Minotauros

775
Just adding som icing to the cake: A good place to start thinking about procedurally generated narratives, might be the good old structuralists, Vladimir Propp (wikipedia) being the most obvious theorist to use. A quick search even reveals a proppian fairy tale generator. Whaddya know. And of course, there's Tales Online (here and here).

As always,
Minotauros

776
Agreed that developers should do what works for them; that's how most innovations happen. It's easy to get trapped in the game engine, adding mandatory RL features, until your system is too complex to add the nifty features that would make your game unique. Although I think making plans in advance is a good idea, I say go with the flow. Personally, I couldn't care less which tool is used to make a game, as long as it's system agnostic.

What interests me more, is your thoughts on what a RL/IF hybrid might look like. While I think good writing is important to a game, stuff like elaborate room descriptions can easily become entertaining (or even mind blowing) the first few times, and then something you <more>-surf through, once you know the drill. ADOM suffers from this.

I think the most common pitfall in this admittedly very unexplored area, is to add fixed IF content to the procedurally generated RL dungeons. What I feel, instead, is that the roguelike genre is so great because of the randomness/replayability, and to really take advantage of IF-like features (such as a storyline, or puzzles), you should ideally tie it up with the principle of randomness, in a meaningful way. If, in every game, you have to visit the librarian to get the magic book you need to solve the sphinx' riddle, gameplay can easily deteriorate into "grind dungeon A, 'c'hat with librarian, grind dungeon B, 'c'hat with sphinx." On the other hand, a lot of storyline could be generated procedurally (with great difficulty, of that I assure you), using some narrative templates and narrative memes. One story template might for instance require a helper, a tool, an antagonist and a difficulty to overcome. The template itself would just be a story with holes in it. But pretty soon, you would want the memes used to fill these holes to conain even smaller holes that can be filled be even more randomly chosen content. Let's say the helper might (or might not) be unavaiable, for a numer of (randomly chosen) reasons -- he might be stuck in jail, and you need to get him out. Or some other problem preoccupies him (a quest to solve) As far as I've understood, Gearhead goes a bit in this direction. I've played it only a little, and it looks interesting, but I can't stand mechas! Legerdemain, while an excellent game with a great atmosphere, mostly plays fixed content.

This turned out to be quite a rant. The original post touches on one of my personal hobby horses, as it were. I'm sure you have entirely different ideas about all of this.

Must go to sleep now,
Minotauros

777
Traditional Roguelikes (Turn Based) / Re: Agduria
« on: April 28, 2009, 04:44:28 PM »
If you want something done right (or sometimes at all), you have to do it yourself. So, krice, you should probably just swallow you pride and create that page for Teemu. Or wait for it to magically become recognised as a major RL :-X On a related note, I would have tried out the game myself (it certainly sounds interesting), but being Windows-less, what should I do?

As always,
Minotauros

778
Programming / Re: (un)acceptable memory usage
« on: April 07, 2009, 10:04:16 AM »
Thanks for your answers. I was afraid the post was going to be a dud.

Writing the data to disk... that's very clever. Why didn't I think of that? :D

@Anvilfolk: That's sensible stuff, and in fact I did consider just what you are suggesting a while back, so each tile is loaded only once, when the game starts. And making the grid coordinates point to, instead of copying, floor & obstacle Beings is exactly what I did to get reduce memory consumption by 45 megabytes per level.

@Krice: I used the python console to measure how much memory an instance uses. Something like:

import beings # critters etc. defined in this module
l=[]
for i in range(0,1000):
   tmpbeing=beings.Being() # creates an "empty" class instance
   l.append(tmpbeing) # and watch memory consumption skyrocket

As always,
Minotauros

779
Programming / (un)acceptable memory usage
« on: April 06, 2009, 05:16:59 PM »
Here goes: Actually kind of a support question from a n00b :-[

I've been working on this roguelike, (badly) written in python+pygame. I have no formal training as a programmer, instead learning as I go along, and focusing on effect rather than good programming habits. At the outset, it seemed a good idea to make "everything" (monsters, items, walls, etc.) instances of the same class. This does indeed provide me with a very flexible system, but it turns out to have its down sides. At the moment, I am concerned with memory usage. Even an "empty" instance of this class, where all variables (a little more than 70) are set to False, takes up about 5.5 kB of memory. Obviously I don't understand how python handles memory, since I can't understand why. Does the functions defined in the class (more than a few) take up space, or something like that?

A few days ago, a single dungeon level would take up more than 50 megabytes of RAM. That boggles the mind. Even after some ugly tweaks, a level with monsters, treasure and various features requires something like 5 mB. This leaves me with a potential application that will eat up hundreds of megabytes for a reasonably long game.

So I hope I might benefit from the wisdom of more seasoned programmers. Is it to be expected that python objects take up this crazy amount of memory? Are there some generic, nifty tricks to reduce memory usage that I should know of? Or simply a doc describing the basics of how python allocates memory (articles I find on the web, seem mostly to focus on particular cases)?

Any hints (or just friendly ridicule) would be greatly appreciated.

As always,
Minotauros

780
Programming / Re: Worst bug you had?
« on: February 16, 2009, 08:24:01 PM »
Funny bug: I added water, and discovered that monsters who take drowning damage turn hostile against the water, trying to attack it, thus repeatedly splashing back in, eventually drowning themselves.

Another kludge added, another problem solved.

Minotaur

Pages: 1 ... 50 51 [52] 53 54