Git Product home page Git Product logo

acclint's Introduction

Overview

acclint is a lint program that checks AC3D model files for problems. It supports the standard AC3D file format (files ending in .ac) and the extended AC3D file format used by TORCS and Speed Dreams (files ending in .acc). acclint is also able to correct many common problems.

Download

Use the git clone command to download this project:

git clone https://github.com/IOBYTE/acclint
cd acclint

Build with CMake and GNU Make

Create a build directory inside the example project directory and configure the build using CMake to generate the Makefiles for GNU Make:

mkdir build && cd build
cmake CMAKE_BUILD_TYPE=Release ..

Then build the executable named acclint using GNU Make:

make

The resulting binary is acclint inside the build directory.

You can install acclint using GNU Make:

sudo make install

Examples

Here is an example of running acclint on the supplied file example.ac.

AC3DbS
MATERIAL "1" png 1 1 1  amb 1 1 1  emis 0 0 0  spec 0.5 0.5 5  shi 64.1  trans 1.1
OBJECT world
kids 2
OBJECT poly
name "square"
numvert 7
0 0 0
0 1 0
1 0 0
1 0 0
0 1 0
1 1 0
1 1 1
numsurf 2
SURF 0x10
mat 0
refs 3
0 0 0
1 0 0
2 0 0
SURF 0x10
mat 0
refs 3
3 0 0
4 0 0
5 0 0
kids 0
acclint example.ac
example.ac:1 warning: trailing text: "S"
AC3DbS
     ^
example.ac:2 warning: invalid material rgb: png
MATERIAL "1" png 1 1 1  amb 1 1 1  emis 0 0 0  spec 0.5 0.5 5  shi 64.1  trans 1.1 
             ^
example.ac:2 warning: invalid material spec: 5 range: 0 to 1
MATERIAL "1" png 1 1 1  amb 1 1 1  emis 0 0 0  spec 0.5 0.5 5  shi 64.1  trans 1.1 
                                                            ^
example.ac:2 warning: floating point shi: 64.1
MATERIAL "1" png 1 1 1  amb 1 1 1  emis 0 0 0  spec 0.5 0.5 5  shi 64.1  trans 1.1 
                                                                   ^
example.ac:2 warning: invalid material trans: 1.1 range: 0 to 1
MATERIAL "1" png 1 1 1  amb 1 1 1  emis 0 0 0  spec 0.5 0.5 5  shi 64.1  trans 1.1 
                                                                               ^
example.ac:2 warning: trailing text: " "
MATERIAL "1" png 1 1 1  amb 1 1 1  emis 0 0 0  spec 0.5 0.5 5  shi 64.1  trans 1.1 
                                                                                  ^
example.ac:8 warning: trailing text: " "
0 0 0 
     ^
example.ac:12 warning: duplicate verticies
0 1 0
^
example.ac:9 note: first instance
0 1 0
^
example.ac:11 warning: duplicate verticies
1 0 0
^
example.ac:10 note: first instance
1 0 0
^
example.ac:19 warning: trailing text: " "
0 0 0 
     ^
example.ac:14 warning: unused vertex
1 1 1
^
example.ac:29 warning: blank line
example.ac:4 warning: missing kids: only 1 out of 2 kids found
13 warnings

acclint can also fix and optimize many common non-fatal problems.

acclint example.ac -o example-cleaned.ac

produces this:

AC3Db
MATERIAL "1" rgb 1 1 1  amb 1 1 1  emis 0 0 0  spec 0.5 0.5 1  shi 64  trans 1
OBJECT world
kids 1
OBJECT poly
name "square"
numvert 4
0 0 0
0 1 0
1 0 0
1 1 0
numsurf 2
SURF 0x10
mat 0
refs 3
0 0 0
1 0 0
2 0 0
SURF 0x10
mat 0
refs 3
2 0 0
1 0 0
3 0 0
kids 0

acclint can also convert from one file format version to another.

acclint filev12.ac -o filev11.ac -v 11
acclint filev11.ac -o filev12.ac -v 12

acclint can also convert .acc files to the .ac file format.

acclint file.acc -o file.ac

acclint can also convert .ac files to the .acc file format.

acclint file.ac -o file.acc

The converted file will have normals but will not have triangle strips.

acclint can also dump the object hiearchy of a file.

acclint  --dump surf -Wno-warnings example.ac
1 world 1 kid
    1 poly "square" 2 surfaces
        1 surface 3 refs
        2 surface 3 refs

Running regression tests

Running the regression tests on linux requires Bats (Bash Automated Testing System).

Change the current directory from the installed directory to the test directory and run the file testrunner.sh.

acclint must be installed before you can run the tests.

cd test
bash testrunner.sh

Feedback

This software is in early development and is far from feature complete. There is a todo list in TODO.txt.

Please let me know if you have problems with the software or want to see improvements using Issues.

Copyright

© 2020-2024 Robert Reif

acclint's People

Contributors

iobyte avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

beaglejoe

acclint's Issues

Transparency issues and SSG crash

Hi @IOBYTE
I made a test with my LongJour track with this command:
acclint --combineTexture longjour.ac -o longjour.new.ac

It takes some time to finish, but the final results are overwhelming. Take a look to this screenshots after the first lap and compare the average fps.
-Before:
LongJourDefaultOSG
-After:
LongJourAcclintOSG-OK

For the moment I only find two problems:

  • First one is an issue with fences and trees. Take a look to the second screenshot to see the fences, and this other for the trees:
    LongJourAcclint_TreesBug

Could it be that it is not using the "_n" in the texture name correctly for objects with transparency (treeX_n)?

  • Second one, I went to check the track's performance in SSG, but upon loading it the game crashed to the Desktop with the following message:
00:00:12.775 Default  Info    Graphic options : Number of cloud layers : 1
00:00:12.779 Default  Error   Env. texture file shadow2.png not found in tracks/road/longjour;data/img;data/textures;.
00:00:12.779 Default  Error   Env. texture file shadow2.rgb not found in tracks/road/longjour;data/img;data/textures;.
00:00:12.779 Default  Warning shadow2.png/rgb not found ; no shadow mapping on cars for this track
00:00:12.779 Default  Info    Loading background-sky.ac
00:00:12.800 Default  Info    Loading longjour.new.ac
WARNING: Map is not a power-of-two in size!
corrupted double-linked list
Aborted (memory data was recovered)

Seems that acclint changes the size of the track

acclint files with --combineTexture .acc file fails on Windows

Hello

This morning June Ravenmoon (formerly harunasan) told me that when he tries to create a race with bots on my longjour track on Windows with the ‘main’ version (not the current release), the game closes to the desktop. I have tested it on a Windows partition (real, not virtual), and it does indeed fail.

But the failure occurs when after creating the .acc file with raceline in trackeditor, we use acclint with --combineTexture. If I create a race with the track as it comes out of trackeditor, it doesn't fail.

Cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.