Thread: Novul
View Single Post
  #38  
Old 03-14-2015, 10:57 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 88,908
Kyttias is on a distinguished road
Default

Alright, similar to Lioden and Flight Rising I want to have breedable genetics (both marking patterns and features such as wings) and colors (primary and secondary).

On Flight Rising images are created in PHP with a library like GD or ImageMagick, merged down, and then saved with the pet's id number in deeply nested organized files. I can only imagine how much this weighs on the server. On the plus side, these are real images and can be saved to your computer.

On Lioden each layer is its own image and they're merely stacked on top of one another in a div. (I'm super surprised they're not even using HTML5 Canvas.) On the downside? These are all separate images and cannot be easily saved -- you'd have to take a screencap to show your friends. On the plus side? These individual layered images will be cached by the browser -- making revisits to the site quite speedy. And there isn't intensive load on the sever because there isn't an image saved for each and every lion.

I'm going to try and do something in between the two of these methods with HTML5 Canvas -- and the end result should be savable, even though it isn't stored server side. It won't be directly linkable, same as Lionden, however. On the upside, Canvas will allow for layer clipping with 'masks' if you're familiar with the term.

The jist of it is that wherever a pet image is called with the GUI, it'll display a canvas and render layers instead. Because these individual layers never need to be changed they'll be set to be cached by the browser - once a person has a seen a layer before it'll instantly load in the future, making it much faster after the initial visit. I can have pets look very beautiful, and, don't have to save an image for every single pet.

I can already access species, gender and age from the owned adoptables table, but I also need to store: primary color, secondary color, primary gene pattern, secondary gene pattern, if they have a face expression other than the default set, if the pet has a nightmare infliction, if they have a designer skin equipped, and then if they have any body shop mods such as wings, extra tails, additional fluff, etc.

Later I should be able to extend this into item equipping, but that's a whole additional process, and it probably would be best in its own table.

...

edit: I'm just going to go with the Lioden approach until I'm more comfortable with Canvas, aha.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.

Last edited by Kyttias; 03-28-2015 at 10:24 PM.
Reply With Quote