Author Topic: Camera placement  (Read 479 times)

Daniel3D

  • Joe's Friend
  • **
  • Posts: 442
    • View Profile
Re: Camera placement
« Reply #15 on: February 23, 2021, 11:37:08 PM »
I believe that the cameras are placed every 3 track pieces. Sometimes not in the middle but at the edge of the piece. The loop is two tiles but counts as one piece. Same for corners.
Ever tried, ever failed. Try again, fail better.

Duplode

  • Breaths Stunts
  • ******
  • Posts: 3888
  • Fear is your only god on the radio
    • View Profile
    • The Southern Cross Stunts Trophy
Re: Camera placement
« Reply #16 on: February 24, 2021, 01:00:00 AM »
Fantastic!  I really want to be able to use that tool!

This map was done with Cartography in pretty much the same way the race reconstitution videos are done, except that I replaced the auxiliary program which extracts car coordinates from the repldump output with one that does it for a trackdata dump (the dump itself was obtained using the DOSBox debugger). If all goes to plan, a new version of Cartography will be released within the next week or two with support for setting up this kind of visualisation.

So each track element has a "position-for-camera" that serves as a potential waypoint. My guess is that this is established in the GAME resource files, together with the walls and that.

There indeed is an element-specific camera position offset, though I didn't look into it too closely back in 2016. IIRC it is defined into the executable, alongside other element information such as the connectivity flags.

I believe that the cameras are placed every 3 track pieces. Sometimes not in the middle but at the edge of the piece. The loop is two tiles but counts as one piece. Same for corners.

It does seem this three-element pattern is the primary rule used by the game. In Default, there is only one sector where it is not followed: the beginning of the long way (there is an extra camera just after the split, then the next one is four elements ahead).

Cas

  • Master of Opponents
  • ***
  • Posts: 877
  • Think different. That's OK... as long as you think
    • View Profile
    • Dimioca Labs
Re: Camera placement
« Reply #17 on: February 24, 2021, 04:11:31 AM »
What I'm feeling is, as I was saying, that perhaps it's not how many tiles ahead, but how much distance from the previous camera position. This distance is fixed and Stunts is looking for the tile camera position that's nearest that distance from the previous camera and on the same path. This would explain why most of the times it is every three tiles, but not always. If this is so, when it takes four tiles, it's because the place where the camera would go at that tile is nearer that fixed distance from the previous camera than the place in the previous tile.

So are you manually reading the memory dump?  I thought you were using something like rpldump to automatically obtain a file that Cartography would read. By the way, where do I get rpldump?
Earth is my country. Science is my religion.

Duplode

  • Breaths Stunts
  • ******
  • Posts: 3888
  • Fear is your only god on the radio
    • View Profile
    • The Southern Cross Stunts Trophy
Re: Camera placement
« Reply #18 on: February 25, 2021, 12:07:27 AM »
On the cameras being positioned according to Euclidean distance: I'd find that surprising, as it seems most of the other track setup and checking is based on tile and element counting. But then again, some of those exceptions are really strange, specially that one with the dangling 1x1 split.

On reading memory dumps: the usual procedure, which I use for the videos, is (1) generate the binary dump from the RPL with repldump; (2) extract the relevant data from the dump to a text file with an auxiliary tool; and (3) have Cartography read the text file. The main difference is that this time for step 1 I manually created the dump with the DOSBox debugger because repldump doesn't dump trackdata. Steps 2 and 3 were largely the same.

(I could obviate step 2 by making Cartography read the binary dump directly, and I'll likely implement that at some point. Still, it can be convenient to be able to look at the data in a human-readable text format.)

On repldump: you can get the executable from Southern Cross and the sources from restunts' SVN repository at svn://anders-e.com/restunts/trunk/restunts . (Next time I boot into Windows I'll try building it from source. It would be useful to be able to tweak a few things in it.)
« Last Edit: February 25, 2021, 12:34:51 AM by Duplode »

Cas

  • Master of Opponents
  • ***
  • Posts: 877
  • Think different. That's OK... as long as you think
    • View Profile
    • Dimioca Labs
Re: Camera placement
« Reply #19 on: February 25, 2021, 09:23:55 PM »
Thanks!  I'll take a look at it :)  By the way, does the default installation of DOSBox allow for memory dumping or did you have to install any mod to it?  I don't know how to generate this dump
Earth is my country. Science is my religion.

Duplode

  • Breaths Stunts
  • ******
  • Posts: 3888
  • Fear is your only god on the radio
    • View Profile
    • The Southern Cross Stunts Trophy
Re: Camera placement
« Reply #20 on: February 26, 2021, 12:05:34 AM »
The default DOSBox installation doesn't include the debugger. To enable it, you have to give configure the --enable-debug option when building it from source. Two relevant threads from the official DOSBox forums: an usage guide, and a Windows binary.