Page 7 of 13 FirstFirst ... 56789 ... LastLast
Results 61 to 70 of 121

Thread: G.T.A.2 Map Editor

  1. #61
    Quote Originally Posted by User137 View Post
    I would do 2) to hold 256x256 colored vertex array for the pixels.
    Why bothering with veticles if you can simply do this with normal pixels. You can always stretch that texture to fit the desired size if needed.

    Quote Originally Posted by User137 View Post
    You can optimize it by having a boolean variable "minimapChanged". Every time you draw to tilemap it is set True. Then every half second check if it's True. If it is, then set it False and generate the minimap texture again.
    Why not change minimap texture as soon as you do any change to the map? Since you are usually changing one tile at a time this means that you only need to change one pixel or smal portion of your map if it is generated from map-specific mini sprites. I mean there is absolutely no need to redraw the whole map but only change the relevant part of it.

    As for your suggested approach that is more suitable to be used inside a game where map changes are more rapid (unit movments etc.) but in map editor there is no use of that.

  2. #62
    Oh you mean altering the texture data directly. Well, you might have glTexSubImage2D(), but i don't have experience of that.

    With normal methods you aren't able to change just 1 pixel, but render the whole minimap. Besides when you're editing the map you are watching the main screen where cursor is. By the time you move your eyes to minimap, with 500ms interval it would already be updated. And in the playing mode the minimap is normally not changing. Or if it, you can have an additional transparent map texture for dynamic objects.

    I just uploaded new nxPascal to SVN, with change to framebuffer demo. I had previously left it with window size locked to framebuffer size 512x512, but now it works with any window size, to emphasize the fact that screen buffer size has nothing to do with texture size.

  3. #63
    Quote Originally Posted by User137 View Post
    Oh you mean altering the texture data directly. Well, you might have glTexSubImage2D(), but i don't have experience of that.
    To be honest I also don't have much expirience with this, especially on OpenGL level. I did try once achiving this using Aphyre Sphinx TAsphyreLockableTexture which provides you with acces to each pictures pixel if needed but I don't know which OpenGL cal the Asphyre Sphinx makes for this to work.
    Another way would be to simply use ordinary TBitmap to store minimaps data and then render this butmap on screen (many graphical engines alows doing this).


    Quote Originally Posted by User137 View Post
    Besides when you're editing the map you are watching the main screen where cursor is. By the time you move your eyes to minimap, with 500ms interval it would already be updated.
    @User137 if you need 500ms to change your eyes focus from one point on the monitor to another you gotta be getting realy old
    Plese don't be ofended by my previous statement but 500ms is enough for average human not ony change the focus of his eyes from one point to another but to even turn his head for about 30 degres.
    Also you have to asume that user decides to change his eyes focus at the same time he decides to do a mouse click. And since it takes a bit of time from the pint when you decide to do mouse click and actually do it your eyes could already be on the half way to destination focus point.


    Quote Originally Posted by User137 View Post
    And in the playing mode the minimap is normally not changing. Or if it, you can have an additional transparent map texture for dynamic objects.
    Yes using multiple layers for ingame minimaps is quite often especially if the minimap background is made from series of so caled minisprites.

  4. #64
    Quote Originally Posted by SilverWarior View Post
    if you need 500ms to change your eyes focus from one point on the monitor to another you gotta be getting realy old
    Plese don't be ofended by my previous statement but 500ms is enough for average human not ony change the focus of his eyes from one point to another but to even turn his head for about 30 degres.
    Also you have to asume that user decides to change his eyes focus at the same time he decides to do a mouse click. And since it takes a bit of time from the pint when you decide to do mouse click and actually do it your eyes could already be on the half way to destination focus point..
    That was just an example Main part is still that you shouldn't do the texture-memory update in the event of mousemove, but at the beginning of render function, all changes at once, and only if there are changes. 500ms is just an example, might aswell be 100ms. Take a look at Starcraft 2 editor for example. While you are painting terrain and moving mouse rapidly, no changes to minimap are done. But if cursor is on 1 spot for about 500ms or release mousebutton, then update happens. These are just optimization tricks for when they are needed. Like if your minimap means actual polygon rendering of the whole world, with light environment and everything.
    Last edited by User137; 18-04-2013 at 05:14 PM.

  5. #65
    Working few days already on this thing. Today i messed again with selection boxes and noticed that Delphi 7 either has bug or it just has to be that way..

    Here is snippet from drawing of block selectors:
    Code:
                    glTranslatef(
    
                      Iff(frmMain.XPositive,(selcount2+selx), (-selcount2+selx))-0.5, // 1
    
                      Iff(frmMain.ZPositive,(selcount+selZ), (-selcount+selZ))-0.5,  // 2
    
                      Iff(frmMain.YPositive,(selcount1+selY), (-selcount1+selY))-0.5, // 3
                      
    
                    );
    You see comments there 1..3 at the end of the lines. So at the 3 comment you see the comma?
    Delphi 7 compiles without any error, which is strange, but if i put anything after the comma, it will give error, "too many parameters".


    My D7 is very slow for some reason and hangs when compiling, then wakes up and runs my project, maybe i will have to format my laptop again.
    So i decided to look how fast the compiling is done in XE.
    I must say that even heavy XE on my old poor laptop here is faster than D7 IDE.
    Dunno how that could be.

    So i opened this project in XE and this immediately generated error that there is too many parameters, he saw the comma there.

    So what is this? Bug or hidden feature? D7 just ignores commas, if there is no actual values after such "final" commas?

    I didnt notice that comma was there, its a XE which pointed me to that.
    Last edited by hwnd; 28-07-2013 at 03:23 PM.

  6. #66
    Quote Originally Posted by hwnd View Post
    My D7 is very slow for some reason and hangs when compiling, then wakes up and runs my project, maybe i will have to format my laptop again.
    Maybe you wanna check your antivirus software. If you have residental protection on and in depth heuristic scanning enabled and your final exe contains quite some resources in it, it could take a while before antivirus finish scanning it (it actually extracts the resources from your exe and checks them seperately).

    It is posible that your are slowly running out of free disk space on your system partition whoich could lead to files which are saved in Temp folder to be higly fragmented which could lead to slowdowns. D
    efragmenting your hard drive might improve this. Also as a general note I recomend having athleast 1GB of fre HDD space on your primary partition or in case of dynamic alocatable page file size even more free space. I ususlly have fixed size of page file set to 150% size of my RAM.
    Having fixed sized page file could mean great difference on Windows XP as the pagefile tends to become realy fragmented othervise.
    Another thing that might lead to such problems is partially damaged sector on your hard drive which is causing slowdowns.

  7. #67
    I dont have any AV, this lap. is too slow and old, if i install one of these and it starts scanning and watching in background, it will take years to compile each time.

    I have divided the HDD to 2, part. C: has 37GB (14.3GB free) and part. E: 37GB (30.2GB free).
    Sometimes reinstalling Delphi helps me.

    But i will try to find out what it is later, have to do backups first.

  8. #68
    PGDCE Developer
    Join Date
    Oct 2011
    Location
    Blumenau/SC, Brazil
    Posts
    17
    Try Andy's IDE Tools if you don't use them already.

    http://andy.jgknet.de/blog/

  9. #69
    I have Speedup installed.

    What about the actual problem i posted? Is this Delphi bug or feature?

  10. #70
    It's a buggy feature. This compiles on D7
    Code:
    function test(a, b, c: integer): integer;
    begin
      result:=a+b+c;
    end;
    
    procedure test2();
    begin
      test(1, 2, 3,);
    end;

Page 7 of 13 FirstFirst ... 56789 ... LastLast

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
  •