Author Topic: AutoLevel Final Release  (Read 1356 times)

Offline F1Bomber

  • Copper Member
  • **
  • Posts: 214
      • http://www.bushtech.com.au
AutoLevel Final Release
« on: January 25, 2004, 09:09:42 PM »
Okay finaly finished up the autolevel program.

It will detect a object from the oba file, scan the elv file and apply the leveling of that terrian that the object is on.

This includes all objects.

The options that you can choose from are as follows.
Min atl ( Applys the lowest vertex to the square )
Max alt ( Apply the highest vertex to the square )
Average ( Adds up all vertex and then calcullates the average )
Middle Vertex ( Selects the middle vertex in the square and apply that alt to the rest )

You will need java Run time enviroment.

http://www.java.com

Its a exe so you dont need to worrie about command promt.

Comes with its own installer program.

Before testing out on your final map, make some test examples and see witch option you like for leveling. I personal recommend average because it makes it blend better into the terrian.

Download it here 6 megs.

http://www.bushtech.com.au/chads/install.exe

( If you want the source code send me off a email and i will send you the files )

( note. You accept the package as is )

Offline United

  • Gold Member
  • *****
  • Posts: 2536
      • http://squadronspotlight.netfirms.com
AutoLevel Final Release
« Reply #1 on: January 25, 2004, 10:30:42 PM »
Wonderful stuff youve got there.  I know it will get a lot of use from many mapmakers.  Good work! :) :)

Offline reacher15

  • Copper Member
  • **
  • Posts: 260
re: java runtime
« Reply #2 on: February 03, 2004, 03:23:18 PM »
when i try to install the auto leveler it wants a folder containing JRE 1.4.0_01....however when i went to the java web site it installed j2re 1.4.1_02 and i also have j2re 1.4.2_03 on  my system. can you let me know how to get that particular version.

Thanks

Reacher

Offline Dux

  • Aces High CM Staff (Retired)
  • Platinum Member
  • ******
  • Posts: 7333
AutoLevel Final Release
« Reply #3 on: February 03, 2004, 04:15:41 PM »
That's fantastic, F1. I'm going to definitely check this out (tho I'm a complete newbie/idiot when it comes to Java).

Question: how hard would it be to program a similar utility that would detect roads, the source altitude, and the destination altitude, and apply an even slope between them?
Rogue Squadron, CO
5th AF, FSO Squadron, Member

We all have a blind date with Destiny... and it looks like she's ordered the lobster.

Offline artik

  • Silver Member
  • ****
  • Posts: 1909
      • Blog
AutoLevel Final Release
« Reply #4 on: February 04, 2004, 01:16:40 AM »
Where can I get exactly descriptions of formats of elv, obj files and other file formats in AH TE.
I think it will not be too hard even to make program that will put automaticly all spawn points between bases or even will make random base layout with zones and start objects when you will give as parameter the distances between bases etc. (for MAs not historical maps). I would really like to have and automatically spawn point maker or other feachers that could be usefull.
Auto altitude maker for MA maps etc..

So can I find exectly specifications of formats of these files?

Thank you
Artik, 101 "Red" Squadron, Israel

Offline reacher15

  • Copper Member
  • **
  • Posts: 260
re: java file
« Reply #5 on: February 04, 2004, 09:56:31 AM »
i found it and installed it. the program loaded no prob....first attemps don't seem to have an effect. i'll keep messing with it.

Reacher

Offline F1Bomber

  • Copper Member
  • **
  • Posts: 214
      • http://www.bushtech.com.au
AutoLevel Final Release
« Reply #6 on: February 05, 2004, 06:06:10 AM »
Sorry chaps i didnt know if anyone replyed to this theat until i actualy came back and had a look again.

Okay to answere some of the questions

the *.elv file is a array of 2 short.

for example.

short array[][]

Personal note that the elv file is actualy written little indian instead of big indian.

For example, C programs write data to the file little idian first, were java writes data big indian first.

So lets say you have a short data type.
C writes it out like 1000
Java Writes it out like 0001

C read it in like 0001
Java Reads it in like 1000


little indian = First Bit is the leading bit.
Big Indian = last bit is the leading bit.

I hope i got that correct.

Okay moving onto the *.oba file.
the oba file is basicaly ascii characters.

==============================

In reply to the actual spawn points and other matters, i am going to start writing my own terrian editing program. it includes the following abilitys.

AutoLevel Object on Terrian.
AutoAdd Spawn Points ( base on radar range )
AutoWeave and place Rivers and Roads.
GUI ( OpenGL 3D world editor )

===============

Going to have a look at the Installer again later today to make it more user friendly sorry for the late reply.

Offline F1Bomber

  • Copper Member
  • **
  • Posts: 214
      • http://www.bushtech.com.au
AutoLevel Final Release
« Reply #7 on: February 05, 2004, 06:07:53 AM »
Dux it would be pretty simple to make auto spawn points and auto resupply system done.

Offline F1Bomber

  • Copper Member
  • **
  • Posts: 214
      • http://www.bushtech.com.au
AutoLevel Final Release
« Reply #8 on: February 05, 2004, 08:02:34 AM »
Okay guys i found a better way of getting the program to you guys at a lower bandwidth consumption.

Download java any runtime enviroment.
http://www.java.com

Download the New EXE file.
http://www.bushtech.com.au/chads/AutoLevel.exe

If you have installed java it should run fine. Please post any suggestions for the program. I may be able to implment all of the above before aces high 2 comes out.

F6Bomber.

Offline artik

  • Silver Member
  • ****
  • Posts: 1909
      • Blog
AutoLevel Final Release
« Reply #9 on: February 05, 2004, 08:35:51 AM »
Quote
Originally posted by F1Bomber
Sorry chaps i didnt know if anyone replyed to this theat until i actualy came back and had a look again.

Okay to answere some of the questions

the *.elv file is a array of 2 short.

for example.

short array[][]

Personal note that the elv file is actualy written little indian instead of big indian.

For example, C programs write data to the file little idian first, were java writes data big indian first.

So lets say you have a short data type.
C writes it out like 1000
Java Writes it out like 0001

C read it in like 0001
Java Reads it in like 1000


little indian = First Bit is the leading bit.
Big Indian = last bit is the leading bit.

I hope i got that correct.

Okay moving onto the *.oba file.
the oba file is basicaly ascii characters.

==============================

In reply to the actual spawn points and other matters, i am going to start writing my own terrian editing program. it includes the following abilitys.

AutoLevel Object on Terrian.
AutoAdd Spawn Points ( base on radar range )
AutoWeave and place Rivers and Roads.
GUI ( OpenGL 3D world editor )

===============

Going to have a look at the Installer again later today to make it more user friendly sorry for the late reply.

Thank you but some more questions.
oba file format.
It is text file - what each field means for object? Name, Index position etc. what coardinates do you have any spec?
Ground cover?
A lot of other things?

HITECH probably you have spec of these files?
Because just trying on blind - do not worst it?
Can you post specs of these files? Or it is private information of HTC?
Artik, 101 "Red" Squadron, Israel

Offline F1Bomber

  • Copper Member
  • **
  • Posts: 214
      • http://www.bushtech.com.au
AutoLevel Final Release
« Reply #10 on: February 05, 2004, 09:06:20 AM »
WATER 0, GRASS 1, GRASSY_ROCK 2, FARM 3, ROCK 4, and FOREST 5

Thats the DataTypes for the *.typ File.

I havent debuged the oba file as of yet.

But i will try.


C01VOD000,      city,     42272.031,         0.000,   -918865.268, 0.0000, 0.0000, 0.0000,      2560,    0,    0,   -1.00,    -1.0,        -1,   0,    0,    0,    0

Lets look at the first Data.

C01
This is what i am assuming for all of them.
C01 is the Field Number.

VOD is the Type of object

000 Is the number of objects on that Field.

So you have.
C01VOD000
C01VOD001
C01VOD002
C01VOD003
C02VOD000
C02VOD001
C02VOD002
C02VOD003

Okay next data.

City
Dont know about that one.

Okay next Data.
42272.031  = x position

Okay next Data.
 0.000 = alt

Okay next.
-918865.268 = y position.


6th 0.00000 = roll Each Degree is approximately 0.0174533
7th 0.0000 = Tilt Each Degree is approximately 0.0174533
8th 0.0000 = Rotate Each Degree is Approximately 0.0174533

There is a direct Corrilation between the array index and oba x and y posiitions.

Here is how you calculate the object double value down to the array middle even index.

Copy and past from autolevel program.

== Covert Array *.elv Index into object double position ==

if( ( row > 512) & ( col > 512) ){
realrow = (row - 512) * 2640;
realcol = (col - 512) * 2640;
System.out.println( row );
System.out.println( col );
}

if( ( row < 512) & ( col < 512) ){
realrow = (row - 512) * -2640;
realcol = (col - 512) * -2640;
System.out.println( row );
System.out.println( col );
}

if( ( row > 512) & ( col < 512) ){
realrow =(row - 512) * 2640;
realcol =(col - 512) * -2640;
System.out.println( row );
System.out.println( col );
}

if( (row < 512) & (col > 512) ){
realrow =(row - 512) * -2640;
realcol =(col - 512) * 2640;
System.out.println( row );
System.out.println( col );


== Covert Double object position back to *.elv array index==

public void convertback( double row, double col ){
   double realrow = 0;
   double realcol = 0;

   if( ( row > 0) & ( col > 0) ){
   realrow = (row / 2640 ) + 512;
   realcol = (col / 2640 ) + 512;
   }

   if( ( row < 0) & ( col < 0) ){
   realrow = ( row / 2640) + 512;
   realcol = ( col / 2640) + 512;
   }

   if( ( row > 0) & ( col < 0) ){
   realrow = ( row / 2640) + 512;
   realcol = ( col / 2640) + 512;
   }

   if( (row < 0) & (col > 0) ){
   realrow = ( row / 2640) + 512;
   realcol = ( col / 2640) + 512;
   }

Offline F1Bomber

  • Copper Member
  • **
  • Posts: 214
      • http://www.bushtech.com.au
AutoLevel Final Release
« Reply #11 on: February 05, 2004, 09:08:27 AM »
I built another program that converted a bmp image into the typ file, not that hard really.

Everthing is currently on hold until aces high 2 comes out. Then i will start making the new java GUI 3D Terrian Editor.

Offline F1Bomber

  • Copper Member
  • **
  • Posts: 214
      • http://www.bushtech.com.au
AutoLevel Final Release
« Reply #12 on: February 05, 2004, 09:11:44 AM »
Okay on the mission for dux.

0,Type
2,Flags
-1,ResourceType
161,DestFieldIndex
-1,SourceFieldOrObjectIndex
26400.000000,SrcRadius
26400.000000,DestRadius
Road to F162
6,PntCnt
241560,0,-99000
241560,0,-88440
225720,0,-88440
225720,0,-83160
215160,0,-83160
215160,0,-72600

Dux it seems pretty easy actualy to do this, dont know if you want it done rgiht now but i will go though it with ya.

6,PntCnt = number of roads.

241560,0,-99000
241560,0,-88440
225720,0,-88440
225720,0,-83160
215160,0,-83160
215160,0,-72600

Roads Terrian Index.
x,alt,y

So actualy this would be very easy to actualy do.

Here is a picture without editing code what the results will be like before and after applying the average with the autolevel.

http://www.bushtech.com.au/chads/Typicaly.JPG
http://www.bushtech.com.au/chads/After.JPG

http://www.bushtech.com.au/chads/Typicaly2.JPG
http://www.bushtech.com.au/chads/After2.JPG

Just wondering do you want it to automaticaly add the rivers and roads in or, just level them off.
« Last Edit: February 05, 2004, 09:38:25 AM by F1Bomber »

Offline F1Bomber

  • Copper Member
  • **
  • Posts: 214
      • http://www.bushtech.com.au
AutoLevel Final Release
« Reply #13 on: February 05, 2004, 09:41:06 AM »
Just re-read your post.

Very easy dux. i will get onto it when i get some free time, let you know when i get around to it.

Offline Dux

  • Aces High CM Staff (Retired)
  • Platinum Member
  • ******
  • Posts: 7333
AutoLevel Final Release
« Reply #14 on: February 05, 2004, 10:37:01 AM »
That's just amazing, F1. :)

At this moment, I was just curious about whether it could be done or not. I wouldn't need anything right away, so don't rush on anything for me.

btw, I've been able to open TYP files in Photoshop, using "Open As... RAW". It works really well, especially when you can overlay it on the elevation map to assist in assigning ground textures.
Rogue Squadron, CO
5th AF, FSO Squadron, Member

We all have a blind date with Destiny... and it looks like she's ordered the lobster.