Thank you! Glad that it inspires you. This is turn inspires me.
Seeing encouraging posts about your game fills you with Determination.
Sorry could not resist
Ha-ha, that's right!
Okay, some progress update.
I'm
determined to finish the demo's prototype by the end of the month or a bit later. I won't post much screenshots, because it will be a raw prototype which means shitty graphics, shitty dialogue and some bugs. But this just gets stuff moving faster which I've realized when I made pretty cool boss battle in just 3 days.
How long will I polish what I do? I have no idea.
Scripted action sequence (previously cutscene system) goes pretty well and I'm adding new stuff I can do with it.
Sorry for broken tiles/stuff, this is just a test level!
It's not even a sequence anymore, as I can go from any action to another depending on some conditions. So, it's more like a state machine now.
For example, I made a script named
house_enter.lua which scripts door behaviour and stuff when you enter the house.
Here it is:
http://pastebin.com/GMcqUQwEFirst of all, it has a function named
makeCutscene which returns array of actions which are then later used to make a C++ vector of
Actions which are then executed mostly in C++, but they also call to Lua functions (for example, f function defined in lots of actions in the script)
It could have been just a vector of references to Lua functions, but some tasks are pretty complex, so I've made some shortcuts for myself which are coded in C++.
I can pass table named args to cutscene, which is used to get different parameters.
For example, when I call door's interact function, it looks like this:
interact = function(this) -- "this" is a LuaEntityHandle of door entity
playCutscene("house_enter", { door = this, key = "GOLDEN_KEY" } )
end
So I can later get stuff which I need like this:
local door = args.door
Some actions have tags, so I can go to them by calling goTo function.
Actions which have
nextTag property are calling
goTo(nextTag) after they're finished.
"EXIT_REQUEST_TAG" is a special tag which just stops cutscene from playing.
When I go to the
"ENTER" action, following actions don't have tags, so they're executed one after another.
(I'm also thinking about how to do State machines in Lua better and I'll write some stuff about it later when I test some things. I'll also most likely use Behavior Trees for AI, because they're awesome, though this will be the first time I implement them and I'll try to make them data-driven, of course.)
So, that's how it works. What do you think about this system? Any stuff I can improve?