Jump to content
  • entries
    943
  • comments
    5,899
  • views
    924,400

Gameplay!


Josh

4,276 views

 Share

The Leadwerks community project "Midnight Salsa" was one of my favorite things that came out of Leadwerks 2. Watching the videos of everyone collaborating across the globe was really interesting, and with Aggror's leadership they did pull off what they set out to do: Make a playable zombie FPS. However, there were some weak points that showed me where I could put effort and have it be the most useful.

 

When you go through the first set of doors, a carefully placed light above the door shines to illuminate a sitting zombie as the doors open. I noticed right away the animation transitions weren't completely smooth. Although our animation system makes it very easy to transition between frames and do all sorts of interesting things, the logic that manages multiple animation sequences blending in and out can get a little messy. I approached this as a general problem and wrote an animation manager script in Lua that handles a "stack" of animations. When you set a new animation sequence, it is added to the top of the stack and blended in over a specified amount of time. Once it is completely blended in, all animations beneath it in the stack are removed. This process can handle any number of transitions smoothly, so you can just always set the latest one and there will never be more than two or three sequences active in the stack.

 

The second problem that affects a lot of people is AI. How do you get characters to go where you want them to go? My advice in the past was to implement a system of connected nodes, as I did in my game "Metal". I finally solved this problem once and for all with a relatively recent technique called navmesh pathfinding. This provides more accurate pathfinding that isn't limited to node points, and it's completely dynamic. If the level changes, the pathfinding adjusts to it. This level of integration is only possible because Leadwerks 3 was built with pathfinding baked into the core, and it makes it very easy to use. Implementing this system was a huge investment of time and effort, and there was no guarantee it would have succeeded, so it probably wasn't conceivable to add this on top of Leadwerks 2. In retrospect, I really should have built node-based pathfinding into Leadwerks 2 so we could all have a common foundation for AI.

 

In this video, the project leader mentions having to send the level model back to the artist for resizing. This causes a delay in progress while everyone waits for the new model. Our new CSG level design tools eliminate this problem because the map can be immediately adjusted right in the editor, without any waiting around or reimporting. Even if the artist wanted to take their time to make it perfect, a quick modification could be made to give the other team members something to test with. When combined with the built-in navmesh pathfinding, you can visualize the navigable areas as you build the level. There's never any guessing or going back to redo things because your enemies don't have room to get through a hallway or something.

 

Finally, there is the matter of game object interaction. Sometimes you have special interactions in a map, and abstract classes aren't always the best way to manage that. In the past, gameplay mechanics like doors, switches, were exclusively the domain of expert programmers. Although Leadwerks 2 had a built-in messaging system, too much was left undefined. Consequently, even the programmers who were able to implement advanced interactions each isolated themselves from the community of developers, because they were branching the engine. Our new flowgraph system provides a shared framework we can all utilize and share code within. This means reusable scripts can be written that can be used in many games, by many developers, and our scripts can "talk" to each other through the flow graph. In the map below I've set up a collision trigger (shown in grey) and attached it to two doors (shown in green). When the player walks into the collision trigger the doors open. This simple example shows how anybody can set up advanced game interactions in their map.

blogentry-1-0-62293400-1360619442_thumb.png

 

Our primary focus for Leadwerks 3 is delivering gameplay. I think all of these features will facilitate collaboration and give the community some much needed high-level frameworks. Not only does it make building games faster, it gives us all a common framework to work together within.

  • Upvote 8
 Share

17 Comments


Recommended Comments

Every frame. Of course you could modify the script to add a re-fire delay, connect an output to itself to disable it after the first hit, or whatever you want.

  • Upvote 1
Link to comment

Volume triggers like this open up the door (some pun intended) for so many things! It's really something so simple, but can have many game interactions from it.

Link to comment

so, in this example, it stops opening when the player leaves the trigger? are there standard scripts like a NOT or something, because then, you could close the door again easily when the player is not colliding with the trigger

Link to comment

That's the nice thing about this system CGMan. We can make these scripts ourselves and the layout is defined for us so they will all fit together!

  • Upvote 1
Link to comment

yes a not-script is not that complicated to make :-} It's beatiful, we don't have to worry what object receives or sends what, we just see it in the flowgraph

Link to comment

I wrote the door script so that as the signal is continually received, it resets the door close delay. This makes it so the door doesn't close on a player if they stay inside the trigger area.

 

Regarding "not" and other logical scripts, you can add arguments to flowgraph connections, and they will be passed to the receiving function. So yes, you can make a logical script like "not" that tests one condition as an argument, and fires and output if the result is true. You could also make logical scripts for "and" and "or" and have them receive two function arguments each, for the two conditions to test.

  • Upvote 1
Link to comment

It was actually a combination of Rick's and Pancakes' suggestions that eventually led to this design. (They had a lot of other ideas I threw away though.) tongue.png

Link to comment

Looks good, so we got here a "Lego" for big kids :) We can make scripts and integrate them into the flowgraph and use them with other "blocks", correct ?

Link to comment

My understanding is the flowgraph "blocks" are made from the scripts themselves. They get constructed based on what you define in the scripts.

Link to comment

Yep, when you attach a script to an entity it exposes any functions marked in the script.

 

All of this runs in tandem with your C++ program. You can code the entire game in C++ and just use Lua for simple game level logic, or just use pure C++ if you prefer. Most games will probably work best with a combination of C+ and Lua.

Link to comment

My understanding is the flowgraph "blocks" are made from the scripts themselves. They get constructed based on what you define in the scripts.

 

That's what i meant :)

 

Nice, real nice. Hope Le3D will release verrrrrrrrry soon, cant wait.

Link to comment

For the resizing and or scaling of models you said the "CSG tools". Does this mean the only models that can be resized or scaled is leadwerks CSG models. Or will I be able to scale a model made from a differnt modeling tool?

Link to comment
Not only does it make building games faster, it gives us all a common framework to work together within.

That's great.

I think we'll see some FlowGraphs for any little functions we could need in space games, platform games etc ....

 

It's the thing i will test first : Flowgraphs.

 

Can we create easyly new flowgraphs ?

Link to comment
Guest
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.

×
×
  • Create New...