Jump to content
  • entries
    941
  • comments
    5,894
  • views
    868,002

About this blog

Learn about game development technology

Entries in this blog

Multitouch Madness

I've implemented multitouch input on iOS, and gave Aria the information he needs to do the same for Android devices. Multitouch is an interesting input method. Each "touch" has a beginning, some movement, and an end. To handle multiple touches, they need to be persistent; you need to keep track of which touch is which. This is a little weird if you're coming from a mouse and keyboard paradigm.   On iOS, you have a pointer to a UITouch object, and on Android it's a jObject object (I think)

Josh

Josh

Leadwerks3D on Android

After some initial difficulty, Leadwerks3D is now running on Android, with the exact same code that runs on iPhone, iPad, Windows, and Mac. A big thanks for Aria for all his help and expertise with the Android platform. This means Leadwerks3D is now running on all platforms we intend to support at launch, and it can be easily extended to support new ones.     To celebrate, here's another cartoon I drew:

Josh

Josh

iHurt

Here's the code: Print("context = "+GetObjectAddress(context)); Print("Graphicsdriver: "+GetObjectAddress(graphicsdriver)); Print("GetGraphicsdriver: "+GetObjectAddress(GetGraphicsDriver())); Print("ActiveGraphicsDriver: "+GetObjectAddress(ActiveGraphicsDriver)); Print("context->graphicsdriver: "+GetObjectAddress(context->graphicsdriver)); Print("context = "+GetObjectAddress(context)); Here's the output, running on an iPhone 4: context = 0x06921400 Graphicsdriver: 0x0694e800 GetG

Josh

Josh

Coders Gonna Code, Haters Gonna Hate

Lately I've been talking a lot about making non-programmers happy, so here's something for the coders. B)   For Leadwerks3D documentation, I considered three possibilities: -IPB-based docs -Wiki -Offline CHM files   Each has their own strengths and weaknesses, as always seems to be the case.   IPB A bit slower, harder to organize, harder to edit, looks really good and consistent with the site, search requires quite a few clicks to get where you want to go, missing table of contents is

Josh

Josh

Pathfinding

It doesn't happen to me much anymore but when I get stuck on a difficult problem, I get very restless and short-tempered. I guess that's the point where most programmers give up on a project. Since I can't physically wrestle code to the ground and give it a good beating Billy Batts style, the fight or flight response probably is not conducive to sitting in front of a piece of glass and figuring out code. On the other hand, I have a tendency to get difficult things done, no matter how hard the

Josh

Josh

Connecting Actors

To make an entity in Leadwerrks3D behave, you can drag a script from the asset browser to the actors list in the entity properties editor. Each entity can have multiple scripts attached to it. Each script can have different variables exposed, with control for the GUI they are displayed in. For example, you can specify upper and lower limits of a spinner or a list of choices for a drop down box. Each script attached to an entity, along with its set of properties, is called an "actor" because.

Josh

Josh

Drag, drop, and roll

The various parts of the new editor are coming together. Today I got the properties list box drag and drop functionality working. I actually had to go back and rewrite some of the list control rendering code because I haven't used it in a while, but it didn't take long.   I'm trying to attack known unknowns first, so we're focusing on the flow graph, AI, and game logic, and everything required to build up to support that. I've already written a CSG editor and an engine with great graphics,

Josh

Josh

Entities and scripts

Below you can see the properties editor. When you select a script attached to an entity, the properties for that script appear on the right. Here we have a simple "Pulse" script that changes the color of the entity along a sine curve. This can be used for making lights that pulsate slowly, or continually turn on and off.   Here's what the script looks like. The "--in" tag at the end of the Pause and Resume functions indicate that these functions can be activated in the flowgraph editor.

Josh

Josh

Almost Android

Leadwerks 3 is compiling for Android. There's presently a problem with the file system that is preventing any 3D rendering, but we'll get that worked out shortly. We're targeting Android 2.2.   In order to compile C++ for Android on Windows, we had to install the following: -Java SDK -Eclipse IDE -Android SDK -Android NDK -CygWin -GDB   We also learned that OpenGL ES 2.0 does not run in the Android simulator. For the time being, we have to run the engine on an actual Android device.

Josh

Josh

August 13, 2011

Once again, I like to attack the things I haven't done in the past first. I know how to make a CSG editor. What I haven't done in the past is a visual editor for gameplay and logic.   In the shot below, you can see the properties editor, with the "Scripts" tab selected. I moved the name and angle editor outside the tabbed panel, with the idea that these are so important they belong in the main window, but the real reason was to break up the boredom of a full-window tabbed panel. Under the

Josh

Josh

Making a scene

The scene browser lets you see every entity and brush in the scene, and also lets you arrange entities in a hierarchy. You can add a light to the scene, position it onto a lamppost, then use the scene browser to parent the light to the lamppost model and save the whole thing as a prefab.   There's no "mesh" class in the new engine, and entities inherit a lot of the properties that models in LE2 had, like scripts and physics. Models are just MDL files, and generally just contain model and bon

Josh

Josh

More interface stuff

I implemented resizable viewports this morning. This is so much more fun than fiddling around with compiler settings.   You can grab the bars between viewports, or the very center space, and drag it around to resize the four viewports. I usually prefer a smaller perspective view, and like to devote most of my space to the 2D views when doing serious editing:   You can also drag the views around to make a single big viewport, or just have two viewports visible:   In 3D World Studio, w

Josh

Josh

And now the fun begins

We have our design parameters. We know the editor should let the user control every aspect of the engine in a visual manner, without having to use any other tools or do any editing of text files. We have 3D World Studio to serve as inspiration for the design and feel of the program.   The sky's the limit. You, the users, have told me that you want to invest in a system that does more for you and makes your life easier. I'm happy to provide the basis for your next projects. Thank you for l

Josh

Josh

Interfacelift

The fantastic Fatcow icon set was recommended to me in the comments in a previous blog post. These are very similar to the Silk icon set, but come in 32x32 and 16x16 versions, have more icons, and better coloration. The Silk icon set is sort of a desaturated pastel tone I don't like, and Fat Cow's icons are more saturated and bright. I had actually considered running the Silk icons through a color-correction algorithm, but Fat Cow has already done the work for me.   I knew from the start I

Josh

Josh

Debunking Hype

I am usually very excited to read about new graphical techniques, and even new hardware approaches, even if they are presently impractical for real use. I was very interested in Intel's Larabee project, even though I didn't expect to see usable results for years.   However, sometimes articles get published which are nothing but snake oil to raise stock prices. The uninformed reader doesn't know the difference, and these articles are usually written in such a way that they sound authoritative

Josh

Josh

Android Ahead

I hired a local Android developer to get Leadwerks 3.0 running on Android devices. We don't know a lot yet, other than that we have an OpenGLES renderer, and everything should be cross-platform compilable. The Android version of LE3 is using a minimum requirement of Android 2.2, which is the lowest version that supports OpenGL ES 2.0. This will run on about 75% of Android devices:     As you can see here, the proportion of 2.1 devices is steadily dropping. If a linear rate of decrease i

Josh

Josh

Lions, Leadwerks, and Androids, Oh My!

It took a while to figure out, but I was able to get drag and drop interaction working on OSX. (Thanks to Seb Hollington for helping with the coordinate transformation stuff.) Now the editor lets you assign textures by dragging them onto texture slots, just the same as on Windows. There's one last step before the editor code becomes totally platform-agnostic. A file system watcher needs to be implemented on Mac. On Windows, this was fairly straightforward, because there is a built-in API fo

Josh

Josh

Leadwerks on the iPhone

So here's what it took to get Leadwerks running on the iPhone:   Let's start at the point we had the C++ code building and running with an OpenGL 1 renderer on OSX. I was worried OpenGLES might be a dramatically different API that required a whole new learning curve, but I was pleasantly surprised. It's just a stripped-down version of OpenGL, more like OpenGL 3.3 than anything else. Making the OpenGL2ES renderer was mostly just a copy and paste operation, and then I had to comment out a few

Josh

Josh

More Leadwerks.com Improvements

There's a new set of pages for Leadwerks Engine 2 up. I think these do a better job communicating all the features of LE2, and explain why it's unique and awesome. Existing users might even learn something from the material: http://www.leadwerks.com/werkspace/page/Products/le2   This also integrates into the forum skin. The only page left on the site that isn't using the global forum template is the 3D World Studio page, and that will be changed shortly.   The 2.43 evaluation kit will be

Josh

Josh

Implementation Details

A few weeks ago, I was getting pretty nervous about all the known unknowns in going cross-platform with the Leadwerks Engine 3 code. All my libraries and languages are platform-agnostic, but there's always going to be small issues, and I wanted to get those worked out while the code was still malleable. Here's a few things I found.   -OSX file paths don't have a drive letter, so the only way to specify a relative path is to add ".\" to the beginning. This had some significant implications f

Josh

Josh

Multiplatform Madness

So after a lot of learning and mistakes, I finally have Leadwerks Engine 3 running on OSX Snow Leapord, Lion, and iOS. Rather than write out a detailed blog, I'll just throw a lot of random thoughts your way:   -OpenGLES2 is a nice blend of OpenGL 2 and OpenGL 3.3. I'm really surprised my OpenGL 3 shaders translate easily into OpenGLES2 shader code, with only a few changes. In fact, the iOS renderer looks exactly like the deferred OpenGL 3 renderer, except for shadows and some post-effects.

Josh

Josh

Leadwerks Engine 2.43, advanced optics, and more...

Leadwerks Engine 2.43 ...will be released tomorrow, along with a new source distro. I've fixed a number of bugs, but I don't like compiling releases when I am tired because there's a lot of little steps to mess up, so I will do it in the morning.   Leadwerks Engine 3 Optics was always my favorite subject in physics, and I've been getting some amazing results lately by modeling computer graphics after real lighting phenomena.   Once I decided to make the materials system like 3ds max, ever

Josh

Josh

Lua and C++ Debugger

The C++ object debugger for Lua is working now. It was a little tricky, but I implemented a method to view all members of C++ objects. The debugger does handle dynamic object fetching, so if you expand a node in the debug tree representing a C++ object, the contents of that object will be loaded and displayed. Let's say you have an entity parented to another entity. This allows you to expand the parent member of the child, then find the child in the parent's child list, and so on, ad infinit

Josh

Josh

Tools and Stuff

The script editor and Lua implementation is very close to being a usable programming environment. You can actually see the pointers to the C++ objects you create, and step through code. It's still missing features, but the parts I was worried about are working.   I am adding Lua commands like crazy, and it's easy to keep track of them because they all reside in one header file. The function overloading is great, as you can see in my example here, where I use a single float value to set the

Josh

Josh

Small Victories

Two issues in the art pipeline were giving me some doubt. I stopped working on them a couple weeks ago, and I'm glad I did because the solutions became clear to me.   Shader Files First, there is the matter of shaders. A shader can actually consist of half a dozen files:bumpmapped.opengl3.vert bumpmapped.opengl3.frag bumpmapped.opengl4.vert bumpmapped.opengl4.vert bumpmapped.opengles.vert bumpmapped.opengles.vert   I originally thought the .shd extension would be good for shaders, i

Josh

Josh

×
×
  • Create New...