Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411423 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 19, 2024, 02:03:13 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsRe:creation - action adventure game about undeads
Pages: [1] 2 3 ... 9
Print
Author Topic: Re:creation - action adventure game about undeads  (Read 27417 times)
eliasdaler
Guest
« on: July 23, 2015, 12:36:38 PM »


Site: https://eliasdaler.github.io/re-creation
Developers: Elias Daler (programming, art, game and level design, story, etc.), Torchkas (music and sound effects)
Dev logs (old): https://eliasdaler.wordpress.com/tag/devlog/
Dev logs (new): https://eliasdaler.github.io/tags/#Dev+log
Progress screenshot album: http://imgur.com/a/luoFe
Twitter: @eliasdaler
Platforms: PC, Mac, Linux
Release date: When it's done



The coolest screenshot yet (January 2016):



Hello, my name is Elias Daler and this will be a dev log of my game!
I'm a solo hobby developer and work on the game in my free time so the progress won't be very fast I hope I'll post some interesting stuff from time to time! You can read previous dev logs here.

The development of this game started in October 2013.
I'm writing the game in C++ and use SFML. I also use Lua for scripting. I'll try to explain how my game works in next posts. I'll write about how I use scripting, how my entity/component/system works and lots of more programming stuff!

Story
The main hero is an undead knight who was betrayed by his partner, Necromancer, during a fight with a giant demon. When the hero raises from the dead, he realizes that lots of time has passed since his death. The Great War between humans and undeads is being fought for several centuries. Necromancer is still alive. He actually became a Lich. He has lots of power and uses undeads as a cheap working force. The hero explores society of undeads and finds out that they don’t actually want to kill humans. They just don’t want people to use them for training and steal their treasure! The hero decides to stop the war and prove that undeads are not that evil as it seems.


Undead City becomes hero's new home.

Gameplay
The gameplay is very similar to top-down 2D Zelda games with the exception of the main mechanic of the game, called recreation.
At any point of the game, you can become a ghost and travel through objects easily.
You can also control enemies you killed with it to get their abilities and solve various puzzles. Here's how it works:



You can't carry any weapons other than a hammer in the game, so you need to control enemies with bows to be able to use arrows, enemies with shields, to be able to block attacks etc. If you're killed when you're controlling someone else, your ghost will automatically return to your body and the person which you were in will respawn shortly after (because you can't solve some puzzles without other bodies).

Here's are some puzzles which you can solve with recreation mechanic:





Other gifs / screenshots:


NPC's are interesting...


Hero reacting to items he gets from chests


Boss fight

Tools and engine

I use C++11, SFML and Lua. I also have in-game level editor and other cool stuff which helps in development which I'll show off later (I plan to write about it in a few days).  
You can also read old dev logs here and here! You can find some details about implementation there. And feel free to ask some questions about tech stuff, I'll be glad to answer them.
« Last Edit: May 20, 2017, 07:09:20 AM by eliasdaler » Logged
eliasdaler
Guest
« Reply #1 on: July 24, 2015, 05:01:20 AM »


I've made new death animation.
You can see who's lying in the grave by looking at the weapon which lies near it.
Logged
eliasdaler
Guest
« Reply #2 on: July 24, 2015, 12:30:49 PM »

Here's a tileset I've been working on for the past week! (Do you recognize the painting? Wink)

This is a house of Master of Recreation. He's the guy who will teach you the main principles of recreation and some combat stuff.
This tileset is quite reusable and I'll use it in other houses as most games do.

You can also go into buildings now.

This was quite interesting to make, because it involved attaching AIComponent to the player.
First, door's state is changed to "DoorOpenedState". Then I disable player's CollisionComponent (so he can go through houses's collision box). This is much more easier than making multiple collision boxes for houses.
Then a target inside the house is set and AI turns on, so the character walks in without player doing so. Then a transition effect happens and another target for AI is set and the character goes there. After he arrives at destination, AI turns off and  player can control the character again. CollisionComponent is enabled. Pretty easy and works perfectly well.
Logged
JobLeonard
Level 10
*****



View Profile
« Reply #3 on: July 24, 2015, 01:11:22 PM »

Hey, finally a TIGsource threat? Subbed Smiley
Logged
del
Level 1
*



View Profile WWW
« Reply #4 on: July 24, 2015, 01:14:58 PM »

Very cool! Neat concept and I like that your having fun with it! Can't wait to see what you do with the duck!
Logged

Four Realms. Action RPG. Platformer. Animals.
thephantom
Level 0
*



View Profile WWW
« Reply #5 on: July 24, 2015, 02:08:09 PM »

I have been following your game for a few months now on reddit, but its great to finally find you here (also just found you on twitter, I am new to twitter myself).

Is that painting that Japanese painting of an ocean wave, by any chance?

How do you do your GIF screen captures?  Mine always turn out so grainy!

Keep up the work, really like your game concept and art style!
Logged

RpgLegend - retro 2D multiplayer RPG:
eliasdaler
Guest
« Reply #6 on: July 25, 2015, 12:08:45 AM »

@JobLeonard Welcome!
@del Thanks a lot!

I have been following your game for a few months now on reddit, but its great to finally find you here (also just found you on twitter, I am new to twitter myself).

Glad to hear that. :D

Is that painting that Japanese painting of an ocean wave, by any chance?
Yep, that's "The Great Wave off Kanagawa" Smiley


How do you do your GIF screen captures?  Mine always turn out so grainy!
LICEcap. It's a very good program.

Keep up the work, really like your game concept and art style!
Thanks!
Logged
eliasdaler
Guest
« Reply #7 on: July 25, 2015, 07:44:37 AM »

Here's a side attack animation I've made. It makes hits very satisfying!
Logged
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #8 on: July 25, 2015, 07:59:33 PM »

Love the concept and the graphics are neat Smiley
Logged

eliasdaler
Guest
« Reply #9 on: July 27, 2015, 09:37:37 AM »

Love the concept and the graphics are neat Smiley
Thanks a lot!

Progress update
Can't show anything at all, unfortunately. Fixing some bugs, paying of programmers debt, etc.
My main goal now is finishing first few levels, so they could be played from the beggining to the end. The graphics won't be finished, but the progress will feel good.

And I'm going to start posting notes about my development process soon. I'll show how I create entities with Lua tomorrow.
Logged
eliasdaler
Guest
« Reply #10 on: July 28, 2015, 02:53:00 AM »

Entity creation

My game's engine is build around entity/component/system (ECS) model. Because there are lots of different ways to implement ECS, I'll explain my approach. (I'll explain some implementation details in the article for my blog I'm currently writing)

Entity is every object you see (and don't see, e.g. collision boxes, triggers, etc.) in the game: rocks, tress, NPC's, etc. Each entity has a number of components which are stored in std::vector<Component*>.

Component is a data about particular aspect of entity. There are number of different components: GraphicsComponent (contains info about sprite, texture, animations, etc.), CollisionComponent (information about bounding box, collision response function, etc.), HealthComponent, etc.

Systems are where logic lives. They have a list of components of currently active entities which they iterate through. They don't care which type of entity the component belongs to. For example, RenderingSystem iterates through GraphicsComponent's and renders them in particular order. CollisionSystem checks collisions between entities usign their CollisionComponent's , etc.

What's cool about ECS is that there is no complex inheritance tree and this solves lots of problems (blob-classes, deadly diamond problem, etc.). In fact, there are no classes which inherit from Entity class.

Entities are created by attaching components with different parameters. Here's a simple example of how it looks in C++ code:

Code: (cpp)
Entity e;
auto gc = new GraphicsComponent;
gc->setSprite(entitySprite);
...
e.addComponent(gc);
...

Here's how I can get components by the class name:

Code: (cpp)
auto gc = e->get<GraphicsComponent>(); // gc is nullptr if entity doesn't have GraphicsComponent

Okay, pretty cool. But how do you create specific entities, like an NPC or a house? A Factory pattern may be used, but eventually you'll have lots of different types of entities and customizing entity definitions would cause recompilation which is not very good.

This is where Lua helps me a lot.

Here's an example of a simple Lua script:



Note, that this script doesn't create entity. It's simply used to obtain data to set different components parameters and then create Entity in C++.

I get all table's keys and now I have a list of components I need to create. Then I pass luabridge::LuaRef's to each component constructors (LuaRef is a reference to a table in LuaBridge, C++/Lua binding I use). Components get parameters from these tables and then they're attached to what I call "template entity". Template entities are created with scripts and other objects of this type are created using this C++ object (by calling copy-constructor and copying each component). This means that only one entity is created using information from the script. Instances of entity type are created much quicker by copying.

I could have easily used JSON or XML for this, so what's the point of using Lua? Lua is used for adding different functions to entities and this makes scripting very enjoyable and lets me put lots of code in Lua instead of C++. This is very awesome, because it lets me easily change entity behaviour with no recompilation. I can even change entity properties and functions when the game is still running! Isn't this great?

Here's an example when Lua functions are used to provide different entity behaviour.
For example, different entities may react differently to collisions.
Suppose I want to create a cute ghost which blushes when it collides with some entity (it also damages it. This is absurd, but hey, it's just an example!). Here's how it would look in the script:


Here's how it works: when CollisionSystem finds a collision between two entities, it calls collide function which is stored in entity's CollisionComponent. It also passes two arguments to the function: this - pointer to the entity of the type which this function belongs to, second - pointer to the entity which collided with this (this is a name of a variable I use, not a Lua keyword!)

setAnimation is one of the C++ functions which I bind to Lua. Here's how it looks in C++:

Code: (cpp)
void setAnimation(Entity* e, const std::string& animationName) {
    auto gc = e->get<GraphicsComponent>();
    if(gc) {
        gc->setAnimation(animationName);
    } else {
        ... // write error in debug console
    }
}

This is an example of why I chose not to expose components to scripts: it makes error checking easier. (No need to make it in Lua, just check everything in C++). Another reason is that some functions can be more complex but still remain simple in scripts (even non-coders can easily use them). For example, if entity needs to say something, I can just write this in script:

Code: (lua)
say("TALK_TAG")

But in C++ it will do a lot more: check if NPC component exists, get text by tag from it, set dialogue state for GUI, set text for that state, etc.
Once the entity template is loaded, I can easily create it with in-game level editor (I'll write about it some day)


And that's just a small simple example. Complex entities have state machines and callback functions which are easily scriptable too (more about that later).
This lets me easily create new types of entities without touching C++ code. No hardcoding required. This also makes my game very moddable.

What about the perfomance? So far I've noticed no problems at all. Even when Lua functions are called 60 times per second for
different entities, it's pretty fast and makes no noticeable difference.
Logged
eliasdaler
Guest
« Reply #11 on: August 01, 2015, 12:30:59 PM »

Nothing special to show off: I'm mostly refactoring my code and making some code a lot better :D
But I've made ladders today:

The perpective is quite off, so I'll be working on that!
Logged
eliasdaler
Guest
« Reply #12 on: August 04, 2015, 03:10:43 AM »

Worked on the tileset today. I think it's a big improvement.

Still unsure about the perspective.
Here's another way to do it:

(Notice the bottom part. I don't like that one because it's not that obvious that there are different heights there)
Logged
jctwood
Level 10
*****



View Profile WWW
« Reply #13 on: August 04, 2015, 03:18:41 AM »

Hmm I find the ladder perspective clashes with the perspective of the wall. Although as you say it would be hard to differentiate the heights otherwise. Your art is very nice though and I love all the little details.
Logged

eliasdaler
Guest
« Reply #14 on: August 04, 2015, 09:02:36 PM »

@JctWood Yeah, I'm experimenting with different perpsectives now and the ladder is also used indoors, which have that weird Zelda perspective and they look good there.

And thanks! :D
Logged
jctwood
Level 10
*****



View Profile WWW
« Reply #15 on: August 05, 2015, 04:39:09 AM »

No problem! Look forward to more.
Logged

eliasdaler
Guest
« Reply #16 on: August 08, 2015, 02:02:21 PM »

Didn't have much time to work on the game in the last few days, but I still managed to do something cool.
Levels now support multiple tilesets. I can easily switch between them in the level editor.

Previously, I only had one tileset per level, because I've thought that having city tileset / forest tileset / dungeon tileset etc. for each level would be okay. But then I've realized that it would be cool to mix tilesets instead of copy/pasting some tiles between tilesets
Another issue I'm thinking about is how to assign unique ids to tiles. I've previously used integer ids which were assigned like this:

This is pretty straightforward approach and it lets me easily get texture coordinates of the tile by its id.
But it leads to some problems:
1) Changing the width of a tileset breaks ids, because they correspond to other tiles.
2) If I change the ordering of tiles, I need to replace their ids with new ones in the level.
So, I need a better approach. I think that generating some tileset file like this:
Code: (none)
x=0,y=0,id=G
x=16,y=0,id=G2
...
Then I can freely change width of tileset and swap tiles by changing their ids in a tileset file.

What do you think of that? Maybe there are some cooler methods to store tilesets and levels? Smiley
Logged
Mr. Levich
Level 0
**



View Profile
« Reply #17 on: August 08, 2015, 11:12:31 PM »

Don't really have any experience with programming tilesets, but I would just have a list (or any other appropriate data structure) of Tile class, which would contain all the information - tile's width and height, sprite position/path to image, position in grid, etc., - and then just display it in a grid. This approach would take some additional programming, but save time later on, as it allows for easier organization and extension, than an int-array Smiley
Logged

eliasdaler
Guest
« Reply #18 on: August 09, 2015, 12:20:20 AM »

Don't really have any experience with programming tilesets, but I would just have a list (or any other appropriate data structure) of Tile class, which would contain all the information - tile's width and height, sprite position/path to image, position in grid, etc., - and then just display it in a grid. This approach would take some additional programming, but save time later on, as it allows for easier organization and extension, than an int-array Smiley
I already have Tile class and now I'm thinking about the better way to store/load tile information. The file has to be easily modifiable and the approach I've described is the best one that I can come up with now. Maybe someone have even better solutions. Smiley
Logged
eliasdaler
Guest
« Reply #19 on: August 19, 2015, 01:03:51 AM »

I'm mostly refactoring and polishing stuff. So, nothing new to post, sadly.

And I've posted an article which explains some of the scripting stuff used in the game.
https://eliasdaler.wordpress.com/2015/08/10/using-lua-and-cpp-in-practice/
I'll post some implementation details in the second part!
Logged
Pages: [1] 2 3 ... 9
Print
Jump to:  

Theme orange-lt created by panic