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

Pages: 1 ... 8 9 [10] 11 12 ... 23
136
Play With Your Buddies / Re: Rise of Nations: Diplomacy Hell
« on: December 31, 2014, 11:52:18 am »
PTW.

Also, can I suggest that we prefix all of our posts with our team?

For example, I'd prefix this with blue:

137
Forum Games and Roleplaying / Re: The Derail Games: Dawn of a new Era
« on: December 30, 2014, 01:52:24 pm »
Blue!

138
DF Suggestions / Re: Idea for Pathfinding
« on: December 17, 2014, 08:49:38 am »
A nice solution might be to maintain a "path network" which reaches every accessible tile (not all tiles are on the path network, the algorithm might be set to have nodes roughly every 16x16 tiles horizontally, but one on every opened z-level, nodes would be allowed to move to adjacent tiles every so often, but constrained such that they minimize the path length through them - perhaps weighted by the most common routes).

Then, to get from a->b you path just from the start to the nearest node, and from the end to the nearest node, and use the network of pre-calced stuff for the rest (basically a sped up process where you jump from node->node and use precalculated costs. This part can still be handled with A*, but you use it to traverse a weighted graph, not a grid). Opening or closing a door just means you connect or disconnect nodes. When you dig out tiles, it will see if there's any improvement in the network possible (a* through  the cleared tile, try and find shorter paths between nearby nodes), or if a new node can be spawned.

Thank you, I've never been good at explaining things clearly.

[...]
No it doesn't require that, you use an oct-tree or similar, you only have to generate the nodes of the cleared out part. Traversing the octtree is only done when you need to compute a path.

Quad-tree per level would be better, as oct-tree would be pretty much subdivided to 1x1x1 due to the nature of floors, walls, and open space.

139
DF Suggestions / Re: Idea for Pathfinding
« on: December 16, 2014, 08:34:35 am »
Why not go full inception and have macro-macro-nodes, then macro-macro-macro-nodes, until at some point you have all map in one (or more depending on the connectivity) node?

It would have a negative benefit of making units more likely to go through certain spaces, but it would potentially speed up pathfinding calculations immensely.

That would use quite a bit of RAM,
And have fun recalculating the entire map every time a tile is dug out.

If we just have a single layer, you'd only need to update an avg of three node travel lengths each time.

Also, nodes could take into account swimming and climbing costs.

140
DF Suggestions / Re: Idea for Pathfinding
« on: December 14, 2014, 09:33:42 pm »
This has some gameplay issues. Like, do the nodes also control pathing of enemies? If so, you could really majorly cheat by forcing them to take ridiculous paths to approach your fort, to give yourself time or guarantee they pass into narrowly trapped areas. If not, then it wouldn't really address a bunch of the lag... (and would require maintaining two pathing algorithms)

The basic idea is really just an addition: we'll use the traditional pathfinding to do it between nodes.
Enemies/caravans/animals could default to traditional pathfinding, or the computer can have a separate list of nodes (if we can get a good algorithm for placing them).

141
DF Community Games & Stories / Re: The Hall of Legends
« on: December 12, 2014, 07:38:07 pm »
+1 for dumplin
+1 for TLCM when it comes on
+1 Vanod

142
DF Suggestions / Re: Idea for Pathfinding
« on: December 12, 2014, 11:16:15 am »
AI could be part of it, but pathing is still pretty bad, especially with the new trees.

About the rewrite, as I see it, he probably just needs to add the node structure and node pathing. Dijkstra's just uses a constant H of 0, which shouldn't be too bad an addition.

143
DF Suggestions / Idea for Pathfinding
« on: December 12, 2014, 10:54:26 am »
I've been reading a few threads and bug reports lately, and I've seen how many people complained about the FPS in the new version.
Lots of people have also said that the most likely culprit is pathfinding.

So, I studied a bit about it, and read this, and as a CS student, I've come up with an idea.



First, though, about the way the paths are calculated:
It uses the A* algorithm and the Manhattan heuristic.
It also uses a connectivity chart so that pathfinding doesn't use too many resources on dead ends.



The problems presented there?
Manhattan isn't the best heuristic: X+Y+Z isn't very efficient when units can move in diagonal directions.
   (this can be easily changed to Z + max(X, Y) * 1.4 + min(X, Y))
Connectivity charts take lots of resources to update, and when there's lots of changes (bridge raising/lowering, door locking/unlocking, water) it has to update more often. It also doesn't really speed up pathfinding: it only cancels paths which are absolutely not possible.



My proposed solution:
A* is an algorithm where one assigns a value to every node that is added to the list of possible nodes a unit will travel.
At the current time, if a dwarf wants to path the other side of the map, he/she has to path the entire map.


In DF, every tile is a potential node.
What if, instead, we had another structure, a macro node? One that is placed in places like doorways or intersections, or on a large plain, in intervals of 8/10/16 tiles?
Of course, finding a way to place these will be a pain, but what if we left it to the user to define? If anything, we can define nodes for the outside, and so that would be a much faster whenever one has to path outside.
Nodes will have a connectivity chart with its closest distance to another node, pre-calculated. While calculating, you could toggle a flag so that pathfinding goes back to standard A* without the nodes.
Macro nodes will only need an X, Y, and Z co-ordinate, and any node room they're connected to.

Another structure, a 'node room', sort of, will contain a list of nodes. Simply put, it will make a boundary using its list so that it is easier to calculate starting/ending nodes.

However, when it's finished calculating the connectivity chart, the speed will be much faster.



This way, the computer does these steps:
- Dijkstra's algorithm for the start path; it uses the node room list to find which one it's in.
- Dijkstra's algorithm for the end path,
- The start path chooses a random node from its room,
- Calculate the macro-nodes, which is pretty fast (use Manhattan heuristic with the X, Y, and Z of the nodes),
- Use the room node closest to the end of the path as its start,
- Path to the first node,
- On each step onto the node, or in its vicinity, path to the next node.
- On the last node, path to the destination.

This way, pathing should require less resources and time, as the path will be much more direct.

Spoiler: Example (Final) (click to show/hide)

In the examples listed above, the old way would take ~130 to ~150 calculations, and the new way would take  ~70, and the highest amount of memory needed at once is 150 nodes' worth compared to 15. This might not be much of a difference, but it's a very small proof-of-concept example that would be expanded upon exponentially when on an actual DF map, so it would probably increase FPS rate dramatically.

tl;dr: nodes and stuff

Thoughts?

144
Life Advice / Re: Moving to Canada?
« on: August 24, 2014, 08:44:09 pm »
I'm Canadian and I'd like to say a few things.

First, immigration is pretty hard. The government is limiting it to a few thousand a year, so you pretty much have to send in your application on New Year's to consider having much of a chance.

Second, it's incredibly hard to get a job without references. Most jobs, for outsiders, would be lowest-level jobs as all the higher-level jobs are taken by people already inside the company. Healthcare may be free, but only if you live there permanently and have a Health Card. (In Ontario, it's the OHIP, Ontario Health Insurance Plan) Even if healthcare is free, you'll need money for food unless you're willing to go to a food bank to get food, and also to pay for rent/property taxes/any other bills.

Basically, if you don't have any references or friends in Canada at all, then it would be incredibly challenging.

145
DF Adventure Mode Discussion / Re: Best DF2014 conversations
« on: July 16, 2014, 08:53:22 pm »
So I tamed a demon. You'll never believe what he said to me.
Spoiler (click to show/hide)
I think he took it pretty well.
It was inevitable.
It is terrific.
It is for the best
MAAAGGGMMAAAAAAAA
Not three hours ago InsanityIncarnate died of the heat.

146
What's savescumming?  ???
...
It's when one loads an earlier save if, for example, a siege comes up and kills everyone, so they can continue playing.

147
You are not supposed to save-scum, so why should Toady make it easier for you?

Neither is game supposed to unexpectedly crash on you, thus making you lose an hour's worth of work and thereby forcing you to savescum if you want to continue to play the same fortress.

148
DF Dwarf Mode Discussion / Re: What's going on in your fort?
« on: July 07, 2014, 10:00:30 am »
(If I ever find out how to make a ceiling)
Ramp up the outside side of a wall, then floors everywhere.
Or constructed up-steps anywhere inside the room, with down-steps directly above. Of course, flyers can then get in, but enemies cannot get on.

I use ramps so I can deconstruct them without stranding someone on the roof.

149
DF Dwarf Mode Discussion / Re: What's going on in your fort?
« on: July 07, 2014, 08:28:17 am »
(If I ever find out how to make a ceiling)

Ramp up the outside side of a wall, then floors everywhere.

150
Isn't the door nailed in place? There's nothing to worry about yet. Still, get to the side of the door. Chances are, whoever opens it will think you went out the open window somehow and rush over to it, providing an opportunity to slip out, attack, or push them out of the window.

You rush over to the side of the door.

"Argh, crap! Ow! That hurt!
"Maybe I should just stay away from the door, don't let her get suspicious..."


... Maybe he's just an idiot.

What do you do? Do you wait? You remember that you have about thirty minutes.

Pages: 1 ... 8 9 [10] 11 12 ... 23