Game Development Community

dev|Pro Game Development Curriculum

Plan for Melv May

by Melv May · 07/27/2005 (3:57 am) · 22 comments

Well it's been quite a while since the last T2D update and seemingly nothing is happening behind the scenes but the reality is quite different! Our original plan of action still stands but, not suprisingly, we've been sidetracked by the need to fix reported bugs and make improvements to areas that were considered only placeholders. Lots of this has been driven by community feedback in one form or another and very valuable this has been. This has obviously slowed things down and the timetable of work has had to change to accomodate this. I've also had a tough time of late what with being busy at work and some pretty bad back problems and just general fatigue but through all this, I've been proud to be developing T2D as it is starting to really take shape!

So what exactly have we been doing then? Well, there have been a number of areas we've focused on but a large chunk of work has been fixing-up bugs and making improvements such as clearer documentation which just seems to eat-up time!

One of the more noticable changes to T2D users will be the change of nomenclature for objects. When I developed the original T2D, I used my "fx" prefix but this doesn't really suit a GG branded product and to be honest, T2D isn't really an "fx"! Unfortunately, we didn't have the time to do this earlier but it was always a high priority and we absolutely wanted to get this change out the way early. So previously we were using fxWoot2D but this has now changed to t2dWoot so we've got a prefix of "t2d" only for all objects. Sounds like a simple change but this involves changing of the existing documentation, tutorials, demo-code etc.

Alongside this change was another that we desperately wanted to get out the way. This was to implement a more flexible method to load/save objects e.g. object-serialisation. We looked at various strategies for this considering script-user usage as well as extendability for C++ developers and finally came up with a method to deal with this. The end result of this work was such that any object can load/save its state to/from disk. You can also setup a set of objects and get them to save. As previously, you can also load/save a whole scene-full of objects to/from disk. Another goal of this new system was to allow each object to load/save itself via an arbitrary stream meaning that object state can be transfered in-memory (or potentially via the network). This gives rise to some new features which are the ability for one object to copy its state into another object with "obj1.copy(obj2)". This can be very handy but there's a little more which is the ability to clone an object with "obj2 = obj1.clone()", the difference being that a new object is created with clone and therefore the scripts don't necessarily need to know what the object class is.

Another small improvement but handy enough to mention here is the ability for any T2D object to start its own periodic timer using "setTimerOn(time)". This will produce a script callback to "object::onTimer(%this)" in the specified period. When you're finished you can just turn it off. This can be very handy in many situtations.

In my previous plan I mentioned the huge chunk of work on the collision detection/response framework but at that point, I had only worked on the response side of things. To recap slightly, each object can select from a set of stock collision responses. These are Bounce, Rigid-Body, Clamp, Sticky and Kill. Here's a set of images detailing these modes...

Bounce Mode
68.233.5.139/~transfer/melvstuff/t2dCollisionModeBounce.jpg
Rigid Body Mode
68.233.5.139/~transfer/melvstuff/t2dCollisionModeRigidBody.jpg
Clamp Mode
68.233.5.139/~transfer/melvstuff/t2dCollisionModeClamp.jpg
Sticky Mode
68.233.5.139/~transfer/melvstuff/t2dCollisionModeSticky.jpg
Kill Mode
68.233.5.139/~transfer/melvstuff/t2dCollisionModeKill.jpg
Lots of Object Collision Modes
68.233.5.139/~transfer/melvstuff/t2dCollisionModes.jpg
Movies...

Bounce Mode Movie

Rigid-Body Mode Movie

Clamp Mode Movie

Sticky Mode Movie

KillMode Movie

Lots of Object Collision Modes Movie

These modes not only make things much easier as they cover lots of standard case responses needed in games but they obviously perform much better than doing this stuff in scripts. All this done using "setCollisionResponse( bounce );"! Another benefit is that the framework allows for extending the collision responses in a number of ways, something which I'll go into more detail below.

With that work finished, I moved onto the more complex collision detection side of things. The existing system used a two-stage (broad/narrow) phase detection method. The broad-phase used a container bin system which allocated objects into configurable-sized bins within the world. This gave a very fast method for counting/discounting objects from subsequent, more detailed detection. The narrow phase we had used a swept-polygon detection which was very fast. This allowed objects to defined convex polygons as their collision boundary which were swept through the world meaning that no matter how fast the objects were moving, they wouldn't step through another object. Now with a handful of bugs aside, this worked extremely well.

Now being as T2D is trying to be a 2D game engine for lots of different types of games, we needed to make a few improvements in a few areas. The first was to allow the collision boundary to be defined not as a polygon but as a circle/ellipse. This would make the collision boundary much easier to define which can be very important when you're not interested in exact polygon detection. In-fact, if you wanted to define a circle/ellipse using a polygon, you had to ramp-up the polygon edge count quite high to get decent collision normals. These extra edges can degrade performance if used on hundreds of objects. Of course, we didn't want simple instantaneous detection, we had to make it a swept detection for the reason outlined above.

Something that we've tried to do with T2D is to not presume how people will use it but still try to put reasonable constraints in there. I'd hope that we can be accused of providing too much functionality, not too little. With this in mind, we decided to extend the idea of how to select the collision detection system therefore we decided not to restrict the detection method to simply swept ellipse or swept polygon but to provide a selectable tiered approach. The end result is that you can configure the collision detection for an object with different modes; these are... FULL, POLYONLY and ELLIPSEONLY. Poly/Ellipse only are obvious and tell the object to only use the selected method but FULL will tell the system to use ellipse first then, if sucessful, use the more accurate poly-detection. Now because the swept-ellipse is much, much faster than swept-polygon, you can use the swept-ellipse as a mid-phase detection method to potentially speed-up your detection in games where lots of collision are happening. As before you can scale both the polygon and ellipse detection areas in realtime with little/no performance hit. An additional option for the ellipse detection is to select from either a subscribed or superscribed ellipse e.g. covering the interior or exterior of the axially-aligned bounding-box, again, switchable in realtime. All this from "obj.setCollisionDetection( full );"!

This new detection method can be seen here (the movie shows the switching between super/subscribed ellipses)...

Swept-Ellipse Detection
68.233.5.139/~transfer/melvstuff/ellipsedetection.png
Ellipse Detection Movie

The final thing I'll add about the new collision framework is the ability for the C++ developer to extend T2Ds collision detection/response system. As a developer you may want to interrupt/override the collision detection process at different points, possibly do your own broad-phase or use the broad-phase and develop your own swept detection method, perhaps add a method that extends the FULL mode so that you get swept-ellipse, swept-poly then swept per-pixel (*ahem*). More realistically, you may want to override the swept-polygon to implement concave support. All this you can do. On the response side, there is a CUSTOM mode which turns off the stock response and calls the custom method which a C++ developer can implement. This means that you can, without changes, refer to this mode as custom or even extend the list so that you have a script-named response.

Another feature that now works perfectly and will undoutably be used for some very cool things in the future is active-tiles. I posted a little information about these a while ago but I thought I'd repeat it a little here. Active-tiles allow the C++ developer to quickly and easily implement a new class based-upon the active-tile class. This allows tiles within a tile-layer to do almost anything from tracking other objects like a gun-turret or even bizarre rendering effects that are not limited to the tile area itself. Being as I posted about this before, I won't go into more detail but here are the simple movies illustrating a test active tile that tracks the mouse-cursor. Note that the active-tile does this autonomously without any need for script-interaction. Anyway, here are the movies...

Active Tiles
68.233.5.139/~transfer/melvstuff/activetile.jpg
Active Tile Movie #1

Active Tile Movie #2


Well, onto some seemingly minor things but important non-the-less. There are lots of features that have been folded into TGE v1.4 which are extremely handy. Not soon enough for us, we'll merge with that codebase and the simply staggering amount of improvements will get folded into T2D but in the meantime, it seemed silly to deny T2D users at least some of these benefits. TGE users will already know about these but T2D owners won't. None of the following changes are down to me but have come from the guys @ GG such as Ben Garney, Justin'Dujardin and others. You can see some of the T2D specific work Justin has been involved in Here and Here.

One of the improvements was to the drop-down console. Previously, when you had a script-error, you wouldnt' know until either your code didn't work as expected or you searched through the console for a red warning.

One of the improvements here was to add a small drop-down window and status bar to the console which when dropped-down, immediately shows the number of warnings as well as a list of script line numbers where the problem occurs. This removes the need to scroll through the console searching for a potential error. Another issue was that the console was of fixed size which was a pain if you were running at higher resolutions and needed to see more information. The console can now be dragged to different sizes as required. All this is demonstrated here...

Console Warning/Grouping
68.233.5.139/~transfer/melvstuff/consolewarning.png
Console Warning/Resize Movie


Well, I could extend this plan to many more pages with improvements in functional areas but I thought I'd finish this plan by detailing some of the documentation improvements made. TDN will address some of the main concerns of T2D users but we're trying to improve the shipped T2D SDK doco as well. We decided to stick to the PDF format for the documentation as it's the most widely accepted format. Some minor problems with the previous PDF doco was caused by using the OpenOffice (beta#2) PDF exporter. With the documentation reformat, a improvement was called for here and I decided to purchase pdfFactory pro which is a great product. One of the bigegst documents in the SDK is the reference documentation. I spent a huge amount of time reformatting this document to take into account the nomenclature changes but more importantly, the grouping of functions into logical groups by colour-coding them into blocks within tables like so...

note that I've obscurred these images so that I don't break the EULA myself!!

Functional Grouping
68.233.5.139/~transfer/melvstuff/referencecolourcoded.png
Another improvement was to index this very large document by object and then by function. pdfFactory Pro allows you to do this and so you get the standard bookmarks in your pdf viewer like so...

PDF Object/Function Index
68.233.5.139/~transfer/melvstuff/referencebookmarks.png
An additional document that I created was one that details the particle-engine. Something that we didn't want to do was to detail either the particle/tile editors as these are subject to serious change in the future. Because the functions of the particle-engine are simply duplicated in the editor, understanding the particle-engine makes the editor almost obvious. Obviously I can't post the document here but here's one of the images from the document showing the kind of detail within it...

Particle-Engine Graph
68.233.5.139/~transfer/melvstuff/particleenginedoco.png
Still on the documentation front, I recently submitted some config files for dOxygen that allow you to download dOxygen, load-up the config file and produce a complete engine document including image-graphs using GraphViz. I also took a handy resource and created a config that will also output a single windows CHM file for the whole codebase, obviously windows only. Very handy indeed!

Another improvement has been to the god-damn awful load/save dialogs in the engine. I believe that Justin has posted some of this stuff in one of his plans but I'd like to at least show it working within T2D so here it is...

New T2D Load/Save Dialogs
68.233.5.139/~transfer/melvstuff/loadsavedialog.png
On a side-note to these dialogs, you should note that you can now load/save stuff from anywhere within your project. This makes using the particle/tile editors much more intuitive. Another background improvement which impacts this is the fact that T2D now loads/saves everything via the resource-manager meaning that as soon as you save an object, it's available for subsequent loading without either a restart or a hacky "setModPath()" call.

Well, what am I doing right this minute?

Well, I can tell you. I'm working on a considerable improvement to the way T2D handles imagemaps. For those who don't know, imagemaps are the core-object that provide an interface between your images on disk and textures that T2D objects need. It is the primary route to get hold of image data and it provides a mechanism to acquire frames from bitmap data. You can split-up a single bitmap into many frames either using a regular grid, a colour-keyed image or simply using the whole bitmap as a single frame. One of the issues here is that 3D accellerators (at least of old) like nice power-of-two sized bitmaps. T2D will automatically pad textures to comply with this requirement and issue a warning telling of the wasted texture memory. What we've set about to do is address this and many more issues by providing a system which can be set to automatically decided on the most efficient method to acquire these frames, even under circumstances where the bitmap exceeds the capbilities of the underlying hardware. Alongside this we want to provide a mechanism which allows power-users to fine-tune how this works. I'm not going to go into much more detail here as it'll get too boring too quickly, especially as I've not got any nice images to wake you up with. ;)

Well, I'm going to have to end this plan somewhere and now's a good a time as any. You can be assured that alongside the changes detailed above, are many, many others which should make development much easier. We've fixed a huge array of bugs as well, some of these relate to the underlying TGE and they have been submitted to the TGE v1.4 codebase.

All in all, lots of work and we're still going at it. Many other areas to improve such as animation, performance, new objects, memory etc. I'm sorry for the lack of information of late but as was posted recently on the T2D private forums, we'll address that ASAP.

All the best everyone and great T2D'ing!

- Melv.
Page «Previous 1 2
#1
07/27/2005 (4:17 am)
Yay!.. awesome stuff... :)

I will write more when I get home fom work :)
#2
07/27/2005 (4:43 am)
This all sounds quite good, but what about network support? This is surely the real selling point of T2D to a lot of people over other engines. Or have you decided not to put net support in?

Ian
#3
07/27/2005 (5:31 am)
Ian,

We will be putting in network support and as I pointed out within the post, part of the work was to organise the streaming of object-state which is a prerequisite of that. Because networking isn't enabled doesn't mean that we're not working towards that milestone. I can obviously only do so much though. On this note, GG have brought people online to help out with T2D development and this has helped really speed things up and will enable us to get through many of the features we originally planned.

- Melv.
#4
07/27/2005 (5:47 am)
Great plan, Melv. It's cool to see what you have in the works, and i'm really excited about these new developments. Thanks for putting together such a lengthy plan. :)
#5
07/27/2005 (5:49 am)
Quality!
Great stuff Melv/GG.

Way to go!
#6
07/27/2005 (6:28 am)
Thanks for the information Melv, having the offline T2D pdf docs is extreamly useful. Even when TDN is up and running, it will still be good to have core reference docs locally.

BTW Linux users can read chm files using "xchm". Whether it works in all cases, I don't know, but it has worked with the few help files I've tried it on.
#7
07/27/2005 (7:15 am)
Melv, I just hope you realize how much we appreciate your work. It's awesome to have T2d in the state that it is in right now, and hearing about the upcoming improvements always fills me with excitement.

Keep it up!
#8
07/27/2005 (8:21 am)
Awesome Melv! You kick arse :)
#9
07/27/2005 (9:01 am)
(referencing the last screenshot)

sceneeditor? I know that I've heard some talk about editors, but care to divulge any details on that one melv?

Anyways, thanks so much for the update, looking foward to all the cool things T2D has coming, and really enjoying working with T2D to this point!
#10
07/27/2005 (9:52 am)
Thanks for updating everyone on all the hard T2D work lately Melv! As you can all see, Melv has been working his butt off making great progress on the development plan he and I laid out for T2D. I'd just like to note too that we've expanded the T2D dev team, and all this great stuff Melv is talking about only represents about half of what's been done in T2D since the latest public release (1.0.2).

There's more to come, and I can't wait to have T2D 1.1 done, and then to quickly get out of Early Adopter. I'll be posting a .plan soon too, giving an overview of what's changed and what's left to do.

Ryan, T2D 1.1 will include a great new object editor... details to come soon. And yes, T2D will have a scene editor-- which combined with the object editor will be T2D's equivalent of the Torque World editor--- though the scene editor will not come out in the 1.1 update.
#11
07/27/2005 (9:58 am)
Thanks Josh.

Yes, I ran out of time and energy doing this plan. There's so much more to post that I thought it would be best to split it up. We should get around to another plan with more details soon.

- Melv.
#12
07/27/2005 (10:51 am)
Great to see this info. Just what we've been starving for! Thanks very much for taking the time/effort to create this plan. Much appreciated.
#13
07/27/2005 (11:02 am)
Thanks for the update Melv, looks like we're in store for a sweet release.

During bug-fixing and feature-adding, have you or anyone else working on T2D performed any optimizing or achieved any cheap speed boosts (particularly in rendering of larger sets of sprites)? Are there any areas that you'd like to shoot for optimization in the future?
#14
07/27/2005 (12:10 pm)
Stop posting more cool info about T2D!!!!

I'm trying to finish my 3D game, and my fingers keep itching every time I read about T2D

;-)
#15
07/27/2005 (12:12 pm)
Great update! Thanks so much for putting this together. 1.1 looks to be really rich and feature packed. I can hardly wait.

I had a question about your ImageMap improvements: inset fixes some of the problems with visual artifacts from texture blending, but more and more, I'm convinced that they only way to get "absolutely perfect" rendering is to have one frame per texture. If only there was a way in either OpenGL or DirectX to use CLAMP mode for coordinates within a texture, as opposed to only at the edges!

I was wondering if you've thought about the possibility of "acquiring" images from a single sprite sheet by creating an array of individual textures for each sprite. In other words, if my source art contains a sprite sheet with 4x4 images, that would internally create 16 textures--one per frame. The only real barrier to just using ImageMap type=full to work around this is that fxAnimationDatablock2D requires all animated frames to come from a single sprite sheet. Effectively, I see there being two "simple" solutions:
1) Allow animation datablocks to take frames from multiple textures
2) internally manage an array of textures

To do this right would also mean having a rendering pipeline that was really efficient about batching up all draw calls to a specific texture. Otherwise you'll be thrashing the bus and the GPU render state caches like crazy. Anyway, I'm curious what you think.

Please keep up the good work!
#16
07/27/2005 (3:37 pm)
Eh, it just ate my post!!!

Great stuff.

Ill have to update my Image Datablock and Animation Datablock Editors when 1.1 come out. The save/load Gui looks really great.

Does the object saving also extend to datablocks? It would be great if my editors could just write out the datablocks instead of the current way im doing them.

If you guys are interested i would love to help you guys turn out T2D editors. This would mean a total re-write for the Image Datablock Editor and probably one for the Animation DataBlock Editor to bring these up to GG quality. Should i get a hold of you or Josh via email about making this happen?
#17
07/27/2005 (7:39 pm)
SAAWWWWEEEEEEEEEEEEEETTTTTTTTTTTT!!!

Thanks for all the hard work guys! (but don't stop ;) )

PS Some of the movies didn't work: activetile1, activetile2 (maybe more???)

PSS I think Melv's blog should be promoted to the "GarageGames Blogs" section!
#18
07/29/2005 (12:52 am)
Melv, i'm glad you posted a list of upcomming changes to the 2d engine. these are all great changes, and it's good to have a heads up on what's going on, because a lot of people's projects (including mine) need to take the future engine into account.

-Jason
#19
07/31/2005 (9:27 pm)
Awesome Melv! It's great to learn about how T2D is getting better and better.
#20
08/06/2005 (7:33 pm)
I can't wait, Melv! My project is excited about this update! Thanks so much for the effort put into this. Also, my black background version of the logo makes those demos look a lot nicer than the white version ;).
Page «Previous 1 2