Oct 21, 2012

Game Engine, Lua, Box2D and other things

Hi there, it have been a long time, I apologize...
Well as You can imagine the game engine progressed a lot, well YOU'RE WRONG! I started it over again (this is the last time, I promise) and I did it like pi times better! I rewrote how the depth is handled, added Lua support and added Box2D for physics and better collisions.

But before talking about the new engine I need to say that someone joined the team, even is he's not always active :P, he participates in the game design, the programming and ideas. He's named Senryoku over the net, here is his GitHub page.

 I talked about Lua, well, he was the one who introduced the idea in the game, we talked about it and decided that adding an interpreted language to the game would make it easily expansible allowing for example to create dynamic levels or even to create your own enemies, weapons or objects, and this is quite exciting because we want to provide a big amount of functions and classes to let Lua get acces to everything someone will need to make a custom story. Yes, I picked that name from Amnesia, it's almost the same concept but even more customizable, we will allow you to prevent the player from playing and moving thing around, adding text, creating bodies, trigger functions to make things happens under some conditions etc. And that simply mean AWESOMENESS TO THE MAX!

I also implemented Box2D as the physics and collision engine for the game. I'm currently wrapping code to allow Lua to create joints between bodies. It's not difficult but it takes time to warp correctly because I have to test everything and well, I also have fun doing senseless things that move, destructibles joints, etc.



I already implemented the particles to Lua, meaning that you can create any kind of particles and particle modifiers (emitters, destructors, attractors). I may create more things to add more fun and customization  but with these tools you can already create complex effects. The things runs quite smooth at the moment, even with large amount of particules but they're not thought to be use a lot so you wouldn't be able to have more than 2000 of particle, I may optimise this later using a direct OpenGL drawing instead of using my own Sprite class based on SFML (which relies on OpenGL but it's not the same ^^) What's interesting about these particles is that they are actually textured and well that obviously makes it
slower...



The particles and the bodies are created through Lua code like that:


w = 15
h = 25 body = Body:new(x, y)
body:setAsCircle(w, dynamicBody);
body:setTexture("mini");
body:setAnimation("s_box.png");
body:setSpriteScale(w/4, w/4);
body:setSpriteOrigin(4, 4);

This will create a simple dynamic Circle. The particles code is a bit more complicated because it involves attractors and emitters ^^.

As you can see there is nothing specific to KDD for the moment, that's the purpose, an engine optimized for games like KDD that will allow to develop other games in the same style. And well that will be all for the moment! I'll try to write more often from now on!

2 comments:

Holas! Yo se que hablan espanol por aqui... :D

Solo tengo la dudilla de... en que estais haciendo el engine? en que lenguaje n.n

El engine es en C++
Ahora mismo no trabajamos en el porque hay mucho trabajo al lado y no da tiempo xD

Post a Comment

Sorry for word verification but it's to avoid spam