1. virtual pet mascot

    Virtual Pets

    Welcome to the Virtual Pet list forum!
    We're a virtual pets and sim games community and the largest forum in our industry. Game owners can use our forum to their advatange by promoting/advertising their games to our users and receive feedback/reviews from those members that try their games out. We support developers of all kinds from RPG developers, sim game developers to virtual pet site developers. We want to see more games in our industry come across more success and that's why we try our best to release as many guides/articles regarding online gaming development as we can.
    We're unlike other forums in our industry because we try our best to be there for our users no matter what and give them advice whenever they ask for it. Running an online game isn't an easy task, but with our many resources that we've built since 2011, you'll learn a lot from our online community. Please don't ever be afraid to ask a question on the forums because if you never ask, then you'll never receive an answer to your question and you can only improve by asking other users for help/advice.
    We have a lot of virtual pet sites' owners and sim game owners that are very frequent visitors on our online community. Along with artists, writers and programmers that come here looking for work and games to work for. Our members who are artists sell art in our art marketplace and programmers are allowed to sell their scripts in the programming marketplace. We also allow game owners to sell their game in our general marketplace
    In early 2011, we decided to make a comeback to the internet because in 2010, we had a minor setback and we had to re-launch without any content, but with a lot of time, patience, hardwork and effort, we've managed to rebuild the Virtual pet list community into something better than it was before. We actually registered our domain name on November 4th, 2004, but we were only a directory then and all we had was a basic comments system for users to post things on their favorite games..
    So, what are you waiting for, why don't you join today? If you have any problems figuring out our security code, then here's a hint, it has millions upon users and has been around since 1997.
    Our list of virtual pet sites and directory of sim games have a lot of different games listed, so we're pretty sure that you may find some games that suits your needs as a player of sim games or virtual pet sites.
    If you're still curious about a certain game that you'd like to play, then please check out some of our game reviews that were written by some of our great contributors and our interviews with respective virtual pet site owners, sim game owners, artists, writers and programmers that have worked in this industry.

  2. Check out our latest guide on how to grow your user base!
    Paladore - Boopets - Icepets - Corepets open beta
    Virtual Pet Directory
    Are you looking for new virtual pet sites or sim games to play?

Coding problem, help needed

Discussion in 'Programming General' started by Hituro, Jun 1, 2012.

  1. Hituro
    Offline

    Hituro Approved Game Owner Pet Game Owner VPL Supporter VPL Member

    Reputations:
    17
    Joined:
    Feb 1, 2011
    Messages:
    1,416
    Likes Received:
    97
    Trophy Points:
    48
    Okay, I have a coding problem I just can't get my head around, so I thought I would throw it out there and see if anyone has any ideas.

    When you load a page on Grophland you may get one or more random events. Some of these events require complex CSS. Since they can appear on any page the CSS is in the main site CSS, taking up pointless room, so I want it out of there. However events are triggered by including a script (events.php) *after* the header file, so CSS for the page is already set. This means I can't remove the CSS to optional stylesheets.

    Now I can move generation of events to earlier in the process, before the header is sent, so I can use optional CSS. However not every page shows events. This means if I generate events before the rest of the page loads then they may not actually get displayed on that page, which could mean some important notification being missed. I don't want to go and change every page (out of hundreds) to pass some value saying they are, or are not, going to display events and messages, but I can't see how else to avoid generating the events on pages that won't show them.

    Any ideas?
     
  2. indysolo621
    Offline

    indysolo621 Member VPL Member

    Reputations:
    0
    Joined:
    Feb 27, 2011
    Messages:
    1,397
    Likes Received:
    59
    Trophy Points:
    48
    Can you not take the events css out of the header and have it only display if you do have a random event on the page?
     
  3. nobackseat
    Offline

    nobackseat Member VPL Member

    Reputations:
    0
    Joined:
    Jan 22, 2011
    Messages:
    508
    Likes Received:
    46
    Trophy Points:
    28
    Location:
    Florida
    Style tags can work in the body, it's not that big of a deal. If you must be politically correct then make the CSS inline and use an older DOCTYPE. Echo it in the same block as the HTML of the actual event itself. Every unnecessary byte adds up to quite a bit when it comes to mobile phones or your site's bandwidth.

    NBS
     
  4. Hituro
    Offline

    Hituro Approved Game Owner Pet Game Owner VPL Supporter VPL Member

    Reputations:
    17
    Joined:
    Feb 1, 2011
    Messages:
    1,416
    Likes Received:
    97
    Trophy Points:
    48
    That might be the best idea, can I do an inline style with an @import?
     
  5. Grotesque
    Offline

    Grotesque Approved Game Owner Pet Game Owner VPL Member

    Reputations:
    0
    Joined:
    Oct 17, 2011
    Messages:
    261
    Likes Received:
    75
    Trophy Points:
    0
    Bundle all your css-files to one, compress and timestamp/hash-mark it, thus the browser can do proper caching. You have PLENTY of whitespace and each single asset increases load time.

    This is how we do in our production enviroment:

    http://breepets.net/assets/application-aea34afe3f096fd5877b296b6875aa2e.css

    There are tools out for this kind of stuff. Luckily, Rails does this automagically for me. However, you might also take look at SASS
     

Share This Page