Jump to content
  • Advertisement
  • entries
    503
  • comments
    1888
  • views
    334960

Porting Static:IT - C++ to HTML5

Sign in to follow this  
EDI

929 views

'lo again all.

I mentioned in my previous entry that I've been porting our 2009 release, Static: Investigator Training
which is a C++/Direct3D/lua fmv horror adventure; to html5/js (canvas)
using the base code from 96Mill and Revel Immortal as a starting point.

The process has been going well, however there have been some sticky spots.

  • extracting the original data from binary files
  • atlasing approximately 300mb of png compressed graphics
  • mimicking synchronous co-routine functions lua provided in JS
  • differences between the original engine and the new engine
  • re-re-remembering that everything takes way longer than you think it will

I attacked what I thought would be the hardest problem first, which was extracting the original binary data.

There were two forms of binary file classes.bin and game.bin; where classes.bin represented the data classes or 
'templates' that described static, shared (by flyweight pattern) attributes for all three object types; game, rooms and actors.

...and where game.bin was in the exact form of a save-game, that represented a new-game initial state. That is representing the 
actual objects, their relationships (game has rooms, room has actors), starting attributes (position, animation, alpha, etc.)

I used NodeJS to parse both of these files and export json equivalents of each file for easy access of data; I also took this opportunity
to have computer assistance for renaming/transforming members to better match what the new engine would expect.

 

Next I began to import the existing resources, which involved preparing them for a lot of atlasing

Audio was simple, save for the shear amount of it; when starting a new HTML5 project; you always take size and amount of 
resources into consideration; it's like climbing Everest (not that I ever have) but everything you include needs to be downloaded by the user
who is expecting a snappy game on their probably outdated tablet ...so you're careful.

I didn't have any such luxury in the port, the final sound effect atlas came to 10 minutes; which should be fine.
...thankfully voice files are not atlased, as there is over 500 of them.

In addition to atlasing, all of this data must be trans-coded as well, from source formats such as .wav, to deployment formats of .ogg and .mp3
...why both? because depending on which device/browser/version you encounter some are only  capable of running one or the other ...and some 
which are capable of playing both, are better at playing one than another ...and some devices outright lie.  But this has gotten better over the years.
 

 

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!