[Ohrrpgce] Battle code refactoring

James Paige Bob at HamsterRepublic.com
Wed Sep 3 11:44:34 PDT 2008


On Thu, Sep 04, 2008 at 07:34:04AM +1300, Ralph Versteegen wrote:
> > I'd favour rewriting the whole text file with no slack every time.
> > It'd be a lot easier to deal with. You could keep the index consistent
> > (so string 20 remains string 20 even if you delete string 19 - 19
> > would be recycled later or left blank) but keep the actual data clean.
> > I don't think the overhead would be sufficiently bad to warrant some
> > complicated space reallocation. Although as long as the index is
> > right, I guess it wouldn't really matter if there were gaps in the
> > data.
> >
> > Cheers,
> > Simon
> 
> Well, I'll try that out, and if I get lag when editing textboxes in
> SoJ (3MB .SAY lump), I try out something else.

One "Something Else" to consider for very large games is to break the 
text box data up into text box ranges, like boxes 0-499 500-999 
1000-1499 or some such scheme. Then when text box data is written, there 
will be a maximum number of boxes to be re-written.

> Oh! I just realised, after seeing the question "How can I make more
> than two choices in a text box?" on the wiki, that we could/had
> suggested changing the way that the choicebox is implemented at the
> same time to be menu-based. Existing choiceboxes could be translated
> into menus (is this pointless?). I think it would be silly if 2-choice
> textboxes and 3-choice textboxes were made in completely different
> ways, and 3 choices are much harder.

I'm working on this right now. I do like having choice boxes tightly 
anchored to the boxes they go with.

Im going to have to solve some problems soon with draw-order and I want 
choice boxes to always be drawn together with the box they go with.

> At the least, when we allow menus to be linked to textboxes, it would
> be nice to be able to go to the menu editor and create a new menu
> straight from the textbox editor.

Yes, definitely!

> Maybe we can add tighter
> integration, like actually show the textbox while you are editing,
> have default settings for the menu and menu items appropriate to
> choice boxes, automatically name the menu, and so on. Ideas? Waste of
> time?

I am inclined (for now) to leave choice boxes pretty much as they are, 
and to just add menu integration separately into the text box editor.

---
James



More information about the Ohrrpgce mailing list