Image resource changes

Freeform discussion about anything related to modding Transcendence.
Post Reply
george moromisato
Developer
Developer
Posts: 2984
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Mon Dec 20, 2010 12:24 am

I've made a couple of enhancements in 1.04:

1. Image types can be overridden. This means that you can create an extension that overrides an image in the core game. For example, your extension could add a new copy of rsItems1 to override the default one:

Code: Select all

<Image UNID="&rsItems1;"
   bitmap="MyItems.jpg"
   bitmask="MyItemsMask.bmp"
   backColor="0x00000000"/>
[If you do this inside an adventure extension, the images are only overridden if you run that adventure.]

2. In order to support SiaFu's cool new item images, I've started to assign each item to its own image. For 1.04, I've separated all items marked with one of the following attributes:

Bushido
EI
Makayev
NAMI
Rasiermesser
Taikon

That means that each of the items with the attributes above points to a separate image. For example, Bushido items use images in the &rsItemsBushido1 resource.

If you want to assign a unique item image to a Bushido item, all you have to do is override the rsItemsBushido1 resource--you don't have to modify any of the items.

In 1.05 I will convert more items to have their own images as needed.

User avatar
sdw195
Militia Captain
Militia Captain
Posts: 779
Joined: Wed Nov 18, 2009 1:01 am
Location: Still looking for the csc Antarctica
Contact:

Mon Dec 20, 2010 12:40 am

does this mean every weapon will have a deferent image resource of just the deferent weapon makers have a deferent image resource??
Image
Image
Image
Image
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"

User avatar
Star Weaver
Militia Commander
Militia Commander
Posts: 311
Joined: Sun Nov 07, 2010 10:20 pm
Location: . . . between the stars and the warm black sky . . .

Mon Dec 20, 2010 12:43 am

Hm. I think I'm missing something here. Is the image for rsItemsBushido1 going to contain a grid of identical cannons for the canon game? Since the pixel coordinates of the subimage are still defined in the ItemType, it would have to if we were going to give, say, the Shruiken and the X-Ray laser seperate graphics, right?

Great progress though! (And while you're at it, can we get something like this for sounds, so we can also replace item sounds without changing functionality? :D)

george moromisato
Developer
Developer
Posts: 2984
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Mon Dec 20, 2010 1:36 am

Star Weaver wrote:Hm. I think I'm missing something here. Is the image for rsItemsBushido1 going to contain a grid of identical cannons for the canon game?
Yes, rsItemsBushido1 will have a grid of identical cannons. An extension can replace rsItemsBushido1 and make each of the weapons different.

Here is an example:

Image

In 1.04, the only items that will have separate images will be the ones from a specific maker (listed in the OP). Later I will separate the images for other items.

User avatar
Star Weaver
Militia Commander
Militia Commander
Posts: 311
Joined: Sun Nov 07, 2010 10:20 pm
Location: . . . between the stars and the warm black sky . . .

Mon Dec 20, 2010 1:41 am

Awesome. Are you planning on going as far with this as seperate image locations for all the trade goods? That would be awesome but it would seem to bloat the offical release a bit if you do it this way.

Have you perhaps considered adding an intermediary design type, such as:

Code: Select all

<SubImage UNID="&siNeutronBlaster;">
  <Image imageID="&rsItems1;" imageX="96" imageY="0"
      imageWidth="96" imageHeight="96"/>
</SubImage>

<ItemType UNID="&itNeutronBlaster; ...>
   ...
  <Image subImage="&siNeutronBlaster;">
   ...
I wouldn't know what the best way to do that would be, but it would allow great access to modders without having to change any files in the base game, if that was preferable.

george moromisato
Developer
Developer
Posts: 2984
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Mon Dec 20, 2010 6:00 am

In practice, the big problem won't be download size, because the images are heavily compressed (even if every item had its own image it would only increase download size by 2.5 MB).

The problem is memory use. Having 500 items with their own image will consume 9 MB during play. One strategy is to only load the images when needed and to cache them appropriately.

But in any case, I don't think it is necessary to have every single item have its own image (not at first, anyway).

I do like your proposal of adding a level of indirection. This would save both download size and memory use. But it does add complexity (and implementation time) and it does consume UNIDs.

Another possibility is to add a way for an extension to override only certain parts of an item. Imagine:

Code: Select all

<ItemTypeOverride UNID="&itNeutronBlaster;">
     <Image imageID="..." ... />
</ItemTypeOverride>
This is also very complex (more complex that your proposal) but might be more flexible (e.g., you can imagine overriding a launcher to add a new missile without re-declaring all the old missiles).

User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

Mon Dec 20, 2010 5:34 pm

Another option would be to externalize the definition of the image, and just set it as an attribute.

Code: Select all


<ItemType UNID="&itGemOfContrition;"
  image="&imGemOfContrition;">
....
</ItemType>

<ImageType UNID="&imGemOfContrition;"
  imageID="&rsItems1;"
  imageX="0" imageY="576"
  imageWidth="96" imageHeight="96"/>
It would take up a lot of UNID's and require changes throughout the xml, but it would be a very straight forward development from the current methods and not require adding a complex ItemTypeOverride (which otherwise sounds nice)

As an added benefit you would not need to change the current sprite sheets or load more images into memory (depending on how you handle using the same image across ImageTypes).

If you leave in the old handling of images in items then you even only have to migrate over items a bit at a time, and wont end up breaking old mods.

User avatar
SiaFu
Commonwealth Pilot
Commonwealth Pilot
Posts: 88
Joined: Thu Jul 08, 2010 4:10 pm

Mon Dec 20, 2010 6:41 pm

This is great news!

If the ItemTypeOverride path is taken, would there be some order of priority as well?
If this externalization would recognize a parameter (like for installed/inventoried items or a simple condition) that'd be great.

Also, if a similar thing is done for the sound definition, it could solve the current 1.03 buggyness of sharing SFX resources with the same UNID across XMLs.
(I'd also suggest that onArmorHit sounds for the PlayerShip be differentiated from the other hits so we can discern when our armor is hit versus when somebody else is damaged and never have to worry about red flashing again).


P.S. Will the separate manufacturer sheets mean that there'll be some new canon company logos? And I'll finally find out what the NAMI acronym is for?
Image
Mods here & there.Banners thanks to: digdug .

george moromisato
Developer
Developer
Posts: 2984
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Wed Dec 22, 2010 4:40 am

Here are the labeled resources in 1.04 (please feel free to put these on the Wiki):

ItemsBushido1
Image

ItemsBushido2
Image

ItemsEI1
Image

ItemsEI2
Image

ItemsEI3
Image

ItemsMakayev1
Image

ItemsMakayev2
Image

ItemsMakayev3
Image

ItemsNAMI1
Image

ItemsNAMI2
Image

ItemsNAMI3
Image

ItemsNAMI4
Image

ItemsRasiermesser1
Image

ItemsRasiermesser2
Image

ItemsRasiermesser3
Image

ItemsRasiermesser4
Image

ItemsTaikon1
Image

Post Reply