Payload track generating program (WiP)

Discussion in 'Mapping Questions & Discussion' started by Sergis, Feb 25, 2012.

  1. Sergis

    aa Sergis L666: ])oo]v[

    Messages:
    1,870
    Positive Ratings:
    1,130
    Reading through YM's autobrush thread, I got inspired to do some coding. This is the result of 3 days of me trying to remember how to code.

    [​IMG]

    dl link : http://dl.dropbox.com/u/9180221/trackgen/payloadtrack.exe

    source code: http://dl.dropbox.com/u/9180221/trackgen/main.cpp

    This program expects a .vmf with a payload track laid out and a single path_track present at the start of the track. It will then place path_tracks on all the trackpieces and connect the nearest ones, starting from the pre-placed one. It will save the file as enteredfilename_t.

    Right now it can only handle the simpliest tracks. Tracks with crossovers, plr, multistage maps are beyond its capabilities to lay a useful track on. Even on simple tracks, mistakes happen every now and then :p

    One big and stupid bug I have now is that this program doesn't read most files' entities to the end, stopping and telling that the initial path_track was not found. A workaround to this problem is opening the .vmf with notepad, finding the path_track entity and cut and pasting it higher up in the file.

    I needed to do this workaround when testing the program on both my batt2 map and sdk_cp_badwater. The track generated for batt2 was pretty good, needing only some height adjustments at slopes, adjusting the beginning and path_tracks under control points. The track generated for badwater had quite a few path_tracks placed as if underlying trackpiece was rotated differently :p

    To do list:
    - fix the filereading bug
    - add autoplacing the cart and game logic
    - proper path_track placement code for rotated track pieces
    - proper path_track linking in the beginning of the track
    - control point i/o
    - link the path_tracks sharing the trackpiece to enable crossovers
    - limit the distance to the next trackpiece so there are no links across the map
    - fix crashing when there is only one trackpiece on the map
     
    • Thanks Thanks x 4
    Last edited: Feb 25, 2012
  2. Penguin

    aa Penguin Clinically Diagnosed with Small Mapper's Syndrome

    Messages:
    1,992
    Positive Ratings:
    1,233
    make one that auto-generates a path layout, so we can build maps around those.
     
    • Thanks Thanks x 2
  3. Sergis

    aa Sergis L666: ])oo]v[

    Messages:
    1,870
    Positive Ratings:
    1,130
    given the success of batt contest, i dont really want to :p
     
  4. Penguin

    aa Penguin Clinically Diagnosed with Small Mapper's Syndrome

    Messages:
    1,992
    Positive Ratings:
    1,233
    batt was bad because of a bad track.
     
    • Thanks Thanks x 1
  5. Sergis

    aa Sergis L666: ])oo]v[

    Messages:
    1,870
    Positive Ratings:
    1,130
    I think Ezekel is making a random track generator. I want to at least fix the filereading bug and finish a map before coding something else :p
     
  6. Lancey

    aa Lancey Currently On: ?????

    Messages:
    3,076
    Positive Ratings:
    1,314
    Why stop there? Just make a program that randomly generates a payload map.
     
  7. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,557
    Why stop there? Why not make a program that just generates entire games?
     
  8. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    4,102
    Positive Ratings:
    5,982
    They've been using one of them at Activision for years.
     
    • Thanks Thanks x 5
  9. Lancey

    aa Lancey Currently On: ?????

    Messages:
    3,076
    Positive Ratings:
    1,314
    Hey.

    They had to add the slow motion parts by hand.