SonicGLvl 0.9 - Now on GitHub NEWS 8/27/2016 This version is not meant for public use and is merely uploaded as the work that I've done so far. It's very much in need of work to be considered a stable release. GitHub repository licensed under GPLv3 Building on Windows Development Roadmap SonicGLvl Wiki Builds: Stable: None yet. The bin folder in the repository at the moment has the last compiled version of the code, but ideally no binaries should be hosted there. Code Status: In need of some cleaner refactoring, especially how file opening is handled at the moment. Loading the files should be an external method that returns a value, not a constructor per type of object. Almost all of the ugly WinAPI code can and should be ignored since a port to Qt5 is inevitable. Switch all headers to #pragma once and try to forward declare mostly everything. Needs to be documented a lot more, although the names are pretty obvious as to what the methods do most of the time. Last Preview Video: https://www.youtube.com/watch?v=2fAkw7kcQPw FAQ Q: Can I use this over the original SonicGLvl? A: No, and you shouldn't. The current new branch does not have feature parity with the original SonicGLvl yet. At most it's fairly usable for some simple object layout editing. Q: Can I use the database/models from the original SonicGLvl? A: No, the databases are no longer compatible for the purpose of extending the functionality a lot more. However, on the plus side, dumping and detecting new object templates is pretty much unnecessary unless you want bigger control over how the objects are displayed. The new branch of SonicGLvl no longer relies on having objects on the database to be able to load/display them at all. Q: How similar is it to use this branch of SonicGLvl compared to the original one? A: For the purposes of optimizing the work pipeline and making it easier to understand, a lot of old tutorials will be pretty much useless, so a new knowledge database will need to be built on the wiki. Q: Summary of new features planned/implemented compared to original SonicGLvl? Smoother and much easier to use Viewport Controls. Undo/Redo. Smarter Object Database with extended previewing features. Smarter Stage/Terrain cache, verifies hashes and cleans up automatically. Game shader support, able to preview materials in the editor very similarly to the game. FBX Importing/Exporting instead of using Ogre formats, which gives us plenty of possibilities for a smoother pipeline between 3DSMax and SonicGLvl. Generalized Formats Library: You can do other applications that use LibGens for reading files from the game without having to integrate them into SonicGLvl. Also allows the possibility to do batching command-line tools. Terrain Lightfield Generation: Generate a lighting map based on rendered maps of the stage so objects and the player are affected by them. Better Terrain Group/GI generation workflow. More details on this can be seen on the roadmap. Ghost Playback/Camera Previewing for easier iteration on editing cameras. New material editor with real-time previewing, using the real game shaders, simplifying the iteration on polishing graphics a lot. Original thread: Spoiler Current Version 0.4: Check the last post for update information For the sake of not pestering the Generations resource thread for the ones who actually CARE about resources there, I'm splitting off the discussion of my editor in here, and also sharing all the information I researched so far in case anyone wants to try it on their own. Also, the editor is pretty much feature complete at the moment when it comes to level data format and templates so far. What's needed at the moment is raw models, templates tweaking, lots and lots of game content that needs ripping and being distributed with the editor. SonicGLvl - Visual 3D editor for level objects layouts Features: Loading XML or AR.00 files directly as levels. 3D camera controls and edition. Customizable model previews of in-game objects, can be fully extended later using a template database. MultiSetParam array support for creating copies of a single object easily. Ogre3D engine ensures a pretty good performance all around. Saving back directly to the AR.00 or XML files, ready to import straight to the game. Hosting and Downloads I will host SonicGLvl on Google Code, although I haven't opened the source code yet. SVN will allow me to keep a common database of the objects so far ripped out. Also, this would help people to not have to download a whole new version of the editor, just for adding a simple template. Using SVN update, you can just download the latest changes. SonicGLvl on Google Code. Checking out the latest SVN(for use for anyone who was the tools): Code (Text): svn checkout http://sonic-glvl.googlecode.com/svn/trunk/ sonic-glvl-read-only Also, for the users who obviously ain't gonna download SVN tools just to check out the program, I will upload stable "snapshots" of the repository periodically. In other words, you will be able to download the latest uploaded version on the Downloads page. Important notes: Do not use fullscreen mode or you'll be locked out of any "File Open" dialogue Windows pops up. You can limit the FPS turning VSync on If it looks like crap, you can put some FSAA to improve the looks Look over at the help menu for a "Quick Overview" so you're not completely lost with the controls. There's some focus issues with the windows. So make sure of what you click. Who can contribute to SonicGLvl The program needs lots of content ripping at the moment. Obviously I will work on it when more time frees up sooner or later, but all help is appreciated. Here's what can be contributted by simply posting here, or even comitting to the repository. Note that I'll need your google account name for adding project members. You can create a google account with any e-mail you currently have. What you can contribute: - Models and textures(models preferrably compatible with 3DS Max 2012) - Converted models: Processed models with materials ready to be imported into the editor. This includes the .mesh files exported and .dds textures, plus the .material script. - Templates (.xml): Refer to the technical info later on. - Ideas & feature suggestions are welcome. How to contribute? - Post here. - Request here to be added to the repository's project members so you can contribute using SVN tools. - Or just PM me anything. Tools needed for ripping Currently SonicGLvl is using Ogre3D engine to provide display previews. Ogre3D provides enough features and a pretty fast performance for the needs of the editor, and there's no plans of changing the engine. Plus, it's cross platform in the event that SonicGLvl goes that path in the future. - OgreMax Exporter is the plugin I'm currently using to export all models to the .mesh format Ogre uses. Do note that OgreMax supports 3DS Max, Maya, Softimage/XSI, and covers a big array of the versions of them. There's a commercial version, but the non-commercial version works fine for our purposes even with the restrictions. Non-commercial version of the plugin for 3DS Max. - Darkspines' script with a slight modification to change the naming of the materials created is the one I'm currently using to import game's models. The name modification is because OgreMax exports the materials named as the maps in 3DS Max. - Any 3D editor that's compatible with the above should work for exporting models into the editor. At the moment you can just use 3DS Max 2012 for free with a student 3 year license. Screens & Videos Some simple modifications of levels I made in the past with the editor: Future plans: - Add needed features like Undo/Redo. - Support editting additional vectors from the object with another 3D point in space. - Support loading level geometry when we got the chance to export it. Editting in blank space ain't fun. - Add support for editting easily stuff like Lines, spline paths, etc. Tech Info dump So for the ones currently researching into the game's objects as well, here's all the info I got so far. AR.00 Files Sonic generations seems to use two different kinds of .ar.00 files for loading an stage, appart from the geometry in the /Packed folder. - The file with a '#' (e.g. #ghz100.ar.00) is likely to be the "info" file of the level. The file size is small most of the time, and it holds all the data regarding object placement, as well as some physic files. While "Stage.xml" seems to refer to which files are the ones holding level data at the moment, it's safe to assume that all xml files with the prefix setdata_ are object level data. Mostly because "Stage.xml" seems to have a broken format sometimes, so it isn't really reliable. - The file without the # holds the geometry, textures, and other stuff of the custom objects from the level. You can look into these files if you want to rip any custom models. - These setdata_ xmls are completely human readable. While they can be editted by hand to add or move any objects you want, it's better to rely on the editor for the task. Mainly because using a 3D preview is way more intuitive. Objects - All objects of the level will be placed under the <SetObject> node in all these xmls. Each entry added to the file will appear as a whole new object in-game. Do note that most of these objects have a unique ID, set by a <SetObjectID> node inside them. Clashing IDs ingame are not something you'd like to see, so no objects should EVER have the same ID. - The level files seem to have a special option built into the game to generate copies of itself across different positions. These are called <MultiSetParam> nodes, and each of these hold various <Element> nodes with their own <Position>, <Rotation>, and <Index>. There's also a <Count> node for the total ammount of copies. This <MultiSetParam> makes it easy to generate say, a line of 40 rings in a perfect pattern. While there's other parameters such as <LineBase>, or <Interval>, this only seem to be relevant to whatever editor SonicTeam used to make the game, because they have no relevance whatsoever apparently if modified ingame. What matters is the individual positions and rotations in each <Element> node, and this is handled by the editor already. - It's considered pretty much globally for ALL objects to have their own <Position> and <Rotation> nodes. Coordinates between the editor and in-game match perfectly. You can consider the X-Z plane as the "floor" plane of the game, while the Y axis represents the Height. - The nodes inside each object never specify what kind of variable they are. That's where the concept of templates comes in. SonicGLvl HAS to have a way to know what variables an object normally has, and what kind of variable they are. Templates are simple XML files located in the editor's folder. They are normally built in the following way: Code (Text): <?xml version="1.0" encoding="utf-8" standalone="no" ?> <MyObject> <MyVariable1>bool:true</MyVariable1> <Position> <x>double</x> <y>double</y> <z>double</z> </Position> <Rotation> <w>double</w> <x>double</x> <y>double</y> <z>double</z> </Rotation> <SetObjectID>integer</SetObjectID> <Mesh>object.mesh</Mesh> </MyObject> Each node represents the name of the object's attributes. Instead of writing a normal value inside though, you are supposed to write the type of variable it is. The editor currently supports the following: string: a name double: decimal number integer: self-explanatory I guess bool: boolean value, will write either "true" or "false" Any value after ':' will be considered the "default" value with which the object is created from the editor's menu. For example, <CastShadow>bool:true</CastShadow> means that true is the default value for that attribute. Note that it supports attributes inside other nodes, like <Position> and <Rotation>. Also of notice, <Mesh> isn't an actual attribute, but a reference for the editor to know what model to use in the preview display. Here's an example for a game ring: Code (Text): <?xml version="1.0" encoding="utf-8" standalone="no" ?> <Ring> <GroundOffset>integer</GroundOffset> <InitDisp>bool</InitDisp> <IsCastShadow>bool:true</IsCastShadow> <IsLightSpeedDashTarget>bool</IsLightSpeedDashTarget> <IsReset>bool</IsReset> <Position> <x>double</x> <y>double</y> <z>double</z> </Position> <Range>double</Range> <ResetTime>double</ResetTime> <Rotation> <w>double</w> <x>double</x> <y>double</y> <z>double</z> </Rotation> <SetObjectID>integer</SetObjectID> <TreasureSearchHideType>integer</TreasureSearchHideType> <Mesh>ring.mesh</Mesh> </Ring> - Another option provided is the <AltMesh> reference. Some objects will change depending on the attributes they have, so the best way to represent that inside the editor is just changing the model displayed. For example, if you would want a red spring to be displayed instead of a yellow one when the power of the spring is above 30. Code (Text): <AltMesh> <Condition>FirstSpeed >= 30</Condition> <Mesh>spring_classic_r_01.mesh</Mesh> <Mesh>spring_classic_r_02.mesh</Mesh> </AltMesh> This is purely for the editor's reference, it doesn't change anything in the game. <Conditions> are single line statements. You can add as many conditions as you want. There's also a custom string value, LevelPrefix to check what level you're currently working on. For example, ghz for Green Hill zone, cpz for Chemical Plant. Same way as the game's files are named. - Yet another option provided in the case it's needed, <MeshScaleX> (or Y, or Z) will allow you to change the preview model's scale using an attribute of the object(for example, <Width>). It also has a custom multiplier attribute. Here's an example for the object <OnewayFloor>, which depends on <Width>, <Height> and <Depth> to be represented accurately inside the editor. Code (Text): <MeshScaleX multiplier="2.0">Width</MeshScaleX> <MeshScaleY multiplier="2.0">Depth</MeshScaleY> <MeshScaleZ multiplier="2.0">Height</MeshScaleZ> - The editor will search for any matching objects with the templates it has, and will write any changes made. It will also add any new objects, as well as erase any deleted ones automatically. It's totally safe and compatible so far to open and save a level and import it into the game directly so far, given that you haven't tampered too much with object's attributes that you don't know about and make the game crash. - The editor supports reading an XML and dumping all types of detected objects manually, using the default "unknown.mesh" as display model. It's recommended to tweak these files dumped manually. TL;DR; Editting the levels is way easier than you ever thought.