Gaming Your Way

May contain nuts.

swfs. They just don't want to smell each others bums to say hello

The controller is well under development now, and over the weekend I hit the first real snag(s).

In the good old days when as1 was king, you'd create an movieclip and load your external swf into that, and then just call a function directly. Nice and easy.
In the slightly meaner days of as2 it's a bit trickier. Let's load the swf in, now where the hell is the main class that I need to get to ? Arse.

Now I'm sure there is an easy way to do it, a way I've totally missed, but this is the solution I've come up ( And it's as long winded as you like ).

I've made a CrossSWFInterface class, which the controller brings in and creates a new instance of. Now by being cunning I know that packages/ classes are placed in the _global name space when they're created. So, each loaded class just passes it's entry point singleton to the CrossSWFInterface class via _global, eg
        _global.Interface.CrossSWFInterface.setLoadedAPIClass(gameControllerObj);
And because the controller swf is the first one loaded, I know these methods are going to exist in _global by the time the loaded swf sends it's goodness to them.

Then by using static properites in the CSWFI class, the controller class can get all the info it needs from the loaded swf, and visa versa.

Now I'm sure there's got to be a easier, cleaner way, but it escapes me and we're badly up against the clock on this project, so it works and I'll happily admit I'm a dumb arse when someone explains how to do it correctly, but until then I'm happy with this approach.

I did mention snags at the start didn't I ? In my vain attempt to be a grown up Flash coder I use mtasc ( Which is so sexy ). The one issue with it I found this weekend was that you can only ever have one entry point to a swf ( ie, mtasc expects a class called "main" to be there, it's what it calls to run the code in the swf ). You can't change it to anything else, that's set in stone.
This is all cool normally, but I want to create seperate packages within my project file for the games themselves, but I can't have a different main class for each of them ( eg, main_game1 won't work. mtasc just wants main and nothing else will do ).

Cosmic.

 

But this bad boy came to my rescue, hamtasc. Basically it's a "hacked" version of mtasc which allows you to define the entry point. Never has something so out and out geeky made me so happy.

I'm hoping tomorrow to have the controller in a useable state so I can start focusing on the game I've got to do ( "Souper Bowl". Tell me that's not genius ), so it'll load in and hand over control to the game etc.
I'm getting so close to doing something fun...

Squize.

And so it begins

The project has finally been green lighted, we're off and running.

Completed the road map tonight, so all the dates for deliveries are set, which is nice 'cause we know how much time before we have to panic.

The project has grown ( They never seem to shrink do they ? ) but because of the delay in getting the concept signed off it's going to be split into 3 distinct phases for release ( It was two previously ).
It's good in many ways, it means the quality won't suffer because of trying to cram too much stuff in before the deadline ( Which is set in stone, it's got to coincide with something, and there's no moving it ), and I've done my share of episodic games, it's always proved to be a nice way to work when you're dealing with a lot of different games.

As to the code, the "controller" movie's development has already begun. Doesn't do a great deal atm, loads in a bit of xml, displays some buttons and not much else. The start of a project is always slow where you're arranging classes and spending as much time thinking as coding to ensure you don't code yourself into a corner.
One aspect of this project is that it's got to be translatable, so I've done a button class which resizes to match the text inside. No biggy, but just one of many things which need to be thought about when the text can change.

I really need to have an interesting blog entry soon, it's all very worky right now :)

Squize.

Deconstruction of a scene or: nope, this is not Bryce ...

Inspired by a recent thread on fk's game forum here's a brief description how the day scene was actually built:

Usually it starts with a *very* simple sketch, whith very littly detail. Most 3d artists I know do extensive and detailed drawings, but for me it works best to directly do it in 3d.
twh_070410_08.jpg
more ugly than beautiful

Once I have this I start by modeling parts of it as single object that I later can link into the final scene, this time it's only the tower:
twh_070410_01.jpg twh_070410_10.jpg
Simple outline rendering and the textured version.

A detail of the main tower mapping:
twh_070410_09.jpg
3584x3584 px ... now tell me that size doesn't matter.

Now I start composing the scene, here just the linked tower with the landscape set up. In the foreground I've placed some noised up spheres to be used as rocks.
twh_070410_03a.jpg twh_070410_03b.jpg
Landscapes in plain grey and with some basic textures applied.

Now adding some depth:
twh_070410_13.jpg twh_070410_04.jpg
Added 2 trees for the foreground (846,419 polygons now) and finally with all the trees, grass, bushes
and textures applied (now 383,890,620 polygons).


Final step: adding real light and shadows and setting up the atmosphere ...
twh_070410_05.jpg
Preview rendering, you can see the result in the previous post ... (or click here)

After the scene was done, I decided to add two wizards to the final image so I quickly built a low poly one from this sketch (done by Chrsitof) and did two very simple texture maps:
twh_070410_07.jpg twh_070410_14.jpg
Sketch and the wizards placed in the scene.

Done!

nGFX.

You never can have enough rendertime ...

As promised in an earlier post here two (still working on a third one) stills from the intro of my "private" game:

twh_070409_01.jpg
Welcome to the Secret University, home to many soon to be wizards.

twh_070409_00.jpg
What now looks like a friendly night, ...

Both rendered at a resolution of 5120x2880 px (ugly to lose all this detail in those resized images, though), taking about 19h rendertime each. My plan is to use the way smaller version (my hope is to get it rendered at 480x270 (16:9) in a moderate filesize, using some 250 frames per shot (a day shot, a night shot and the secret third one)  in order to tell the story. Some earlier tests have shown that the animated clouds, the moving sun/moon and some wind moving all the grass and the leaves simply looks incredible. Yep and I know this is a bit much for a flash game - but hey - one should have dreams.

I hope I get the third shot done by Thursday this week and then start to lay out the animation.

Oh, you might noticed that this isn't quite the way it works usually (first doing a *lot* of artwork and later do the game), but this time I decided to do all the frontend stuff first and then add the game, call me stupid, will ya?
Ok, one of the reasons is that I needed to get my head away from flash while working on the code for the client's games and applications, and doing 3d is the way to keep me sane at the moment.

While typing this, I forgot to mention that the game as a name now, though this is for the next post.

nGFX

ps: happy easter :)

More words

So all the design docs have been done, some more vague than others, but they're done and sent for sign off...

The client has come back with quite a hefty amount of feedback already which is going to alter how we go about developing the project, and has expended the scope of it quite a bit, which we're going to have to factor in ( Both budget and time scale wise ).

To touch on the project itself, it's a collection of mini-games which follow you as you go through life, from toddler to retirement age.

And that's about it for now. Hoping to get final sign off on the concepts soon so we can start the actual coding.

( Yeah its a boring blog entry, but projects aren't all flv clips and moving sprites, but hey whilst you're along for the ride you're going to have to take the rough with the smooth along with us ).

Squize.

Writing, writing and yet even more writing

Hopefully going to go back to what the stimunation blog used to be, and focus on the actual development of a game from start to end.

It's always tricky 'cause everything has a NDA these days, so it's often a period of 4 weeks or so when you can write very little about what you're actually working on, and then ta dah, here's the game everyone, let us know what you think ( And retroactively answering questions about its development ).

With this project there is still going to have to be a slight viel of secrecy, but I'm hoping we can still give you some ins and outs of it's development along the way.

So I guess we can call this day 1. And day 1 is... writing up the design docs day. Not the most fun thing in the world, and to be honest I'm a firm believer in games evolving rather than being planned out to the nth degree, but this is a game made up of lots ( Around 12 ) of sub-games and a five week turnaround so we really need that structure in place.

This project is a first for me too, in that I'm more project manager than coder ( Due to prior commitments rather than a huge desire to wear that hat ), so more of my time is going to be spent making sure our client is happy, ensuring that olli and Elliot ( Our artist on this project ) know what's going down and when and other such organisational feats.

I think that's about it for this post. I've still got 11 docs to write today which should keep me off the streets, and hopefully they'll be signed off without too much alteration so olli can start getting down and dirty with the code as soon as possible.

More soon...

Squize.

383,890,620 polygons

Finally I started working on a new "private" game, basically it should have been an action game ...
... but somehow the idea has been altered and now it seems like it's becoming a puzzler.

For the last couple of days (weeks to be true) since my last post, I've been working on the title screen, mainly to get into the right mood for the style of the game. It also helps a lot to find the overall visual style.

As you might expect I'm not going to reveal anything about the actual gameplay, but it involves a bit of magic, wizards, a wizard's hat, an awfull amount of eyecandy and hopefully as much fun to play as I'll have doing (and selling) it :) ...

Enough words for now, here are 3 tiny parts of the intro animation (or part of the title/menu screen), and the reason for the nice and friendly number of polygons mentioned above:
       

Once I've finished this shot, I'll post the complete image, but there are some details left I want to alter to really make it look the way I want it to.

nGFX

test, test, test

Hi folks,

while inbetween two bigger projects (that surely will leave no room for just "playing" around), I wanted to get my head into a new game. The idea was fresh, and highly motivated I started to code some samples in order to see if the flash player could handle it at all.

Nope, it couldn't.

The goal was to be able to move over a "3d" landscape, textured was my first plan, coloured is what I ended up with.

And no, it *wasn't* code excution speed. So two weeks were wasted trying different approaches to achieve the same result, but somehow failed. While the code took about 1 at a high rate 3 ms, flash's graphic renderer consumed between 30 and 90 ms.

As the stat's say the code is fast enough, I didn't see the point of moving to AS3, though it might make the whole thing possible - but for now I can happily ignore all the AS3 buzz and see that I get things done.

shish!

Anyway, I hope I be able to set up a little example swf, because the idea still isn't dead - it just needs some more thinking :)

nGFX

New blog, new post, same old geek

Well let me kick my posting off here with a bit of a techy one.

Just finished work on my profiler, which looks all transparent and nice.



It works by replacing the trace() command. As I use mtasc for development rather than the Flash IDE you have the issue of not having a trace command as such ( No IDE, so no IDE based trace window ).
mtasc gets around this allowing you to overwrite the existing trace command with your own goodness. I've been using alcon as an alternative trace since moving over to mtasc, and it's pretty sweet. It uses a local connection to spit the data out to it's own window, so no nasty textfields in your swf, and it works with movies embedded on a site. Using a local connection means the output is displayed a bit slower than Flash spits it out, but to me that's no big deal, so long as I get to see what's causing the problem I can wait :)

Anyway in the brief moments of downtime I've been working on my own version, tailored to suit my needs. As you can see from the screeny it can output a fair bit of info from a trace command ( Such as the line number, calling package etc. ).
I've also copied the coloured output feature from alcon, so trace("test",2) outputs in a different colour, which is handy.
A colour value of 3 is classed as a fatal error, and if the flag's set then all output stops, so it's like a breakpoint and saves you have to scroll through a lot of output checking for that line which is badly broken.

It also supports trace("_dump",object), which spits out all the properties in an object ( Also covers the type, eg testFlag:Boolean=true; ), as well as trace("_dumpMC",mc) which displays the most relevant movieclip properties.

As it's a profiler and not just a trace replacement, it also handles trace("_profileStart"); trace("_profileStop"); and trace("_profileEnd"); ( Which stops the profiling all together ). When the end command is called it outputs all the methods which have been profiled, the number of times they've been called, the quickest they ran ( In ms ), the longest time they took, and the average.
So hopefully with this I'll be able to find bottlenecks quickly and speed them up before they become a performance issue. It also means testing different approaches can be done quickly to see exactly which way is quicker in a given situation.

Squize.

Something useful to start with ...

Hi folks,

I know that there are by far more people out there not iis/asp.net, and not all of this tiny rest are having to deal with the server (2003 and iis 6.0 that is).

Anyway, I was just setting up a flash application that uses flash video. So do a bit of surrounding html, upload the app and the .flv vids and ... done.

Oh bugger, it would have been so good if it would have worked.

The first thing I thought it has something to do with my code, but on my local iis it worked like a charm.
The best thing was, the file gave me a 404 when I tried to access it via the URL I used in the player ...

A good deal of time later i finally found this: How to set up .flv files on iis 6.0.


Here's the solution (copied from the above link, though)

  1. On the Windows 2003 server, open the Internet Information Services Manager.
  2. Expand the Local Computer Server.
  3. Right-click the local computer server and select Properties.
  4. Select the MIME Types tab.
  5. Click New and enter the following information:
    • Associated Extension box: .FLV
    • MIME Type box:flv-application/octet-stream
  6. Click OK.
  7. Restart the World Wide Web Publishing service.


nGFX