Time for a small update.
The last few days have been spent doing random things - beginning AI/NPC's, fixing some bugs, beginning some performance boosting things like hiding objects and terrain past a certain distance (it will be adjustable so you can set it to match your computers speed), and quests.
The hardcoded quest part of the game is basically already done and it only took me less than 2 hours to do. That's because quests will be completely scripted using LUA, as are many other parts of the engine. Here's a short explanation for those of you interested...
For quests, the engine calls a setup quests file that looks something like this:
<quest>
name="Test Quest"
script="data/scripts/testQuest.lua"
timeDelay=500
state="init"
</quest>
Where each quest is defined using the basic parameters. The PoPR engine parses and interprets that file, translating it into a .lua file that looks like this:
quest.create(0,'Test Quest','data/scripts/testQuest.lua',0);
quest.setState(0,'Test Quest','init');
You could just type it in the setupQuests file like that and it would just leave it as it is, but obviously the other way is more readable, so the option is there (same with things like entities, classes, npcs, etc.). So quest.create and quest.setState are hardcoded within the engine to call the corresponding functions, setting up the quests.
Then, the quest update function checks to see if a quest is active (all start active by default), if the time since the last call to its script file is more than it's timeDelay (this is so you're not calling a script file every loop when you really might only need it checked every second or so), and if it is, it calls it's script file. The quest script file might look like this:
questNum = quest.getNum("Test Quest")
questState = quest.getState(questNum,"Test Quest")
if questState == "init" then
if input.getLastKeyPress() == 19 then
quest.setState(questNum,"Test Quest","start")
end
end
if questState == "start" then
npc.moveTo(1,camera.getPosX(),camera.getPosY(),camera.getPosZ(),2)
quest.setState(questNum,"Test Quest","complete")
quest.setActive(questNum,"Test Quest",0)
end
As you can see, the script file for a quest handles the actual quest. In this simple example, if the quest is in it's initial state and the user presses 'R' (keystate 19), it sets the questState to start, which then causes npc 1 to move to the camera position, and then the quest is set to complete and inactive.
Anyways, not really sure if anyone cares to know about it, but anyone who has the game (when it finally comes out) will be able to use this to create their own quests and mods and such.
Speaking of finally coming out, my new goal for a releasable version of the world editor and engine for PoPR is September, with a beta by August. Of course, this could be just another deadline that I watch fly by, but I'm thinking and hoping I have a better understanding of where the engine/world editor are at and how much work is required to finish them. At the moment, my idea is to release a demo that has a few quests and part of the world, and then have the full game for something like $15 (about 10.7 Euros according to Google) that has many quests and a larger world.
So, does anyone have any input on that? Or anything else, for that matter?