• Tweet Twitts

  • Looking for something?

  • Posts in this page

Games to play

Projects



[ Next Page » ]

Development Blog

The Trick to Using SharedObject

Shared Objects ~= Browser Cookies

Having a SAVE feature in a project/game is one of the common things that could lead users to be more attracted and increase replay value for potentially recovering what was done in a previous visit. Using the SharedObject class in actionscript project/games is sometimes a requirement or at least a need, may it be AS1 (FP6), 2 or 3. It can be used to store valuable data like progress, settings, statistics, achievements and a lot more without dedicating storage on the server. Basically, SO or shared objects are like the browser cookies for flash, it is used to store some amount of data on the user machine, therefore it also has some limitations on its use (for security purposes really).

By reading the documentations or the livedocs, either for AS2 or AS3 (it’s really the same), you might have a gut start of what key points to remember.

  • created shared objects can only be stored/retrieved on the same domain
  • shared objects cannot be shared across domains, meaning a shared objects from “examplesite.com” cannot read shared objects created by another domain “mywebsite.com”
  • users can disallow local storage per domain or opt-out globaly, then the object would not be saved locally
  • data size to be stored is limited by which the user sets it (none, 10kb, 100kb, 1mb, 10mb, unlimited), although a dialog box can request an increase in storage if what is set is exceeded
  • if the user sets a limit smaller than the shared object, the shared object would be deleted
  • shared objects are stored on the user’s local machine not on the server, something shared over another machine cannot be accessed by another machine

The most essential part when using SharedObject is the SharedObject.getLocal() method, which is what we will be discussing more through out. Basically, AS1/2 and AS3 syntax haven’t really changed (although a few more rules were imposed in as3).

getLocal(name:String, localPath:String = null, secure:Boolean = false):SharedObject
[static] Returns a reference to a locally persistent shared object that is only available to the current client.

var mySo:SharedObject = SharedObject.getLocal( 'mySaveName', localPath, secure );
mySo.data.thingtoSave = myVariable; // your variables
mySo.flush(); // stores data into disk

Avoiding Known Issues

It might seem that using shared objects could be the simplest when you are only storing a couple of variables and objects like statistics or even could be the more complex when saving a game progress/state together with the players preferences. The bigger the system, more likely, the more complex your variables/objects are (same for games), and this is where possible issues during saving/loading/handling the shared objects.
[ Read more... ]


Things to Initialize on your AS2 Game/Project

While transitioning to AS3 is a massive must as people have regarded, some developers (mostly new) just want to or is forced to get stuck with AS2. So if you’re working on a AS2 project or lower, here some common things you should consider checking at the start of your project.

Some common but usually neglected things you might not want but your game might have:

  • The everlasting suggestion of “avoid directly referencing _root“.
  • Yellow boxes appear (on buttons/movieclips) when pressing Tab.
  • Cheating by pressing Space when the yellow boxes focus on buttons/movieclips.
  • Cheating by right clicking (shows the context menu, a cheat for some game genres).
  • Cheating/altering game play/screens by pressing forward, back, etc from the context menu.

_root or no _root

_root?

_root ?

As you might have read a dozen or countless times, it is highly recommended to not directly call _root within the project, although using _root is not necessarily wrong. These developers come to use _root as a hack way of referencing an absolute path to their objects. If you are building an independent system, prototypes, does not consider expansion/addons and will never be a part of a larger system then it would be fine to use _root as a hacky way. But if your work is part of a larger system or the like consider having to add in various (most of the time, 3rd party) extensions, plugins, services, APIs (application programming interfaces), SDKs (software development kits), or anything similar in it’s purpose then you’ll be in for some serious headaches. Most notable of these are those that wrap your game within another swf file. You might be able to face serious issues and problems varying from sounds not playing/missing, disposition world objects, localtoGlobal/globaltoLocal miscalculations, undefined object property, sprites (movieclips) not following the expected position and behavior, wrongly positioned custom cursors and a lot more. [ Read more... ]


Cheating AI from Hardcourt – Code the Plans

Behavior

Plan your behavior

So I have introduced how to plan out simple AI behavior from my previous post – Cheating AI from Hardcourt – Plan it out – if you haven’t, read that one first before this.

Our next step would be writing the data charts into codes. It might look quite easy when you see the simple flow charts but remember that the AI must process this through out the game with a character’s lifespan.

What I’m about to share is simply a psuedo codish (partly actionscript syntax) of the AI’s logic. Eventually you can port it into which ever approach you are comfortable with, like OOP or the old school timeline.

Remember that this is my first published game where as I still used AS2 using prototypes and functions but I’ll discuss this in a little of close objective approach. First of we prepare a few world declarations & preparation in a quick manner.

[ Read more... ]


Version 2 is Up and Other Updates

Horay Horay!! v2 (version 2) of jaycsantos.com is now up and running.

Look at all the colors… yeah, I know it’s the same scheme. But I’ve added more functionality and relative contents.

jaycsantos.com v1

jaycsantos.com v1

JaycSantos.com v2

JaycSantos.com v2

  • sidebars are much wider
  • home page is quite different
  • game list page is more awesome
  • game pages are more content oriented now with media (images and vids), download, highscore and playable sub pages.
  • And the site is now more blog feature oriented with related posts, archives, tags, etc – all displayed respectively.

By the way, the long promised update on the portfolio page is finally done. I was able to put some things in there for now and it even has my pic!

With regards to game production, I’m glad to share that I’m continuing, or I should restarting, the development of Neolithic. The whole engine was done before and is quite playable but I’m rewriting the engine again, this time in AS3 so it can have more power which results with more fun. I’m keeping the assets and slightly upgrade them too.

Enjoy the newly designed site!