Author Topic: Modern system native Stunts proto-engine  (Read 955 times)

Cas

  • Bernie's Brother
  • **
  • Posts: 263
    • View Profile
    • Dimioca Labs
Modern system native Stunts proto-engine
« on: September 22, 2018, 11:27:32 PM »
Guys, I made this very, very simple proto-engine last year and left the project because of a difficulty I know I cold overcome with some hard work. Now I was thinking it's there so I can share it with you and maybe eventually give it another push. What I'm posting is the GNU/Linux 64bit compiled version. I didn't compile it for Windows because I would first have to install a 32bit Linux and then Wine on top and the compiler (I don't know why, but Wine doesn't seem to work with 64bit Linux for me), but I can later get that done and post it too.

Use the arrow keys to look around and the + and - keys to change the height of the camera. Also, < and > can be used to bank the view. The engine uses pure high-level routines, so it could be highly optimised. All calculations are made with floating point numbers so, again, this could fly if intended. You'll notice a problem when drawing very close to the camera. This is my main problem.

My intention?  To build a graphic engine that could draw any visual from Stunts at game speed with the same technology (flat triangles), but at any screen resolution. What for?  Could be used to generate high-res images of what a part of a track or replay could look like. Could also be the base for a re-creation of a full Stunts engine. If so, I'd like it to be faithful to the original, only allowing plugins easily. We don't want another Stunts-like game. We want Stunts. In any case, we want a Stunts we can more easily mod. For now, it's just a curiousity. Done the old-school way, but with modern OS and compiler support. Take a look and give any impressions or ideas. Thanks!
Earth is my country. Science is my religion.

Duplode

  • Moderator
  • Breaths Stunts
  • *****
  • Posts: 3515
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: Modern system native Stunts proto-engine
« Reply #1 on: September 23, 2018, 03:31:09 AM »
Nice work!

I didn't compile it for Windows because I would first have to install a 32bit Linux and then Wine on top and the compiler (I don't know why, but Wine doesn't seem to work with 64bit Linux for me), but I can later get that done and post it too.

You can have a 32-bit Wine prefix on a 64-bit Linux -- cf. the relevant Arch Wiki page. Below is some stuff that used to be in my .bashrc to help using multiple prefixes, which might be of some use.

Code: [Select]
# Making wine default to 32-bit.
export WINEARCH=win32

# Keeping the default wine prefix in a non-hidden directory.
export WINEPREFIX="/home/duplode/wine32"

# Simplifying the handling of Wine prefixes.
# (Adapted from http://code.google.com/p/winetricks/wiki/CommandlineTips )
# Of course we will keep some symlinks of our own at
# ~/.local/share/wineprefixes .

prefix-wine() {
    if [ -z "$1" ]; then
        echo "${WINEPREFIX}"
    else
        echo "${HOME}/.local/share/wineprefixes/$1"
    fi
}

lswine() {
    ls $* "${HOME}/.local/share/wineprefixes"
}

with-wine() {
    lswine | grep "$1" > /dev/null
    if [ "$?" -ne 0 ] || [ -z "$1" ]; then
        echo "Please select an actual wine prefix (try lswine)."
    else
        prefix=$(prefix-wine $1)
        shift 1
        echo $prefix
        env WINEPREFIX="$prefix" "$@"
    fi
}

goc() {
    lswine | grep "$1" > /dev/null
    if [ "$?" -ne 0 ]; then
        echo "Please select an actual wine prefix (try lswine)."
    elif [ -z "$1" ]; then
        cd "${WINEPREFIX}/drive_c"
    else
        cd "$(prefix-wine $1)/drive_c"
    fi
}

_lswine () {
    local cur

    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}

    if [[ $COMP_CWORD -eq 1 ]] ; then
        COMPREPLY=( $( compgen -W "$(lswine)" -- $cur ) )
        return 0
    fi
}

_with-wine () {
    local cur

    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}

    if [[ $COMP_CWORD -eq 1 ]] ; then
        COMPREPLY=( $( compgen -W "$(lswine)" -- $cur ) )
        return 0
    elif [[ $COMP_CWORD -eq 2 ]] ; then
        COMPREPLY=( $( compgen -cf -- $cur ) )
        return 0
    fi
}

complete -F _lswine prefix-wine
complete -F _lswine goc
complete -o default -F _with-wine with-wine
« Last Edit: September 23, 2018, 03:32:46 AM by Duplode »

Cas

  • Bernie's Brother
  • **
  • Posts: 263
    • View Profile
    • Dimioca Labs
Re: Modern system native Stunts proto-engine
« Reply #2 on: September 23, 2018, 03:57:19 AM »
I think my problem is more general than just with Wine. I'm having difficulty (lack of knowledge?) getting to install anything that requires 32bit architecture in my 64bit system. When I try to install Wine (which I usually do by using the software centre in Ubuntu or by sudo apt-get install), the installation fails because of dependency problems related to the architecture. Same thing was happening to me with Skype in the past. Now Skype is 64bit-only. So I don't get to the point of having it installed to be able to configure it in any way :(
Earth is my country. Science is my religion.

Duplode

  • Moderator
  • Breaths Stunts
  • *****
  • Posts: 3515
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: Modern system native Stunts proto-engine
« Reply #3 on: September 23, 2018, 06:25:34 AM »
I don't know if you have already tried it, but you apparently have to explicitly enable alternative architectures. (On Arch, you'd rather similarly have to enable a "multilib" repository.)

Cas

  • Bernie's Brother
  • **
  • Posts: 263
    • View Profile
    • Dimioca Labs
Re: Modern system native Stunts proto-engine
« Reply #4 on: September 23, 2018, 07:57:13 AM »
Looks like it's enabled 32bit, but still even the most fundamental 32bit libraries are not there, so nothing that's 32bit is running. For instance, I'm trying to run the 32bit compilation of Bliss and it just won't. I wonder what I should install next. Probably, I should check with the people at FreeBasic on how to compile 32bit on a 64bit system and that would also allow running most 32bit programs.
Earth is my country. Science is my religion.