B AATools. V0.5a <--!! + tutorial see pg. 2

Got something that makes Armagetron look shiny? Post it here.
User avatar
jessethemidget
On Lightcycle Grid
Posts: 36
Joined: Sun Apr 01, 2007 10:49 pm

B AATools. V0.5a <--!! + tutorial see pg. 2

Post by jessethemidget »

>>>>>>> news! <<<<<<<
project page:
https://sourceforge.net/projects/aatools/
newest version: 0.5a (now with gui)

tutorial:
http://www.addertooth.net/aatools/aatools_tutorial.html

image:
Image
(the atv from the tutorial)


even if you're not really interested check out the tutorial to see how easy it is.

>>>>> original post: <<<<<

Hello there.

A year ago I made a nifty export-import script for blender to import or export Armagetron .mod files. I know it's kinda dangerous to use the .mod format, but I have made some very interesting mods by editing the models and textures.

Now, after some pc troubles, I am remaking this script with several new features, but I'd like to open it up to you guys as to what features you'd like.

what I want:
-Model import/export.
-'Working Directory' support, i.e. you just specify your armagetron dir and off you go...
-Texture mapping/painting support (automatic texture import w/ model?)

Also, but slightly less priority:
Map making, with real-size previews
possibly a mini blender test game...
auto-backup of old files.

I plan to make a full gui with all this.

so: what would you guys like? any comments?
Last edited by jessethemidget on Tue Apr 17, 2007 6:48 am, edited 5 times in total.
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

Hi,

I really sound interesting! I'm sure people who like to create and tweak models will find it very useful. How do you plan to release it? Do you have a project on sourceforge.net for it?

A word of advise, you will find that coloration differs in the game. IIRC, the game adjust the color (the 0 to 15 for r,g and b) to make it differ from its environment.

As of map making, it would be a nice addition. But I'd be carefull, the guy in charge of that part is a bit of a wacko, always planning way too complex ideas and then taking for ever to deliver them. You'd better start reading all the documents in Wiki detailing current and future development (the next one is about the zones) and be prepared to bang your head on your desk a few times.

Keep up the good work on your blender plug-in!

-ph
Canis meus id comedit.
User avatar
jessethemidget
On Lightcycle Grid
Posts: 36
Joined: Sun Apr 01, 2007 10:49 pm

Post by jessethemidget »

hmm... I'd not thought of sourceforge. I already have an account, maybe I'll use it.

But I was just planning on making it myself and posting it to my web server.

If anyone would like to help who knows python, post or pm me and we can discuss how we'd like to do it. SVN? CVS? something else?


any final suggestions or thoughts before I start in (i've already started work on the model import-export, I'll keep you informed.)

oh, and It'll be gpl.

about color: what do you mean? does it add color instead of overlaying or something?
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

jessethemidget wrote:...But I was just planning on making it myself and posting it to my web server.
Having it on sourceforge doesnt mean crowd will rush to help you, but i does makes it easier for somebody else to have a look or scratch an itch. ;)

SVN should be a safe bet as its a sort of improved CVS.
any final suggestions or thoughts before I start in (i've already started work on the model import-export, I'll keep you informed.)
If I may chime the bells of my experience for a while, I'd like to pass 5 words of advise: Do Cu Men Ta Tion. Write it BEFORE so people can know what you want to do, and how your planning to. Makes it easier to follow your progress, and understand your work. And yes I need to my own advise too. But a second peice of advise: Do as I say, not as I do! ;)
about color: what do you mean? does it add color instead of overlaying or something?
I'm a bit guessing for the following. IIRC, as I've mentionned earlier the game tweak the colors to enhance the contrast. So color Red = 8 (out of 16) might not maps directly to Red = 128 out of 256. I'd guess it applies only for cycle and traces, but textures take part of their info from the cycle too.

-ph
Canis meus id comedit.
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

<Nitpick mode>Limits are 15 and 255.</Nitpick mode>

Cycle textures are built by alpha blending the cycle image on top of the cycle color. Walls are drawn as if they are lit by the wall color. Those colors are a brighter version of what the player entered if they are too close to the floor color, but that shouldn't affect the textures in a way that matters.
ˌɑrməˈɡɛˌtrɑn
User avatar
jessethemidget
On Lightcycle Grid
Posts: 36
Joined: Sun Apr 01, 2007 10:49 pm

UPDATES!!!!

Post by jessethemidget »

ok, I'll get sourceforge and svn up and running... as for now:

update: first success!!! (attached) (yes, that's the basic file... nice and simple)

the import (hard part) is working!!!

before I continue, here's how I'm planning to do it:
have 4 scripts:
libamodio.py = a library script with all the import/export functions
import_mod.py = a simple import script w/o gui, just calls libamodio.readmod()
export_mod.py = like import, just calls libamodio.writemod() for the selected object
AATools.py = a full gui with image support etc...

now, to business. As you can see, the game has a hardcoded offset for the wheels and body, in the attached image they simply all import at the origin (0,0,0). Does anyone know these offsets or do I have to go source code-digging?

Documentation is in-line atm... but when I get a little farther and I know the possibilities/limitations, I'll figure out a gui etc.. and start on docs.


also, if I did open it to the public to help, would anyone be interested?


EDIT: sourceforge project submitted, pending approval
Attachments
Screenshotlores.png
User avatar
jessethemidget
On Lightcycle Grid
Posts: 36
Joined: Sun Apr 01, 2007 10:49 pm

Post by jessethemidget »

haha, found it! :D :D :D :D
from the source code:

Code: Select all

            ModelMatrix();


            bodyTex->Select();
            body->Render();

            wheelTex->Select();

            glPushMatrix();
            glTranslatef(0,0,.73);

            GLfloat mr[4][4]={{rotationRearWheel.x,0,rotationRearWheel.y,0},
                              {0,1,0,0},
                              {-rotationRearWheel.y,0,rotationRearWheel.x,0},
                              {0,0,0,1}};


            glMultMatrixf(&mr[0][0]);


            //       TexMatrix();
            //       glLoadMatrixf(&tswap[0][0]);
            //       glScalef(.65,.65,.65);
            //       ModelMatrix();

            rear->Render();
            glPopMatrix();

            glPushMatrix();
            glTranslatef(1.84,0,.43);

            GLfloat mf[4][4]={{rotationFrontWheel.x,0,rotationFrontWheel.y,0},
                              {0,1,0,0},
                              {-rotationFrontWheel.y,0,rotationFrontWheel.x,0},
                              {0,0,0,1}};

            glMultMatrixf(&mf[0][0]);


            //       TexMatrix();
            //       glLoadMatrixf(&tswap[0][0]);
            //       glScalef(1.2,1.2,1.2);
            //       ModelMatrix();

            front->Render();
            glPopMatrix();
            glPopMatrix();


        }
offsets are where it says 'gltranslatef(...'
body: no offset
back: (0,0,.73)
front: (1.84,0,.43)


also: import pretty much finished, starting export.
User avatar
jessethemidget
On Lightcycle Grid
Posts: 36
Joined: Sun Apr 01, 2007 10:49 pm

Post by jessethemidget »

YAY!!! import AND export are FINISHED!!!!!
as a test I imported and exported the base file, aside from the original cropping off the extra zeros at the end and my script leaving them, they are exactly the same!!!

I'll clean up a little, and make the two small exec scripts, then release to you guys!

next stop: gui
User avatar
jessethemidget
On Lightcycle Grid
Posts: 36
Joined: Sun Apr 01, 2007 10:49 pm

Post by jessethemidget »

sourceforge project approved!
aatools.sourceforge.net (currently empty)

now, I'm not so experienced with svn, does anyone have tips?
I use subversion under Ubuntu Linux, (just cli) and I'm kinda lost as to how to commit my project.
User avatar
Lucifer
Project Developer
Posts: 8742
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

Sourceforge has good docs for how to import your project. Unfortunately, they're hard to find.

When you find them (i'm not about to go looking, it's a pain, I tell ya), I suggest doing a setup like this:

svnroot/projectname/trunk/projectname
svnroot/projectname/tags/projectname
svnroot/projectname/branches/projectname

Even if you leave branches empty for a long time. (also, "svnroot" here is part of the sourceforge path, your actual repository starts in the first "projectname" shown)
Check out my YouTube channel: https://youtube.com/@davefancella?si=H--oCK3k_dQ1laDN

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
jessethemidget
On Lightcycle Grid
Posts: 36
Joined: Sun Apr 01, 2007 10:49 pm

Post by jessethemidget »

found it:
https://sourceforge.net/docs/E09/en/#top
thanks, I'll try and figure it all out...
User avatar
jessethemidget
On Lightcycle Grid
Posts: 36
Joined: Sun Apr 01, 2007 10:49 pm

Post by jessethemidget »

now on sourceforge!
svn @ https://aatools.svn.sourceforge.net/svnroot/aatools

or just browse online here:
http://aatools.svn.sourceforge.net/viewvc/aatools/

notes:
libamodio.py is usable at present, but aatools.py and the import/export scripts aren't.

for import just add:

Code: Select all

readmod('path/to/your/file.mod', 'name of object to create')
or, for export:

Code: Select all

writemod('path/to/output/file.mod','name of object to export')
... to the end of libamodio.py and execute.

notes: in /trunk/examples/ there's a blendfile called aatools.blend which contains a copy of libamodio.py and the original model imported as blender objects.
the examples folder also includes the original .mods that the blendfile is made from, but you all should have those anyway :wink:


edit: title edited, import script now functional, soon to be followed by exporter...
basic gui for aatools in the works, coming soon.
User avatar
jessethemidget
On Lightcycle Grid
Posts: 36
Joined: Sun Apr 01, 2007 10:49 pm

Post by jessethemidget »

IMPORT AND EXPORT NOW FUNCTIONAL!!!!

ok, instructions (until I get docs written):

1) checkout w/ svn [edit] you can also svn browse with the link above...
_1: instructions for linux svn:
_1a: get svn (or subversion)
_1b: navigate to the directory you want it (in terminal)
_1c: type this:

Code: Select all

svn checkout https://aatools.svn.sourceforge.net/svnroot/aatools
2) now, from that directory copy libamodio.py, import_mod.py, and export_mod.py to your blender/.blender/scripts directory
3) open blender, split the window, set second window to 'scripts'
4) menu: scripts>>update menus
5) then, the scripts will be in import>>armagetron .mod and export>>armagetron .mod

6a)import: run the script, select your .mod from the file browser, voila!
6b)export: select the object to export (make sure it's only tris), run script, select path to export, press the magic button, voila!

NOTE: I have not tested this under windows and therefore cannot guarantee its usability, if anyone has windoz please test and post any errors etc...

note to devs/people interested in script workings: you can edit the scripts to enable more output, under the gpl license in import_mod.py and export_mod.py there's a line that says "debug = False", change it to "debug = True" to enable debug info.

also, I haven't implemented exceptions yet, errors will cause the script to crash without reason! check your filenames!!! and permissions!!!
User avatar
jessethemidget
On Lightcycle Grid
Posts: 36
Joined: Sun Apr 01, 2007 10:49 pm

Post by jessethemidget »

Version 0.1A released!

download .tar.gz from sourceforge:
http://sourceforge.net/projects/aatools/

some docs come with the file in the readme, it should be enough to get you started, but I'm working on full html + pictures documentation/tutorials

changelog:
-fully functional import/export
-now correct blender menu locations
User avatar
Your_mom
Match Winner
Posts: 653
Joined: Sun Jun 06, 2004 1:45 am

Post by Your_mom »

I tried it, and it works. However each exported file somehow ended up being oriented wrong(even after readjusting several times) and polygons would get eaten by the export script, import seams to work flawlessly.

(novice blender user)
Post Reply