Yet another thing I'll soon be able to check off my list of stuff to get done for v2.0... Yay! SAT collisions are almost done, and are working fairly well. If you click the link below you can try it out. All three types of collision hulls are in use in the tutorial now. I ended up reverting Tutorial 9 to what it was and creating a new tutorial.
Tutorial 11 - Convex Hulls and Particles
There's still a few small things which need tweaking, but it's so close to being done that I'll be able to start working on some of the more interesting demos. I'll probably also update the Asteroids demo to use collision hulls and SAT.
The Render Engine is a cross-browser, open source game engine written entirely in Javascript. Designed from the ground up, it is flexible and full of great features. The engine runs on a wide variety of browsers including Firefox, Chrome, Safari, Opera, and IE.
Tuesday, November 30, 2010
Monday, November 29, 2010
SAT Collision Detection
I spent time, this evening, working on the SAT implementation. I got it working, partially, but it needs some tweaking. I think I am missing something. When the OBB for the player is rotated, it treats the collision as if it were not rotated. Very odd, but I'm starting to get the actual math and hope to have a solution soon. Check out the link below for the updated example. Once you pick up a powerup, the next collision with a powerup will stop you from collecting (it's supposed to stop movement entirely, like it does when moving from right to left)
Tutorial 9 with SAT collisions
I also wanted to give props for where I found this code. I tried to decompose the "N Tutorial", but aside from nice flash demos it left a lot up to the inquisitive mind to figure out on their own. Instead, I found this:
Rocketman Development - SAT Tutorial
Tutorial 9 with SAT collisions
I also wanted to give props for where I found this code. I tried to decompose the "N Tutorial", but aside from nice flash demos it left a lot up to the inquisitive mind to figure out on their own. Instead, I found this:
Rocketman Development - SAT Tutorial
Sunday, November 28, 2010
Convex Hulls
I know this doesn't look like much, but I've been working on SAT collision detection and just got convex hulls working. There's not really that much that is done with them, at the moment, but you can see (in the attached demo) that they are getting generated. In this case, the hull is generated from the sprite's bounding box. Unlike the world bounding box (in blue) the convex hull (in yellow) rotates with the player.
Tutorial 9 with Convex Hull Test
Like I said, not much to see and the hull isn't even being used yet. Hopefully I'll have more tomorrow or Tuesday...
Tutorial 9 with Convex Hull Test
Like I said, not much to see and the hull isn't even being used yet. Hopefully I'll have more tomorrow or Tuesday...
CSS Transformations II
I wanted everyone to see that it's in progress, so here's a quick test that is only using CSS transformations. There is no canvas involved in this example. This will not work in IE8 or earlier (yet) so don't even try. =)
CSS Transformations Testing
I feel it's important to point out that this isn't using the support method I previously talked about. That was actually quite problematic and wasn't an ideal solution. Instead, HTMLElementContext has transformation support built into it. It also has a very simple transformation stack so it works like the canvas context. By the way, this is running out of the v2.0 branch.
CSS Transformations Testing
I feel it's important to point out that this isn't using the support method I previously talked about. That was actually quite problematic and wasn't an ideal solution. Instead, HTMLElementContext has transformation support built into it. It also has a very simple transformation stack so it works like the canvas context. By the way, this is running out of the v2.0 branch.
Wednesday, November 24, 2010
CSS Transformations
Most modern browsers support some sort of CSS transformation. What this means is that a lot of what can be done only with Canvas, can also be done within the DOM. There has always been a plan to include this and I think that v2.0 will be the place where it is developed. In particular, the HTMLElementContext has had support for this for a while, but nothing was ever done with it.
Each class in The Render Engine can implement a class method called resolved() that will be executed as soon as the class dependencies are resolved and it can be initialized. The HTMLElementContext uses this method to load one of two support files, either for Safari or Gecko. These files would add the functionality for transformation support into the context, thus completing methods which are currently just abstract in RenderContext2D.
I just wanted to point this out because so many people have been asking about the HTML contexts recently. While support is limited in v1.5.3, the next major version of the engine should have more complete support for this functionality.
Each class in The Render Engine can implement a class method called resolved() that will be executed as soon as the class dependencies are resolved and it can be initialized. The HTMLElementContext uses this method to load one of two support files, either for Safari or Gecko. These files would add the functionality for transformation support into the context, thus completing methods which are currently just abstract in RenderContext2D.
I just wanted to point this out because so many people have been asking about the HTML contexts recently. While support is limited in v1.5.3, the next major version of the engine should have more complete support for this functionality.
Downloads Fixed
Someone alerted me to the fact that the downloads were broken links. They have been fixed now. There is a variable used in the build process that means "engine version" and another that means "build version". I got them mixed up and lo' and behold, the download links were borked... <sigh>
Monday, November 22, 2010
User Interfaces in v2.0
After spending some time doing the due diligence on user interfaces, I have decided to remove them as part of The Render Engine. Since the engine is running in a browser, it just didn't make sense to try to abstract what the browser is doing so well already. While it would be neat to have a user interface be tightly integrated within the engine, I feel that it just eats up cycles better spent on the game. User interfaces can still be created, loaded, displayed, and interacted with -- it'll just happen outside of the engine. For example, you could load a UI with jQuery and display it over top of the game. You'll have finer control over the interface's design and display, and you'll also have access to the game's objects if you want to display things like sprites and so forth. So, in an effort to get 2.0 going again, and to focus on what makes a great game engine, I'm dropping UI's as a part of the engine core and leaving that up to the developer. I think most people will agree that this is a better plan all around.
Saturday, November 20, 2010
v1.5.3 Released
Just a quick note to let you know that The Render Engine v1.5.3 was released today. There were a few small bugs that appeared while creating Tutorials 8 & 9.
Friday, November 19, 2010
The Render Engine v1.5.2
Last night I released v1.5.2 of The Render Engine. This version is a small update to the 1.5.1 release to address some bugs identified in the ColliderComponent and its subclasses. In addition to the fixes, I've added the ability to specify collision masks which should eliminate the need to perform instanceOf checks in the onCollide() callback. Plus, a new callback has been added which will let your host object know when collisions have stopped: onCollideEnd().
Other things in this release:
Other things in this release:
- Transform2DComponent now supports non-uniform scaling
- Container's forEach() method wad updated so it will halt if the "this" object is defined and has been destroyed. The loop can also be terminated by returning false from the callback
- ColliderComponent's execute() method will not throw an exception if the host is destroyed
See the release notes for full details.
Wednesday, November 17, 2010
v1.5.2 is Coming...
Some of you might have noticed that v1.5.2 showed up for a moment on Wednesday night. I have pulled the tag and rolled back to v1.5.1 for the time being. There was a regression in the collision components which needs to be addressed. The API still shows as v1.5.2, but still applies to v1.5.1. I hope to have v1.5.2 up by tomorrow night.
Sorry for the mistake!
Sorry for the mistake!
Monday, November 15, 2010
v2.0 Refactoring
In v2.0 I have moved everything related to the engine into the "/engine/" folder. Components, render contexts, resource loaders, etc. have all been moved in there. Since the files are considered "engine files", it makes a lot of sense to make them subfolders of "/engine/". The folder structure is a lot cleaner since the files are now "hidden" in the engine. These files were always intended to be the foundation classes for a game, and not supposed to be modified directly.
Putting them in "/engine/" sort of enforces that concept. Doing so allows someone to see the separation between their game and the engine. I know this will cause some confusion, especially for people who want to upgrade to v2.0 of the engine. However, the only real change is that files which were previously loaded via:
Engine.include("/engine/...");
Will now need to be:
Engine.include("/...");
That and the index page will need to load the libraries from the "/engine/libs/" path now. This change will not affect previous versions of the engine, so only if you're using v2.0 and beyond.
Friday, November 12, 2010
Abstracting the Sound Engine and Collisions
Currently The Render Engine uses SoundManager 2, which was a great solution at the time since the audio tags weren't formalized and Flash seemed like the only way to play sounds reliably. Now that the spec is formal, and after analyzing SM2, I have decided that abstracting the sound system would be a good idea for v2.0. This would allow a developer to plug in a different sound system if they have a better alternative. Instead of loading SM2 and using its HTML5 capabilities (originally what was planned) I'm going to create a layer of abstraction which allows for just such a thing.
SM2 will continue to work, but will instead be a pluggable sound system. The actual SoundLoader and Sound objects won't change, but instead the loader will interact with the abstraction. This is all planned for v2.0 but should be in the repository soon. I really want a lightweight sound system, and depending on SM2 is pretty heavyweight but it does have lots of nice options...
I played around a bit with getting the fundamentals in for the Separating Axis Theorem last night. While The Render Engine will support any collision system, I've decided to provide both GJK and SAT. GJK is mostly implemented, and SAT is getting there. It'll be nice to have some choices when using the collision system. I still think that the SpatialGrid will continue to be the broad-phase of choice, but I'm also considering BSP which would open up the engine for raycasting and such.
SM2 will continue to work, but will instead be a pluggable sound system. The actual SoundLoader and Sound objects won't change, but instead the loader will interact with the abstraction. This is all planned for v2.0 but should be in the repository soon. I really want a lightweight sound system, and depending on SM2 is pretty heavyweight but it does have lots of nice options...
I played around a bit with getting the fundamentals in for the Separating Axis Theorem last night. While The Render Engine will support any collision system, I've decided to provide both GJK and SAT. GJK is mostly implemented, and SAT is getting there. It'll be nice to have some choices when using the collision system. I still think that the SpatialGrid will continue to be the broad-phase of choice, but I'm also considering BSP which would open up the engine for raycasting and such.
Wednesday, November 10, 2010
v1.5.2 is in the works...
I was working on Tutorial 7 last night and realized that the collision system wasn't acting appropriately. It was yelling, getting really drunk, and generally being annoying... I kid, I kid. There were some issues with arguments being out of order in the ColliderComponent subclasses of BoxColliderComponent and CircleColliderComponent. Plus, CircleColliderComponent was doing way too much for simple circle-to-circle collision checking so I've moved the code into Math2D for now. Also, I realized that I was depending on instance checks which can be costly when executed repeatedly. I'm always looking for a win when it comes to getting some milliseconds back to use elsewhere.
Well, of course this means that I need to fix up some code in v1.5.1 and release a small upgrade. v1.5.2 will include the fixes for the two subclasses and also have the implementation of collision masking. Plus I'm trying to figure out what's going on with IE and FlashCanvas when run remotely. That's going to be all that will change, since there really isn't anything new that's ready. Plus, I need stuff for v2.0!
If anyone's interested, here's a link to Tutorial 7. You can't download the tutorial code yet and the example isn't hooked up yet. If you see anything crazy, let me know. Oh, and if you're trying to get the tutorial working in v1.5.1... well, you're gonna have to wait for v1.5.2.
Well, of course this means that I need to fix up some code in v1.5.1 and release a small upgrade. v1.5.2 will include the fixes for the two subclasses and also have the implementation of collision masking. Plus I'm trying to figure out what's going on with IE and FlashCanvas when run remotely. That's going to be all that will change, since there really isn't anything new that's ready. Plus, I need stuff for v2.0!
If anyone's interested, here's a link to Tutorial 7. You can't download the tutorial code yet and the example isn't hooked up yet. If you see anything crazy, let me know. Oh, and if you're trying to get the tutorial working in v1.5.1... well, you're gonna have to wait for v1.5.2.
Sunday, November 7, 2010
Update to v1.5.1
After releasing v1.5 of The Render Engine we found some bugs which were quite critical. Internet Explorer support was not working and some of the tutorials were faltering. After some quick debugging, we've gotten these working and have released an update to version 1.5.1.
Version 1.5 is unsupported and should be replaced with v1.5.1 instead.
Version 1.5 is unsupported and should be replaced with v1.5.1 instead.
Saturday, November 6, 2010
The Render Engine v1.5 has been released!
The v1.5 incremental release of The Render Engine has been tagged! This version includes the Box2d Physics Engine and two examples of its usage. Additionally, this release has numerous bug fixes and enhancements to the engine as a whole. The API documentation has been updated and is available, along with the full and minified versions of the engine.
Now I can start to focus on v2.0 again...
Now I can start to focus on v2.0 again...
Tuesday, November 2, 2010
v1.5 Ragdoll Demo
It's almost complete, just working out the kinks (no pun intended) in the joints. Wanted to give you all a peek at what's coming with the v1.5 release...
http://renderengine.googlecode.com/svn/branches/v1.5/demos/physics2/index.html
You can't do anything with it, except restart it and watch the doll fall again, but it's almost there. I also have the FlashCanvas support working in IE prior to IE9. It's certainly not very fast since it is emulation using Flash, but at least all of the demos are beginning to work.
Asteroids demo:
http://renderengine.googlecode.com/svn/branches/v1.5/demos/vector/index.html
New physics demo:
http://renderengine.googlecode.com/svn/branches/v1.5/demos/physics/index.html
I'm still hoping for an end-of-week release. My fingers are crossed!
http://renderengine.googlecode.com/svn/branches/v1.5/demos/physics2/index.html
You can't do anything with it, except restart it and watch the doll fall again, but it's almost there. I also have the FlashCanvas support working in IE prior to IE9. It's certainly not very fast since it is emulation using Flash, but at least all of the demos are beginning to work.
Asteroids demo:
http://renderengine.googlecode.com/svn/branches/v1.5/demos/vector/index.html
New physics demo:
http://renderengine.googlecode.com/svn/branches/v1.5/demos/physics/index.html
I'm still hoping for an end-of-week release. My fingers are crossed!
Monday, November 1, 2010
v1.5 Delayed
Sorry to be the harbinger of bad news, but the release of the 1.5 update will be delayed. There are a few things that haven't been fully tested and I want to make sure that everything is solid before releasing the update. I apologize for the late notice, but I didn't want people waiting around for something that isn't going to happen. I don't have a specific date yet, but I'm feeling pretty strongly about it happening before the end of the week.
Subscribe to:
Posts (Atom)