code logs -> 2009 -> Fri, 13 Mar 2009< code.20090312.log - code.20090314.log >
--- Log opened Fri Mar 13 00:00:16 2009
00:03
<@Derakon>
Awww...I can't do `rm -r .`
00:03
<@Derakon>
Anyway, algorithm ramble time.
00:04
<@Derakon>
I wish to find blocks that can be stood upon.
00:04
<@Derakon>
The space directly under the start of the map can be stood upon.
00:04
<@ToxicFrog>
...you can't?
00:04
<@Derakon>
The player is 3 blocks tall, can jump vertically 3 blocks, and can jump horizontally 6 blocks.
00:04
<@Derakon>
"rm: "." and ".." may not be removed"
00:05
<@ToxicFrog>
Aaw, you can't.
00:05
<@Derakon>
So.
00:05
<@Derakon>
Enqueue starting accessible block.
00:05
<@Derakon>
While queue is not empty
00:05
<@Derakon>
block = pop queue
00:05
<@Derakon>
Go out horizontally 1 space from block.
00:06
<@Derakon>
Look up for physical blocks.
00:06
<@Derakon>
If there is a block with 3 open spaces above it, that is no more than 3 blocks above the popped block, enqueue that block and mark it as accessible.
00:06
<@Derakon>
Look down for physical blocks.
00:06
<@Derakon>
If there is a block, and it has at least three spaces open above it, enqueue it and mark it as accessible.
00:07
<@Derakon>
Go out horizontally 2 spaces from the popped block.
00:07
<@Derakon>
Repeat.
00:07
<@Derakon>
Go out horizontally 3 spaces from the popped block. Repeat.
00:08
<@Derakon>
Go out horizontally 4 spaces. Now our jump height is 2, and we cannot have found an accessible block in the previous step for blocks in this step to be accessible.
00:08
<@Derakon>
Otherwise the same.
00:08
<@Derakon>
Go out horizontally 5 spaces. Jump height is now 1, and cannot have found accessible blocks in either of the previous two steps.
00:09
<@Derakon>
Finally, for the 6th step, our jump height is zero, and anything in the way is invalidated.
00:09
<@Derakon>
Hmm...we also need a ceiling of at least 6 blocks for the long jumps, don't we?
00:09
<@Derakon>
s/is invalidated/invalidates the block/
00:10
<@Derakon>
Enqueue all accessible blocks that aren't already marked as accessible, and loop until the queue is empty.
00:10
<@Derakon>
Does this sound plausible/comprehensible?
00:15 * Derakon finds a flaw with that approach while sketching it out, sighs.
00:16
<@Derakon>
Namely: http://derakon.dyndns.org/~chriswei/games/jbrl/accessibility/1.png
00:17
<@Derakon>
Okay, so if you're below the marked space, you need at least three open spaces above the starting space so you can jump off.
00:30
<@Reiver>
Derakon: Can you control direction whilst airborne?
00:30
<@Derakon>
Yes.
00:31
<@Reiver>
So you can leap vertically up a steep slope then, without need for a runup. OK.
00:31
<@Derakon>
Honestly, a lack of air control is very frustrating in platformers.
00:34
<@Reiver>
Aye.
00:34
<@Reiver>
It's a convention of the genre, and a downright /useful/ one, given it improves the margin of error.
00:35
<@Derakon>
And also lets you do things you couldn't do in normal life, which is a big part of gaming~
00:35
<@Reiver>
Jumping higher than your head counts as that for a start~
00:35
<@Reiver>
(And ones with 'realistic' jumping heights just feel /odd/, to boot.)
00:35
<@Derakon>
Aye.
00:37 * Derakon tries to remember flight time for a parabolic path.
00:37
<@Derakon>
Ehhh, worry about that later.
00:53
<@Derakon>
Incoming conditional.
00:53
<@Derakon>
if (canJumpSideways and riseBlock is not None and
00:53
<@Derakon>
doubleRiseBlock is not None and
00:53
<@Derakon>
riseBlock[1] - doubleRiseBlock[1] >= constants.playerHeight and
00:53
<@Derakon>
startBlock[1] - riseBlock[1] <= jumpHeight and
00:53
<@Derakon>
not self.accessibilityMap[riseBlock[0]][riseBlock[1]]):
01:00 Vornicus [~vorn@Admin.Nightstar.Net] has joined #code
01:00 mode/#code [+o Vornicus] by ChanServ
01:10
<@Derakon>
Hmm...I can see that debugging this is going to be painful.
01:11
<@Vornicus>
This being?
01:11
<@Derakon>
Determining map accessibility.
01:14
<@Vornicus>
That sounds like hell, yes
01:15
<@Derakon>
Gotta have it to have a game worth playing, though.
01:16
<@Derakon>
Spelunky dodges this issue by letting you blow up the map. I can't do that.
01:16
<@Vornicus>
Quite
01:16
<@Vornicus>
Spelunky also actually /fails/
01:16
<@Derakon>
Yeah, the bombs are, at least in part, meant to let you deal with map failure.
01:16
<@Vornicus>
It's supposed to be true that you can get from the entrance to the exit without any bomb/rope use; it is not always the case though.
01:17
<@Derakon>
I've seen myriad cases where there was no safe drop downwards and a rope was required. I've also seen McM post a screenshot of a starting area entirely enclosed in rock (and he without any bombs, too).
01:29
<@Derakon>
Well, this is progress... http://derakon.dyndns.org/~chriswei/games/jbrl/accessibility/test1.png
01:29
<@Derakon>
There's only four impossible blocks marked accessible there~
01:30
<@Derakon>
The problem with testing this, really, is making the maps. :\
01:56
<@Derakon>
...heh. Silly idea I will not implement: after you finish the map, it flips itself upside-down and you get to play through it again with a different monster set and no powerups.
02:04
<@Derakon>
Getting better: http://derakon.dyndns.org/~chriswei/games/jbrl/accessibility/test2.png
02:17 * McMartin eyes the Haskell Compiler
02:17
<@McMartin>
... that is totally not 50KB of additional code.
02:20
<@Derakon>
Less, I'd hope?
02:21
<@McMartin>
Well, I'm doing the excercises in YAHT.
02:21
<@McMartin>
One of them is 30 lines longer.
02:21
<@McMartin>
This translates to a binary 50KB larger.
02:22
<@McMartin>
Though it's also, apparently, statically linking libghc.
02:23
<@McMartin>
... And then there's one that 15 lines shorter and 200kB larger.
02:25
<@McMartin>
I think I'll be throwing these at MCV later and seeing what he makes of them.
02:26
<@McMartin>
Especially since the +200KB one is using a strict subset of the functions in the smaller one.
02:26
<@McMartin>
I think.
02:27
<@McMartin>
Hm, no, it uses read and show, which might be huge.
02:28 * MyCatVerbs blinks.
02:29
<@MyCatVerbs>
The automatically-derived read and show instances are kind of large.
02:29
<@McMartin>
That must be it.
02:29
<@McMartin>
I can pastie them if you want to check them out.
02:29 * MyCatVerbs hasn't read the backscroll. Examining context...
02:30
<@MyCatVerbs>
Oh yeah. GHC is really, really bad at output executable size, as it turns out.
02:31
<@MyCatVerbs>
Derived instances tend to be huge too for some reason. If you have deriving (Show, Read) on any type, then you'll get enormous code blowup.
02:31
<@McMartin>
This appears to include Num >_<
02:31
<@MyCatVerbs>
Er, that's not it.
02:31
<@Derakon>
This test case is breaking me. ;.; http://derakon.dyndns.org/~chriswei/games/jbrl/accessibility/test3.png
02:31
<@MyCatVerbs>
Hrmn. Do you have "cabal"?
02:31
<@McMartin>
NHOI
02:32
<@MyCatVerbs>
Please expand that acronym?
02:32
<@McMartin>
Never Heard Of It
02:33
<@McMartin>
Also, what's "not it"?
02:33
<@MyCatVerbs>
Throw the command into a terminal and see whether you get 127?
02:33
<@Vornicus>
Der: what is your accessibility rubric.
02:33
<@MyCatVerbs>
"Not it"?
02:33
<@McMartin>
19:31 <@MyCatVerbs> Er, that's not it.
02:33
<@McMartin>
mcmartin@spiff:~/devel/haskell$ cabal
02:33
<@McMartin>
bash: cabal: command not found
02:34
<@MyCatVerbs>
Ah. I take it you have an older version of GHC?
02:34
<@McMartin>
6.8.2
02:34
<@MyCatVerbs>
I think it might've only been 6.10 that included Cabal install by default.
02:34
<@McMartin>
But installed ona Debian machine, so I needed to install like eight packages.
02:35
<@McMartin>
It's entirely possible I missed a few.
02:35
<@McMartin>
I needed to add four extra ones to have access to Control.Monad.State
02:35
<@Derakon>
Vorn: it's complicated.
02:35
<@McMartin>
Anyway, heading home
02:35
<@McMartin>
back later
02:35
<@MyCatVerbs>
McMartin: I'll give it a look. Travel safely.
02:36
<@McMartin>
Thanks
02:36
<@Vornicus>
Der: well, give me the gist.
02:36
<@MyCatVerbs>
Oh, also, are you compiling with or without -O2, please?
02:37
<@Derakon>
Okay, so I have an accessible block A.
02:37
<@Derakon>
It's just given that it's accessible.
02:37
<@Vornicus>
How tall is the character, how high can he jump, does he have Power Grip or Morph Ball?
02:37
<@MyCatVerbs>
Because you can potentially get astoundingly crap results with optimization turned off.
02:37
<@Derakon>
3, 3, no, no.
02:37
<@Vornicus>
Okay, can he slide like Mario or Mega Man (two distinct slide mechanics)? How far can he jump?
02:38
<@Derakon>
No, no, 6 in a 45° parabola.
02:38
<@Vornicus>
Okay.
02:39
<@Derakon>
I look 1 block left of A, then up until I see a square that isn't empty space. If it is less than 3 blocks above A, then I can jump to it. Mark it as accessible. If not, I look 2 blocks left of A, then up...if not, then 3 blocks left of A...if not, then 4 blocks left of A, and my jump height is now 2...if not, then 5 blocks left of A, my jump height is now 1...if not, then 6 blocks left of A and my jump height is 0.
02:39
<@Derakon>
Additionally, it's possible to drop down to blocks below you.
02:39
<@Vornicus>
Okay.
02:39
<@Derakon>
But all of these are only if there's enough headroom.
02:40
<@Derakon>
I only look 1 space over for dropdowns, BTW.
02:40
<@Vornicus>
Right.
02:40
<@Derakon>
Which means that I may think a block inaccessible when it's accessible if you jump from high up.
02:40
<@Derakon>
I don't have a good solution for that yet.
02:41
<@Derakon>
But that can come later.
02:41
<@Derakon>
My problem here (with test3.png) is that the "get the first block above A" test is getting a block that has zero headroom because it's in the middle of a column.
02:41
<@Derakon>
And I haven't yet figured out how to tweak my "get block above/below this point" function to do what I want, since sometimes it's looking for ceilings and sometimes for floors.
02:42
<@Derakon>
...maybe if I told it what type it was looking for... >.>
02:42
<@Vornicus>
heh
02:45 * Vornicus fiddles.
02:45
<@Vornicus>
Okay, let me see here.
02:48
<@Vornicus>
Well. Jump height 3 and jump stride 6 means you're not actually jumping at 45 degrees.
02:50
<@Derakon>
These are all configurable and I inaccurate.
02:50
<@Derakon>
There'll be enough fudge in the numbers for an imprecise reckoning of accessibility to still pass muster.
02:50
<@Vornicus>
More like 70; 2 up for 1 across. Which is /probably/ terminal velocity, too.
02:56
<@Vornicus>
So, that gives I think enough information for me to try my hand
02:56
<@Vornicus>
Language?
02:56
<@Derakon>
...I almost wrote Perl, but no, it's Python.
02:57
<@Derakon>
Here's the test map I'm using: http://paste.ubuntu.com/130431/
02:57
<@Derakon>
Rotated sideways in this view.
02:58
<@Vornicus>
Thank ye.
03:00
<@MyCatVerbs>
McMartin: I think you're right and it's just that Plain1 pulls in and uses read and show.
03:01
<@Vornicus>
Also do you bounce, splat, or slide along the ceiling?
03:03
<@Derakon>
Probably I'll just set your vertical velocity to 0.
03:03
<@Derakon>
This is what happens in Super Metroid.
03:03
<@MyCatVerbs>
McMartin: ah, it's just that read is enormous.
03:04 * Derakon passes that test case.
03:05
<@Vornicus>
SPlat then.
03:05
<@MyCatVerbs>
McMartin: the Read class involves something fancy, arguably overcomplicated and definitely underdocumented called precedence parsing. Replacing "read" with a hand-rolled function cuts 250kB off the size of Plain1.
03:05
<@Derakon>
So now I get to worry about this situation: http://derakon.dyndns.org/~chriswei/games/jbrl/accessibility/test4.png
03:05
<@Derakon>
The player cannot teleport through walls. ¬.¬
03:05
<@Vornicus>
Okay, and same question against walls, and also if it's splat again, then how fast can the player change horizontal velocity?
03:06
<@Derakon>
I don't know, man.
03:06
<@Vornicus>
Okay.
03:06
<@Derakon>
Hitting a wall sideways kills your horizontal velocity.
03:06
<@Derakon>
Air control, probably less than ground control, but I don't know by how much.
03:07
<@McMartin>
MCV: Noted.
03:08
<@MyCatVerbs>
Where the "hand-rolled" one looks like, "undigit c = fromIntegral (ord c - ord '0')"; "naiveDigits l = rawr 0 l"; "rawr a [] = a; rawr a (c:cs) = if isDigit c then rawr (10*a + undigit c) cs else a;"
03:09
<@Vornicus>
rawr.
03:09
<@MyCatVerbs>
McMartin: Every other change I've tried making to it has no appreciable effect whatsoever on the file size.
03:10
<@McMartin>
Yeah
03:10
<@MyCatVerbs>
Including replacing (show) with (shows), and replacing that with another hand-rolled version.
03:10
<@McMartin>
Hello World is 400kB, so that's just the runtime support, because I guess dynamically linking your runtime is evil. =P
03:11
<@MyCatVerbs>
Not so much "evil" as "GHC has a bus factor of like two. Exceedingly few developers available. And a some of the time that they *can* work on it, is for research."
03:12
<@MyCatVerbs>
Hence boring, mundane, awkward things like dynamic linking and a good low-level optimizer have been on the roadmap but unimplemented for a looong time now.
03:12
<@McMartin>
(That's the thing; I'd think dynamic linking would be *easier*)
03:13
<@MyCatVerbs>
Meanwhile, things that you can actually get good research papers published on, like interesting type system extensions and a truly heroic high-level optimizer, are present and do rock.
03:13
<@MyCatVerbs>
Really? Having never written a production compiler myself, why do you say that?
03:14
<@McMartin>
Well, they're going through gcc
03:14
<@McMartin>
it's harder to link static stuff into gcc than it is dynamically
03:14
<@McMartin>
DYnamically you say "here is the .so, go to town" and it does
03:15
<@MyCatVerbs>
And statically...?
03:15
<@McMartin>
In theory, the same thing, except 90% of the time it doesn't work because they're in the wrong order or symbols clash or etc.
03:15 * MyCatVerbs pokes the internet. "Manually surround the libraries that you want to link statically with -static and -dynamic."
03:16
<@MyCatVerbs>
Eh, they have their build system straightened out. For the code that the Haskell compiler itself emits, there's voodooish name-hangling going on anyway.
03:16
<@Vornicus>
Okay, the most sensible algorithm I see - and this is exhaustive, so it's not going to be pretty - is to determine not only where the player can get but with what speed.
03:17
<@MyCatVerbs>
Moot point either way, because the gcc backend is slowly but surely bitrotting and going away. All hail the new -fasm backend! ^_^
03:17
<@Vornicus>
Which is a horrible supersampling problem!
03:17
<@MyCatVerbs>
Goodnight, humans.
03:19
<@Derakon>
Yeah, this is why I'm taking a simpler approach. ¬.¬
03:20
<@Vornicus>
Yeah.
03:20
<@Vornicus>
I'm just glad you don't need to be able to climb walls!
03:21
<@Derakon>
Heh.
03:21
<@Vornicus>
Or double-jump!
03:21
<@Derakon>
Some kind of augmented jumping will be added eventually.
03:21
<@Derakon>
As a powerup.
03:22
<@Derakon>
The plan is to generalize the accessibility algorithm and then limit it to regions.
03:22 Molgorn [~moltare@Nightstar-16368.plus.com] has quit [Ping Timeout]
03:22
<@Derakon>
And the first region says "I use the basic parameters, and my powerup modifies the parameters like so." And then the second region says "I use those modified parameters, then tweak them further, like so." And so on.
03:25 Moltare [~moltare@Nightstar-16368.plus.com] has joined #code
03:42 * Derakon posts to GD.net to see if the swarm has any algorithm ideas.
03:42
<@Derakon>
I'm at the end of my hacking for today, I think.
03:45
<@McMartin>
Ah, and now we're at the part of YAHT where the material isn't actually there.
03:51
<@Reiver>
Derakon: For what it's worth, test4 looks downright awesome.
03:54
<@Derakon>
It's just a bog-standard map with a buggy accessibility algorithm applied to it.
03:57
<@Reiver>
Yes, but the /map/ looks cool.
03:58
<@Reiver>
First one that looks like an Actual Proper Level From A Computer Game.
03:58
<@Reiver>
(With platforms, anyway.)
03:59
<@Derakon>
I suspect that has something to do with the "super-pixel" effect.
03:59
<@Derakon>
Have you seen http://derakon.dyndns.org/~chriswei/games/jbrl/mapgen18.png ?
03:59
<@Reiver>
Yeah. Would make a good layout for a D&D dungeon crawl~
04:03 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Quit: Z?]
04:06 * ToxicFrog swims in
04:06
<@ToxicFrog>
Type-checking compiler: emailed to the prof
04:07
<@ToxicFrog>
Goals: scored
04:07
<@ToxicFrog>
Spellcast: delicious
04:07
<@Derakon>
Awesome.
04:07
<@Derakon>
I'm too braindead to play, I fear.
04:09
<@ToxicFrog>
So am I, actually
04:09
<@Derakon>
So you're probably too braindead to come up with an accessibility algorithm for JBRL. >.>
04:10
<@ToxicFrog>
...uh, yeah.
04:10 * Derakon fixes an out-of-bounds error on his wall-thickening algorithm, kinda wishes that Python magically knew when you expected to use negative indices into arrays. Anyway, http://derakon.dyndns.org/~chriswei/games/jbrl/mapgen18b.png
04:11
<@ToxicFrog>
I'm too braindead to even do UI scutwork in gtkcast.
04:11
<@Derakon>
Nothing special, I just thought it looked neat.
04:11
<@Derakon>
That big room left of center would make a nice aquarium.
04:11
<@Reiver>
Looks byzantine~
04:11
<@ToxicFrog>
It would.
04:11
<@Vornicus>
I like the upper right; it's an aerie
04:12
<@ToxicFrog>
It has that "Metroid aquarium full of aggressive, carnivorous fish" feel.
04:12
<@Reiver>
aerie?
04:12
<@Derakon>
Home to a bunch of raptors, Reiver.
04:12
<@Derakon>
Or cliff-dwelling birds, at any rate.
04:13
<@Reiver>
Not sure I see it, but okay.
04:14
<@Derakon>
Man, I'm glad the spacefilling algorithm worked out so well~
04:17
<@ToxicFrog>
Yeah, it's pretty sweet.
05:04 Syloqs-AFH [Syloq@Admin.Nightstar.Net] has quit [Connection reset by peer]
06:05 Derakon is now known as Derakon[AFK]
06:22 Vornicus [~vorn@Admin.Nightstar.Net] has quit [Quit: ]
06:57 AnnoDomini [~farkoff@Nightstar-27889.neoplus.adsl.tpnet.pl] has joined #Code
06:57 mode/#code [+o AnnoDomini] by ChanServ
07:22
<@McMartin>
So, Reiver
07:22
<@McMartin>
Any luck on filter?
07:26
<@McMartin>
Also, as a Hint on how one might do reverse, here are two ways of computing factorial: http://paste.ubuntu.com/130487/
07:26
<@McMartin>
Screw *you*, Blargh, I have ops.
07:28
<@McMartin>
Did my last line with a link to the paste site get through?
07:33
<@jerith>
It did here on Troika.
07:33 mode/#code [-o McMartin] by jerith
07:33 mode/#code [+o McMartin] by jerith
07:33
<@McMartin>
Which is where Reiver lives. OK.
07:34 * McMartin heads off to freshen up, and will rant about currying when he gets back.
08:52 You're now known as TheWatcher
10:24 * McMartin wields mighty laziness powers, constructs an infinite list of Fibonacci numbers, lives to tell the tale
10:24
<@McMartin>
Prelude> let fib = 1:(aux 1 1) where aux a b = b:(aux b (a+b))
10:24
<@McMartin>
Prelude> take 20 fib
10:24
<@McMartin>
[1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765]
11:28 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has quit [Quit: Rhamphoryncus]
11:40 GeekSoldier [~Rob@Nightstar-8573.midstate.ip.cablemo.net] has quit [Quit: Praise "BOB"!]
11:47 GeekSoldier [~Rob@Nightstar-8573.midstate.ip.cablemo.net] has joined #code
11:47 mode/#code [+o GeekSoldier] by ChanServ
12:20 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Quit: <Insert Humorous and/or serious exit message here>]
13:12 morpheus [pIRCuser69@92.126.57.ns-26763] has joined #code
13:13 morpheus [pIRCuser69@92.126.57.ns-26763] has quit [Quit: Teleos IRC]
13:47 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
13:47 mode/#code [+o gnolam] by ChanServ
13:59
<@ToxicFrog>
Infinite lists are delicious.
13:59 mode/#code [-o+o McMartin McMartin] by ToxicFrog
13:59
<@TheWatcher>
Yeah, but you need to be careful to eat them before they start talking, or they just go on forever.
14:30 somnolence [~somnolenc@Nightstar-5762.hsd1.ca.comcast.net] has quit [Operation timed out]
14:37 somnolence [~somnolenc@Nightstar-5762.hsd1.ca.comcast.net] has joined #code
14:47 somnolence [~somnolenc@Nightstar-5762.hsd1.ca.comcast.net] has quit [Operation timed out]
15:04 Syloqs_AFH [Syloq@Admin.Nightstar.Net] has joined #code
15:05 Syloqs_AFH is now known as Syloqs-AFH
15:13 KBot [AnnoDomini@Nightstar-29250.neoplus.adsl.tpnet.pl] has joined #Code
15:13 AnnoDomini [~farkoff@Nightstar-27889.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
15:14 KarmaBot [AnnoDomini@Nightstar-27889.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
15:16 KBot is now known as KarmaBot
15:20 AnnoDomini [~farkoff@Nightstar-29250.neoplus.adsl.tpnet.pl] has joined #Code
15:20 mode/#code [+o AnnoDomini] by ChanServ
15:27 Alek [~omegaboot@Nightstar-23818.dsl.emhril.sbcglobal.net] has quit [Quit: beroot!]
15:28
<@jerith>
Dear $damager_across_the_pond, INDIVIDUALS AND INTERACTIONS OVER PROCESSES AND TOOLS! Yours, the guy who has to wait for approval from "business" for a low risk, high impact bugfix.
15:30 Alek [~omegaboot@Nightstar-23818.dsl.emhril.sbcglobal.net] has joined #code
15:49 Vornicus [~vorn@Admin.Nightstar.Net] has joined #code
15:49 mode/#code [+o Vornicus] by ChanServ
15:53 C_tiger [~cheng@Nightstar-5625.hsd1.ca.comcast.net] has quit [Ping Timeout]
16:48 C_tiger [~cheng@Nightstar-5625.hsd1.ca.comcast.net] has joined #code
16:48 mode/#code [+o C_tiger] by ChanServ
16:51 Derakon[AFK] is now known as Derakon
16:51
<@Derakon>
Bah. No response from the GD.net forums for my question. :\
16:51 C_tiger [~cheng@Nightstar-5625.hsd1.ca.comcast.net] has quit [Client exited]
16:52
<@TheWatcher>
linky?
16:52
<@Derakon>
http://www.gamedev.net/community/forums/topic.asp?topic_id=527717
16:54
<@TheWatcher>
hm
16:54
<@TheWatcher>
I shall have a think
16:54
<@Derakon>
I'm wondering if maybe I should post it in the algorithms and/or general programming thread.
17:03
<@Derakon>
Hmm...TASVideos might have some good ideas for this too, since they're so familiar with the inner workings of videogames.
17:08 You're now known as TheWatcher[afk]
18:17 C_tiger [~cheng@Nightstar-5625.hsd1.ca.comcast.net] has joined #code
18:17 mode/#code [+o C_tiger] by ChanServ
18:38 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has joined #code
18:40 You're now known as TheWatcher
18:44 * Moltare eyes javascript
18:44
< Moltare>
If I ask it to alert(variable) before it uses that variable in a particular function, the alert claims the variable is undefined but the function works
18:45
< Moltare>
If I do not ask it to alert(variable), the function immediately breaks
18:49 GeekSoldier [~Rob@Nightstar-8573.midstate.ip.cablemo.net] has quit [Ping Timeout]
18:53
<@TheWatcher>
Possibly the alert() creates the variable as a side effect?
18:57
< Moltare>
No, it was a bracket mismatch
18:57
< Moltare>
still wtf
19:06
<@Derakon>
Alternate accessibility test idea: http://derakon.dyndns.org/~chriswei/games/jbrl/accessibility/
19:10
<@TheWatcher>
Hm. Looks like bounded raycasting at a glance, unless I misunderstand?
19:10
<@Derakon>
Um, maybe?
19:10
<@Derakon>
I'm not familiar with that algorithm.
19:10
<@Derakon>
Also, the rays in practice would not be straight.~
19:43 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
19:43 mode/#code [+o Attilla] by ChanServ
20:02 * Derakon tries to find an equation for position for ballistic trajectories.
20:03
<@Derakon>
Ahh. y = y_0 + x*tan(theta) - gx^2/(2v*cos(theta))^2
20:10
<@Derakon>
...working out runspeed and vertical jump speed to get maximal jump height is a bit annoying.
20:16
<@Derakon>
Agh, I'll need a derivative. ;.;
20:16
<@Derakon>
5x^2/(12cos(1.1))^2 does not look pleasant.
20:17
<@Derakon>
Okay granted that's a constant down below.
20:17
<@Derakon>
So...10/(nasty constant) * x, right?
20:27 GeekSoldier [~Rob@Nightstar-8573.midstate.ip.cablemo.net] has joined #code
20:27 mode/#code [+o GeekSoldier] by ChanServ
20:30 * Moltare eyes his app
20:30
< Moltare>
I haven't changed anything
20:30
< Moltare>
Why are you suddenly working?
20:50 GeekSoldier [~Rob@Nightstar-8573.midstate.ip.cablemo.net] has quit [Ping Timeout]
21:32
<@Derakon>
This is not pleasant code to write...:\
21:33
<@Derakon>
And the best part is I get to do it all over again if I change my physics! ;.;
22:26 * Derakon realizes his clever, simple "draw a line between these two points and see if there are any blocks in the way" idea requires finding blocks along lines, which isn't necessarily straightforward.
22:41
<@Vornicus>
Bresenham's Algorithm.
22:41
<@Derakon>
Is nice and all, but has squares that are not colored which the actual line still passes through.
22:41
<@McMartin>
Which I think I've implemented something like a dozen times.
22:42
<@McMartin>
Including once in assembler. >_<
22:42
<@Vornicus>
Ouch.
22:42
<@McMartin>
But if you ever need a bitmap library for the C64, I got it right here~
22:42
<@Vornicus>
Idunno, it's pretty straightforward; seems like it'd take maybe 20 instructions in asm
22:42
<@McMartin>
In other news, it seems Fedora 11's new artwork theme is named "Leonidas."
22:42 * McMartin goes to check
22:42
<@McMartin>
Note that C64's bitmap is very literally a "bit" map, so setting a pixel involves shifts and ORs.
22:43
<@McMartin>
Not to mention that the addressing itself is in fact based on an entire screen full of programmable characters.
22:43
<@Vornicus>
a true thing.
22:43
<@Vornicus>
So it'd be worse in c64
22:43
<@McMartin>
So, byte 0 is pixels (0,0)-(7,0), byte 1 is pixels (0,1)-(7,1), etc. and byte 8 is (8,0)-(15,0)
22:44
<@McMartin>
Also, 16-bit math with 8-bit accumulators, etc.
22:44 * McMartin checks to see if he's got the source handy.
22:46
<@Vornicus>
In /modern/ assembler anyway it's easy.
22:46
<@Derakon>
This whole accessibility testing thing is a major pain. >.<
22:47 * McMartin guesses about 120 instructions.
22:48
<@McMartin>
http://www.stanford.edu/~mcmartin/misc/bitmap.oph
22:49 You're now known as TheWatcher[T-2]
22:49
<@McMartin>
(This could be made cleaner now, but it's from before when Ophis had namespaces)
22:52 GeekSoldier [~Rob@Nightstar-8573.midstate.ip.cablemo.net] has joined #code
22:52 mode/#code [+o GeekSoldier] by ChanServ
22:52 You're now known as TheWatcher[zZzZ]
22:57 * Derakon bashes his head on his desk.
22:57
<@Derakon>
This is fucking hard. >.<
23:05
<@Vornicus>
Gah, P:tB mission 14 is the hard one.
23:13
<@Derakon>
...I just realized I can't use all this trajectory crap anyway because my jumping mechanics will not use a single initial impulse.
23:14
<@Derakon>
(It'll be "Press jump, vertical velocity is set to X; as long as a) jump is held, and b) frames jump is held is less than Y, X is fixed")
23:15
<@Derakon>
(This allows you to control the height of your jump easily, but does mean non-ballistic trajectories)
23:22
<@Vornicus>
Hard hard hard because of everything you have to do right near the beginning.
23:22 * Derakon ponders...
23:23
<@Derakon>
Alternative strategy: walk the walls. If local slope is less than 45° then it is accessible, otherwise platforms must be added perpendicular to the slope.
23:24
<@Derakon>
Ignore situations where we're walking the ceiling, naturally.
23:26
<@Derakon>
This sounds simple and I think it might actually work, with the exception of overhangs.
23:28
<@Derakon>
Hm. Overhangs: if floor is too far away, add a platform.
23:58 * Derakon ponders http://derakon.dyndns.org/~chriswei/games/jbrl/accessibility/retry1.png
--- Log closed Sat Mar 14 00:00:27 2009
code logs -> 2009 -> Fri, 13 Mar 2009< code.20090312.log - code.20090314.log >