#nuvie@irc.freenode.net logs for 7 Jul 2012 (GMT)

Archive Today Yesterday Tomorrow
Nuvie homepage


[01:01:16] <-- Darrenor64 has left IRC ()
[02:34:10] <SugarCube> wjp: I am.
[02:35:28] <SugarCube> wjp: I originally made new functions to return a const char * directly instead of returning a const std::string& and calling c_str() on the result, but I didn't want to add too many new functions in a small commit really just meant to get MSVC working again.
[02:35:50] <SugarCube> That is, next to std::string get_input(), I considered adding a new const char * get_input_c_str() function.
[02:36:18] <SugarCube> I still think that both should crash, since the result of get_input() immediately goes out of scope, but this seems to work.
[08:10:15] <-- CIA-68 has left IRC (Read error: Operation timed out)
[08:11:01] --> CIA-35 has joined #nuvie
[09:05:18] <wjp> SugarCube: returning the result of c_str() of a local variable doesn't work. Same for returning a reference or pointer to a local variable
[09:06:09] <wjp> returning a std::string _does_ work
[09:06:45] <wjp> if it were true that "the result [...] immediately goes out of scope", then you would never be able to return objects at all
[09:07:02] <wjp> so fortunately that just isn't true :-)
[09:08:46] <wjp> on the other hand, what Converse::continue_script does with the return value of get_input() is broken
[09:10:15] <wjp> (but get_input is not a function your commit touched, so we hadn't looked at that yesterday)
[09:10:43] <wjp> well, broken is not the right term
[09:10:51] <wjp> it's ok, but only because set_svar does a strdup right away
[09:13:31] <wjp> the temporary returned by get_input has a lifetime of the full expression it's in
[09:22:01] <wjp> looking over all get_input() calls, things seem fine
[10:36:26] --> Yuv422 has joined #nuvie
[11:58:31] <-- Yuv422 has left IRC (Quit: Yuv422)
[13:14:20] <-- Kirben has left IRC ()
[17:24:08] --> Malignant_Manor has joined #nuvie
[17:35:09] <Malignant_Manor> current magic information is used for combat mode in MD and SE
[17:35:16] <Malignant_Manor> 2 is command, 4 is ranged, 7 is flee, 8 = attack (MD) close (SE)
[18:21:08] <SugarCube> wjp: Converse::get_input was changed from std::string to std::string&.
[18:21:57] <SugarCube> Whether it's a quirk of MSVC or gcc, I have not reexamined the spec to ascertain. Either way, works fine in both compilers now.
[18:28:48] <wjp> ah, I see, it's get_output which would have been causing trouble
[18:29:09] <wjp> in ConverseInterpret::do_text
[18:29:59] <SugarCube> Precisely.
[18:30:11] <wjp> not get_input :-)
[18:30:36] <SugarCube> get_input().c_str() was also causing similar crashes elsewhere.
[18:30:44] <wjp> I don't see that
[18:31:00] <SugarCube> Converse::input() DEBUG(0,LEVEL_DEBUGGING,"Converse: INPUT \"%s\"\n\n", get_input().c_str()); for one.
[18:32:42] <SugarCube> (I believe that's the right one. It was a longer-than-expected process tracking down all the runtime crashes.)
[18:32:49] <wjp> hm, that should be fine
[18:33:12] <wjp> ah well, since get_input returns a reference to a member var, it doesn't really matter
[18:35:03] <SugarCube> It doesn't matter. My goal was to produce the smallest patch that allowed for a stable runtime in MSVC without adversely affecting other compilers.
[18:40:42] <wjp> yes, but I'd prefer the goal of understanding things :-)
[18:45:48] <SugarCube> Sure. const char *c_str = converse->get_output().c_str(); creates a const char * pointer that is referring to the result of a std::string() that goes out of scope after that sequence point concludes. On certain platforms, the memory pointed to will be overwritten immediately. Perhaps a better solution would have been to change that line to std::string output_str = converse->get_output(); const char * c_str = output_str.c_str();
[19:26:11] --> Dominus1 has joined #nuvie
[19:27:25] <-- Dominus has left IRC (Ping timeout: 244 seconds)
[19:44:40] <-- Malignant_Manor has left IRC (Quit: ChatZilla 0.9.88.2 [Firefox 13.0.1/20120614114901])
[20:50:54] --> Malignant_Manor has joined #nuvie
[21:28:34] <SugarCube> Reduced smooth lighting ambient light level, slightly increased size of all smooth light globes. Flipping back and forth between smooth and original lighting under a variety of conditions, it looks much closer to the original game now. It's a little hard to judge, because it's always easier to see objects under smooth lighting, since there's no completely opaque fishnet over anything.
[21:30:16] <SugarCube> I think I actually like having everything *slightly* lit up in what should be pitch blackness. That's an artistic decision that I will defer to Eric.
[21:31:03] <Malignant_Manor> Does the minimum brightness work for that so there is gamer choice?
[21:31:32] <Malignant_Manor> That would probably lighten up the light radius too
[21:33:45] <SugarCube> Gamer choice? How do you mean?
[21:33:55] <SugarCube> Do you mean the minimum light cheat option in the config?
[21:34:00] <Malignant_Manor> Configuration settings
[21:34:10] <Malignant_Manor> If it makes sense.
[21:34:29] <Malignant_Manor> Minimum brightness would probably be different though.
[21:34:52] <Malignant_Manor> It would be easier to tell after your commit.
[21:37:17] <SugarCube> Hmm... I think that's doable, actually. The way it works is that it builds a single light map of the current ambient light level, draws each light globe onto that, and then blits the lightmap once over the game window. I can make it use the minimum brightness configuration option by default... just need to fix up the dusk/dawn transitions. With the new light globe sizes, the game is very close to the original with 0 ambient light.
[21:38:00] <Malignant_Manor> Well, min brightness messed with total ambiance.
[21:39:11] <Malignant_Manor> After you commit, I can tell what happens.
[21:39:25] <SugarCube> It is a cheat, isn't it? :)
[21:39:35] <SugarCube> Did you notice any actual graphical glitches?
[21:40:19] --> Yuv422 has joined #nuvie
[21:41:05] <Malignant_Manor> Glitches with what?
[21:42:19] <Malignant_Manor> The minimum brightness cheat only adjusted the ambiance before it went to the shader info so it just lightened the screen and increased the globe
[21:42:22] <SugarCube> Mostly I'm curious what "it was too translucent when shadows are over lighter colors" means and how I can reproduce it.
[21:42:41] <Malignant_Manor> That was with my old code.
[21:42:50] <Malignant_Manor> That I screwed up on
[21:42:57] <Malignant_Manor> Let me find the pic
[21:43:33] <SugarCube> I'm looking at the screenshots you emailed me.
[21:43:35] <Yuv422> hi guys
[21:43:37] <Malignant_Manor> You should have ditched my changes from that patch I emailed you.
[21:43:51] <Malignant_Manor> http://i156.photobucket.com/albums/t13/Malignant_Manor/Nuvie_smooth_vs_original_1.png
[21:44:00] <Malignant_Manor> That was after my bad patch.
[21:44:42] <Malignant_Manor> It was so much worse walking through town where the walls were light colors.
[21:48:23] <SugarCube> Hi Eric!
[21:48:33] <SugarCube> K, sounds like we want to target 0 ambiance unless the player is cheating.
[21:48:39] <SugarCube> ambient light*
[21:49:07] <Malignant_Manor> Yeah
[21:51:14] <Malignant_Manor> Raising the minimum ambiance will probably work for SM quote >>I actually like having everything *slightly* lit up in what should be pitch blackness
[21:51:45] <Malignant_Manor> I like being able to see somewhat in the dark too. That is why I added the cheat.
[21:52:30] <Malignant_Manor> with 0 minimum as default like it should be
[21:53:29] <Malignant_Manor> Eric, current magic information is used for combat mode in MD and SE
[21:53:37] <Malignant_Manor> 2 is command, 4 is ranged, 7 is flee, 8 = attack (MD) close (SE)
[21:53:59] <Malignant_Manor> I'm fixing up the combat text display in SE and MD.
[21:54:18] <Malignant_Manor> I changed the read and write of magic and combat_mode
[21:54:39] <Yuv422> are you talking about views
[21:54:39] <Malignant_Manor> I have no idea what the other bits do.
[21:55:05] <Malignant_Manor> I'm talking about saved data and fixing the views too.
[21:55:14] <Yuv422> ah k
[21:55:18] <Yuv422> in objlist?
[21:55:34] <Malignant_Manor> yeah
[21:55:38] <Yuv422> cool
[21:55:51] <Yuv422> maybe we need an objlist.txtx file in the se docs
[21:56:05] <Malignant_Manor> Nelly and Avatar were 0 (U6 combat_mode now SE/MD magic)
[21:56:19] <Malignant_Manor> *Nellie
[21:56:25] <Malignant_Manor> Spector is 155
[21:57:04] <Malignant_Manor> Maxed to 128 I guess
[21:58:14] <Malignant_Manor> I think I will try and figure it out since I can see that it is being truncated
[22:08:11] <SugarCube> Looks like dawn should occur between 5:00 and 5:45, not 5:00 and 6:00 as before? What about dusk? Do you happen to have that handy?
[22:09:10] <Malignant_Manor> I don't think I tested it in the original
[22:10:12] <Malignant_Manor> Jimmy is 128 magic now (probably 155)
[22:10:17] <Malignant_Manor> Hmm
[22:10:29] <Malignant_Manor> I have no idea what this would be for.
[22:11:27] <Malignant_Manor> id_n: 6 has it too
[22:14:06] <CIA-35> nuvie: 03smatthews * r1397 10/nuvie/trunk/ (MapWindow.cpp screen/Screen.cpp):
[22:14:06] <CIA-35> nuvie: * Made minimum ambient light configurable without messing up dusk/dawn transitions
[22:14:07] <CIA-35> nuvie: * Dawn now occurs between 5:00 and 5:45 instead of between 5:00 and 5:59
[22:14:07] <CIA-35> nuvie: * Increased size of smooth lighting globes to better approximate original lighting globe sizes
[22:14:19] <SugarCube> I'll work on making it better soon. Time for lunch!
[22:17:03] <Malignant_Manor> Eric, is there a way you can automatically output all npcs in SE and MD's combat_mode number? (current source not the fixed combat_mode)
[22:28:14] <Malignant_Manor> You should make int a be uint8
[22:28:45] <Yuv422> Malignant_Manor: I usually stick a printf in the load loop
[22:28:46] <Malignant_Manor> Then get rid of the (uint8) and if(a > 255)
[22:28:52] <Yuv422> to dump that sort of info
[22:29:31] <Malignant_Manor> It would be nice to know what it means.
[22:29:49] <Malignant_Manor> I doubt it will tell me anything.
[22:30:45] <Yuv422> I was thinking about expanding the total number of npcs in nuvie at one stage
[22:30:53] <Yuv422> to use uint16
[22:31:12] <Malignant_Manor> I was talking about the lighting
[22:31:20] <Yuv422> hehe
[22:31:24] <Yuv422> whoops
[22:31:54] <Malignant_Manor> the value of ambiance is uint8 anyway
[22:47:29] <Malignant_Manor> Here's SE http://pastebin.com/T8AViCLx
[22:47:47] <Malignant_Manor> oops
[22:48:03] <Malignant_Manor> I need to delete my saves since it overwrote
[22:53:09] <Malignant_Manor> I guess not. Anyway, MD's UNK_0x12f1 is http://pastebin.com/XGxc9gpa
[22:53:41] <Malignant_Manor> Expiration is one month from now
[22:55:55] <Malignant_Manor> It seems I remembered wrong on the number. It seems to be saving the same so I won't worry about it for now.
[22:58:51] <Yuv422> I'm sure there will be quite a few differences in the objlist data structure
[22:59:59] <Malignant_Manor> Maximum HP is shown as 0
[23:07:04] <Yuv422> I've got to go now
[23:07:06] <Yuv422> cya
[23:07:07] <-- Yuv422 has left IRC (Quit: Yuv422)
[23:22:53] --> Dominus has joined #nuvie
[23:22:53] <-- Dominus1 has left IRC (Read error: Connection reset by peer)
[23:38:05] --> Kirben has joined #nuvie