This forum is in permanent archive mode. Our new active community can be found here.

Geeknights Coding Club: Project D.O.R.F.

145791013

Comments

  • I've made a river. If the water reaches a part of the map and settles for a while, it deposits silt, and raises the height of the terrain. But this isn't updated on the display.
    The river probably shouldn't be a "mover". Water should probably be entirely its own system that is tied with the terrain. I think right now the thing is we have a terrain that is generated, but is static afterwards. What we need is a terrain that updates and changes over time.
  • The river idea is just a test thingy. My point is that if a mover, say a dorf, digs a hole, that should effect the terrain. And where they dump the earth should effect that terrain too. So far I've just been changing the height of the terrain, and everything is working, but the terrain itself isn't changing looks wise.
  • I made "Hide" and "Seek" movers. Hiders run from seekers, and seekers chase hiders. Scroll wheel up places a hider, scroll wheel down places a seeker.

    Am I doin it rite?
  • Wouldn't you be better off binding them to some keyboard key/combo? Scroll up and down are prime use keys.
  • edited May 2010
    Well I didn't know how to do that.

    But I am looking it up now. Oh yeah, now I remember why I didn't. How would one go about detecting a keypress+click, such as ctrl-click, for example?
    Post edited by Starfox on
  • edited May 2010
    Okay, so the way I figure it, the terrain surface should offer a method for updating a single square rather than needing to update the entire surface. To make things as clean as possible, we should move the terrain surface related functions out of the main game. Where should they go? A new class?
    Or do we add a method that changes the height of a grid square so that changing it will automatically update the relevant square of the terrain surface?
    Post edited by lackofcheese on
  • Ok, I modified it so CTRL switches between mover types, click to place, right-click to remove. The current type is displayed in the upper left, next to the coordinates and FPS.
  • I need some help here, and google didn't seem to help. I downloaded all the source from the site, and installed python-graph-core, but i get this error when i run python game.py:


    Traceback (most recent call last):
    File "game.py", line 7, in
    from grid import Grid
    File "/home/justin/dorf/d/grid.py", line 1, in
    from pygraph.classes.graph import graph
    ImportError: No module named graph


    Any suggestions?
  • How did you install pygraph?
  • I had a vision regarding the game, more later.
  • How did you install pygraph?
    easy_install python-graph-core
  • We need to make the game have a user interface that is manageable. I think the primary problem in Dwarf Fortress is that it's not entirely clear whether you control the dwarves, or if you don't. You sort of give them priorities, create jobs for them to do, assign them to militias, etc. The thing is, there is no consistency whatsoever. Some instructions they will always obey immediately, and they will never do it on their own without being ordered to. For other things, no matter how much you tell them to do it, they just won't make it a priority even if all the prerequisites for performing the task are set.

    The solution to this problem is to pick one or the other. Either you control the dwarves, or you don't. I think the obvious answer is that you don't. All the awesome stuff in the game is due to the emergent unexpected and unintended behavior of things the dwarves do on their own, not what you tell them to do.

    So if the dwarves do their own thing, what does the player do? I think the player's input should be limited entirely to just giving orders. There will be a queue of orders. We can code every type of order the player can give. The player will create (or un-create) the orders, and then prioritize them. That will be the entirety of the user input.

    The dwarves will then behave according to an AI, that will be very interesting and fun to code. I imagine the AI will follow something along the lines of Maslow's hierarchy of needs. A hungry dwarf with food nearby is going to eat before he engraves the bathroom floor tiles. A sleepy dwarf will find a place to rest before he goes and chops more wood. However, a dwarf who is contented and unoccupied will gladly craft some fine goblets.

    We can still maintain the fortress designing aspect of the game, as the artfulness of that is still a great part of what makes the game fun. When giving orders to dig, you will still be able to specify exactly where that digging should happen. When giving orders to cut trees, you can still specify which ones. When giving orders to build doors, you can still pick where they go.

    At the same time, a lot of the micro-management will be eliminated. For example, you will tell the dwarves you want a bed built, and placed in a particular location. You won't tell the dwarves to assign the room as a bedroom, or tell a dwarf to sleep in it. A tired dwarf will refuse orders, and claim it. A really tired dwarf might kick a sleeping dwarf out of their bed, or get in bed with them.

    Here is a pseudo-code algorithm in pseudo-BASIC

    10 Generate world.
    20 Process the natural systems, like water flow, animal behavior, weather, etc.
    30 If all dwarves have been processed GOTO 90
    40 If current dwarf has very strong needs or desires (food, sleep, sex, imminent threat) that it can fulfill, it will do so.
    50 If current dwarf is in a state (insanity, unconscious, ill) it will act appropriately.
    60 If current dwarf is sated and otherwise unoccupied, he will take the orders as very strong suggestions, and pick one based on priority of the order, and his personal taste/skills.
    70 If current dwarf who would otherwise follow an order has no orders available, he may perform a possible task as he desires (a skilled woodcrafter might like to make a wooden craft) or idle.
    80 GOTO 30
    90 Process each dwarf so that they take one step (often literally) towards achieving their current task.
    100 If there is at least one living dwarf GOTO 20
    110 game over

    This will be good because the only interactive interfaces we have to come up with are the basic game menus and a way for the player to manage their order queue. Everything else is just a matter of displaying information, watching the game, showing some graphs, etc.

    Also, this makes multi-player or co-op gaming really interesting, and manageable. A vs. game becomes a matter of my order queue vs your order queue. A co-op game is a democratic process of voting on the order queue.

    Thoughts?

  • easy_install python-graph-core
    Your PYTHON_PATH is messed up.
  • Also, here's another example.

    Right now in DF, military stuff is really complicated. All the way down to assigning specific pieces of equipment to specific dwarves. Instead, we will abstract it down to one order "fight off invading goblins," "guard this area," "kill that dragon". The order will have a strong influence on the dwarves. Some of the more courageous ones will choose to fight instead of fleeing for their lives, which comes naturally. Maybe all the dwarves will choose to fight, who knows? They will then equip themselves, as they desire, and as equipment is available. They might fight over equipment. They might even craft new equipment, if preparation time and resources allow for it. They will then fight on their own, and individuals may flee mid-battle, or who knows what. All you had to do was give the order to "kill" nice and simple.
  • I really like this whole direction. It means we can code desires and urges based on a 1 to 100 scale, and then leave it up to the algorithms. As danger approaches, the urge to flight or fight will stay constant, but only when the danger level reaches their level will they kick in.

    Also, it can be set up to order tasks. If a dorf is set to "nice place to sleep = 50" and "tired = 49" they'll go find a bed first. If, in the course of not finding a bed, tiredness increases to 51, they just find a corner.

    It would be good to be able to have a "fear of god" mode, where you can control a dorf to do exactly what you want, regardless of what they want. But this should come with really big consequences. For example, if you order one dorf, they might take that order as something religious, or proof there is god, and as soon as they finish the task, they leave to join a cult. Or maybe start a cult centered about the task you set, thinking that is the way to salvation, and everydorf who joins it becomes celibate, and gives up alcohol, and refuses to touch metal from then on.
  • Scott is 100% correct. Thinking back on my attempts at DF, the lack of clarity on this single issue accounts for almost all of the frustration I encountered.
  • edited May 2010
    I agree with Scott's vision as well. Luke's idea for numbered priorities makes very good sense, and would simplify things down to just having a priority queue for each dwarf with all the tasks that dwarf needs to do.
    Post edited by lackofcheese on
  • edited May 2010
    Love the idea! It's like how I always envisioned Dwarf Fortress worked (but rarely ever seemed to). Does Luke's suggestion have any clout though? Maybe make a few different ways for Dorfs to operate (like free will mode, fascist dictatorship, marshal law) where they're all different versions of Scotts initial pseudo-code. Once I read Scott's post, I had thought of dozens of gameplay mechanics based on this idea, but I'll keep my mouth shut so I don't veer this initial conversation off course.

    EDIT: Aww, eff that, I'll mention one idea: I was wondering what stats the player would be able to see. As in, would there be a cowardice meter or would the player just see "Coward" under the Dorf's description, or would it be completely unknown. Then I thought what if this information were based on who the expedition leader/some of noble was. For example, an empathetic leader may show a character's desires and needs in clear numbers (Hunger = 13, Happiness = 61, Health = 98), but that same leader may see much vaguer numbers in an area they aren't proficient at (So skills may just be BAD Engraver, GOOD Mason, BAD Cook). Eventually different nobles would contribute their own information (but only the leader would be able to read a dwarf's numbers exactly).
    Post edited by Schnevets on
  • edited May 2010
    I think we can handle "fascist dictatorship" and "martial law" easily just by using the numbered priorities. For example, "Fear of God" would just set priority=95, or some such.

    We could also generalise the way the tasks affect the dwarves - the higher the priority of a task for a dwarf, the higher the probability / larger the scale of the psychological impact on the dwarf.

    So, if a dwarf gets so hungry that the priority of eating reaches 90, there will almost certainly be a lasting impact on the dwarf.
    Post edited by lackofcheese on
  • I didn't propose a priority queue. That wouldn't work anyway. You need to compare different desires of the dorf. If making axes is at 40 for a dorf, and making swords is at 20, it doesn't just mean it will make axes first, it means it will spend twice as much energy or time on making axes than swords. The dorf could do it first, or spend more time on it but do a bad job, or save up a month's worth of sword making and do it all on one day. That kind of thing.

    When commanding the whole group you can select them all, and say "Everydorf listening? Here's an important job." You can set that job at 100 for every dorf, but then they would become mindless zombies, and never do anything else again. Or you could set it at 50. Each dorf may or may not have another desire above 50. Those that do will go do what they wanted anyway. Those that don't will follow your command. Working more will decrease their desire to work, but will increase their desire for food and sleep. Some will desire their own lives more than the good of the fortress, and not go out to fight the dragon. Others will desire fame and prestige, and going out to fight will be an easy way to obtain that desire.
  • Well, the priorities would obviously change over time, which could still mean that a dwarf with axemaking=40 and swordmaking=20 will indeed end up making both as the priorities change.

    As for the "The dorf could do it first, or spend more time on it but do a bad job, or save up a month's worth of sword making and do it all on one day.", that's complicated. If that's what you want, the best thing to do would probably be to introduce a priority-based probabilistic system to handle it.
  • The way I think you implement it is that when you get to each dwarf, you build a set of all possible actions, and then select one based on the dwarf's current stats and status.

    The set would contain all the queued orders, with greater weight given to those at the top. It would contain all of the default actions like eat, sleep, poop, based on hunger, fatigue, etc. It would have idle. Greater weight would be given to whatever task the dwarf is currently engaged in, for purposes of inertia. When you're all set, just sort and pick the first item.
  • edited May 2010
    That's basically what I was thinking as well, but I'd still like to see what Luke is proposing.
    Post edited by lackofcheese on
  • When you're all set, just sort and pick the first item.
    Maybe have all the possible jobs on sliders, and set each dorf to do so much of each job? Sort of like MOO?
  • Maybe have all the possible jobs on sliders, and set each dorf to do so much of each job? Sort of like MOO?
    Sim Ant it that way, but globally.
  • Your PYTHON_PATH is messed up.
    How do i configure PYTHON_PATH? Google doesn't seem to be much of a help lately.
  • How do i configure PYTHON_PATH? Google doesn't seem to be much of a help lately.
    What OS are you on?
  • How do i configure PYTHON_PATH? Google doesn't seem to be much of a help lately.
    What OS are you on?
    Ubuntu 10.4
  • Ubuntu 10.4
    IDK wtf you have done.
  • Ubuntu 10.4
    IDK wtf you have done.
    Im just gonna re-install it all, what all do i need to run game.py?
Sign In or Register to comment.