Also, <3 valgrind. After adding lots of debug statements I was still clueless, then I remembered valgrind, which pointed out the problem in about 5 seconds.
On 8 December 2013 20:20, Ralph Versteegen <[email protected]> wrote: > Yikes. You were right that this was exposed by the previous fix. The > whole thing is a bit of a mess, but the fix basically removed more > stuff (another premature optimisation: caching) from reloadbasic.py, > so things are getting steadily less complex :) > > I didn't see the loadherodata errors in any game, but I did see the > save game loading errors, which are now fixed. The loading errors had > a rather interesting effect: I had an empty (and thus invisible) > walkabout party. > > On 8 December 2013 08:31, James Paige <[email protected]> wrote: >> Oops! Looks like a found a rather serious symptom of this corruption. When >> you load a save game now, the inventory is completely blank. Here are some >> messages I see in the g_debug.txt >> >> Save slot 0: savegame.rbas:237, in gamestate_from_reload: unexpected node >> node:/inventory >> Save slot 0: savegame.rbas:237, in gamestate_from_reload: unexpected node >> node:/shops >> Save slot 0: savegame.rbas:237, in gamestate_from_reload: unexpected node >> node:/vehicle >> Save slot 0: savegame.rbas:234, in gamestate_from_reload: Did not see >> expected node node:/inventory >> Save slot 0: savegame.rbas:638, in gamestate_inventory_from_reload: Expected >> node node:/slots missing >> Save slot 0: savegame.rbas:235, in gamestate_from_reload: Did not see >> expected node node:/shops >> Save slot 0: savegame.rbas:236, in gamestate_from_reload: Did not see >> expected node node:/vehicle >> >> >> >> On Wed, Dec 4, 2013 at 11:26 PM, Ralph Versteegen <[email protected]> >> wrote: >>> >>> I haven't looked into it, but it looks exactly like the bug I just >>> fixed, indicating this is another serious bug. Who know what memory is >>> getting scribbled over this time. I'll try to look at it tomorrow. >>> >>> On 5 December 2013 07:14, James Paige <[email protected]> wrote: >>> > Ah, cool. That is interesting, and I think I mostly understand :) >>> > >>> > I have noticed since the fix that a warning now pops up a lot when >>> > loading a >>> > game in custom >>> > >>> > loading.rbas:1603, in loadherodata: unexpected node heroes:/hero >>> > loading.rbas:1603, in loadherodata: unexpected node heroes:/hero >>> > loading.rbas:1603, in loadherodata: unexpected node heroes:/hero >>> > loading.rbas:1603, in loadherodata: unexpected node heroes:/hero >>> > loading.rbas:1603, in loadherodata: unexpected node heroes:/hero >>> > loading.rbas:1603, in loadherodata: unexpected node heroes:/hero >>> > >>> > No actually problems seem to be occuring. I have poked around in the >>> > hero >>> > editor and as far as I can tell, everything is find. >>> > >>> > I am guessing this might just be a harmless spurious warning that didn't >>> > get >>> > noticed before because it was masked by the bug you fixed. >>> > >>> > --- >>> > James >>> > >>> > >>> > >>> > On Wed, Dec 4, 2013 at 5:36 AM, Ralph Versteegen <[email protected]> >>> > wrote: >>> >> >>> >> In order to avoid creating strings and doing lots of string >>> >> comparisons, readnode uses a variable length id-to-id mapping table >>> >> that allows it to just compare the internal ids that RELOAD Nodes >>> >> have. But that table (or rather the relevant entries in it) needs to >>> >> be created the first time it's used. Each function has a different set >>> >> of node names it uses in a readnode and thus asks to have inserted in >>> >> the table. The bug was that memory allocation was only done the first >>> >> time any function containing a readnode needed the table, rather than >>> >> any time entries need to be updated. >>> >> >>> >> Most uses of READNODE probably aren't so performance critical that >>> >> this approach helps. But I guess the real premature optimisation was >>> >> only updating the entries in the table needed for the *current* >>> >> function rather than just building a table that can be used from any >>> >> function. At some point I want to rewrite this system and simplify. >>> >> >>> >> On 4 December 2013 15:10, James Paige <[email protected]> wrote: >>> >> > Yay! Thanks for the fix. >>> >> > >>> >> > I read over the changes, but it went a bit over my head. But I am >>> >> > very >>> >> > glad >>> >> > it is fixed. >>> >> > >>> >> > Working with reload is getting pretty pleasant. I am getting more >>> >> > comfortable with using it. >>> >> > >>> >> > --- >>> >> > James >>> >> > >>> >> > >>> >> > >>> >> > On Tue, Dec 3, 2013 at 5:42 PM, Ralph Versteegen <[email protected]> >>> >> > wrote: >>> >> >> >>> >> >> Whoops, that was a pretty serious bug. Took me a while to >>> >> >> understand. >>> >> >> >>> >> >> On 4 December 2013 06:40, James Paige <[email protected]> >>> >> >> wrote: >>> >> >> > tmc, I have a puzzling READNODE error that I don't understand. >>> >> >> > >>> >> >> > If you open an rpg file that does not yet have any purchase >>> >> >> > information, >>> >> >> > and >>> >> >> > try to add a new product, the product node will be added to the >>> >> >> > general.reld >>> >> >> > reload document, but the purchase menu will not refresh properly. >>> >> >> > This >>> >> >> > debug >>> >> >> > warning appears in c_debug.txt >>> >> >> > >>> >> >> > customsubs.rbas:5420, in edit_purchase_options_rebuild_menu: >>> >> >> > unexpected >>> >> >> > node >>> >> >> > products:/prod >>> >> >> > >>> >> >> > If you try several times to add new products, the nodes will be >>> >> >> > added, >>> >> >> > but >>> >> >> > the above warning will repeat. >>> >> >> > >>> >> >> > If you exit saving changes and re-open the rpg file, the product >>> >> >> > nodes >>> >> >> > will >>> >> >> > now appear in the purchase menu, and the "Add new product" button >>> >> >> > will >>> >> >> > now >>> >> >> > work normally with no problems. >>> >> >> > >>> >> >> > --- >>> >> >> > James >>> >> >> > >>> >> >> > >>> >> >> > _______________________________________________ >>> >> >> > Ohrrpgce mailing list >>> >> >> > [email protected] >>> >> >> > >>> >> >> > >>> >> >> > http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org >>> >> >> > >>> >> >> _______________________________________________ >>> >> >> Ohrrpgce mailing list >>> >> >> [email protected] >>> >> >> >>> >> >> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org >>> >> > >>> >> > >>> >> > >>> >> > _______________________________________________ >>> >> > Ohrrpgce mailing list >>> >> > [email protected] >>> >> > >>> >> > http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org >>> >> > >>> >> _______________________________________________ >>> >> Ohrrpgce mailing list >>> >> [email protected] >>> >> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org >>> > >>> > >>> > >>> > _______________________________________________ >>> > Ohrrpgce mailing list >>> > [email protected] >>> > http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org >>> > >>> _______________________________________________ >>> Ohrrpgce mailing list >>> [email protected] >>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org >> >> >> >> _______________________________________________ >> Ohrrpgce mailing list >> [email protected] >> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org >> _______________________________________________ Ohrrpgce mailing list [email protected] http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
