Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Re:creation - a top down action adventure about undeads [hiatus]  (Read 492302 times)

0 Members and 2 Guests are viewing this topic.

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re:creation - a top down action rpg about undeads
« Reply #105 on: June 10, 2015, 11:28:52 am »
You're tricky! =)

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action rpg about undeads
« Reply #106 on: June 11, 2015, 07:04:06 pm »
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

Jabberwocky

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re:creation - a top down action rpg about undeads
« Reply #107 on: June 12, 2015, 04:03:38 am »
Definitely a nifty game mechanic you've got going on, Elias.  Thanks for the updates.

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action rpg about undeads
« Reply #108 on: June 12, 2015, 10:29:02 am »
Definitely a nifty game mechanic you've got going on, Elias.  Thanks for the updates.
Thanks! And thank you for reading them and giving feedback. :)
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action rpg about undeads
« Reply #109 on: July 08, 2015, 07:35:36 pm »
Progress update
I've had lots of exams and successfully passed all of them. This means that I have two months which I can devote to my game. Lots of updates incoming!
 
I've spend some days paying off my "programmer's debt". Lots of bugs were fixed and lots of stuff was optimized. There isn't much to talk about there.
I'll talk about cooler stuff instead.

Forest

I've spent lots of time redrawing forest tileset. Lost of grass, flowers and cliff tiles... Compare it to the old screenshot:


Quite a difference, don't you think?

Tile patterns in level editor


This is very handy for level editing. For example, forest tileset has two grass tiles. They alternate between each other in checkboard pattern. Making it all by hand is just too slow, so I made tile patterns scriptable!

Here's how grass pattern script looks:
{
        tileId = 10, -- if this tile selected, pattern below is pasted
        pattern = {
            { 10, 37},
            { 37, 10}
        }
},

10 is first grass tile ID. 37 is another grass tile ID.
When some area is selected, I can press "P" to fill it with current tile's pattern. Each tile can have a corresponding pattern. Patterns can be of any size and it's useful for any stuff that has similar structure.

Input

I've spent some time making input more abstract. I can now save and load input bindings.
I already had a simple input manager which helped me check when some button is pressed, held or released.
Now it's even more abstract. Instead of checking for specific key in C++ code, I check for button tag.
Here's how I check for input now:
if(inputManager->isKeyHeld(ButtonTag::PrimaryAction)) {
...
}
 
Each ButtonTag has a corresponding sf::Keyboard::Key. 

I've also added gamepad support which was a bit harder to make abstract because Dpad and Sticks are not buttons, they have axes. What made it even worse is that coordinate systems for D-pad and left stick differ (so, when up is pressed on the D-pad PovY axis is 100. But when up is pushed on the left stick Y axis is -100!). This was easily fixed and gamepad works fine now.

Future plans
And that's just the beginning. I have lots of plans and ideas and I'm currently remaking some old levels to make them better and more interesting.
I'll have lots of cool stuff to show off soon (new NPC's, new art, some puzzles and all that stuff), so stay tuned!
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

Brax

  • Newbie
  • *
  • Posts: 39
  • Wannabe C++ Game Developer
    • View Profile
Re:creation - a top down action rpg about undeads
« Reply #110 on: July 08, 2015, 08:25:50 pm »
This is awesome!!!  :o
Great work!

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re:creation - a top down action rpg about undeads
« Reply #111 on: July 08, 2015, 08:53:23 pm »
Quote
Quite a difference, don't you think?
What was changed? =) Ah, flowers, yes, much better.

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action rpg about undeads
« Reply #112 on: July 08, 2015, 09:08:52 pm »
This is awesome!!!  :o
Great work!
Thanks!

Quote
Quite a difference, don't you think?
What was changed? =) Ah, flowers, yes, much better.
Ha-ha, thanks. Flowers, grass (spent lots of time redrawing it, totally worth it because it's more natural and less blocky now) and I've added some cliffs :)
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action rpg about undeads
« Reply #113 on: July 16, 2015, 01:10:33 pm »
Okay, this is going to get very technical. :D

I've been working for several days on a new Event Manager. Event manager is very important because it helps me decouple stuff and optimize perfomance a lot.
Previously I had a simple subject/observer system which let observers to subscribe to subjects and provide a callback function which was called if the subject sent an event. But it had some issues: messages could only be sent immediately and for some object to become observer/subject its class should inherit IObserver/ISubject classes. This caused lots of recompilation each time I realized that some object needed to become an observer or a subject and adding new events when they were already sent caused some troubles too.

So I've decided to completely remake event system and add some cool features.
I've made an event queue and got rid of IObserver/ISubject classes.
Each time something needs to send an event, it adds it to the global event queue.
If some entity subscribes to an event of this type, its callback is called during Event Manager sendMessages() function

Here's how objects can subscribe to events:
SomeClass obj;
engine_system.eventM->addListener<SomeEvent>(&obj, &SomeClass::onSomeEvent);

And here's how they can send them:
auto event = std::make_shared<SomeEvent>();
event->someParam = someValue;
engine_system.eventM->queueEvent(event);

I can later get event's parameters by casting them in a callback which is called during EventManager's sendMessages() function:
void SomeObj::onSomeEvent(const std::shared_ptr<Event>& e) {
    auto event = std::dynamic_pointer_cast<SomeEvent>(e); // this is totally a SomeEvent, because this function is called
                                                          // only when e has this type
    std::cout << event->someParam;
}

Callbacks are implemented using std::function and std::bind and here's how they should look:
void Class::CallbackFunc(const std::shared_ptr<Event>& e)

Objects can also subscribe to certain entities to receive events only from them. (Objects receive messages from everyone by default)

For example, GUIPlayingState only needs to know when player's hp changes, so it adds a playerEntity as a subject:
engine_system.eventM->addListener<HpChangedEvent>(&gui, &GUIPlayerState::onPlayerHpChanged);
engine_system.eventM->addSubjectToListener<HpChangedEvent>(&gui, playerEntity);
 

But it doesn't stop here!
I've implemented Lua/C++ event manager too!

Previously, if I needed to observe another entity's state, I called update() entity function in every frame. For example, if a bridge is lowered when a button is pressed, this function was called:

bridge.update = function(bridgeEntity)
    local button = getEntityByTag("BRIDGE_BUTTON")
    if(getScriptState(button) == "ButtonPressedState") then
        setScriptState(bridgeEntity, "BridgeLoweredState")
    end
end

This is obviously not a great solution, because calling this function 60 times per second may be expensive.  It also sucks that I need to check button's state every frame and this may be very expensive too. Especially if lots of entities have their own update functions.

Event manager fixes that problem by calling a callback function only when the button's state changes.

Entities can add callbacks in Lua this way:
addLuaListener(entity, "SomeEvent", func) -- func is some Lua function

They can also subscribe to entities:
subscribeToSubject(entity, "SomeEvent", subjectEntity)

Each time an event is queued in C++ or Lua, both C++ and Lua callbacks are called. And this it very cool, because it makes communication between Lua and C++ even simpler than before.

 Lua callbacks get an event table which can be used to get parameters:
f = function(event)
    print(event.someParam)
end

So, here's how the bridge can subscribe to the button:
addLuaListener(bridge, "ScriptStateChangedEvent", bridge.onBridgeButtonPressed)
subscribeToSubject(bridge, "ScriptStateChangedEvent", button)
   
And here's how a callback looks like:
onBridgeButtonPressed = function(this, event) -- this function is called every time button entity changes its state
    if (event.currentStateName == "ButtonPressedState") then
        setScriptState(bridge, "BridgeLoweredState")
    end
end

In C++ ScriptStateComponent emits ScriptStateChangedEvent everytime a state is changed. Then a callback Lua function gets called. This works!

The implementation is pretty difficult and required lots of template magic, error checking and optimization, so it would take me far too long to write about everything. Ask me any questions and I'll try to answer them. Maybe you have your own cool Event Manager: tell me about it!
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action rpg about undeads
« Reply #114 on: July 17, 2015, 11:57:57 pm »
New title screen. You select menu item with a ghost, just like you select corpses in the game! :D


Also, meet the Master of Recreation

Dialogue portrait:

In game sprite:


This man will teach you some neat combat lessons and he'll show you main principles of recreation technique.

I'm currently working on the tutorial part of the game. I'm trying to make it fun and sometimes unexpected.
I also came up with different situations which will show main concepts of recreation in practice, instead of just displaying them on screen. More of that later!
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action rpg about undeads
« Reply #115 on: July 23, 2015, 10:48:47 pm »
Re:creation TIGSource dev log thread is LIVE!  ;D
http://forums.tigsource.com/index.php?topic=49336.0
This doesn't mean much for people who read this thread, as I would post in both SFML and TIGSource threads. But this may probably give more attention to my game. I would like to hear your reactions in TIGSource thread too.

Btw, I've drawn new death animations and cliff tiles. Here's how the bridge puzzle looks now:

I think it's looks less confusing than it did before. (also a bit prettier, I think)

I also have some other cool things to show off and I will do it tomorrow, so stay tuned!
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re:creation - a top down action rpg about undeads
« Reply #116 on: July 24, 2015, 09:02:59 am »
Personally I liked the gravestones, it gave the game some kind of charm in the world of dead bodies. ;)

Cliff tiles look neat.

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action rpg about undeads
« Reply #117 on: July 24, 2015, 11:25:22 am »
Personally I liked the gravestones, it gave the game some kind of charm in the world of dead bodies. ;)

Cliff tiles look neat.

I liked them too, but those gravestones make gameplay a little bit confusing, because you don't see who're going to become. And thanks :)
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action rpg about undeads
« Reply #118 on: July 24, 2015, 01:38:59 pm »

Gravestones are back. Now the player can see who's lying in the grave by looking at the weapons near graves!
« Last Edit: July 24, 2015, 02:57:00 pm by Elias Daler »
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

dabbertorres

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • website/blog
Re:creation - a top down action rpg about undeads
« Reply #119 on: July 24, 2015, 06:11:52 pm »
Talk about a developer listening to feedback!  ;D

Ok, I actually have a question, though it's more art than programming. Maybe it'd be better for twitter. Oh well.

How do you draw the game's perspective? With the game's sprites, I mean.
You have the "half top-down, half at-an-angle" perspective down really well I think.

Is it all in the art, or are you doing something on the programming side as well?

I've tried drawing sprites in that perspective as well, and I just can't seem to be satisfied with the results. I've never claimed to be an artist though. :)

So, I guess, main question is: Do you have any tips for drawing sprites in the perspective you have in Re:creation?
« Last Edit: July 24, 2015, 06:18:37 pm by dabbertorres »