GS2 had a somewhat decent API I found, that might be a good starting point.
I spent some time refamiliarizing myself with the script engine code and somewhat redesigned the way it interacts with the rendering engine. I think the script engine in a much better spot now for me to more easily make API functions available to it, though I guess Iāll find out for sure as time goes on. I just finished this as I need to go to sleep, of course. So Iāll test it a bit more tomorrow and start figuring out how to make events work. The current goal is to get all of the framework pieces in place to allow input > event > script > reposition animation.
Iām sure Iāll reference it repeatedly for ideas, but Iām definitely not trying to mimic it. Keep an eye out for new posts asking for input too, as theyāll surely come along in the future.
I just ran a quick test of the script engine and it generated 100,000 random numbers about 8 times slower than pure C++ code, while in debug mode. This is pretty awesome for a language thatās currently interpreted and not compiled into assembly code. (Such as JIT versions of Lua/JavaScript, for example.) My concerns about it not being fast enough for the client are clearly unjustified. This is looking great for the project as a whole. Sorry, I had to post. I was excited/relieved by this result.
Anyway, the updates to the script interface are adequately done for now and are great changes for me as I work on the client API. Iām starting planning/work on making events possible now.
Thatās awesome. Canāt wait to code in CodrScript.
I canāt even settle on a client name. Letās not start on the language. :whatever:
Someday?
-edit Hey, guess what. You canāt put the TM character so youāll have to deal with the question mark, thatās what.
Iāve been stuck trying to figure out a good way to link script variables to objects within the game engine. Iāve got a few ideas, but none of them are very efficient. There has to be a better way. Work has also been exhausting and Iāve not wanted to think about this problem much, so Iām hoping this weekend will give me the time to come up with a solution.
Hereās a basic script illustrating the problem:
obj = new Sprite;
obj.x = 5; //This needs to update the actual Sprite objectās x. The object isnāt stored with the variable. That would be bad for the renderer.
There are numerous ways to make this happen, but none that Iāve been satisfied with so far.
Possible to store like a pointer to the object on the heap or something? Then obj.x is a shortcut for some something like obj.getObject(id).x
Not a lot of thought went into that idea, so forgive me if itās retarded lol
Youāre on the right track, but there are lot of factors to consider. Iām not going to go into every detail, but for example, the variable wonāt always be a particular type.
Iām trying to get back into this. Summer is still here, though, so activity probably wonāt be very consistent. I donāt think it ever has been anywayā¦
As I recall, everyone was wanting a means of starting to develop content as soon as possible. While a level editor can definitely be a first goal, a lot has to be completed to even make that a reality. I donāt want to make it an external program, as that complicates future cross-platform functionality.
The milestones to cross to get to a level editor are:
- Script engine interface completion (currently in progress)
- Development of necessary user interface controls
- Development of the level editor scripts
I canāt attempt to put a time frame on this, but it doesnāt seem terribly far in the future, depending on how active I am with development. A new WoW expansion is coming in 2 weeks, too. Iām hoping it wonāt keep my attention long, as they tend not to anymore.
One question I have isā¦ is a level editor even worth it without scripting support? While that could be added, it would be incomplete, as the game engine hasnāt even been fully developed. I donāt have a plan for all of the engineās script API. I think it would be best to limit the level editor to scriptless objects only until later, but againā¦ is that worth it?
As long as there are objects to be used to make general levels that could be improved later when scripts get released, I think itās worth it. Some people might also benefit from getting their level designs done before they start scripting.
Glad to see someone is still motivated enough to work on a project like this.
Having the level editor without scripting support would also allow for more extensive testing of the tile system. Unless thatās already been doneā¦ In which case ignore me.
I support this project fully and would love to see its development through, I am too busy to help myself.