Newbie Spellweaver
- Joined
- Dec 26, 2019
- Messages
- 69
- Reaction score
- 38
Hi
I recently started recreating the Danish Habbo Hotel as it was back in 2004-2008 the golden Shockwave ages, and I quickly found the need to display images of the Habbo´s on the website.
Now to do a little bit of background research; the old figuredata is based on 25 integers and the new one is very different, based on a string defining the different parts of the figure in a somewhat more human readable format.
Old figuredata
8311618501285023000680546
New figuredata
hr-831-16.hd-185-01.ch-805-46.lg-285-02.sh-300-06
Converting
Now just converting the old figuredata to the new is somewhat possible, however the colors is all mixed up.
Old figure rendered in the Shockwave client:
Figuredata:
8311618501285023000680546
Directly converted:
Figuredata:
hr-831-16.hd-185-01.ch-805-46.lg-285-02.sh-300-06
Now as you can see the colors are all mixed up, and even further investigating will reveal that hats are not rendered at all.
The new figuredata is roughly translated to something like this:
hr-{spriteid}-{color}.hd-{spriteid}-{color}.ch-{spriteid}-{color}.lg-{spriteid}-{color}.sh-{spriteid}-{color}.
So its clear theres a pattern here.
Therefore I looked into taking the colors from the old "figuredata.txt" and matching it with the new "figuredata.xml". Now this required converting of the old and new files to json and traversing the trees matching the colors and returning the new ids of those colors.
As it turns out the old figuredata relied on the index of the color, where as in the newer version they switched from index of the colors to ids.
For hats I had to do a switch on the sprite-id of the old figuredata and manually match it with the new one.
As a result I ended up with what I expected the correctly rendered figure/avatar.
Converted from the old figuredata to new:
hr-831-1041.hd-185-1026.ch-805-1134.lg-285-1200.sh-300-1195.ha-0-1041
Functional demo
The method simply converts the old figuredata correctly and and sends it to the Habbo API.
Therefore it supports all the bells and whistles of the current Habbo API.
You're free to download, fork and contribute to the project on Github:
- Patrick
I recently started recreating the Danish Habbo Hotel as it was back in 2004-2008 the golden Shockwave ages, and I quickly found the need to display images of the Habbo´s on the website.
Now to do a little bit of background research; the old figuredata is based on 25 integers and the new one is very different, based on a string defining the different parts of the figure in a somewhat more human readable format.
Old figuredata
8311618501285023000680546
New figuredata
hr-831-16.hd-185-01.ch-805-46.lg-285-02.sh-300-06
Converting
Now just converting the old figuredata to the new is somewhat possible, however the colors is all mixed up.
Old figure rendered in the Shockwave client:
Figuredata:
8311618501285023000680546
Directly converted:
Figuredata:
hr-831-16.hd-185-01.ch-805-46.lg-285-02.sh-300-06
Now as you can see the colors are all mixed up, and even further investigating will reveal that hats are not rendered at all.
The new figuredata is roughly translated to something like this:
hr-{spriteid}-{color}.hd-{spriteid}-{color}.ch-{spriteid}-{color}.lg-{spriteid}-{color}.sh-{spriteid}-{color}.
So its clear theres a pattern here.
Therefore I looked into taking the colors from the old "figuredata.txt" and matching it with the new "figuredata.xml". Now this required converting of the old and new files to json and traversing the trees matching the colors and returning the new ids of those colors.
As it turns out the old figuredata relied on the index of the color, where as in the newer version they switched from index of the colors to ids.
For hats I had to do a switch on the sprite-id of the old figuredata and manually match it with the new one.
As a result I ended up with what I expected the correctly rendered figure/avatar.
Converted from the old figuredata to new:
hr-831-1041.hd-185-1026.ch-805-1134.lg-285-1200.sh-300-1195.ha-0-1041
Functional demo
You must be registered to see links
The method simply converts the old figuredata correctly and and sends it to the Habbo API.
Therefore it supports all the bells and whistles of the current Habbo API.
You're free to download, fork and contribute to the project on Github:
You must be registered to see links
- Patrick
Attachments
You must be registered for see attachments list
Last edited: