1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. GTA Network forum is now in archive mode.

Server side height map

Discussion in 'Scripts' started by Draex, Apr 15, 2017.

  1. Draex

    Draex Active Member

    Messages:
    64
    Likes Received:
    31
    Joined:
    Apr 2, 2017
    Ladys n' Gents, I may present you a way to generate and embed a server side height map :=o

    First of all: What is it good for, why not just use the client sided getGroundHeight()?
    A client sided get ground height isn't very useful when you're doing thing server sided like placing objects and so on. For some gamemodes it's essetial that you can get the ground coordinate for a given point.

    Was such a script written before?
    Yes and no, It was done before in SA:MP (MapAndreas) but not for GTA V.
    My goal for this script was too keep the code universal, so that it can be reused easily in any other modable GTA game.

    Where can I get the map?

    Nope. Can't just download the map, you'll have to generate it by yourself. Go to the Github repository and clone it. Please read the description there, I was to lazy to repost the entire stuff here again (sry). BUT: If you don't know python please just skip that part, I'm not willing to give 24/7 support for coding beginners (sry again :=P).
    For those of who are advanced coders, there are plenty of configurable parameters, so you can adjust the script as you want (e.g. the map resolution)

    How does the script work?
    The c# script isn't actually very complicated, it just moves you arround from the left to the right map boarder, slowly increasing your y coordinate. While doing that the script graps the heightdata in a rectangle(cell) around the player. The most complicated thing was too find out the right size for those cells (This took so freaking long)
    The python script can be used to unite several maps to an almost completly correct one.
    It uses numpy(which is implemented in c) to create the correct map. If you wan't to know more about that, just look in the source code.

    Why have I published this?
    As many of you probably have discovered already, I'm also working on a GTA:N Server.
    This server needs (as many big gamemodes) a height map for better object placing,
    placing markers on the ground, a lot of development crap, and so on. We agreed on that we will release parts of the script, that are usefull for everybody and aren't specific for our gamemode, so this won't be the last thing ;-) . By doing this we want to help to push GTA:N so that it will become as famous as SA:MP one day.

    Yeah I want to see some Images!
    Here ya go:
    [​IMG]

    And one above the sealevel:
    [​IMG]
    The screens are done with pythons matplotlib, just do some research on it.

    How to embed it?
    I've rewriten the script we're using on our server for general purpose, you can use that (it's also in the repo).
    The server uses it's own Math lib including a class Vector2D, which can be filled to a 3D Vector with using vec.dim3ground(). In our development this was pretty handsome so far, so if you're about to make a big gamemode, you should go for something like that

    Have fun & Cheers!
     
    Last edited: Apr 15, 2017
    VFRZ, Shepard, Trust37 and 3 others like this.
  2. MissMelissa

    MissMelissa New Member

    Messages:
    0
    Likes Received:
    0
    Joined:
    Dec 26, 2016
    The github link goes to MapAndreas, not your own repository, I guess that's a mistake in your post.. :=P
     
    Draex likes this.
  3. Renato

    Renato Member

    Messages:
    31
    Likes Received:
    17
    Joined:
    Jan 22, 2017
    Glad to see people from samp contributing with really good content.
     
    Draex likes this.
  4. Draex

    Draex Active Member

    Messages:
    64
    Likes Received:
    31
    Joined:
    Apr 2, 2017
    Whoops, fixed the link
     
  5. MissMelissa

    MissMelissa New Member

    Messages:
    0
    Likes Received:
    0
    Joined:
    Dec 26, 2016
    Nice job, code looks solid :=)
     
  6. Adam

    Adam Staff Member Administrator Webmaster Developer

    Messages:
    275
    Likes Received:
    146
    Joined:
    Apr 3, 2016
  7. Ficho

    Ficho New Member Donator

    Messages:
    3
    Likes Received:
    0
    Joined:
    Apr 13, 2017

Share This Page