Payload track generating program (WiP)

Sergis

L666: ])oo]v[
aa
Jul 22, 2009
1,874
1,257
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.

trackgen.jpg


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
 
Last edited:

Penguin

Clinically Diagnosed with Small Mapper's Syndrome
aa
May 21, 2009
2,039
1,484
make one that auto-generates a path layout, so we can build maps around those.
 

Penguin

Clinically Diagnosed with Small Mapper's Syndrome
aa
May 21, 2009
2,039
1,484
batt was bad because of a bad track.