The Begining of Kill da Ducks

Learn how it was at the begining.

Last progress entry

See how the game development is going

Grav

A WIP arcade hard game you should check :P

Last Bug revealed

Look at the game's bugs and have some fun!

About me

Just a bit of information about myself.

Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

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!

Jun 9, 2012

Jump'n'Run

What's up!? It has benn a while since my last post, but I'm still here, and I'm still programming!
I really had no time to work on Kill da Ducks as I was working on a University project with a friend. We put a lot of effort on it and did new things we never did before like physics (realistic one) behaviour.
We used the verlet integration to solve vertex movement and using rigid and elastic (more like springs) constraints we were able to create polygons. The using the SAT theorem we detected collisions and finally using some more complex formulas I don't know we implemented the collisions behaviours. Then we implemented a grid to minimize collisions detections and optimize the whole thing. Benchmarks were really nice. Alowing us to create very big worlds with more than 200 dynamic boxes and running at 60+ fps
We then created a Level Editor that allowed us to place vertex, polygons and constraints and then save them and load them too. We needed that in order to create levels for our game. We then started with the player and the GUI for the editor.



We wanted to implement a realistic behaviour on our player but we realized that it was way more difficult that I thought and that we were not in time to do such a thing so we kept things simple and created a Box for the player. Changing the mass and teh size of the base we created some kind of stable player. We tried lot of things before that, there were all more difficult, using constraint to make the player stand-up but then the physics behaviour was incorrect. In fact we wanted to still have the world have an impact on the player, in order to make gameplay more difficult than just being a physics actor that cannot be pushed by other bodies.



In order to have an animated player we introduced a simple Animation based on angles or position to determine the different body parts positions (Neck, arms etc)

After lots of test and hours of work, we came up with something playable. And I must say the result was really nice, not only graphically but also because the game offered a gameplay that could be way simple or ultra hard. All of this depends on the level, and this allow people to create easy levels or really hard levels only playables by people who have mastered the player controls.



The Final result is that:

This level is hard for example. It may look simple but it's not.

Finnally I will say that you can go and take a look at the code and even compile it by yourself. All the dependecies are explicitily mentioned on the page and a Makefile is provided to have an easy compilation.

http://code.google.com/p/jump-n-run/