Showing posts with label Gizmo. Show all posts
Showing posts with label Gizmo. Show all posts

Friday, 23 November 2012

XNA 3D Gizmo v2.0.0

I've just released a new version of the XNA 3D Gizmo! The updated source has been available on CodePlex for a while, but I never got around to add the final touches and create a release.

As the name suggests (2.0) it involves a major change compared to 1.0 which was released well over a year ago. The new release provides a much improved framework and simplified code while adding customization options if more advanced usage is desired.





The following is a snippet from the release notes:

FOR EXISTING USERS: If you are already using v1.0 you may choose to leave this release alone unless you require additional customization options or more advanced features which have been added in this release (see notes below for all additions)

- Quaternion support.
- Built-in vertex lists replacing fbx models (easier implementation for new users),
- ITransformable interface to add transformation support to anything in the scene (example: vertices inside an editable mesh that lives inside the 3d scene)
- A lot of framework simplifications and no more dependancies on Engine class or any other outside classes.
- Gizmo is now a standalone DLL (class files can still be placed in any other engine project without a hitch if standalone DLL is not preferred)
- Support for custom Select functionality (ITransformable.Select(ray) to allow users to define their own selection methods (triangle precision or bounding box etc.)
- Improved internal code for readability.
- Transformation is now done through event handlers, allows much more customization options on how to apply transformations in your own editor. For example it allows you to support a undo/redo system.
- You can now set different 'selection pools' this allows you to select and/or ignore certain object types by only passing a pool of a specific type (example: pass a pool of 3d entities or a pool of selectable vertices)

You can get the latest version right here!

Saturday, 5 November 2011

Gizmo update coming soon!

Hi guys, just wanted to let every XNA3DGizmo user know that a update is currently being developed. I noticed that the original implementation had some sloppy shortcuts that could make it more difficult to implement if you were unfamiliar with the code. This included references to the Engine class among other things.

So I decided to improve things by removing any reference to outside classes (including InputState which is no longer required) I realized this update is necessary as even I found it difficult to implement the gizmo in a new project and wasn't a simple drag&drop operation as it should be (or as close as possible to it) this made it obvious some improvements were required to the public version.

The last public update was quite a while back and I was using a modified version with already several improvements implemented (such as multiple type of objects you can select as shown in the Vertex Manipulation Video where I select both scene objects and vertices with the same Gizmo component)


So in general the upcoming update should make it much easier for everyone to implement this gizmo into his own code/editor. If you had trouble integrating it, please let me know. There is no current ETA on therelease, but I'll try to do it sooner than later...

Sunday, 3 July 2011

Input & Hotkey Management

Input management is one of those things I never really paid a lot of attention to, using simple if-statements inside an Update() or HandleInput() function worked fine is most cases, until recently. Recently I started to notice my input handling got scattered throughout my code-base and a lot of coupling was required to make sure it was handled properly.

To prevent hotkey-clutter (especially when modifiers (ctrl, shift, alt) get involved) I started working on a HotkeyManager that handles groups of Hotkeys in an easily maintanable way. Initially it was supposed to assign a HotkeyGroup to one or more 'editor-states', like 'only-use-this-hotkey-while-in-editmeshmode', I soon realized this wasn't going to be very helpful and I would have to continuously add new states to keep it up to date...so this was scrapped and replaced by a simpler, but more powerful feature - Predicate<T>. Using predicates enables the manager/hotkey to activate only if a predefined condition is met (i.e. if gizmo.IsActive == true -> execute the hotkey-function) it can contain more than one statement such as gizmo.IsActive == true && Camera.IsMoving == false for example...if both conditions are met, the hotkey may execute with the associated Action (the method assigned to the hotkey) The code-snippet below should be able to illustrate its use.





You may have noticed the above code refers to the GizmoComponent class. SetSelectionPool(IEnumerable<ISelectable> selectables) is a new function I've added to more easily support custom collections and to assign new collections at runtime, in my case this is used to switch between vertex- and object-selection more easily. I will add this along with many other improvements to the open-source gizmocomponent at codeplex at some point.

Back to the hotkeys...within InitializeHotkeys() there is a HotkeyGroup class, this class holds a collection of hotkeys that belong to the same component or share similar functionality. These groups are passed to the manager and will be updated automatically.  The Hotkey class is the main class and has several parameters including key (supports all Keys, MouseButtons and GamepadButtons) a KeyPressState (press, release, hold) a KeyModifier (control, shift, alt or a combination - not illustrated in img), the parent  (used by the Predicate to verify the conditions) and the Action to execute after the key is pressed and all conditions are met.

A quick search revealed there are no suitable Input/Hotkey managers (I didn't like any of the libraries available on Codeplex) so I might turn this into an open-source component/library if enough people are interested in such a library.



Actions and Vertex manipulations are also still WIP, I made some progress on both these tasks and should have some something new to blog about soon enough.

Sunday, 26 June 2011

Vertex Manipulation (Mesh-editing)

Editing models inside my engine has been something I wanted to support for a long time now. Especially when you're not the one creating the assets, but do have to work with them inside the editor it can be time consuming to send back a model with incorrect material names or a mesh that should be split to optimize rendering, or vice versa. With this tool I will eliminate the need to have artists re-export their models because of tiny mistakes/changes and should provide a much cleaner pipeline in general.


Currently only the very core of this feature has been implemented (as seen in the video) and a lot of other stuff is still to follow, I will give a brief overview of how the fully functional tool should work once its complete. When any new model (.fbx or .x) is imported, it's processed by the content pipeline and turned into an .xnb file, an .xml file will be attached to the source (model) file that contains all changes to the model and will be processed during build-time. By default this .xml file is empty and nothing altered, during run-time a mesh can be converted to Editable Mesh (trying to keep this similar to 3D Studio Max's naming conventions) which allows vertex and triangle selection with support for any type of transformation that is supported by the gizmo component (translate, rotate, scale in local- and world-space) these transformations are stored inside Actions (I will talk about Actions a lot more at a later time, but it's basically what you use to support undo/redo in any kind of editing software) and written to the model Xml. The model is then re-build the next time the project is build and the actions are applied, this can hold any type of alteration including material renaming, splitting meshes and deleting / adding new vertices alongside vertex transformations.

Because the source model remains untouched, whenever the model is re-exported from any DCC-tool like 3D Studio Max or Maya the model will still build with all transformations and alterations applied. An example: A material named '#46 Material' is renamed at run-time to 'corridor_floor', if the artist then changes the name of '#46 Material' to 'corridor_floor' or something else in the source model, the run-time change is ignored because the original material name (#46 Material) can no longer be found... in a worst-case scenario this ignores the material properties you stored for the original name (material properties are stored elsewhere, so no data is actually lost) so even in the worst case, you are only a small step away from re-applying your previous changes (A warning dialog with failed conversions should help with this, making it potentially very quick and painless to manually re-assign the changes that are never lost, just ignored till resolved) The same applies to vertex transformations, but these can be a bit more difficult to keep track of once the indices of a certain mesh change inside the .fbx source file.

There is still a significant amount of work that has to be completed before this feature takes it full shape, with this first proof of concept up and running I believe it will be a very valuable tool to have available, and a lot of fun to create :)




It proved to be quite easy to convert the gizmo to support vertex manipulation (and selection) I will add these changes to the codeplex project at some point in the future...

Sunday, 1 May 2011

Engine Restructuring

So I have actually had the time to work on the engine again and been experimenting with some design patterns. Since the deadline of our latest project (Project Sunburn) has passed a while ago I have been doing some experimental stuff, mostly to try and fix issues and concerns that were bugging me for a while. Since there are currently no new projects/games scheduled to use the engine I am basically free to experiment and try out new things.

A pretty major annoyance is 'one-frame-lag', it's fairly common and can easily happen when you don't own full control over the optimal update-order of your components. This type of lag most commonly occurs when object-A affects object-B, but B has already updated himself that frame. It will then take another frame for the full-effect to be applied. The same thing can happen when different objects query information from a object that itself gets affected several times during a frame, this ends up being messy and will have unexpected results and one-frame-lag.

However, I believe to have found a pretty solid solution, since it a bit experimental I will first test it against more complex components. More on that later...

The latest version of Core Engine was also lacking a proper Game-State management framework, which wasn't a problem for a long time since we generally didn't use 2D menus for our prototypes, but I am currently figuring out a good way to re-integrate this into the engine (from scratch) The 'standard' frameworks really don't work for me as they easily make your framework very complex and put a lot of extra strain on iteration speed, it should be a lot simpler and that's exactly what I'll be trying to accomplish.

A small note on the Gizmo for those of you who may be using it - I might release an update soon fixing some of the integration issues people might experience when they don't have a similar framework set-up. I will try to completely decouple the component which makes it a lot easier to integrate  into your own editor. (If you experienced any other issues, let me know and I will see if I can fix is along with the rest)

With all the other stuff going on I did not spend a single minute on V-script (Except for a presentation I did, I might talk about it some other time) So there is not much news on that I'm afraid.

Saturday, 26 February 2011

XNA 3D Gizmo Video!

Finally a video about the Gizmo showcasing the feature-set. I've added some tunes as well this time, hope you like it...

Thursday, 24 February 2011

XNA 3D Gizmo v1.0.0 Released!

The latest version of the XNA Gizmo is now available on Codeplex! You can download it here.

Since my last announcement I have added many features (including all those I mentioned in my previous post) and it should be ready to use in your own editor. I supplied a small framework to show the Gizmo at work. I have tried to make the implementation to your own engine/editor to be as painless as possible, however it can always be easier...(if I knew what all of your engines/editors would look like :) )


I still haven't made a video to showcase all of the new features, but it should be available soon...

Download Link

Saturday, 12 February 2011

Gizmo Roadmap & Engine Revamp

First off, there have been several updates for the Gizmo since the last announcement. You can download them on the Source Code-tab on Codeplex.

Most (features and code) has already been implemented by now, however there are still some nice features on the horizon. This includes:

- Grid & Rotation snapping.
- Multi-layer selection. (or click-through selection)
- Reset transform.
- Added support for multi-selection.
- Precision Mode.

Some of these were already part of the old gizmo, and others were already implemented in the internal version of the Gizmo I used in my own editor a while ago. So it shouldn't take long to implement any of these in the revamped public release...Stay tuned for updates!

Next, a quick notification on the Core Engine roadmap. Since there is currently no game in development I can make breaking changes without ramifications. This is something I often do when there are no games actively developed with the Engine. This time it's a pretty huge revamp of the complete engine-structure. So far I have deleted over 110 classes to make room for a new and improved structure including a much better GameState management system that is first on the list.

Not all code is deleted though, I will be using a lot of the old code for new components and managers, deleting them for now makes the re-design a lot quicker and efficient (preventing 100's of errors)

In addition to the new structure I'd like to design components in such a way that it's easier to create external projects for open-source initiatives such as sgMotion & GizmoComponent. If I can just copy/paste my own component to one of the open-source projects, it will be a lot easier to update and maintain. The Gizmo is a good project to fine-tune just that.

A new video should be up soon, once the Gizmo is out of Beta.

Tuesday, 8 February 2011

Gizmo Beta Released!

It's finally here...well kinda. It's still in Beta, but a lot of its functionality is working and now you can try it out for yourself on CodePlex.

There are some known issues (including local-space transformations not working as intended) but I really wanted to let you guys try it and see what you think of it.

The component has been re-built from the ground-up to eliminate all of the old issues and improve readability and flexiblity of this new revamped component. Feedback and suggestions are welcome, you can post it in the comments or leave a message on Codeplex instead.

I'll leave you with just this image and a download link for now, a video will follow once I have a fully stable build.


Since I'm finally using SVN, you can directly follow my updates on the Source Code tab of codeplex.

Saturday, 5 February 2011

GSM & Gizmo Update

Still no release available for the Gizmo project. However, with the Translation mode pretty much complete and the Rotation well under-way it's getting closer.

I finally created an SVN-host. This means the next Gizmo release will use it as well, so you should keep a sharp-eye on the Source Code tab of the project page.

Among other things I completely re-designed the GameState management of the engine. the previous GSM had faded over time in flexibility and support due to heavy changes in overall engine structure. This new system should increase readability, flexibility and performance. The Gizmo will use a small portion of the GSM. As it will be flexible, you can easily change the components to fit in your own framework without having to use mine.

The (normally invisible) collision hull of the Rotation-mode. Mesh vs. Ray will determine the selected axis.

The already complete Translation-mode. As seen in the previous video.

Monday, 31 January 2011

Gizmo Update (no release yet)

I have been working on a completely new Gizmo. The old one did what it has to do, but it lacked feedback for the user and didn't look very professional.

The new release, should be the (near) final iteration of the project. I still don't know exactly when it's going to be finished, but I've made a lot of progress today.

Currently, only the Translation part of the gizmo is in place. But like the previous version, rotation and scaling will be supported.

Friday, 31 December 2010

Due Update

It's been a while since my last update. After a tiring 26 and a half hours of continuous work to make the deadline, I needed some time off from XNA. I got started again earlier this week though and I have a few teaser screenshots to show you guys.


The placeholder shells colliding with the environment.


The new shell models. (By Bo our 3D Artist)


Transparency/cube-map test for scope on Assault Rifle. (using Arbitrary model)


Dummies, a much easier way to align muzzle flashes and shell positions with the weapons.

The new (WIP) Gizmo. The current release on Codeplex is pretty outdated feature-wise. An updated release should be up soon (no ETA available yet)

Other upcoming tasks include, motion-blur on the shells, depth of field on the weapons and a proper muzzle flash among other cool stuff...

Wednesday, 13 October 2010

Editor Update: Clone-tool with ClonePreviewer

You can simply drag your clone to the desired location while using the scroll-wheel to determine the amount of clones you like. The process is finalized by pressing the Enter key.

The preview models share the same instance of the source model, rendered with an offset for each clone. The translation is snapped to the current grid size, alternatively you can use precision-mode (Shift) to fine-tune your clone-offset. Works with any type of placeable entities, however entities without a model (particles etc.) use simple boundingboxes/icons to show their destination. This may change in the future, where even particles may be fully rendered while previewing.

Monday, 31 May 2010

Engine Update: Major Editor/Gizmo Updates

I've spend some time adding new features to the editor and gizmo to increase overall usability and development speed. The lack of (gizmo)precision among other things started to bother me and was slowing down development of our prototype (only 10 days left!) I've compiled a short list of the most significant changes and additions and turned it into a small video.



Wednesday, 5 May 2010

3D XNA Gizmo v0.2.0 Released!

A new update has arrived. You can download the latest release HERE. The most notable addition is rotation and scale functionality that's been added to the gizmo. Switching between the different modes is done using the keys 1,2,3 on your keyboard. Download the sample and get started!

Sunday, 25 April 2010

Update: Game & Engine features

It's time for another update. Got a lot of work done yesterday, and I'd like to share it with you guys. First off, the Gizmo finally got the features it deserved. Rotation/Scale feature are now working properly (images below)



Next up is a long overdue issue that wasn't bothering the frame-rate at all so I post-pone'ed it for quite a while. When loading a scene and reading all object-data stored inside Xml, a copy was hidden and maintained in the background (while it shouldn't even exist) In a case of 500 objects/components this would mean another 500 hidden in the background. I redesigned the loading/saving of Xml data and will no longer keep unwanted objects in the background.

Game Update

As I mentioned earlier, we're working on a new project called "Over Night". My role is Engine programmer, so I make sure everything we need for our game is there for the Game programmer to work with. A few features that I added last week are listed below and are shown in the video...

- Character (movement etc, thanks to BEPU for their base character class)
- Scene switching
- Monitor (ingame security camera footage shown on a TV monitor)
- Story notes (story driven notes and hints on the wall, helping the player with solving the story puzzle)

Saturday, 6 March 2010

Engine Update: Cinematic Controls

...Another feature for the Edit/Play-mode. Cinematic controls can manipulate camera behavior. Our next game will feature some cinematic moments (more on that later) so having a tool to tweak positions and movement speed quickly and visually can be really helpful. Most of it is already working, additional features will be implemented only if the need arises. To demonstrate I recorded a short demo:


Note: The controllers are saved and maintained like any other object in the scene.

Saturday, 6 February 2010

XNA Gizmo Released!

Finally got the time to create a sample with simplified classes of the current Gizmo used in Core Engine. It was quite a bit more than anticipated, with all engine utilities and tools used by the Gizmo and EditorComponent (the two main-classes for object movement) some parts had to be rewritten or completely removed.

The project has been published on CodePlex:
http://xnagizmo.codeplex.com/

The project status is set to Beta. Everything should work out of the box. If you run into any issues using the code/sample, leave your comment here or use the Discussions tab on the CodePlex project page.

I hope you enjoy!