Jump to content

Teaching Leadwerks



About a week ago we sent a survey out to Leadwerks 3 customers to get their feedback and plan our next leg of development. According to the results, the number one most important issue Leadwerkers care about is tutorials.


We've taken the following steps to build resources for Leadwerks user to learn from:

  1. The Leadwerks 3 tutorials database is available here. Anyone can submit a new article, but all articles must be approved by the staff before they appear visible. Without a process of approval, it's difficult to keep everything consistent and error-free.
  2. We added some new features to the tutorials template to make it easier to convey knowledge. First, we added a tabbed interface to display multiple code files. You can use this to display a lesson in C++ and Lua side-by-side, or you can use it to display multiple code files from a single project.
    We've also added some new BBCode tags, available only in the tutorials database, that allow you to display a chunk of code with both C++ and Lua syntax. The "tabber" BBCode tag starts a tabbed box. "tabitem={title}" will open a tabbed panel. Both these tags need to be closed like so:
    [tabber][tabitem="Item 1"]Panel 1 content.[/tabitem]
    [tabitem="Item 2"]Panel 2 content.[/tabitem]
    [tabitem="Item 3"]Panel 3 content.[/tabitem]

    The code above will yield this result:
    You can use this to explain what a chunk of code does, and a block of C++ and Lua code, covering both languages in a single lesson.

  3. Search tags are now available. The following built-in tags can be used: "C++", "Lua", and "Blender". We will add more tags as new content becomes available.

Educating our community is a powerful thing. For our staff, we have all the knowledge of how Leadwerks works in very deep detail, but it can be difficult to communicate that knowledge in a structured way that makes sense. On the other hand there's the community, made up of people who are smart and eager to learn. Conveying the knowledge of how to use Leadwerks to our community is a powerful thing. Like Agent Smith creating clones of himself in the Matrix, we can create new experts and mini-experts just by showing the way.


There's a gap that needs to be overcome. In some ways, this is as difficult as writing the actual code that powers Leadwerks. There's three levels of code examples we're providing right now.

  1. The first are the documentation examples. Just about every command has an example in both C++ and Lua that shows how to call that command. These are kept as simple as possible so it's easy to isolate how the command works.
  2. The second type is the game-ready code we write for examples. Darkness Awaits is an example written entirely in Lua, while our first-person player tutorial is using C++. These examples show real game code I would use in a commercial product, but they're harder to understand.
  3. Somewhere in the middle lies the "feature" examples. "Aggror" has posted a lot of tutorials like this for C++. These are more conceptual than the simple documentation examples, but are usually just one code file, and they don't go into a lot of heavy game structure so they're lightweight enough they could be used to demonstrate both C++ and Lua simultaneously.

So now I would like to ask the community, what's working best for you? What kind of tutorials would you like to see more of in the future?


Recommended Comments

I personally would like to see complete mini game tutorials (much like the awesome FPS tutorial you guys are doing now). I also prefer Lua to C++ (so don't forget about us non-C++ guys). I think Lua is a lot less intimidating to people coming from an art background.


Also it would be great if you could make a tutorial (or later convert the FPS tutorial) for iOS and Android versions. I'm sure a lot of users (myself included) are very interested in publishing for mobile. So having an FPS tutorial for iOS and Android would be super helpful smile.png .

Share this comment

Link to comment

All tutorials are mixed.

It shoud be great to have sub categories if it was possible ?

- Lua

- C++

- 3D art

- game examples

Share this comment

Link to comment

We will separate the lessons into categories as they evolve. Right now, there would only be two categories, so it's not worth doing yet. (The features I just added allow programming lessons to be both C++ and Lua.)

Share this comment

Link to comment

It might be a little advanced for most people, but I would love an article about shaders.


Best way to learn shaders is to read some OpenGL tutorials. Even if you aren't interested in OpenGL itself, you will very quickly learn how shaders work and how to use them.. Then adapt that

Share this comment

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Blog Entries

    • By Haydenmango in Snowboarding Development Blog 6
      So I've been researching snowboarding lately to get an idea of what animations and mechanics I need to create for my game.  I have learned lots of interesting things since I've only seen snow once or twice in my entire life and have never even tried snowboarding or any other board sports (skateboarding, surfing, etc.) for that matter.
      Snowboarding tricks are quite interesting as they are mostly derived from skateboarding.  Snowboarding tricks pay homage to their equivalent skating tricks by sharing many concepts and names.  For example basic grabs in snowboarding share the same concepts and names as skateboarding: indy, mute, method, stalefish, nosegrab, and tailgrab.  Something interesting to note is in snowboarding you can grab Tindy or Tailfish but this is considered poor form since these grabs can't be done on a skateboard (due to the board not being attached to the skaters feet) and grabbing these areas is generally something a novice snowboarder does when failing or "half-assing" a normal grab.  Check out this diagram to see how grabs work -
      So, after reading lots of text descriptions for tricks I was still confused by what all these terms meant and how they were actually applied.  So my next step was to look up these tricks actually being done and I found some really cool videos showing off how to do various tricks.  This video in particular is the best reference material I've found as it contains nearly every trick back to back with labeled names and some tweaks -
      Sadly my rigged model doesn't handle leg animations with the snowboard that well so I can't animate as many tricks as I want to.  Regardless there will still be around 15 total grab/air tricks in the game.  Now it's time for me to stop procrastinating and start animating!  
    • By jen in jen's Blog 3
      I thought I would share my experience on this; if you're working on Multiplayer, you will need to protect your packets. The solution is simple, let's go through how we can achieve this by implementing what Valve calls "challenge codes". (Some reading on the topic from Valve here: https://developer.valvesoftware.com/wiki/Master_Server_Query_Protocol#Challenge_response).
      Disclaimer: this doesn't cover other security techniques like authoritative server or encryption.
      So, I've worked on Border Recon last year (I think) and I needed a way to protect my server/client packets. There was no need for me to re-invent the wheel, I just had to copy what Valve has had for a  long time - challenge  codes.
      The idea behind challenge codes is similar to Captcha, but not exactly. Think of it like this: for every packet submitted to the server, it must be verified - how? By requiring the client to solve challenges our server provides.
      To implement this we need to have the following:
      A randomised formula in the server i.e.: a = b * c / d + e or a = b / c + d - e, be creative - it can be any combination of basic arithmetic or some fancy logic you like and can be however long as you want - do consider that the longer the formula, the more work your server has to do to make the computation.  Copy the same formula to the client. A random number generator.  So the idea here is:
      (Server) Generate a random number (see 3 above) of which the result would become the challenge code, (Server) run it through our formula and record the result. (Client) And then, we hand over the challenge code to the client to solve (an authentic client would have the same formula implemented in its program as we have on the server). For every packet received from the player, a new challenge code is created (and the player is notified of this change by the server in response). For every other packet, a new challenge code is created. (Client) Every packet sent to the server by the client must have a challenge code and its answer embedded.  (Server receives the packet) Run the challenge code again to our formula and compare the result to the answer embedded on the client's packet. (Server) If the answers are different, reject the packet, no changes to the player's state. The advantage(s) of this strategy in terms of achieving the protection we need to secure our server:
      - For every packet sent, new challenge code is created. Typically, game clients (especially FPS) will update its state in a matter of ms so even if a cheater is successful at sniffing the answer to a challenge code it would be invalidated almost instantaneously. 
      - Lightweight solution. No encryption needed. 
      - The formula to answering the challenge code is embedded to the client, a cheater can de-compile the client and uncover the formula. Luckily, we have other anti-cheat solutions for that; you can implement another anti-cheat solution i.e. checking file checksums to verify the integrity of your game files and more (there are third-party anti cheat solutions out there that you can use to protect your game files).
    • By Josh in Josh's Dev Blog 4
      New commands in Turbo Engine will add better support for multiple monitors. The new Display class lets you iterate through all your monitors:
      for (int n = 0; n < CountDisplays(); ++n) { auto display = GetDisplay(n); Print(display->GetPosition()); //monitor XY coordinates Print(display->GetSize()); //monitor size Print(display->GetScale()); //DPI scaling } The CreateWindow() function now takes a parameter for the monitor to create the window on / relative to.
      auto display = GetDisplay(0); Vec2 scale = display->GetScale(); auto window = CreateWindow(display, "My Game", 0, 0, 1280.0 * scale.x, 720.0 * scale.y, WINDOW_TITLEBAR | WINDOW_RESIZABLE); The WINDOW_CENTER style can be used to center the window on one display.
      You can use GetDisplay(DISPLAY_PRIMARY) to retrieve the main display. This will be the same as GetDisplay(0) on systems with only one monitor.
  • Create New...