Page 1 of 13 12311 ... LastLast
Results 1 to 10 of 121

Thread: G.T.A.2 Map Editor

  1. #1

    Exclamation G.T.A.2 Map Editor

    Hello all.
    I decided to show my project here finally. I have been working on it already 5 years or so.
    Started somewhere in 2008. Because GTA2 is my one and only most favorite game i still work on this thing.
    I have been rewriting it many many times, i had different problems with it, specially the picking blocks with mouse, i tried (i think) every picking method there is in OpenGL and finally found a nxPascal with it's picking code and my problems were solved. With lot's of invaluable help from User137. Thank you very much.

    Reason for doing this project is that it's good way to discover new ways of doing things in Delphi (Pascal) and OpenGL and discover and learn old / new things and most important, it's fun. It's my favorite game as i said.

    There are lot's of features to add, but the top thing for me is to add lighting to editor like in original map editor for it (it uses DirectX). The rest is easy.

    I have plan to add support for GTA (i.e GTA1) also, because they use similar data formats. Very few people play GTA1 but it's also very fun game, although with a bit poor gfx. But i has some things that GTA2 doesn't have like motorcycles which you can drive.

    Editing / adding Map objects, map zones, sounds, tile animations etc, many cool and interesting things will be added.

    You can see many of the videos on my YouTube channel:

    Latest video shows the status of the newest renderer

    It has problems with 4 slopes currently. At least i didn't see problems with other slopes so far.
    This is easy to fix. The picking is working in that vid, but i didn't show it.

    Im focusing right now creating a simple GUI for editor now in Delphi, the i can slowly build up from there.
    Atm it's just form with rendered map because i wanted to make core things to work first.
    I.e cam movement, flat (transparent faces), tile flipping / rotation, debugging slopes etc.

    Yesterday i made the picking to work on whole map, instead of initial X: 0..15, Y: 0..15 range.
    Easy thing.
    There are few things to complete with picking, slopes and flat faces (i noticed that some faces need special handling). It's a matter of just adding few boolean operators to code (and, or, not).

    There is lot's of room for optimizing and speeding up both the rendering and picking.
    For ex: rendering is done currently with glBegin glEnd. These i will replace with vertex arrays later.
    Hopefully i must not mess with my vertex constants again to use vertex arrays.
    glbegin glEnd is just easier to debug my verts.

    I am developing this thing in Delphi 7 Personal or Turbo Delphi 2006 and using only freeware components, no shareware involved! Also im using few dll's made in C++, to allow Delphi to use neat things like std::map etc.

    There is lot's to write about this thing, but i will add more later. Just keep looking my thread here and the first post also for updates.

    Please post your comments, ideas, thoughts etc on this project.

    Thanks for reading!
    Last edited by hwnd; 24-01-2013 at 10:07 PM.

  2. #2
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    very nicely done, love the music

  3. #3
    Thanks. I thought that people will say "remove the music". But i think silent videos are not very good.
    Next vid hopefully shows more stuff and is longer.

  4. #4
    Just posting this as log.

    About these 4 slopes, actually they are just are copy of one slope of same type. Just with different rotations.
    It's tricky because they can have different shape, if slope has LID face then it has one shape, if it doesn't have LID then it has second shape or form.
    I completed one slope, now i will just mathematically rotate it (thanks to nxPascal great and neat code again) but rendering of these slopes is also tricky, including picking. I saw that when messing with these 4 slopes i messed up drawing of some faces for other slopes.
    The block (or slope) drawing code tries to be general for all slopes. But if there is bad boolean logic, it messes up other faces. The code is also pretty messy atm. I must rewrite it. The whole logic is there just few boolean functions returning me "true" or "false" and some logical boolean ops like "and "or" "not".
    It's very boring stuff to work on, but i must fix this asap. How the map is rendered and how the picking works depends on this stuff.

    Now i gtg to work.


  5. #5
    You didn't post about the boolean logics as code But you can msg me in Skype/MSN later if want to.

  6. #6
    The logic is pretty tricky there. It's hard to figure out things if code is badly formatted and contains lot's of commented out lines of code from debug time. In my case this quickly builds up and i have source where most of the space is wasted by commented out lines. So i started to rewriting this thingy and that's the reason why i wanted to init nxPascal with button (actually menu item later). So i can slowly move on with GUI. And at the same time continue with rendering part.

    And that initializing stuff stopped me. I will try to make this work first. I will let you know how it goes.

    Of course im not rewriting this from 0 again, it's just i wanted to move on with GUI and move the existing code to this fresh GUI and at the same time cleanup and debug my code.

    Also from the video above it's possible to see that flat (transparent) faces bug, graffiti on the walls, Z fighting (flickering). Not a big problem but just looks bad for eyes. Nothing else.
    I have to add some very small value to flat vertices, like 0.001 or 0.01 or something like that.
    Last edited by hwnd; 29-01-2013 at 09:17 PM.

  7. #7
    Little log again.

    I worked on the editor GUI and added many things and debugged at the same time.
    I added the docking tiles panel where the tiles will be drawn later (on the grid) and some tile info (like small selected tile preview). For docking panel i used old but working component DockPanel from

    (DockPanel is a component which was originally created for the open perl IDE. This release has been modified to be substantially easier to use, requiring virtually no code to actually impliment it, and a few new features including tabposition, and Tabtype (Icon or strictly text). This produces a docking style similiar to that which is seen in Delphi, and Homesite.)

    Does it's job very well and it's very easy to get up and running. Whats even better, it saves it's positions. I don't have to do anything. Also made the menu items to show and hide the side panels, including tiles panel. Made the shortcuts to work.
    Messed with FormShortCut handler to handle any shortcuts or things except the 4 arrow keys. I will handle these by my own:
    procedure TfrmMain.FormShortCut(var Msg: TWMKey; var Handled: Boolean);
    var Key: Word;
      if MenuToolbar.IsShortCut(Msg) then
        Handled := True;
      Key := Msg.CharCode;
      //We handle arrow keys by our own
      if Key in [37..40] then
        Handled := False
        Handled := True;
    I need this so that arrow keys will not mess with components on the form like some Listboxes or buttons, in old versions of editor i had this problem. Arrow keys were messing up everything.
    This handles the issue for me.
    Also i figured out why nxPascal didn't receive a Key values in GameLoop. That was that shortcut thingy again.
    Now it works and i can move my camera movement to gameloop now.

    That's it for now. I must wake up early so i will go to sleep.
    Last edited by hwnd; 30-01-2013 at 01:55 AM.

  8. #8
    I was surfing whole day on he net and found a good tutorial how to make dynamic and more than 8 lights with opengl.
    I downloaded the example, messed around with it alot to understand what he is doing.
    He used simple .obj model for lighting effect but i slowly added my own test vertex coords from map editor and i got it working with my vertices. The results look very very promising for me, im very happy with results so far.

    I believe i can show lights like these in my editor very soon:
    Last edited by hwnd; 03-02-2013 at 07:04 PM.

  9. #9
    Nothing much to write atm but i took a small break from this thing. Currently im working on that "logic" that draws the transparent faces (walls) and with some slopes that had problems previously, fortunately there is only 4 of them that need special handling when rendering them.

    Im making them work face by face. Easier in that case. Not writing all out and then debugging.
    Found more lighting examples, but i must review each of them, find their pros and cons and find one that works at the best in my case.

  10. #10
    Worked a bit on generation of minimaps (map thumbnails) (256x256 in size). Few examples:

    It's not final ofc. I noticed some small problems with it. It's skips some things.
    Last edited by hwnd; 10-02-2013 at 08:32 PM.

Page 1 of 13 12311 ... LastLast

Tags for this Thread


Posting Permissions

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