Jump to content
  • entries
    5
  • comments
    16
  • views
    11,034

Framework, Update


Paul Thomas

4,154 views

 Share

I just finished uploading the framework so that some friends can help out with the content and scene. I already have the overall theme and game put together, I just have to make them, and in this case get help with converting models, creating materials, and so forth.

 

The framework is going extremely well. I've been working on it more than I should be to be honest but I did spend most of the day on the important matters. Plus it's Sunday for crying out loud. Anyways, I've changed several things about the framework. Here is a brief overview:

 

Configuration is now available in the engine. This provided the gateway to the rest of the features I had plan for the framework, such as key/mouse binds, and generic configuration information for both the "engine" and "game."

 

The key/mouse bind configuration file looks similar to:

forward=w
backward=s
left=a
right=d
jump=space
leap=lshift+space
crouch=c | toggle
fire=leftmouse
aim=rightmouse
grenade_toss=middlemouse | release
grenade_cook=middlemouse
debugphysics=f6 | toggle
use=e

 

It's fairly straight forward but the configuration file can contain basic instructions, such as "release" and "toggle." The configuration class itself provides the rest of the support. Examine the following, which is now accessible to Lua:

if input:hit("leftmouse") == 1 then
 -- fire logic
end

if input:hit(input.get("use")) == 1 then
 -- use logic
end

if input:toggle("crouch") == 1 then
 -- do crouch
end

 

The engine configuration is managed with: config.get("resx")

The game configuration is managed with: game.get("difficulty")

 

One last feature I've added is a way to change between behaviors. These behaviors are strictly Lua, a hybrid, and strictly C/C++/C#/BlitzMax. If you provide the file "engine.lua" into the root of the project, the framework will only execute that LUA file after creating the graphics context and managers (config, input, game, etc.).

 

The "hybrid" is a mix of the two. The framework calls upon specific Lua files at specific times. They could be looked at like "hooks." The Lua files are located at: "/scripts/dice" Examples are "update.lua" and "flip.lua."

 

The framework also now handles scenes. It allows Leadwerks to process the scenes at the moment but then each entity in the scene to turn into an actor by the framework. This way you can get any actor:

local actor = engine:getactor("myEditorAddedActorName")
actor:translate(vec3(0,0,0))
actor:setkey("health", 20)

 

Actors have their own Lua files and due to the structure described above we should be able to swap Lua files on the fly. The plan I will be attempting is similar to the following:

local actor = engine:getactor("myactor")
actor:setscript("newscript.lua")
actor:runscript()

 

I assume it will work, but who knows. Since per entity/actor scripts work the flexibility with the framework is fairly polished. I'm starting on default controller mechanics, soon to get into third person characters, and so on. Once my buddies can help me out I'll have more to test mechanics.

 

Everyone should also check out Scarlet Thread Studios work, it looks to me like an RTS/TPS style framework, similar to Diablo series. Slight modifications can turn that into an RTS, FPS/RTS, and so on.

 

Same with Pixel Perfect's engine Neutrino, which utilizes EKI One, and is turning out fantastic. I've bugged him to lease it but he isn't budging. Sorry everyone, lol. Just playing, Pixel.

 

MG, always awesome work. Thanks for joining up to help with the content.

 

Macklebee, hoping you'll come aboard and help me out with Lua. I'm really not in the mood to fully learn Lua at the moment. I plan to stick with hard-coded mechanics, lol. Read the above, it explains how to force the framework to let Lua control the main loop. Figured that would be your expertise.

 

Awesome hangout session. I never planned to make it, thought it was out of my schedule, so it was kind of unexpected, lol. I had to register with Google+ and everything. It was fun, meant to talk about more, and to everyone else instead of just Josh, but I had to go AFK; turned out to be too long. I hope I'm invited to the next hangout but I don't have a camera.

 

Thanks for reading.

  • Upvote 1
 Share

8 Comments


Recommended Comments

Interesting blog Paul, I like your ideas on behaviours and the mixes it supports, I'll be watching this to see how this works out.

 

Great to see you have both MG and Mack on board, that's a massive boost to anyone's team. Hope you're not committed to supply food and beer though, they could run up quite a bill biggrin.png

Link to comment

lolol

 

Well, I haven't had beer in a long time, I wouldn't mind having some myself. I don't mind sharing lol.

 

Definitely is a great boost, both of them are what they would say "jack of all trades," they would also say "master of none" but I would say "master of some." A lot of skill from those two. Though, I think MG just gets lucky :P

Link to comment

Thanks Pixel. I'm trying to have some time to work more on it tonight. I'm slacking behind but it was expected. I want to work more with Lua, expose more of the framework to Lua (anything that is useful) and continue doing what we're doing. Mack is basically building a framework out of Lua (using "engine.lua" [now configured in engine.ini]) while I'm hardcoding specific mechanics. We'll eventually see how well it meshes with Lua but it should be good.

 

The "actors" idea is actually adopted from PhysX and it's just so it's easier to deal with objects in your scenes. Once you have easy access to any object in the scene you can begin flexibility and game-play mechanics. Overall it's just a helper though or a type of caching.

 

I would be interested in learning the structure of your engine, Pixel. If you didn't mind sharing. Would be great to see a blog on it.

Link to comment

Though, I think MG just gets lucky tongue.png

 

Working with Paul and Lucky are polar opposites so that don't wash .. thats what you meant right.. Paul .. right.. Huh? unsure.pngtongue.png

Link to comment

I would be interested in learning the structure of your engine, Pixel. If you didn't mind sharing. Would be great to see a blog on it.

Sure, it's in the process of being re-written for the 3rd time as a result of design lessons learnt along the way, my recent interest in Lua and my imminent team up for a new project (I'm teaming up with an artist who is not too concerned about my limited ability to commit time wise). Once that's completed I'll add an overview to my blog.

 

 

 

Link to comment

Sure, it's in the process of being re-written for the 3rd time as a result of design lessons learnt along the way, my recent interest in Lua and my imminent team up for a new project (I'm teaming up with an artist who is not too concerned about my limited ability to commit time wise). Once that's completed I'll add an overview to my blog.

Great, I look forward to the overview.

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...