Author Topic: Custom textures for races without models.  (Read 2045 times)

Under the moon

  • Forum Addict
  • *
  • Posts: 2335
  • Writer extraordinaire.
    • View Profile
Custom textures for races without models.
« on: September 08, 2006, 11:18:41 pm »
I will make this short and simple.

The situation: There are 12 races in the game -times two for male/female-, making 23 eventual basic character types, yet there are only 10 character folders in the Planeshift folder. The server sends out tags (or whatever the term is) for just those ten characters, using some of the models as many as six times for very dissimilar races.

The problem: Besides the obvious difficulty of telling the races apart at first glance, trying to edit the files to look a little more like your own race or character changes ALL other characters as well.

My suggestion: Copy and rename all the character files so that one exists for each race and gender, then have the server send new tags with all the renamed files. This will not change the appearance of the default client at all. However, it will give folks the opportunity to edit the skins for each race on their own client, rather than a crapshoot.
« Last Edit: September 08, 2006, 11:21:15 pm by Under the moon »

Sisilam

  • Traveller
  • *
  • Posts: 38
    • View Profile
Re: Custom textures for races without models.
« Reply #1 on: September 08, 2006, 11:40:03 pm »
This need some rewriting which isn't that easy I guess .. anyhow I think there is a plan to change this anyway to be able to have a player change his own view

Sisilam

  • Traveller
  • *
  • Posts: 38
    • View Profile
Re: Custom textures for races without models.
« Reply #2 on: September 09, 2006, 01:24:54 am »
as Talad mentioned:
<Talad> Underthemoon: the idea is not bad, but doing it the quick way will raise the memory used by the client, because it will double load the textures and models

I took a look .. as far as I had understood there is a file art/models.zip which holds different textures and views of all the races .. 10 of them are player related:
dermm, enkif, enkim, fynnwn, klyrosm, kran, stonebf, stonebm, ylianm and ynnwnm = 10 different views
so you wish as like for the male and female enkis (enkim/enkif) the same directorys as well fron ylianf, ynnwnf, etc.
Till now the server sends the same tag for different races/genders .. if there are several other directorys with the same date the data is loaded twice which makes no big sense.

So I gues as well the cachemanager should be updated in any way so that it is possible to store links to different objects which will internal just represent a pointer to the same object. So if it is the same object even if it is in another directory it will not consume double the memory...

Nikodemus

  • Prospects
  • Veteran
  • *
  • Posts: 1808
    • View Profile
Re: Custom textures for races without models.
« Reply #3 on: September 09, 2006, 01:25:42 am »
Under the moon, briliant idea.
With some luck people will also make some 3D models? Would be amaizing. Although most of the skins people do are rather weird, but maybe after some time we will have some worth skins :)
As for the additional memory usage.... maybe a switch for those who want to use it and those who dont? But maybe i'm only dreaming about simple code for this one.
« Last Edit: September 09, 2006, 01:27:40 am by Nikodemus »



What you can failure tommorow, failure today.


Better click for shiny stylez Help me with images!

Under the moon

  • Forum Addict
  • *
  • Posts: 2335
  • Writer extraordinaire.
    • View Profile
Re: Custom textures for races without models.
« Reply #4 on: September 09, 2006, 02:23:10 am »
Yes, it may use twice the memory for the same model right now, or even more than twice for the Ynnwn female, which is used six times. But, in the future, all characters have their own models (or modded versions of existing ones). That would increase the memory usage the same amount, would it not? It may even be a good idea to do this, as it would test more load on the clients, and perhaps lead to ways to slim it down some.

Sisilam

  • Traveller
  • *
  • Posts: 38
    • View Profile
Re: Custom textures for races without models.
« Reply #5 on: September 09, 2006, 02:18:23 pm »
yes .. the memory will be used anyway someday .. so I guessed taht we can do it that way:

today: for several races the YnnwnF is send which always load the data from art/models.zip/YnnwnF/*
so for the Hand texture the file leads to art/models.zip/YnnwnF/hand.png
we could change this that example for the Diaboli it leads to art/models.zip/DiaboliF/*

instead of coping the whole data of textures we implement a new file type we called memory-link ..
so fo the diaboli hand it leads to: art/models.zip/YnnwnF/hand.lnk

the link file is a simple text file where there is nothing else than the memory link to the real object in this case: art/models.zip/YnnwnF/hand.png

that way the object itself is only loaded once (hand.png) and the Ynnwn Hand is just a C-Pointer to the other object

this will save memory and it is easy to change .. if someday there is an own hand texture for the diaboli .. just replace the hand.lnk with the diabolihand.png

Under the moon

  • Forum Addict
  • *
  • Posts: 2335
  • Writer extraordinaire.
    • View Profile
Re: Custom textures for races without models.
« Reply #6 on: September 09, 2006, 04:29:48 pm »
I was just thinking the same thing, but did not know if the server sent down a catchall tag for the entire model/texture.

Another thing that could be done (maybe, not sure how this is done exactly), is using the alternate textures (or other 'bump' files?) to procedurally alter the base model so that you only have to download and load the one model. If size tags could be sent as well, then the existing models could be made the different heights with ease. But, that is a lot of work for something that would only be a temp system.

Perhaps if only the base textures and images where saved to file as default, and only the ones you edit and rename would be used. What I mean is the server sends out a tag for the diaboli female to an unedited client. The client reads the tag and checks for the BoliF files requested. If it does not find them, it falls back to the ynnwnF files. Again, I am not sure how hard this would be, or if it is worth the work.

Sisilam

  • Traveller
  • *
  • Posts: 38
    • View Profile
Re: Custom textures for races without models.
« Reply #7 on: September 09, 2006, 04:45:47 pm »
the last part shouldn't be that difficult .. its just like

if(texture==null) // loading has failed
{ // just get the default fallback entry
   texture = ...
}

I will take a closer look to that in the current CVS code

Sisilam

  • Traveller
  • *
  • Posts: 38
    • View Profile
Re: Custom textures for races without models.
« Reply #8 on: September 10, 2006, 01:30:25 am »
I lookd through the code a bit how the models are loaded

1.) psclientchar.cpp: LoadRaceInformation

Loads and Parse the file /data/races/description.xml
at this point the mappings are done while the mappings are still only CStrings:

Stonebreaker: stonebm, stobebf
Enkidukai: enkim, enkif
Ynnwn: ynnwnm, fynnwn
Ylian: ynnwnm, fynnwn
Xacha: ynnwnm, fynnwn
Nolthrir: dermm, fynnwn
Demorian: dermm, fynnwn
Hammerwielder: stonebm, stobebf
Diaboli: ynnwnm, fynnwn
Kran: kran, kran
Lemur: dermm, fynnwn
Klyros: klyrosm, klyrosm

as one can see except for Kran, Enki and Klyors its mostly Ynnwn textures, as well as the Hammerwielder look the same as the Stonebreaker

2.) psengine.cpp: PreloadSubDir

Loads the real cal3d and texture data from /planeshift/models/* (this is the ZIP file models.zip)

3.) pawscharpick.cpp: SelectCharacter

This is on the loading screen the character view of the turning selected character .. this is the first time the loaded data is used .. anyhow the Data is processed through the CacheManager in the way:

->GetCacheManager()->getFactoryEntry(models[selectedCharacter].filename);

where the filename is the ZIP entry .. e.g. for a kran this will be /planeshift/models/kran/kran.cal3d

--------------------

so indeed .. if you add your own texture for the 'Xacha' as example you have to modify the description.xml as well as to add the models.zip, overall if you just copy most of the files from the Ynnwn directory to your new Xacha directory will this lead to load the same data twice to the memory .. but this will happen sooner or later anyway as soon as the Textures for those races is ready .. so my guess is (if not possible yet) to add the option to not realy load an object but link to an existing one inside of the CachManger as soon as an Object should be added .. so instead of using something like CacheManager()->LoadObject(name, filename) .. we might use somethink like CacheManager()->LinkToObject(name, linkedname) .. that way the object isn't realy loaded twice but instead will return the other object ..

anyhow in fact of lack of an other cal3d file I was unable to check on the first run if everything is implemented and we don't have to change any code but only add the entry to the models.zip and description.xml to work proper .. maybe Under_The_Moon .. I saw that you created a female Klyros .. so you might just test it if it will work that way :)

- Sisilam

Induane

  • Veteran
  • *
  • Posts: 1287
  • What should I put here?
    • View Profile
    • Vaalnor Inc.
Re: Custom textures for races without models.
« Reply #9 on: September 10, 2006, 03:10:40 am »
To make this more difficult for everyone, I would like to be able to set skins for say... every character of a certain race within your guild.  That way you could have your own uniforms and distinguish each other ingame without ooc names floating above your head with guild info.

Under the moon

  • Forum Addict
  • *
  • Posts: 2335
  • Writer extraordinaire.
    • View Profile
Re: Custom textures for races without models.
« Reply #10 on: September 10, 2006, 03:22:40 am »
That makes things much more difficult, seeings how the above post turns out to be invalid. That does, indeed load different races...but only in character creation. Once the game starts, those loaded models become invalid as the strings/tags from the server take over. This has lead to two conclusions on my part:

1. The server sends out strings for each race, which the client points towards the other races models.
2. The sever only sends out strings for existing race models.

The second means there is nothing we can do about it. If I could get a dev to answer me, we would have an answer. :)

Sisilam

  • Traveller
  • *
  • Posts: 38
    • View Profile
Re: Custom textures for races without models.
« Reply #11 on: September 13, 2006, 12:55:26 am »
that bad point at top ..

the server itself handles the stuff different to the client .. you wouldn't believe it .. but .. the server loads all the mapping stuff as a predefined constant list .. so instead like the client which is parsing the description.xml and models.zip file to get a clue which texture/cal3d is used for a race there is an array list. Thats why the server always send something like 'stonebm' for a 'Xacha' even if defined something else in the description.xml or models.zip.

I guess the server should be changed to work the same was as the client .. loading the /data/races/description.xml and parse it as well the models.zip
Thtas as well the reason why it will work in the creation process of your char but will fail after reloading ..

to the post of Induane:

yes .. while using such xml like the description.xml which till now only bother about race and gender you may lateron ad as well stuff to add a section about guild or name to make a special outlook .. maybe that way a leader of the Shadow Guild has different clothes as a common Soldier even if they both weild the same kind of armor ..

witchking

  • Guest
Re: Custom textures for races without models.
« Reply #12 on: November 03, 2006, 08:58:50 am »
Custom textures take time to create as well (although it would be really nice to implement them eventually), so even something as simple as a hue/brightness/color_balance change to an existing texture would be great to distinguish from multiple clones running around. Sure, an Ynnwn based female model will still have those little horns sticking out but at least the skin color will match an intended race's skin color. That alone would be a pleasant touch. And while it might look like a crude solution, it's only temporary, and still a step up from identical clones. I'm sure the players will understand and even appreciate it.

Under the moon

  • Forum Addict
  • *
  • Posts: 2335
  • Writer extraordinaire.
    • View Profile
Re: Custom textures for races without models.
« Reply #13 on: December 18, 2006, 03:04:52 am »
*bump*

There are different skins for many of the races ingame now, such as the enki. Perhaps one could just add new texture IDs to the Character Selection screen like the Enki have for their different clans, but instead, have it listed for the races. Female ynnwn, for example, could have Diaboli, Xacha, etc. It would still be up to players to edit those files to look different.

emeraldfool

  • Veteran
  • *
  • Posts: 1383
  • Irish (adj.): Cynical; morally bankrupt
    • View Profile
    • My Portfolio (or at least what I've bothered to upload...)
Re: Custom textures for races without models.
« Reply #14 on: December 19, 2006, 09:40:28 pm »
I think this is a good idea, and agree that there should be something we can do about the clones.

...
I'm going to go away now :P

(Yeah, I have so much to add to this thread...)