Author Topic: first alpha version of StuntsVM is ready  (Read 2198 times)

llm

  • Stunts Maniac
  • *
  • Posts: 54
    • View Profile
first alpha version of StuntsVM is ready
« on: August 13, 2015, 08:26:48 PM »
its some sort of Dosbox but based on Fake86 (http://sourceforge.net/projects/fake86/) and only able to emulate the environment enought to run stunts

the zip contains 3 files

game_pc.exe - the 16bit dos game, build with clvn's execombiner and my own sound driver integration tool for pc-speaker sound
stuntsvm.exe - executes/emulates game_pc.exe
SDL.dll - for Keyboard/Mouse/Gfx (https://www.libsdl.org/)

copy these into your stunts directory (where the tracks, sound and others files are - but make a backup before) and run stuntsvm.exe

what can you do with stuntsvm - test and play - for me its the base of my statical recompilation ideas for stunts




Duplode

  • Considering trying out spam
  • *******
  • Posts: 3430
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: first alpha version of StuntsVM is ready
« Reply #1 on: August 14, 2015, 06:41:08 PM »
Cool! I did a very quick test under Wine, and noticed two things:

  • Very minor issue: files with names longer than 8 characters are ignored (I mention this mostly to remind other testers to rename their files if need be).
  • More significantly: the physics do not seem to be 100% faithful yet. Both Gutix's ZCT070 replay and Akoss' ZCT168 one fail to complete. In the former, the car crashes at various points, depending on how much you rewind it, while in the latter the car is oddly deflected rightwards while climbing a hill at ~34s. Those issues should probably be confirmed by reproducing them in an actual Windows system (as opposed to Wine).
« Last Edit: August 14, 2015, 06:58:18 PM by Duplode »

llm

  • Stunts Maniac
  • *
  • Posts: 54
    • View Profile
Re: first alpha version of StuntsVM is ready
« Reply #2 on: August 14, 2015, 10:12:28 PM »
Quote
Very minor issue: files with names longer than 8 characters are ignored

my DOS-File-API emulation does not support long filenames - easier to implement

Quote
More significantly: the physics do not seem to be 100% faithful yet. Both Gutix's ZCT070 replay and Akoss' ZCT168 one fail to complete. In the former, the car crashes at various points, depending on how much you rewind it, while in the latter the car is oddly deflected rightwards while climbing a hill at ~34s. Those issues should probably be confirmed by reproducing them in an actual Windows system

thats bad - can you attach the replays so i can compare real DOS/dosbox and stuntsvm? maybe the hardware timer isn't correctly programmed

Duplode

  • Considering trying out spam
  • *******
  • Posts: 3430
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: first alpha version of StuntsVM is ready
« Reply #3 on: August 14, 2015, 10:55:21 PM »
can you attach the replays so i can compare real DOS/dosbox and stuntsvm?

Here they are. The Z168 lap was arbitrarily chosen, but I picked the Z70 one because full powergear replays are trickier to get right - even the original game engine gets confused with them sometimes. I can suggest additional test cases if/when you need them.

llm

  • Stunts Maniac
  • *
  • Posts: 54
    • View Profile
Re: first alpha version of StuntsVM is ready
« Reply #4 on: August 15, 2015, 08:37:36 AM »
Quote
reproducing them in an actual Windows system

so what was your compare system - linux/dosbox, a real dos-machine?

Duplode

  • Considering trying out spam
  • *******
  • Posts: 3430
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: first alpha version of StuntsVM is ready
« Reply #5 on: August 15, 2015, 01:42:39 PM »
so what was your compare system - linux/dosbox, a real dos-machine?

Linux/DOSBox, which is how I usually play Stunts. It is safe to use DOSBox as a reference for physics: out of several thousand competition replays there are no known cases of divergences between laps played in DOSBox and in real DOS. (By the way, in the previous post I forgot to mention that I managed to reproduce the issue with StuntsVM running in a Windows XP virtual machine.)
« Last Edit: August 15, 2015, 02:34:41 PM by Duplode »

llm

  • Stunts Maniac
  • *
  • Posts: 54
    • View Profile
Re: first alpha version of StuntsVM is ready
« Reply #6 on: August 16, 2015, 09:37:52 AM »
so what are exactly the steps (1.,2.,3.) i need to take to see the "bug" - reproduceable for both replays

Duplode

  • Considering trying out spam
  • *******
  • Posts: 3430
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: first alpha version of StuntsVM is ready
« Reply #7 on: August 17, 2015, 12:52:47 AM »
so what are exactly the steps (1.,2.,3.) i need to take to see the "bug" - reproduceable for both replays

Load the replays from the "Option" menu, rewind to the beginning with the "|<" command, and watch them at normal speed. In the Z168 replay, the car will leave the track unnaturally at ~34s; in the Z70 one, the car will land on water at ~50s. (Note: If you rewind the Z70 replay after the sinking and play it again it will crash at a different point. That in itself is not an issue, as such things occasionally happen with powergear replays in the original game.)  In the original executable, both laps are completely successfully by following the same steps.

llm

  • Stunts Maniac
  • *
  • Posts: 54
    • View Profile
Re: first alpha version of StuntsVM is ready
« Reply #8 on: August 17, 2015, 07:22:18 AM »
it seems that fake86 already got that problem

llm

  • Stunts Maniac
  • *
  • Posts: 54
    • View Profile
Re: first alpha version of StuntsVM is ready
« Reply #9 on: October 04, 2015, 02:52:18 PM »
StuntsVM is much slower compared to DosBox (or better said inaccurate) - because of the missing dynamic core - could it be that stunts got these errors if the environment is too slow?

Friker

  • Otto's Student
  • **
  • Posts: 385
    • View Profile
Re: first alpha version of StuntsVM is ready
« Reply #10 on: March 03, 2016, 04:57:26 PM »
With Dosbox config:
[cpu]
#      core: CPU Core used in emulation. auto will switch to dynamic if available and appropriate.
#            Possible values: auto, dynamic, normal, simple.
#   cputype: CPU Type used in emulation. auto is the fastest choice.
#            Possible values: auto, 386, 386_slow, 486_slow, pentium_slow, 386_prefetch.
#    cycles: Amount of instructions DOSBox tries to emulate each millisecond.
#            Setting this value too high results in sound dropouts and lags.
#            Cycles can be set in 3 ways:
#              'auto'          tries to guess what a game needs.
#                              It usually works, but can fail for certain games.
#              'fixed #number' will set a fixed amount of cycles. This is what you usually need if 'auto' fails.
#                              (Example: fixed 4000).
#              'max'           will allocate as much cycles as your computer is able to handle.
#           
#            Possible values: auto, fixed, max.

core=simple
cputype=386
cycles=fixed 1000


which should mimics non-dynamic core, running in Linux Gutix's replay ran OK. Well - i did not notice up until today that this game has SLOW and FAST simulation options!! :D I do not know differences and impact on replays. I guess everyone has set up a fast simulation option. Gutix's replay ran OK with both options.

I think almost all bugs in Stunts has something with over/uderflow of registers/variables. If I understand correctly  game_pc.exe is a re-compiled executable. Are you there are registers/variables exactly the same size as in the original game?

Duplode

  • Considering trying out spam
  • *******
  • Posts: 3430
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: first alpha version of StuntsVM is ready
« Reply #11 on: March 04, 2016, 04:44:56 AM »
I think almost all bugs in Stunts has something with over/uderflow of registers/variables.

I believe power gear has something to do truncation handling, though it seems entirely possible it being an over/underflow triggered by bad truncation. I probably should have investigated it further back when I was messing with restunts stuff  ::)

Friker

  • Otto's Student
  • **
  • Posts: 385
    • View Profile
Re: first alpha version of StuntsVM is ready
« Reply #12 on: March 04, 2016, 09:20:54 AM »
I think almost all bugs in Stunts has something with over/uderflow of registers/variables.

I believe power gear has something to do truncation handling, though it seems entirely possible it being an over/underflow triggered by bad truncation. I probably should have investigated it further back when I was messing with restunts stuff  ::)

A-ha. Still, let's assume different handling of PG is caused by truncation differencies. And truncation differencies are probably caused by register/variable bit-size, aren't they? Does restunts code uses same-precision floats as the original game etc.?

Btw is restunts code somewhere available? No that I would understand it, but I have more time to look at some random characters now. :)

Duplode

  • Considering trying out spam
  • *******
  • Posts: 3430
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: first alpha version of StuntsVM is ready
« Reply #13 on: March 05, 2016, 11:58:23 PM »
Btw is restunts code somewhere available? No that I would understand it, but I have more time to look at some random characters now. :)

There is a repository at svn://anders-e.com/restunts/trunk (cf. this post), but I kind of lost track of the latest developments. I suggest you ask dstien for (possibly updated) directions.

clvn

  • Stunts Fan
  • *
  • Posts: 19
    • View Profile
Re: first alpha version of StuntsVM is ready
« Reply #14 on: March 16, 2016, 03:36:22 PM »
this game has SLOW and FAST simulation options!! :D I do not know differences and impact on replays. I guess everyone has set up a fast simulation option. Gutix's replay ran OK with both options.

The game runs some relatively heavy code during startup and measures how much time it takes.  Based on the amount of time, the game runs in either 10 FPS or 20 FPS IIRC. DosBox' emulation flags obviously affect the timing code. Also the FPS is saved in replays, which affects how the replay is played back on other slower/faster machines as well.

The measurement code has been ported and can be seen here (near the comment "// Timing measures.")
http://anders-e.com/code/browser/restunts/trunk/restunts/src/restunts/c/restunts.c#L1334

Quote
I think almost all bugs in Stunts has something with over/uderflow of registers/variables. If I understand correctly  game_pc.exe is a re-compiled executable. Are you there are registers/variables exactly the same size as in the original game?

The stunts code that has been ported to C so far has been written carefully to retain any important weirdness, so indeed the registers/variables should be exactly the same size as in the original game.

Looks like its been almost a year since anybody last worked on this. The source can be browsed in its entirety online here:

http://anders-e.com/code/browser/restunts/trunk/restunts