You can now walk around the map. Bizarrely, when hunting for this
thread I found one from me in 2000 where I had a previous incarnation
of this project at a point where you could walk around the map, but I
assure you that this one has a LOT more internally than that one
did. ;)
http://www.darkunknown.org/darkunknown/darkunknown.html lets you walk
around the main map. It doesn't work on IE, and since uploading that
I've fixed some line of sight bugs locally. Oh, and on FF on Linux for
some people the text doesn't show up properly, I'm still working on
sorting that out. But in the meantime, you can walk around with the
arrow keys or pass with the spacebar, those are the only hooked up
commands thus far. Currently working on making more maps and testing
light sources before I hook NPCs into the time flow.
- GF
--8<--
> http://www.darkunknown.org/darkunknown/darkunknown.html lets you walk
> around the main map. It doesn't work on IE, and since uploading that
> I've fixed some line of sight bugs locally. Oh, and on FF on Linux for
> some people the text doesn't show up properly, I'm still working on
> sorting that out.
Impressive!
Do you want help debugging the Linux problem? The problem I can see is
that the text in the topbar is cut in half. I suppose it might be a case
of having the line-height too large. Clicking the 'calculated' tab in
Firebug tells me that the font size is 20px, and the line-height is 31
px. Does that help any?
'Bon!
/Ibn
> Do you want help debugging the Linux problem? The problem I can see is
> that the text in the topbar is cut in half. I suppose it might be a case
> of having the line-height too large. Clicking the 'calculated' tab in
> Firebug tells me that the font size is 20px, and the line-height is 31
> px. Does that help any?
>
Thanks! I can't yet say if that will lead me down the right track, but
it gives me some ideas for what to look at. I appreciate the help!
Also, mmmm, 'bon.
- GF
I noticed you can step on the west wing of the large castle but not on
the east wing. Just FYI. Also the line of sight gives slightly
unrealistic results in woods near the sea coast some of the time IMHO.
Otherwise, looking very good.
--
Finire Dragon UDIC (Linards Ticmanis)
> I noticed you can step on the west wing of the large castle but not on
> the east wing. Just FYI. Also the line of sight gives slightly
> unrealistic results in woods near the sea coast some of the time IMHO.
> Otherwise, looking very good.
>
I've fixed both of those things in my local copy, I just didn't bother
uploading it to the server. :) The unrealistic results were because I
had originally written forests to have one LOS value if you were near
them, but be opaque if you were at least 5 steps away, and when you
were diagonal to one it sometimes hit a bug in a distance function and
used the wrong value.
There are still some unfixed poor LOS results if you are standing one
off from a line of walls, for instance- you would expect to be able to
see down the entire line, and right now you stop being able to see
them about 4 tiles down. I know what I am going to do about this, but
I haven't done it yet.
The castle thing was just a sloppy copy/paste in the definitions
file. :)
I appreciate the feedback, thanks. Bug reports are always welcome.
- GF
Line of sight in DU is an evolving thing. Originally I had a brilliant
idea, and implemented it, and when I actually walked around the map, I
saw that it sucked. It went like this: To determine if I can see a
tile, I draw a line from the center of my tile to the center of the
destination tile. I then calculate the length of the part of the line
that goes through each intervening tile. Then I multiply that length
times the BlockLOS value of whatever lives in that tile. Walls are
BlockLOS = 1, Forests were BlockLOS = .6. So I'm looking at a tile 3
north of me, then the line of sight's length in the tiles 1 and 2
north of me is 1, so I add together 1*BlockLOS for those tiles. If
they're both grass, I can see through them. If only one is a forest, I
can see through to the destination tile because LOS only gets blocked
once the total calculated BlockLOS is >=1. If both are forests, I can
see through the first one, but the second one blocks my vision.
I figured this way, if I clipped the corner of a wall, the length of
the line through that tile would be short enough that length*BlockLOS
would be below 1, and so I would be able to see through it. It sounded
like a nice theory until I tested it and determined that I could see a
whole lot of things that years of 80s game playing experience
suggested I shouldn't be able to see, and vice versa. Mostly vice
versa, actually.
So I modified my LOS functions, and now rather than drawing a line
from center to center, it draws a line from the relevant corners of
the PC's tile to the center of the destination tile. This gives
results much closer to what is expected, but still causes the problem
I mentioned in an earlier post where if you look down a line of walls
you eventually stop being able to see them- this is because I'm
checking to see if you can see the center of the wall tile, when
really what should be relevant is seeing the edge.
As such, it turns out my whole calculating partial LOS based on only
partially going through a square is mostly useless. I'm going to have
to do what's pretty much standard for this kind of thing, and check to
see if there is a corner of my square that can see the corner of the
target square. I haven't coded this yet, but I know what it's going to
end up looking like. Since I'll be checking from corner to corner, I
don't have to give very much leeway for cutting through only small
parts of tiles, so I'll keep the calculations going for total
BlocksLOS down each line but the threshold for not being able to see
will be reduced to .1 (that way it will prevent clipping the very
tiniest edge of a wall from blocking LOS).
So in summary, at the moment the online version is checking corner-to-
center, but in the end I'm going to calculate which corners are
relevant and just check corner-to-corner and you can see if there is
at least one path that doesn't get blocked by something that blocks
LOS. There are little exceptions and edge cases- like in Ultima V, a
door-with-window blocks LOS unless you are adjacent to it. I think I
am going to do the same with forests- you can see through the first
forest tile if you're adjacent to it, but at a distance it's just a
mass of trees. :)
- GF
Short answer to looong post: Wouldn't center to corner feel more
realistic? I believe that would take care of the disappearing wall
tiles, no?
'Bon!
/Ibn
I seem to need a boat. :-)
I don't know how people survived before the internet came along where
you could just get a map. I am SO lost.
Sorry, can't comment on the technical stuff cause I have no clue. I
just play and leave the hard part up to someone else.
--
Erimess Dragon
-==(UDIC)==-
d++e+NT++Om UK!1!2!3!A!L!
U+uCuFuG+++uLB+uA+ nC+nH+nP+nS++nT-xa8
Never compare yourself to the best others can do,
but rather to the best you can do.
It would take care of the disappearing wall tiles, yes. My gut feeling
is that I would end up with some other situation that is analogous,
where the results would be counter-intuitive, but I can't point to
what those results would be. So maybe I should try that before going
all the way to corner-to-corner. :) All I'd have to do to set it up is
have it swap which is the start tile and which is the destination
tile, so it would be an easy check. So sure, I'll try that first. :)
- GF
I set it up that way, and for a while I was walking around and it was
definitely better... and then I found a situation, like I suspected I
might, that badly violated expected results. It was worth a shot,
though! Next up, corner to corner and let's see how that goes.
- GF
> I set it up that way, and for a while I was walking around and it was
> definitely better... and then I found a situation, like I suspected I
> might, that badly violated expected results. It was worth a shot,
> though! Next up, corner to corner and let's see how that goes.
Oh, well. Worth a try I guess. :)
Anyone tried making an augmented reality fantasy game? I'm currently
playing around with Android and Google maps, and I thought it might be
fun to hide a fairytale in plain sight, somehow.
'Bon!
/Ibn
ok, so I wrote you an email and you start a thread here :)
Funny!
Glad to see progress - how much help do you need on this project`?