Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

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 - Teiwaz

Pages: 1 2 [3] 4 5
31
I don't understand the new military screen at all. There are lists of dwarves where I can change them between white and green. What does that mean? Anyone understand the "positions" screen?

I hate to say this, but the new military screen is a new standard for confusing UIs in a game of confusing UIs.

32
DF General Discussion / Re: Anouncing The PathFinder Project
« on: March 25, 2010, 10:35:08 am »
Yes to both questions.

I'm on my way out the door right now, but compare the process in C++ (and I don't just mean "call function X" - I mean setting up the IDE and compiler, resolving cryptic link errors, including the header file, etc. And do you really think inflicting the Windows API on someone is a good idea? I mean anyone, never mind someone who is there to learn how to program.) to a more accessible platform like XNA. Inflicting the former on a beginning programmer just encourages frustration and abandonment of a project. People learning to code shouldn't go anywhere near C++ until, well, they've learned to code and are ready to focus on the technical issues of C++ specifically.

33
DF General Discussion / Re: Anouncing The PathFinder Project
« on: March 22, 2010, 06:47:27 pm »
thanks Teiwaz!
next question should I learn some C and C++? it seems that many of the examples and stuff that I can find for roguelikes is in them and as I have learned from this thread DF is in C++.

Don't bother with C, C++ will teach you everything C can do, and more. C can be a good stepping stone for C++, but C# will do just as well for that and will get you into an object-oriented way of thinking.

C++ is really, really powerful, but can be simply brutal. Absolutely learn it if your plans are to go into the industry as a programmer, but put it aside for now - C# will teach you most of what you need to learn about programming, and should last you a good long while. Go to C++ when you want to learn C++ - it can be a nightmare, especially if you're trying to get a working project out of it. Just getting something to compile can be a colossal pain in the butt, doubly so if you're trying to integrate other peoples' code to do the stuff you don't want to worry about (and I'm talking really low level stuff here, like polling the state of the keyboard or figuring out where the mouse is, or playing a sound that isn't a default windows beep, or loading an image into memory and displaying it on the screen).

There's a whole lot more to being a good programmer than knowing language X or Y. It's more about being able to figure out how to do things, being able to write easy-to-read, well commented, functional, efficient code, being able to squash bugs quickly and without causing new ones, and being able to familiarize yourself with a new codebase quickly, whatever the language. If you can do that, knowing the syntax and foibles of a particular language is secondary.

34
DF General Discussion / Re: Anouncing The PathFinder Project
« on: March 22, 2010, 03:05:31 pm »
Most of my programming experience is with vb.net and c# so all the talk about A* is over my head by a bit. Also as a question I am currently learning programming in collage and in my free time, what language should I learn if I want to make games more specifically roguelike games?

Language doesn't really matter all that much - A* is just an algorithm, and can be done in any language. (It, and variants, tend to be the most commonly used pathfinding algorithms as it's pretty much the best thing we have). I'd look into XNA (www.xna.com) - it's what "Xbox Live Arcade" games are built with, and it uses C#, so your experience with that language isn't wasted. (It can also be used to make windows games, windows phone games, etc.)

It's an excellent platform to develop on as a hobbyist, as it does a lot of the painful, low-level stuff for you so you can get on to the more interesting parts of the game. (Things like input, and it has an excellent content pipeline to get sprites, or even 3d models into the game easily, etc.)

35
DF General Discussion / Re: Anouncing The PathFinder Project
« on: March 18, 2010, 11:07:08 am »
Movement flags could easily be a bitset, if the unit pathing has the appropriate flags it can use that link if not it can't. Ideally we can link directly to the map anyway. You have to specify some form of system to allow pathing under different conditions. Either that or have a whole node map for each set of movement types, which I imagine would be more space.

Why would you bother? Just get the information from the adjacent tile. You only need connectivity data for a simplified node network (pathing zones, TCZs, reference points) and there would be several orders of magnitude fewer nodes on the path network than there are tiles in the game, so memory wouldn't be an issue.

36
DF General Discussion / Re: DF sprite art
« on: March 17, 2010, 08:14:53 pm »
Actually, I think you can already buy coloured blocks with letters on them at any childrens' toy store.

37
DF General Discussion / Re: Anouncing The PathFinder Project
« on: March 16, 2010, 06:01:22 pm »
I don't think it's very realistic to expect players to set up pathfinding routes for their dwarves. The forum would just get flooded with people asking why their swarves aren't doing any jobs. This should be done proceedurally by the game. Storing the zones efficiently might be a problem, but generating them and figuring out when to update them would be trivial. (Dwarf fortress already does a simplified version of this with its connectivity map)

38
DF General Discussion / Re: Anouncing The PathFinder Project
« on: March 16, 2010, 12:52:09 pm »
No it doesn't, no it's not. If you where getting these problems then either your implementation was broken or the heuristic you picked was flawed. A* is designed to solve exactly this problem, it's what it is good at, it's the one reason you use it.

Yes, the heuristic was flawed for that particular path network, but it worked fine for 95% of the levels in the game. (It was the default implementation used by Unreal 3, I believe. I suspect the heuristic was based on straight-line distance between the node and the destination, just like 90% of A* implementations out there.) That's the problem with game environments - they aren't very predictable. And once you let players start screwing with the environment, (DF lets you do this a little :P) things get worse.

Imagine the case of a dwarf standing on the floor immediately below the barrel of tasty Dwarven Wine he wants to get to. Somewhere on the level is a staircase leading up to the next floor. How do you avoid flood-filling the entire floor the dwarf is on until you find the staircase without doing some prior-to-runtime analysis of the map?

39
DF General Discussion / Re: Anouncing The PathFinder Project
« on: March 16, 2010, 12:30:12 pm »
The flaw with pathing only from zone to zone is that some arbitrary goal needs to be put in each zone which results in a "choppy" path in which the agent unnecessarily moves to that goal point.  My plan is to use a zone tree to both confirm connectivity and to progressively whittle-down a to a series of connected zones which will form a 'corridor' through witch an A* search will be confined.  That prevents most wasted node expansions but still gives the optimum path.

Pathing to the arbitrary zone reference point is unnecessary. All you have to do is path into the zone. Depending on performance, you either path to the reference point, but stop as soon as you enter the zone and generate a path to the next one or you  generate a path to a "best guess" point which is nearest to you inside the target zone (and then generate a new path as soon as you enter the zone for whatever reason, in case your guess was wrong.) Obviously, which approach is more efficient depends on zone size.

You may not get a perfectly optimal path in all conditions (I expect most of the problems would exist outside) but in the normal environment of Dwarf Fortress - a series of rooms and corridors usually connected by only 1 or 2 tiles, which would generally be the boundary of a zone as they often have doors - there's not very much variation between a perfectly optimal path and one that works. (In fact, I'd bet there wouldn't be a difference at all in most cases.) In any case, we're dealing with a game with performance issues. Generating a path quickly and efficiently is *far* more important than generating the perfectly optimal path that saves a dwarf a tile or two of travel time.

While restricting the network over which you need to path will help, generating a complete path still means you're generating a LONG path, and also one that is likely to be discarded (the case of targeting something that is itself moving, like siegers going after a dwarf and having to regenerate their path every frame, for instance), and is therefore wasteful. Pathing between zones means that you only have to re-generate the path if the moving target is in the same or an adjacent zone as you, which means it's a short path by definition and therefore cheap. (If they're in a different zone, your path doesn't change. Even if the target moves to a new zone, you only have to regenerate the "high level" zone path, and even then, you just need to generate it from the second-last zone in your path, with a maximum path length of 2. Cheap!)

40
DF General Discussion / Re: Anouncing The PathFinder Project
« on: March 15, 2010, 07:45:59 pm »
The main reason I want to prove that it is pathfinding is that I work with A* on a game with node spaces orders of magnitude larger than in DF and we don't have anything like this slowdown, we don't do quite so many calls but the time per call shows we could easily with a hundred or so units 50 times a second.

I worked on a game which uses a variant of A*, with substantially fewer units (< 10) pathing over a much smaller network (< 2K nodes) than DF, and found pathfinding to be a huge expense when dealing with situations that basic A* doesn't handle very well. (Multi-story buildings, u-bends, etc. Anything which causes the heuristic to break down by forcing you to move substantially way from your objective to get there causes havoc with A*, as it quickly ends up flood-filling the network. DF is rife with these situations.)

41
DF General Discussion / Re: Anouncing The PathFinder Project
« on: March 14, 2010, 01:02:03 am »
I couldn't find the current algorithm (is there one? Conversation seems to go in circles a lot) but anyway, an observation:

I think generating a complete path to your destination is a waste. You're too likely to have the path invalidated (by map changes, something getting in the way, Dwarf deciding he's thirsty and dropping his current task, etc.)

Generate zones (areas of limited size which are contiguous for the most limited movement type possible in them - i.e. a normal floor area would be part of a zone where the entire area is contiguous for a creature which can walk but not open doors, an area of water for one which can swim but not open doors, a tile with a door on it for creatures which can walk and open doors, etc) with connectivity links (not specific paths, just info that they zones are connected) to adjacent zones. Generate an initial path on this (comparatively very simple) zone network, and then just generate a path to reach the next adjacent zone as you need it.

You'll end up generating a lot more paths, but the cost will be diffused over time, (this doesn't seem so important in DF as in games that demand a smooth framerate - but caravans and sieges arriving can still cause huge, nasty hitches from the cost of the initial long pathfind for a bunch of new creatures entering the map all at once) and with relatively small zones the individual paths should be fairly trivial to solve. Additionally, as you know you are only pathing as far as the next adjacent zone, you can limit pathfinding to within your current zone - so in the worst case, of a failed pathfind, you'll only floodfill your current zone. (Though this should never happen if your connectivity info is good.) Shorter pathfinds also reduce the number of paths which are invalidated and have to be regenerated when the map changes (a map change would only affect creatures currently pathfinding in the same zone, and would only affect creatures pathfinding through the zone but not currently in it if the connectivity changes).

Also, I'd put aside multi-tile creatures for now. They're an edge-case, and even when they're there, there will generally be very few of them. It's not worth optimizing for this at the cost of a better algorithm for single-tile creatures. Not to mention the current lack of multi-tile creatures...

42
My theory is what's happening is the Dwarf isn't actually trying to drink form the well, he's trying to drink from the drinking zone next to the well. As the water level's too low to drink from the zone, he fails.

Try deleting the zone and defining a room from the well itself rather than from a zone designation.

43
DF General Discussion / Re: Get well soon cards for toady
« on: January 05, 2010, 09:22:44 pm »
You guys have too much sympathy.

Toady contracted a communicable disease.
This implies he had contact with another human being.
Which implies he went outside.
That implies he wasn't working on the next release of Dwarf Fortress. For shame!

Let's just hope he learned his lesson about the terrible things that happen when you aren't working on the next DF version.

44
DF Dwarf Mode Discussion / Re: "Dealing" with Children.
« on: December 19, 2009, 09:14:26 pm »
I hate to point out the simple and obvious while you are figuring out your elaborate schemes, but you do know there is a BABY_CHILD_CAP init setting to restrict children, right?

D'oh! Yes, I did know about it, but it completely slipped my mind all the times I went intot he ini to se tthe genreal population cap. Thanks!

45
DF Dwarf Mode Discussion / Re: "Dealing" with Children.
« on: December 19, 2009, 08:49:24 pm »
One of my Champion Hammerdwarves just gave birth WHILE fighting off a siege.

Pages: 1 2 [3] 4 5