#nuvie@irc.freenode.net logs for 25 Nov 2003 (GMT)

Archive Today Yesterday Tomorrow
Nuvie homepage


[01:15:53] <servus> On a minor note: The palette cycling was going *backwards*, so I flipped it. (Fire was appearing to go down as Nuvie, I changed it so that it goes 'up', as in the original U6)
[02:09:52] <servus> Torches aren't implemented in some way that I haven't figure out, are they?
[07:35:42] --> Yuv422 has joined #nuvie
[07:37:09] <Yuv422> I would have thought torches would have the same fire bit as any other tile?
[07:37:16] <Yuv422> bits
[07:40:47] <Yuv422> a lit torch has a full brightness
[07:41:17] <Yuv422> according to the tile flags
[07:41:29] <Yuv422> it is tile number 611
[07:41:55] <Yuv422> 0611 : 00000000 00000011 01000000 lit torch
[07:42:50] <Yuv422> servus: are you checking brightness from the tileflags?
[08:09:29] <servus> I am
[08:09:37] <servus> I meant torches as in people carrying them
[08:10:01] <servus> I haven't found a way to activate a torch and carry it in your hand, but as long as the actor emits a flag2 & 0x3, it should work with the current system
[08:10:58] <servus> I had to rewrite some stuff to combat an oddity with the drag-and-drop: It'd redraw the map and therefore draw the lightglobes again without resetting the opacity map... that's all fixed now. Tell me when you want it (I believe I modified 4 files)
[08:11:13] <servus> Game.cpp, Screen.h, Screen.Cpp, and MapWindow.cpp
[08:26:43] <Yuv422> :)
[08:26:59] <Yuv422> I can check it in now if you like.
[08:29:03] <servus> Hmm, I made lots of other strange additions to the code while mucking it around... Let me get a fresh copy and put the changes in so I don't screw up the diff, or I can just give you a list of the modifications and you can modify it
[08:30:00] <Yuv422> I can do it if you like
[08:30:12] <Yuv422> or you can clean it up. I don't mind
[08:30:28] <Yuv422> probably better to give me the full files rather than a diff
[08:30:39] <Yuv422> as my version might be different again. ;)
[08:32:21] <Yuv422> do you update the light map only when the player moves?
[08:33:53] <servus> It's updated every frame... where would I change it so that it's every movement?
[08:34:56] <Yuv422> when we update the blacking
[08:35:40] <Yuv422> MapWindow::updateBlacking
[08:35:59] <Yuv422> hmm
[08:36:05] <Yuv422> thinking about this somemore
[08:36:09] <Yuv422> it might not work
[08:36:20] <Yuv422> if we have moving lightsources.
[08:36:29] <Yuv422> would that ever happen?
[08:36:39] * servus shugs, I'd think so
[08:36:49] <servus> On a per-frame basis, you can do neat things like bobbing of light
[08:36:54] <Yuv422> yeah
[08:37:11] <Yuv422> what's the overhead like?
[08:37:21] <servus> Not too bad...
[08:37:31] <servus> There are two methods for light, one is computationally cheaper
[08:38:35] <Yuv422> what time do you start making it dark?
[08:38:38] <servus> I s'pose I could also implement the 'original' type of lighting
[08:38:44] <Yuv422> hehe
[08:38:51] <Yuv422> I bet people will ask for it.
[08:39:00] <Yuv422> there are tiles for it in the tileset
[08:39:07] <servus> That part is 100% accurate. Dawn is 5:00 to 6:00 and dusk is 19:00 to 20:00
[08:39:15] <servus> I checked the original for that :)
[08:39:22] <Yuv422> cool
[08:39:41] <servus> Perhaps I should enable 'old-style' shading before giving it to you?
[08:40:01] <Yuv422> hehe but I want to try it now.
[08:40:16] <Yuv422> you can always commit any additions yourself
[08:40:51] <servus> http://4.60.123.159:8080/files/Nuvie.txt
[08:41:19] <servus> I hope the format isn't confusing:)
[08:41:37] <Yuv422> hehe
[08:41:39] <Yuv422> looks good
[08:41:49] <Yuv422> I'll merge it into my copy now
[08:42:16] <Yuv422> have you looked at lava fields with your lightcode?
[08:42:24] <servus> Oh, you'll have to create min and max macros for that :P
[08:42:24] <Yuv422> if so, how does it look?
[08:42:30] <servus> Hmm, know a lava location?
[08:42:39] <Yuv422> let me check
[08:43:01] <servus> Ah, you have them already
[08:43:18] <servus> Just uppercase my macros then:)
[08:45:33] <Yuv422> dc, 73 5
[08:45:42] <Yuv422> for a lava field
[08:45:58] <Yuv422> also do you force darkness for the dungeons?
[08:46:11] <servus> Hmm, nope on that either... just z > 0 right
[08:46:24] <Yuv422> and < 5
[08:46:44] <servus> map_window->moveMap( 0xDC,0x73, 5); isn't lava... *Pokes around more*
[08:47:00] <servus> Ah, it is.
[08:47:18] <Yuv422> you know you can just teleport there
[08:47:22] <Yuv422> with alt-214
[08:47:37] <servus> Ah, I thought that didn't work because I was using the numpad:)
[08:47:43] <Yuv422> hehe
[08:47:49] <Yuv422> yeah got to fix that sometime too
[08:48:28] <servus> When I 'look' at floor tiles, I don't get the stderr readout like I do for objects... It's not treating it as the proper type of object.
[08:48:52] <Yuv422> yeah they are on the map
[08:48:57] <Yuv422> it only does that for objects
[08:50:45] <servus> Oh, I made U6 work in U7, btw, though I have to complete my chunk-to-chunk conversion chart for it to look purty :)
[08:50:55] <Yuv422> cool
[08:51:02] <Yuv422> do you have a screenshot?
[08:52:29] <servus> It looks like gibberish right now, actually, but I know it works and that it's just my conversion chart :)... I can give a screenshot if you *really* want it, I suppose
[08:53:49] <Yuv422> hehe
[08:54:06] <Yuv422> how are you getting the u6 map?
[08:54:34] <servus> I made a program to parse it up.
[08:54:34] <Yuv422> are you going to attempt to convert objects too?
[08:54:39] <servus> Heck no :)
[08:54:39] <Yuv422> ah k cool
[08:54:42] <Yuv422> hehe
[08:55:47] <servus> Something you might recognize is the very top-left of the world level 0... The ocean is apple orchards, outerspace is ocean, and the in-between chunks are odd :)
[08:56:14] <Yuv422> hmm
[08:56:20] <Yuv422> strange
[08:56:29] <servus> Nah, that's just how the chunk numbers happened to match up :)
[08:56:48] <servus> I have to match all ~700 U6 superchunks with a possible ~3000 U7 chunks, by hand.
[08:57:47] <servus> Did you get my code working?
[08:58:15] <Yuv422> doing it now
[09:00:14] <Yuv422> I might move your dusk dawn stuff into an inline method
[09:01:40] <servus> OK.
[09:02:16] <Yuv422> ok compile time
[09:05:09] <Yuv422> I've put the MIN MAX defines into nuvieDefs
[09:07:05] <servus> OK. Once you put it all together I'll sync my version.
[09:07:40] <Yuv422> hmm
[09:07:56] <Yuv422> the darkness map is only in the bottom right corner :(
[09:08:35] <Yuv422> it looks like it is aligned wrong?
[09:08:51] <Yuv422> it is spilling into the MsgScroll
[09:09:01] <servus> Hmm.
[09:09:33] <servus> screen->clearalphamap8( 8, 8, 160, 160, screen->get_ambient() ); should set it to the proper viewport area.
[09:09:54] <servus> Check your shading_rect.x and .y at blitalphamap8()
[09:09:58] <servus> Feel free to rename the functions :P
[09:10:11] * Yuv422 looks
[09:11:48] <Yuv422> (gdb) p shading_rect
[09:11:49] <Yuv422> $1 = {
[09:11:49] <Yuv422> x = 105,
[09:11:49] <Yuv422> y = 111,
[09:11:49] <Yuv422> w = 110,
[09:11:49] <Yuv422> h = 85
[09:11:51] <Yuv422> }
[09:12:12] <servus> Yeah, that's totally wrong.
[09:12:18] <servus> It should be 8,8,160,160
[09:12:35] <servus> OH!
[09:12:36] <servus> I know
[09:12:55] <servus> The constructor for Screen::Screen(Configuration *cfg)
[09:12:59] <Yuv422> hehe
[09:13:00] <servus> needs update_rects = NULL;
[09:13:08] <servus> That'll do it.
[09:13:20] <servus> s/update_rects/shading_rect
[09:13:24] <servus> shading_data
[09:13:26] <servus> Argh!
[09:13:54] <servus> In Screen::Screen(Configuration *cfg), put shading_data = NULL; //:P
[09:14:26] <servus> And in ~Screen, a matching if (shading_data) free(shading_data);
[09:15:11] <Yuv422> free or delete?
[09:16:10] <servus> free
[09:16:22] <Yuv422> It's working now
[09:16:24] <servus> I wanted to keep it similar to your code
[09:16:29] <Yuv422> cool
[09:16:35] <Yuv422> it looks great! :)
[09:16:51] <servus> Thanks:) You've still got the aforementioned problems though, such as lava
[09:17:06] <servus> Take it to 5:00 and do a lot of PASS :)
[09:17:56] <Yuv422> yeah lava doesn't seem to throw off any light. :(
[09:18:20] * servus investiages
[09:18:30] * servus investigates and debutters his fingers
[09:19:06] <Yuv422> Yikes
[09:19:17] <Yuv422> Nuvie chews a bit of cpu when doing the darkness
[09:19:22] <Yuv422> 70% on my system.
[09:20:24] <-- servus has left IRC (Read error: 104 (Connection reset by peer))
[09:20:32] --> servus has joined #nuvie
[09:20:49] <servus> Bah
[09:21:44] <Yuv422> did you get my last message?
[09:21:51] <servus> ?log
[09:21:51] <exultbot> Logs are available at http://www.math.leidenuniv.nl/~wpalenst/nuvielog.php
[09:22:43] <servus> Heh, 95% here; it seems to just be rendering as fast as possible.
[09:23:08] <Yuv422> I get some slowdown when moving past lightpoints too
[09:23:57] <servus> Let's set it to when-player-moves ;)
[09:24:37] <Yuv422> do I just move the parts grom Game?
[09:25:01] <servus> That's what I'm doing.
[09:25:49] <servus> Of course, clock is undefined... There's no pointer in MapWindow that'll let me backtrack to Game?
[09:29:04] <Yuv422> hmm still about 80%
[09:33:45] <servus> How are you getting access to screen or game in MapWindow?
[09:34:02] <Yuv422> GameClock *clock = Game::get_game()->get_clock();
[09:34:14] <Yuv422> and if(screen) {}
[09:34:33] <Yuv422> because screen can be undefined in updateBlacking
[09:35:36] <Yuv422> hehe hmm set_ambient does nothing
[09:35:46] <Yuv422> where is the alpha map created?
[09:35:49] <servus> Hmm, no performance impact now
[09:35:58] <Yuv422> really?
[09:36:12] <servus> Yeah, but the braziers aren't lighting up :)
[09:36:14] <Yuv422> what did you change?
[09:36:42] <servus> clearalphamap8 creates the alpha map and drawalphamap8globe does the obvious
[09:38:01] <servus> Linear attenuation is much cheaper too, change the #if in drawalphamap8globe
[09:38:10] <Yuv422> ah k
[09:39:06] <servus> Ah, there we go @ 20%CPU
[09:39:48] <Yuv422> what did you change?
[09:41:11] <servus> Quite a bit :)
[09:42:53] <servus> First, I added a bool to screen.h for UpdatingAlphaMap, it starts at true. The stuff that was in game loop is now in updatingblacking. I do the only alphaclear in updateblacking. The alphaclear does the only lightglobe around the avatar, and sets UpdatingAlphaMap to true. blit sets UpdatingAlphaMap to false, and when you DrawObj, it checks UpdatingAlphaMap before drawing that lightglobe.
[09:43:01] <servus> That's more or less it.
[09:44:49] <servus> clearalphamap is probably stupidly expensive to call because I pass all the information for the shading_rect each time, though it's only used on the first call.
[09:46:01] * Yuv422 tries to follow servus' instructions
[09:46:15] <servus> Hah, good luck, want new files instead? :)
[09:47:55] <Yuv422> so clearalphamap8 goes in updateBlacking?
[09:48:07] <servus> Yepyep
[09:48:09] <Yuv422> I got weird results when I did that.
[09:48:47] <servus> I did lots of other stuff... Your globes are probably getting superbright over a few frames huh :)
[09:49:02] <Yuv422> yes
[09:49:51] <servus> You are drawing light globes on every call to DrawObj, not just when you have UpdateGlobes (or whatever) set to true
[09:50:07] <Yuv422> ah k
[09:50:16] <servus> GameClock is an undefined type when i'm at updateBlacking
[09:50:31] <Yuv422> just add GameClock.h to MapWindow
[09:50:32] <servus> Heh.
[09:50:35] <servus> I did, just saying :)
[09:50:40] <Yuv422> :)
[09:51:23] <servus> Ah -- we need to update on every tick of the clock as well, for dawn and dusk while Pass!ing.
[09:51:37] <Yuv422> yeah
[09:53:09] <Yuv422> where do I set and clear updatingAlphaMap?
[09:53:20] <Yuv422> in clearalphamap8?
[09:54:10] <servus> I just added map_window->updateBlacking(); to where it says Pass!
[09:54:19] <servus> =true in clear, =false in blit
[09:54:36] <Yuv422> doesn't blit get called alot?
[09:54:45] <servus> Nope, just once per frame.
[09:55:07] <Yuv422> ah you mean blitalphamap
[09:55:12] <servus> Indede
[09:57:44] <servus> Does that clear things up? I need sleep :)
[09:57:49] <Yuv422> yeah
[09:57:52] <Yuv422> thanks
[09:58:05] <Yuv422> I'll get this stuff committed tonight
[09:58:59] <servus> Want the updated rotate_palette function then? (The old one goes backwards!)
[09:59:13] <Yuv422> hehe sure
[09:59:25] <servus> Try setting the #if to 1 on the drawalpha for a different type of lighting, too
[09:59:34] <Yuv422> will do
[10:00:36] <servus> http://sourcepost.sytes.net/sourceview.aspx?source_id=8690 reversed rotation
[10:05:39] <Yuv422> hmm
[10:05:53] <Yuv422> my light globes are still expanding. :(
[10:07:18] <servus> Heh, that sounds funny:)
[10:08:00] <servus> in drawObj, do you have if(tile->flags2 & 0x3 > 0 && Game::get_game()->get_screen()->updatingalphamap ) screen->drawalphamap8globe( 8 + (obj->x - cur_x)*16, 8 + (obj->y - cur_y)*16 , (tile->flags2 & 0x3)*16 );
[10:08:09] <servus> Notice the && Game::get_game()->get_screen()->updatingalphamap
[10:08:20] <Yuv422> yeah
[10:08:41] <Yuv422> if(tile->flags2 & 0x3 > 0 && screen->should_update_alphamap())
[10:09:46] <servus> Make sure that you only set it true when you updateblacking (that's where you clear), and you only set it false when you blitalphamap(at the end of each frame in mapwindow::display, directly before drawing the border
[10:11:05] <Yuv422> should I keep screen->drawalphamap8globe( 88, 88, 64 );
[10:11:07] <Yuv422> in Display?
[10:12:51] <servus> Nope, the only place I have that call anywhere is in clearalphamap actually (that draws the avatar globe)
[10:13:06] <servus> You could put it in updateblacking right after clearing the map... sorry, I'm dead tired:)
[10:13:59] <Yuv422> hehe
[10:14:00] <Yuv422> np
[10:14:48] <Yuv422> 30% now :)
[10:14:55] <Yuv422> that's much better.
[10:15:18] <servus> Indeed... but SF still won't send me my confirmation mail *sheds a tear*
[10:17:02] <Yuv422> hmm it is still lagging
[10:17:10] <Yuv422> I'm dropping frames. :(
[10:17:30] <servus> It is rather computationally expensive... the 'old-fashioned' type should be extremely lightweight.
[10:18:14] <Yuv422> true
[10:18:43] <servus> Also, are you trying the linear attenuation in drawglobes? That should be less intensive.
[10:18:55] <Yuv422> trying it now
[10:20:49] <Yuv422> I think the whole graphics system needs a bit of an overhaul
[10:21:08] <servus> Mmm, possibly.
[10:21:57] <servus> I am in dire need of sleep, and I don't think that I'm going to be able to register this SF account tonight... If there's not anything else..?
[10:22:06] <Yuv422> hehe
[10:22:35] <Yuv422> just let me know when it has been processed
[10:22:42] <Yuv422> thanks
[10:22:58] <Yuv422> I'll post some screenshots on the forum. :)
[10:23:43] <servus> Otay, I can optimize it later too... plus I'll work on the oldfashioned lighting
[10:24:07] <servus> 'night, 'ta. *zzz*
[10:24:10] <Yuv422> righto talk to you later
[10:24:13] <Yuv422> cya
[12:19:59] <Yuv422> time for bed
[12:20:00] <Yuv422> cya
[12:20:02] <-- Yuv422 has left IRC ("BitchX: nine out of ten doctors recommend it")
[13:27:05] <-- Kirben has left IRC ("System Meltdown")
[15:46:46] --> KtJ_Dragon has joined #nuvie
[16:12:21] <-- KtJ_Dragon has left IRC ("$B%/%i%$%"%s%H$N=*N;(B")
[16:13:42] --> Fluffy_Parasite has joined #nuvie
[16:32:36] --> wjp has joined #nuvie
[16:41:06] <-- Fluffy_Parasite has left IRC ("Client Exiting")
[20:00:54] --> royalsexy has joined #nuvie
[22:57:06] <-- wjp has left IRC ("Zzzz...")
[23:57:03] --> Kirben has joined #nuvie