Results 1 to 10 of 121

Thread: G.T.A.2 Map Editor

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #33
    Any ideas how implement undo redo guys?
    I have tried several Delphi units for undo/redo, even with command patters and state machines. Even dig out some website archives for SHAREWARE (!) Delphi units for creating undo / redo and mailed to authors of them to get the units for free (without much hope for any response).
    Etc.

    I got them but nothing works for me. I see "lots" of examples that use simple TBitmap.SaveToStream method.
    Its neat and easy way to make undo / redo.

    But how about 3D map editor like this?
    Map is 256x256x8 (W*H*Z), i only draw small portion of it (20x20).

    I guess i have to invent "gamemap.portion.savetostream" command.

    Whole uncompressed map takes 6MB of disk space, depending how complex map is. But 6MB is minimum for empty map.
    So saving whole map each time is not way to go. it would work for small tilemaps / tilemap editors, but not in this case.

    One way would be just save all the blocks in current view but if camera moves, then what to do?
    I tried that without moving cam, it seems to work, its buggy a bit, i just cant think clearly atm why its buggy, i have to eat and come back to this.

    When camera moves i guess i have to remember the offset to the place where previous undo / redo was made or something and undo / redo in that area, or make some record and in record make a member called XYZpos for storing the start position of the area where the changes were made, dunno something like that maybe.

    Map has so easy format, i didnt know that making a undo/redo will be so difficult for this.
    I have read that if you dont think about undo/redo at the first time you create your app, integrating later any of the algorithms for undo/redo will be difficult.

    So i guess here i am.

    I could modify my rendering function if i could reorganize my map array somehow.

    This is where i need your help / tips / tricks / ideas how to do it.
    Even some pseudo code would help i guess.

    Thanks.
    Last edited by hwnd; 02-08-2013 at 03:57 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •