fantastic gizmo for tex artists+modellers

Thinking about improving the Artwork in Vega Strike, or making your own Mod? Submit your question and ideas in this forum.

Moderator: pyramid

Post Reply
strangelet
Bounty Hunter
Bounty Hunter
Posts: 201
Joined: Wed Jan 14, 2004 11:11 pm
Location: londonengland, england
Contact:

fantastic gizmo for tex artists+modellers

Post by strangelet »

i got tired of creating random techy textures all the time, so i made this to do it for me...


http://www.aqpm75.dsl.pipex.com/hullgen.html
Image
- - above and beyond - -
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Great stuff! Thanks! Been hitting "randomize" for a while and it's amazing. Any chance you could write definitions for the params? Or better yet, post the code? I'd like to rewrite it in C++ and maybe add a couple of features, like making it make tileable textures.
strangelet
Bounty Hunter
Bounty Hunter
Posts: 201
Joined: Wed Jan 14, 2004 11:11 pm
Location: londonengland, england
Contact:

Post by strangelet »

the code is really really ugly. i can post a txt file of the 3 scripts it runs off, but i have no idea if it's gonna be portable at all.
- - above and beyond - -
strangelet
Bounty Hunter
Bounty Hunter
Posts: 201
Joined: Wed Jan 14, 2004 11:11 pm
Location: londonengland, england
Contact:

Post by strangelet »

here's the main code for the actual drawing routines.

maplist and sliderlist are for the interface.

hvar - horizontal variation
vvar - vertical variation
ibdr - inner border
obdr - outer border
bdvr - border variance
step (not initially defined) - amount of smoothing steps
stepvar - amount of additionally randomly defined smoothing steps
modeshift - switches between draw modes (only between round and hard rectangles atm)
skip - instances of skipped draws


Code: Select all

--------- START OF SCRIPT ---------


property img1
property img5


property maplist
property datalist
property initdata
property sliderlist

on new me
  datalist=[1,1,-5,-5,1,1,1,0,0,0]
  maplist=[#hvar:[2,1],#vvar:[2,1],#ibdr:[1,-50],#obdr:[1,-50],#bdvr:[1,1],#step:[1,0],#stepvar:[1,0],#modeshift:[1,-50],#skip:[1,0],#othr:[1,0]]
  initdata=[20,20,45,45,0,0,0,0,10,0]
  sliderlist=initdata.duplicate()
  return me 
end


on drawarmor me
  
  hvar=datalist[1]
  vvar=datalist[2]
  ibdr=datalist[3]
  obdr=datalist[4]
  bdvr=datalist[5]
  stepv=datalist[6]
  stepvar=datalist[7]
  modeshift=datalist[8]
  skip=datalist[9]

    img1=image(1280 ,1280 ,32,16)   
  
  
  img5=image(1280 ,1280 ,16)
  img5.fill(0, 0, img5.width, img5.height, [#shapeType:#rect,#color: rgb(0, 0, 0)])
  
  o=1

  fc=255
  vh=random(hvar)+1
  vv=random(vvar)+1
  ih=img1.width
  iv=img1.height
  ihr=0
  ivr=0
  osh=0
  osv=0
  losv=0
  losh=0
  ihiv=ih
  iviv=iv
  img1.fill(0, 0, ihiv, iviv, [#shapeType:#rect,#color: rgb(0, 0, 0)])
  repeat with i=1 to 100
    
    ivr=(random(iviv/vv))

    if iv-ivr>-50 then   
      
      iv=iv-ivr
      repeat with ii=1 to 100
        ihr=(random(ihiv/vh))
        
        if ih-ihr>-50 then
          ih=ih-ihr 
          if random(100)>skip then
            case  1 of
              1:      
                
                shty=random(50)+modeshift
                if stepvar<1 then stepvar=1
                step=value(stepv)+(random(stepvar)) 
                
                rct1=rect(losh+random(bdvr)+ibdr, losv+random(bdvr)+ibdr, osh-random(bdvr)-ibdr, osv-random(bdvr)-ibdr)
                rct3=rect(losh+random(bdvr)+obdr, losv+random(bdvr)+obdr, osh-random(bdvr)-obdr, osv-random(bdvr)-obdr)
                
                case shty/50 of 
                  0:
                    img1.fill(rct3, [#shapeType:#rect,#color:rgb(50, 50, 50) ])
                    repeat with iii=1 to step
                      rct2=rect(iii,iii,-iii,-iii)
                      rcmd=((255/step)*iii)
                      img1.fill(rct1+rct2, [#shapeType:#rect,#color:rgb(rcmd, rcmd, rcmd) ])
                    end repeat 
                  1:
                    img1.fill(rct3, [#shapeType:#roundrect,#color:rgb(50, 50, 50) ])
                    repeat with iii=1 to step
                      rct2=rect(iii,iii,-iii,-iii)
                      rcmd=((255/step)*iii)
                      img1.fill(rct1+rct2, [#shapeType:#roundrect,#color:rgb(rcmd, rcmd, rcmd) ])
                    end repeat 
                end case
                
                
                
            end case
          end if
          
          losh=osh
          osh=osh+ihr
          
        else
          ii=100  
          ih=ihiv
          losh=0
          osh=0
        end if
        
      end repeat

      losv=osv
      osv=osv+ivr
    else
      i=100
    end if
  end repeat 
end
- - above and beyond - -
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Thanks! Won't be able to look at it for a few days; --just came back from the store with parts to build a new PC; so that comes first... What I want to do, mainly, is to modify the code to make it produce tileable textures, as CoffeeBot and myself have been working on a space elevator station and it's pretty big. Without a tileable texture it would take dozens of megabytes of textures to get it to not look blocky at close range.
strangelet
Bounty Hunter
Bounty Hunter
Posts: 201
Joined: Wed Jan 14, 2004 11:11 pm
Location: londonengland, england
Contact:

Post by strangelet »

yeh i need to get it tilable.

anyway - new version up and its much much improved.

hullgen v1.5! enjoy! (same url)
- - above and beyond - -
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Doh! Shockwave's not available for Linux... :(
Boicot Macromedia.
Another reason to move this code to C++.
CubOfJudahsLion
Confed Special Operative
Confed Special Operative
Posts: 286
Joined: Tue Dec 21, 2004 3:11 am
Location: Costa Pobre
Contact:

Post by CubOfJudahsLion »

Noice!
CoffeeBot
Intrepid Venturer
Intrepid Venturer
Posts: 676
Joined: Wed Jul 06, 2005 5:25 am
Location: On the counter by the toaster
Contact:

Post by CoffeeBot »

chuck_starchaser wrote:Doh! Shockwave's not available for Linux... :(
Boicot Macromedia.
Another reason to move this code to C++.
Amen, brother.

I say boycott Macromedia in general. As if JavaScript didn't damage the internet enough, someone had to introduce Flash...
hellcatv
Developer
Developer
Posts: 3980
Joined: Fri Jan 03, 2003 4:53 am
Location: Stanford, CA
Contact:

Post by hellcatv »

that result looks so cool!
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
CoffeeBot
Intrepid Venturer
Intrepid Venturer
Posts: 676
Joined: Wed Jul 06, 2005 5:25 am
Location: On the counter by the toaster
Contact:

Post by CoffeeBot »

Wow. v1.5 is way better. I like it a lot.

I am curious about the armor, though, and this doesn't just apply to this nifty app, but to nearly everything -- Why is it so popular to create a mass of metal tiles for a hull, as though it were either made out of fish scales or a haphazard quilt of plating? Or, in some cases, randomly sized tiles of metal riveted together.

I know aerodynamics aren't a factor for spacecraft, but, conservation of materials and mass still are. I guess it just doesn't make much sense to me that armor would be a giant quilt of materials -- unless it's some kind of cheap add on or 2nd hull that doesn't quite fit.
strangelet
Bounty Hunter
Bounty Hunter
Posts: 201
Joined: Wed Jan 14, 2004 11:11 pm
Location: londonengland, england
Contact:

Post by strangelet »

well. i never said how you should paint your spaceship, but if you do want chaotic plating then this will do it :)

what you're saying is perfectly true, but i guess we all feel it looks cooler.
- - above and beyond - -
CubOfJudahsLion
Confed Special Operative
Confed Special Operative
Posts: 286
Joined: Tue Dec 21, 2004 3:11 am
Location: Costa Pobre
Contact:

Post by CubOfJudahsLion »

@coffeebot: Um. Tradition? It was common to extrapolate that future technologies will look like current ones in the 60's and 70's. It wasn't until the 90's that alternatives were truly contemplated--namely the 'bio-ships' that suddenly popped up everywhere around sci-fi shows.

I see where you're coming from. I've been thinking the same for quite some time now, design-wise (no, I'm not doing any VS ships presently.) Spaceships might require an entirely different approach to vehicular engineering and construction. Heck, maybe even different engineering principles, or even a different notion of 'science' (compare a 9th century 'man of science' to a modern physicist. It's not unreasonable to suspect that that's exactly what our science will look compared to the one the time of Vega Strike.)

Then again, it can be argued that those ships, buildings and whatever that do resemble familiar structures have been engineered using said unfathomable future knowledge, but that it doesn't show as much as a result of economic, aesthetic or even engineering (ergonomic?) directives.

@strangelet: I dig 1.5. 'scuse me if I use it lots :)
Duality
Daredevil Venturer
Daredevil Venturer
Posts: 583
Joined: Sun Feb 16, 2003 12:58 am
Location: West Coast of USA
Contact:

Post by Duality »

I wish hullgen was a seperate stand alone executable program.
Post Reply