Author Topic: Unit/wep Graphics  (Read 4577 times)

Offline Betaray

  • Administrator
  • Hero Member
  • *****
  • Posts: 2897
Unit/wep Graphics
« on: November 03, 2005, 02:22:57 PM »
just wondering, does op2 use a picture type format for its buildings/units/weps, mabe somthing simmiler to an anamated GIF for ambiant anamations (the str fact venting gas and what not)

for example, does op2 use a pic for a laser turret pointed north, but than use a different pic for it pointing east?

and if so, does anyone have a list of those pics?
I am the nincompoop, I eat atomic bombs for breakfest, fusion bombs for lunch, and anti-matter bombs for dinner

I just hope they don't explode

Offline HaXtOr

  • Sr. Member
  • ****
  • Posts: 423
    • http://www.wtfmoogle.com
Unit/wep Graphics
« Reply #1 on: November 03, 2005, 02:24:34 PM »
this information is somewhere with the mapeditor backend i think

Offline Tellaris

  • Sr. Member
  • ****
  • Posts: 460
Unit/wep Graphics
« Reply #2 on: November 03, 2005, 03:12:23 PM »
I don't know about units, but tiles use a simple .bmp.   Found in the pool in the maps.vol.   Dunno how to extract that tho.
Spell Checker!   The PoWeR tOoL
Click Here For Coolness
Self Proclaimed OPU Help desk.

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Unit/wep Graphics
« Reply #3 on: November 03, 2005, 04:44:43 PM »
Units are stored in OP2_ART.bmp.

You technically *have* them, but not the means to extract them (yet)

We want to release an extractor at some point.

Oh yeah, the next version of the mapper can show unit graphics (from OP2_ART). No extraction though (yet)

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
Unit/wep Graphics
« Reply #4 on: November 03, 2005, 09:12:48 PM »
Processing units graphics (or anything out of OP2_ART) was one of the major areas not touched by the map editor backend.

You can probably find some programs posted in the coding section to deal with the graphics. I know Cynex had a program that could extract the graphics to regular bitmap files. I'm not sure that one is posted though. I've posted a VB project (with source) that allows you to view many of the graphics, but not extract them. If you had some programming experience, you might be able to mod it yourself though.

And yeah, each graphic is stored as a seperate frame. So you'd have seperate "bitmaps" for each direction a weapon was facing.


What were you planning to do with these said images?
 

Offline spirit1flyer

  • Hero Member
  • *****
  • Posts: 621
Unit/wep Graphics
« Reply #5 on: November 03, 2005, 09:36:16 PM »
if anyone wants I can asked one of the art people who made OP2

I have a few E-mails addys to them
 
"Until you stalk and overrun You can't devour anyone"


Loyal Xfir supporter

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
Unit/wep Graphics
« Reply #6 on: November 03, 2005, 09:39:49 PM »
We probably already have the knowledge we need, just not the premade software necessarily. (But Cynex's program can do it.) So unless they happen to have some software kicking around to play with those files, I doubt there is too much they can tell us that will be useful. (Although, it might very well be interesting to get the info from them. Who knows, maybe they can remember something we haven't figured out). So yeah, I'd feel a little guilty bugging them about these obscure technical details after so many years. I doubt there is much they could remember.
 

Offline Betaray

  • Administrator
  • Hero Member
  • *****
  • Posts: 2897
Unit/wep Graphics
« Reply #7 on: November 03, 2005, 09:53:06 PM »
well Im takeing a computer graphics course, and right now I have an assignment to make a flash anamation, and I was hopeing on using some of the imiges from op2 to do it
I am the nincompoop, I eat atomic bombs for breakfest, fusion bombs for lunch, and anti-matter bombs for dinner

I just hope they don't explode

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
Unit/wep Graphics
« Reply #8 on: November 04, 2005, 05:46:57 PM »
Well, it doesn't appear Cynex has released his viewer/converter/etc. to the public. I guess if you really wanted those pics, you could use the viewer I uploaded and just take screen shots and save the images with Paint. Although, the link to the files that I left is currently broken (from recent forum issues?) so if you want it, just message me somehow (PM/IRC) and I'll dig up the files and send it to you.
« Last Edit: November 04, 2005, 05:47:24 PM by Hooman »

Offline Stormy

  • Hero Member
  • *****
  • Posts: 678
    • http://www.op3game.net
Unit/wep Graphics
« Reply #9 on: November 06, 2005, 09:09:53 PM »
I HAVE the op2 Art Viewer.... I think I got it off OPU...

It does have the ability to extract and save any pic you want; Just the pics are not named by the unit/building type. They are numbered.... Sometime someone needs to make a config file that names them all... but that would take quite some time.... at least 1000 images to name if not more...

It's by Cynex.... Hmm


Any ideas here? :lol: I'm lost.....


Stormy
`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·
3D artist in Blender, MS3D, and Terragen.
Trying to get good with Scene composition and lighting.

Offline zigzagjoe

  • Hero Member
  • *****
  • Posts: 626
Unit/wep Graphics
« Reply #10 on: November 06, 2005, 11:29:09 PM »
yeah, the cynex viewer is not for public use; only avalible for devs afaik. as far as hooman's proj, it may be on my mirror somewhere....

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
Unit/wep Graphics
« Reply #11 on: November 06, 2005, 11:44:20 PM »
Yeah, Cynex's program kicks my viewer program's butt. But Cynex has never publicly released his, and I don't much like the idea of having people trading it around behind his back. Maybe if you sent him a PM he might be willing to send it to you.

If not, you can get what I've made from anywhere you can find it. I've released my project for all to use, but with the current hosting problems, the download doesn't work. Nor is that in my power to fix.

If you don't have it ZZJ, I'll send it to you so you can mirror it.
 

Offline Stormy

  • Hero Member
  • *****
  • Posts: 678
    • http://www.op3game.net
Unit/wep Graphics
« Reply #12 on: November 07, 2005, 06:34:47 PM »
Does Cynex come on at all? If he is like that I want to be completely sure he is ok with me using it (and maybe the other artists for OP3). It was a HUGE help, and I don't want to lose it. Anyway, I'll PM him and see what happens ;)

stormy :op2:
`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·
3D artist in Blender, MS3D, and Terragen.
Trying to get good with Scene composition and lighting.

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2350
  • OPHD Lead Developer
    • LairWorks Entertainment
Unit/wep Graphics
« Reply #13 on: November 07, 2005, 08:50:06 PM »
Hmmm... interesting that it's not been released for public use. Oh well... maybe I'll delve into the OP2 Art File Format and come up with something of my own viewer/extracter sort of like WinZIP/WinRAR with a preview window or something.

Offline Stormy

  • Hero Member
  • *****
  • Posts: 678
    • http://www.op3game.net
Unit/wep Graphics
« Reply #14 on: November 07, 2005, 09:26:48 PM »
:lol: leeor_net, don't make yourself TOO busy B)... Oh well, We should see about getting that released for the public or at least for project artists (of all the projects)

OR we could just take screenshots of everything!!!! w00t :heh: :thumbsup: ahem.... Just kidding.....

Hmm..... That's all I have to say about that :P

stormy :op2:
`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·
3D artist in Blender, MS3D, and Terragen.
Trying to get good with Scene composition and lighting.

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Unit/wep Graphics
« Reply #15 on: November 08, 2005, 07:43:20 AM »
Yea right, I wouldnt spend any time on it, let other people do it.

Last time I talked to Cynex he said he was working on making the viewer able to write to the art file as well as read it so we can edit game graphics. Which imo is the last major thing to be able to do with OP2.

Here is v2 of the viewer, i think the latest.
op2artview.rar

I think a viewer than can export all the images to bmps/gifs then can reimport them and recompile the art file would be great and would make it easy to c all the images and edit/replace them.

Offline Betaray

  • Administrator
  • Hero Member
  • *****
  • Posts: 2897
Unit/wep Graphics
« Reply #16 on: November 08, 2005, 06:02:04 PM »
this may be me just being a nieve programming no nothing, but while are the imiges loaded by that so small?, I can barly see anything than pixicls
I am the nincompoop, I eat atomic bombs for breakfest, fusion bombs for lunch, and anti-matter bombs for dinner

I just hope they don't explode

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Unit/wep Graphics
« Reply #17 on: November 08, 2005, 06:05:14 PM »
You need to extract the op2 art from maps.vol and then load the art with the viewer.

Offline Betaray

  • Administrator
  • Hero Member
  • *****
  • Posts: 2897
Unit/wep Graphics
« Reply #18 on: November 08, 2005, 06:08:52 PM »
did that, all I see is pixels with what seems to be random colors, but I can see by how it moves that, I found the anamated pic of construction

what I was wondering, is if there was a way to clean the imige up, and more importantly, zoom it so I can see detail
I am the nincompoop, I eat atomic bombs for breakfest, fusion bombs for lunch, and anti-matter bombs for dinner

I just hope they don't explode

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
Unit/wep Graphics
« Reply #19 on: November 08, 2005, 07:34:54 PM »
Last time I spoke to Cynex (many months ago), he already had a program that could repack the op2_art files with new graphics.

Leeor, I've already released an art viewer (with source code). It reads the op2_art.bmp and op2_art.prt files and displays the images. You can select which image to view. It's just that it sucks in comparison with what Cynex has made. He went and wrote code for displaying animation sequences, and composite images, and allowed for saving of the images to a file, (and repacking too). As for knowledge about the art file, what I have is pretty close to what Cynex had. I just never wrote code to take advantage of all the information. But if you look at the loader code, you can see how it's all parsed, and the data is all there. (Aside for one slight detail, which I showed how to "parse" but discarded the data. I think it had to do with pixel offsets.)

Btw, I agree with Stormy. Don't make yourself too busy Leeor. Finish what you've already started first!  :P


Betaray, I suspect it might be a pixel depth issue or palette issue. Not all the images in the art file have the same bit depth, nor do they use the same palette. If the viewer messes up with either, the image will look distorted. If it's just the palette, than the colors will be wrong, but the image dimension should be right. If it's the bit depth, then it could cause the image to appear resized and in weird colors. Is it for all images? Or just some of them?
 

Offline Betaray

  • Administrator
  • Hero Member
  • *****
  • Posts: 2897
Unit/wep Graphics
« Reply #20 on: November 08, 2005, 07:49:51 PM »
for most of them, it just looks like static

just random pixels, the anamations work, but I cant tell what its anamating

its completly unrecogniseable as a structure, vec, or wep
I am the nincompoop, I eat atomic bombs for breakfest, fusion bombs for lunch, and anti-matter bombs for dinner

I just hope they don't explode

Offline Stormy

  • Hero Member
  • *****
  • Posts: 678
    • http://www.op3game.net
Unit/wep Graphics
« Reply #21 on: November 08, 2005, 08:47:51 PM »
Did the game have actual code that removes the background the vechs and whatnot  are on? How does this work? Does it use RGB or chromakey type things?
:lol: I'm curious..... :D

stormy :op2:
`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·
3D artist in Blender, MS3D, and Terragen.
Trying to get good with Scene composition and lighting.

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Unit/wep Graphics
« Reply #22 on: November 11, 2005, 02:35:39 PM »
Well, it probably works the same way most sprites (bitmaps with transparency) are blit onto the screen.

Basic computer sprites primer:

One palette index is set as the 'transparent' index. This happens to be index #0 in the palette for all the OP2_ART palettes.

This index is used to create a mask (which is just a 1bpp bitmap, with the transparent parts set to white (1), the rest set to black (0)).

The next part, it helps if you have some understanding of how boolean operations work.

The mask is then AND'ed with the pixels on the screen where the image is to be drawn. The black part (the non transparent portion) just turns the part where it's ANDed black, masking out everything but the nontransparent area from being modified.
The actual image is then drawn over that masked out area with the OR operator, with the transparent parts of the bitmap being black (so it won't damage the masked out part). The black pixels turn whatever color was in the source bitmap at that location, and there you have it, it's transparently blitted.

This is how virtually all programs do it. One color is chosen as the transparent color, and is used to mask the transparent areas from being changed. (Well, I guess some programs use separate 1bpp bitmaps for masks. Kinda a pain in the butt if you have to change the image however, because you have to update the mask. It's easier to just assign one color transparent)

This is the same reason that when you extract certain images from programs' resources, the background is a bright pink color. (This color is used as the transparent color and again, is used to mask out those pixels)

OP2 does use 1bpp bitmaps to produce shadows. (It's ANDed with the display as before to darken the ground underneath it, creating the shadow effects).

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
Unit/wep Graphics
« Reply #23 on: November 11, 2005, 05:21:36 PM »
How sure are you of all that stuff?

I've seen a few examples with the AND and OR technique, but I get the feeling that isn't really used all that often in actual production code for most things like games. I'd imagine it's just a simple IF, to see if the color matches the transparent color, and if it is, it skips drawing that pixel. Not that I like the idea of an IF in an innner loop. Nor have I liked programs that stored imagines twice. Once for the color image and once for the mask. I guess it would be possible to replace the IF and AND and OR, but I'm a bit curious as to your exact meaning here. (I've seen some pretty lousy code that uses AND and OR, in a two pass manner  (thumbsdown) ).

At any rate, I'm pretty sure OP2 has some sort of designated transparent color in the palettes.  

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Unit/wep Graphics
« Reply #24 on: November 11, 2005, 05:23:46 PM »
Well, I was talking about the raster op that you give to BitBlt. not actually doing boolean operations pixel-by-pixel, yuck!

Granted, it works a lot different if you're using DirectX (you can specify Colorkeys and it handles everything for you)