.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening > Scenarios, Maps and Mods

Reply
 
Thread Tools Display Modes
  #1  
Old November 1st, 2006, 02:37 AM
Singularity24601's Avatar

Singularity24601 Singularity24601 is offline
Corporal
 
Join Date: Oct 2006
Posts: 55
Thanks: 1
Thanked 10 Times in 2 Posts
Singularity24601 is on a distinguished road
Default A method of extracting perfect sprites

In non-total conversion modding, I strongly prefer additions to be aesthetically consistent with the unmodified game. Given that Dominions sprites are designed systematically (units have consistent poses), the creating of new perfectly consistent sprites requires perfect extraction of existing sprites as template material for modification. This is difficult to achieve in Dominions 3, in the absence of a specific sprite extracting system, for several reasons:
- All sprites in any game screenshot have undergone some sort of scaling and resampling, leading to blurring and size inconsistencies.
- Battle screenshots offer superior resolution, but in addition to scaling, are skewed due to 3D perspective (imagine each sprites as a picture drawn on a flat transparent card, standing perpedicularly to the ground).

I've found a difficult but successful method to extract sprites perfectly. The 'quantum method' uses human judgement plus 'nearest neighbour' resampling to force a sprite from a screenshot back to it's original pixels. I used Adobe Photoshop and Microsoft Paint. See attachment for illustrations:

1) Preparation
In a battle, I position the camera at minimum distance to the ground and take a screenshot of the sprite positioned at the centre (minimise skew distortion) of the bottom (maximise resolution) of the screen. This method will not work unless you first turn off Filtering in your game Video Options. You should also turn off Grass rendering. Prepare the sprite by cropping the surroundings. Then divide the sprite into smaller segments to reduce skew errors in the next step. The red diagram describes the skew expected in the sprite while the blue describes the approximation we will assume in our logic in segmentation.

2) Quantum-isation
For each segment, manually count the number of pixels that would be present in the original sprite. Double check as correct measurement is essential. Then (in Photoshop), scale each segment down to the dimensions you measured, with 'nearest neighbour' resampling, forcing the computer to calculate, as best it can, the original sprite.

3) Error correction
The resampling may not be perfect. I reattached the segments and rescaled (with 'nearest neighbour' resampling) to triple size, juxtaposing with the screenshot to check for errors. All resampling errors should result in 'stretched pixels', so rather than check each pixel, I looked out for areas of identical colour and compared with the screenshot to see whether it is correct or a distortion.

4) Finishing
In this case, there were no distortions for me to fix (distortions were present when I did not segment the image before resampling). Remove the background, magenta the shadow, and place in a TGA file with the feet 2 pixels from the bottom border. Correct lateral centering can be achieved by simple trial and error by observing in-game results.

A somewhat time-consuming process, complex but learnable, or will Illwinter save us the trouble by providing another means?
Attached Images
File Type: gif 465577-Dominions - Spriting.gif (19.9 KB, 249 views)
Reply With Quote
  #2  
Old November 1st, 2006, 07:05 AM
Endoperez's Avatar

Endoperez Endoperez is offline
National Security Advisor
 
Join Date: Sep 2003
Location: Eastern Finland
Posts: 7,110
Thanks: 145
Thanked 153 Times in 101 Posts
Endoperez is on a distinguished road
Default Re: A method of extracting perfect sprites

In windowed mode, the image shown when viewing the details of the unit is in the default resolution, and PrintScr copies the sprite as-is.

I have a black map I use for extracting sprites. Well, I haven't extracted any in a long time, but I just tested and this still works fine. In the Video settings, I put Opacity down to 0 and Filtering off. Then I just zoom to the black map and open the unit details window. so that the unit sprite is against black background. You can only get the first sprite this way, not the attack sprite.

If this wasn't clear enough, I can update my old extraction guide for Dom3. Example JPG, which is BIG for a JPG, attached.

Last edited by Endoperez; August 13th, 2008 at 11:34 AM..
Reply With Quote
  #3  
Old November 1st, 2006, 08:43 AM
Singularity24601's Avatar

Singularity24601 Singularity24601 is offline
Corporal
 
Join Date: Oct 2006
Posts: 55
Thanks: 1
Thanked 10 Times in 2 Posts
Singularity24601 is on a distinguished road
Default Re: A method of extracting perfect sprites

The image shown when viewing the details of the unit is actually enlarged by about 25%. For example, look at the topmost row of pixels of the lizard's tail in the image attached - the whole row exhibits what I meant by 'stretched pixels'. If you use that picture as a sprite and view the details in the game, you'll find that it will be 25% larger than the normal chariot.
Reply With Quote
  #4  
Old November 1st, 2006, 08:47 AM
Endoperez's Avatar

Endoperez Endoperez is offline
National Security Advisor
 
Join Date: Sep 2003
Location: Eastern Finland
Posts: 7,110
Thanks: 145
Thanked 153 Times in 101 Posts
Endoperez is on a distinguished road
Default Re: A method of extracting perfect sprites

Really? I'll have to test that. This method worked in DomII, and in the few tests I did I didn't notice any streched pixels.



EDIT: You are right. I quess the commander icons MIGHT be resized to the correct size, but getting EXACT graphics will be harder.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 12:28 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.