Rick Posted January 3, 2012 Share Posted January 3, 2012 Thought I would share my crazy "invention". Metatron once talked about a 3D flowgraph. I thought he was crazy mainly because I didn't want to make the editor to handle that BUT since LE already has an editor I thought I'd make some use of it in a game as some kind of proof of concept. The 2 below screenshots look insane, I'm aware of that , but that one scene, my level selection scene, only took about 10 mins to setup once the reusable components were created. It was actually kind of fun and refreshing to get some functionality from combining components. The scene functionality: Background music starts up right away A SQLite file is read looking for a specific table that holds variable/value data. That's what the P-Var components do. I think P-Var is pretty slick as you don't have to do anything yourself with SQLite. In the settings you point to a file, or put a name that doesn't exit. You put in a variable name, and initial value. If the SQLite file doesn't exist it creates it, makes a table called persistent_variables and adds the variable with the initial value. If the component is enabled when it starts it'll get the value and fire it's outputs (sendmessage to targets). It can also be set by an L-Var component (not shown) which is a local variable to the scene that you can give a value to. So P-Vars can be used across scenes and stay when the game exists. I still have to make a G-Var which is a variable across scenes but goes away when the game exists. The picture looking this is just that, an image. I have sets of 2 because I have a closed image and open image which indicate if the level is unlocked or not There are 2 IFCompare components per P-Var component that read the P-Var component (which was from the SQLite file so it's persistent) and based on the value (open or close) it enables the correct image component. It's a very basic control structure. You set the value it will compare against when variable components send their values as inputs. If they match exactly the IFCompare's outputs are fired. The image components are clickable as well. The closed images play a bad sound to indicate they are closed, and the open images play a good sound when clicked to indicate it's valid. There are sound components that are getting enabled to play their sound when they should The round button looking things on the top left are just that. Buttons. I plan on having GUI elements all separate components. So to handle drawing order they all have a Sort Order setting which is handled automatically by my Pi-Main script which is the basic, non-game specific main loop file. There is an Exit Game component tied to the Exit button which ends the game when enabled which the Exit button does when it's clicked. There are Level Load components tied to all the open images which gets enabled when they are clicked, and also one tied to the Main Menu which loads the main menu scene I'm kind of excited about this. My new Crazy Marble game is designed 100% like this. Once the components are created it actually goes pretty fast to make things. There are a couple things that I hope LE3D bring to help a system similar to this: Load new levels inside 1 master editor. Currently to test level loading between scenes I can't use the editor Game project wide prefabs. Re-configuring logic that is used in all levels is kind of a pain Targeting system works for this but not ideal as each component can basically have only 1 event that triggers it's output. This is index 0 selected This is index 1 selected This is the visual result, but there is functionality explained above as well Note that the position of the components in the editor aren't related to how it looks when it's done. These visual components all have the x,y,w,h settings. I just placed them in the editor that way to get the basic idea of what I wanted and to make some sense out of the chaos. Also the final result doesn't take up the entire screen because for now I'm using 800x600 dimensions when I load the game from engine.exe. Quote Link to comment Share on other sites More sharing options...
DigitalHax Posted February 27, 2012 Share Posted February 27, 2012 Wow. Looks like you have been busy... Quote Win7 64bit, Leadwerks SDK 2.5, Visual Studio 2012, 3DWS, 3ds Max, Photoshop CS5. Life is too short to remove USB safely. Link to comment Share on other sites More sharing options...
Pixel Perfect Posted February 27, 2012 Share Posted February 27, 2012 Fascinating! Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Rick Posted February 27, 2012 Author Share Posted February 27, 2012 Thread back from the dead I should really release the 1 level I had made for this game with the components so people can see it in action. I'll do that tonight. With a better input/output system this component style programming can work. The hardest part is representing what's going on so you can see it at a glance. With the target system it gets messy. With other systems like how Value's Hammer works you can't see the interactions unless you look at the properties of each item. Some kind of middle ground between the 2 would be nice I think. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 27, 2012 Share Posted February 27, 2012 Looks very good Rick. Very interessting. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.