Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411476 Posts in 69369 Topics- by 58424 Members - Latest Member: FlyingFreeStudios

April 23, 2024, 05:30:08 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsRe:creation - action adventure game about undeads
Pages: 1 ... 6 7 [8] 9
Print
Author Topic: Re:creation - action adventure game about undeads  (Read 27440 times)
JobLeonard
Level 10
*****



View Profile
« Reply #140 on: October 15, 2016, 10:49:40 AM »

If you make a few different cycles with different periods - preferably two prime numbers, like 11 and 13 frames - it'll look even less predictable.
Logged
eliasdaler
Guest
« Reply #141 on: October 15, 2016, 10:16:19 PM »

11-13 frames is a bit too big for me! I usually make 4 frame animations for this idle stuff. :D
But yeah, maybe I should make it 5 at least, because now there's a sudden change in fire intensity which should be smoother. (And 5 is a prime number, he-he-he)
Logged
JobLeonard
Level 10
*****



View Profile
« Reply #142 on: October 16, 2016, 03:20:37 AM »

3, 5 and 7 then Wink

Basically, reduce points of sync-up by longer beats (which is why using prime numbers helps).
Logged
eliasdaler
Guest
« Reply #143 on: October 20, 2016, 01:55:43 AM »

Agreed, I'll try that. Smiley

Little details... Cat's talking animation stops when translation is shown.

And meowing now corresponds to translated text more, he-he.
Don't worry, I work on much bigger stuff too, I just don't have much time to write it down! (Everything will be written in a huge blog post soon)
Logged
eliasdaler
Guest
« Reply #144 on: October 30, 2016, 02:23:25 PM »

Working on a lot of engine stuff. Not just for "I'm gonna need this later", but just finishing very important stuff which is crucial for quick iteration and development.

One such feature is a console, which was previously written in SFML, but now is written with ImGui! It finally has history, native-like text field, scrolling, etc.
And I've made special "Lua" mode for it, which lets me just input Lua commands which are then called with lua_dostring. This allows me to do stuff like this!

And that's just one tool which will make my life better. There are other tools which I'll soon show, which will free me from printf debugging! (some things can't be debugged with printf/cout/breakpoints!)

Also, I only recently understood that it's time to move my object's origin to something reasonable.

Like this. Previously it was left up corner of a sprite. Yeah, silly, I know!
I wonder if there'll be some things which are obvious, but aren't talked about often. (just remembered that I created "damage" entity instead of just placing damage rect and disabling/enabling it when attack occurs).

One more thing I want to talk about: what is the best way to handle collision rect? In some games it's okay to have a static one, but in my case, it should change depending on entity's direction, and maybe even on animation! (Fighting games do this). And I wonder... what's the best way to separate animation and collision so that they won't depend too much on each other? Any ideas? :D
Logged
JobLeonard
Level 10
*****



View Profile
« Reply #145 on: October 31, 2016, 01:57:10 AM »

Oh sweet, in-engine iteration is fantastic; less mode switches, easier experimentation, tighter loop between doing and reflecting.

Also: heehee, that arrow makes it look like you're pointing to a blue, pixelated you-know-what between his legs Tongue
Logged
io3 creations
Level 10
*****



View Profile WWW
« Reply #146 on: October 31, 2016, 09:54:55 AM »

Also: heehee, that arrow makes it look like you're pointing to a blue, pixelated you-know-what between his legs Tongue
That's exactly what I was thinking!  A dirty mind is a beautiful thing. Grin


One more thing I want to talk about: what is the best way to handle collision rect? In some games it's okay to have a static one, but in my case, it should change depending on entity's direction, and maybe even on animation! (Fighting games do this). And I wonder... what's the best way to separate animation and collision so that they won't depend too much on each other? Any ideas? :D
By separating, do you mean having separate objects instead of everything in piece of code together?  Either way, in the end you still need a way to keep those in sync.  I found something similar along those lines. http://gamedev.stackexchange.com/questions/8622/keeping-game-model-and-graphics-animation-separate-but-in-sync  It may or may not be what you need but might give some ideas.
Logged

CesarD8
Level 0
***



View Profile
« Reply #147 on: October 31, 2016, 10:27:48 AM »

This is really, really cool. Are you doing it all by yourself?
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #148 on: October 31, 2016, 11:55:16 AM »

That's exactly what I was thinking!  A dirty mind is a beautiful thing. Grin

☞   ͜ʖ  ☞ "Hey everyone, look at the blue-balling zombie over here"
Logged
Pixel Noise
Level 10
*****



View Profile WWW
« Reply #149 on: October 31, 2016, 06:03:21 PM »

Just seeing this for the first time - skimmed through the previous pages, and I really like the "recreation" mechanic, and story you've got got going for the game. This is looking great, especially for a one person project!
Logged

Pixel Noise - professional composition/sound design studio.
 https://soundcloud.com/pixel-noise
 https://twitter.com/PixelNoiseMusic
 https://pixelnoisemusic.bandcamp.com/

Recently completed the ReallyGoodBattle OST!  https://www.youtube.com/watch?time_continue=2&v=vgf-4DjU5q
eliasdaler
Guest
« Reply #150 on: November 02, 2016, 02:39:34 PM »

Oh sweet, in-engine iteration is fantastic; less mode switches, easier experimentation, tighter loop between doing and reflecting.
Yeah, scripts already help me a lot with that. No compilation times, just changing the scripts and seeing the results after reboot of the game which takes something like 3 seconds, no matter how big changes are.
Right now I'll mostly use in-game console for debugging. It's easy to access almost everything which I want to check about entities. Smiley

Also: heehee, that arrow makes it look like you're pointing to a blue, pixelated you-know-what between his legs Tongue
Ahhh, dat negative space. You got me! :D

By separating, do you mean having separate objects instead of everything in piece of code together?  Either way, in the end you still need a way to keep those in sync.  I found something similar along those lines. http://gamedev.stackexchange.com/questions/8622/keeping-game-model-and-graphics-animation-separate-but-in-sync  It may or may not be what you need but might give some ideas.
Thanks! That's exactly what I'm looking for. I'll check it out and will later post my thoughts on this stuff.

This is really, really cool. Are you doing it all by yourself?
Thank you! Yeah, I'm doing everything myself, except the music and SFX (which are done by Torchkas).

Just seeing this for the first time - skimmed through the previous pages, and I really like the "recreation" mechanic, and story you've got got going for the game. This is looking great, especially for a one person project!
Thanks a lot! :D
Logged
eliasdaler
Guest
« Reply #151 on: November 28, 2016, 01:58:50 AM »

New Re:creation dev log. Talking about what I've done in the last five months. I hope you find it interesting to read!

Feel free to ask stuff about things mentioned here. And I'll probably start posting regurarly soon! Just didn't want to bore you with all the restructuring and refactoring. :D

P.S. One quick question for people who've done it before... How can I easily manage input contexts? (switch input callbacks during menus, interactions, etc.)
For example, if the player goes near some NPC, primary action button calls "interact" function, not "use primary item" button. Right now I manually handle such input changes, which means that I have to manually change input in menus or dialogues and later restore it to previous state... I'm afraid that it may lead to some nasty bugs!)
Logged
JobLeonard
Level 10
*****



View Profile
« Reply #152 on: November 29, 2016, 07:19:59 AM »

Fun to look back and see how big the change really is Smiley
Logged
eliasdaler
Guest
« Reply #153 on: December 05, 2016, 11:54:15 PM »

The work on the game continues! And the biggest change I've made since the dev log is GUI implementation.
Previously I did GUI manually. Storing various sprites and GUI's state in GameStates, etc. But this causes the following problems:
1) Some GUI code was very repetitive
2) GUI was hard coded, I've manually set positions to each sprite and text string
3) GUI callbacks were in C++ which I don't like, because with most of the logic, game state and wrappers being in Lua, it's much easier to do things on Lua side.
4) I've managed to remove almost all GameState's, but GUIs were pretty hard to do in Lua, so I couldn't move GUI states there. (main menu, inventory screen, game UI, dialogue GUI, etc.)

My first idea was not the easiest one: I wanted to expose some of SFML's interface to Lua to draw GUI stuff from Lua and handle all the logic there too. Looking back at it now, it just looks like a really bad idea which would have cost me tons of hours!

Thankfully, after I've started making C++ GUI classes, I've realized that there's no need for doing drawing or even basic GUI logic in Lua! So, let's look at the current stuff I've got going. Here's how the main menu looks now (it isn't a final look, of course!)


Here's a JSON which defines it:
[spoiler]
Code: (none)
{
"class" : "Frame",
"tag" : "MAIN_MENU_FRAME",
"children" : [
{
"class" : "Image",
"texture" : "gui/main_menu_bg"
},
{
"class" : "NinePatch",
"position" : [70, 148],
"size" : [108, 54],
"texture" : "gui/nine_patch",
"script" : "gui/main_menu",
"textureCoords" : {
"corner" : [0, 0, 5, 5],
"horizontal" : [5, 0, 1, 5],
"vertical" : [0, 5, 5, 1],
"contents" : [5, 5, 1, 1]
},
"children" : [
{
"tag" : "CONTINUE_BUTTON",
"class" : "TextButton",
"textTag" : "CONTINUE",
"font" : "press2p",
"position" : [ 26, 10 ]
},
{
"tag" : "NEW_GAME_BUTTON",
"class" : "TextButton",
"textTag" : "NEW_GAME",
"font" : "press2p",
"position" : [ 26, 24 ]
},
{
"tag" : "EXIT_BUTTON",
"class" : "TextButton",
"textTag" : "EXIT",
"font" : "press2p",
"position" : [ 26, 38 ]
},
{
"class" : "Cursor",
"texture" : "gui/ghost_cursor",
"moveSound" : "menu_cursor",
"movementType" : "UpDown"
}
]
},
{
"tag" : "CREDITS_TEXT",
"class" : "StaticText",
"textTag" : "CREDITS",
"font" : "munro",
"position" : [ 122, 228 ]
}
]
}
[/spoiler]

As you can see, GUI has a few basic classes: StaticText, TextButton, Image, NinePatch. I can create children to any element and what's nice is that all positions are kept relative to the parent element, so it's easy to organize stuff! Right now the positions are still kinda hard coded (no automatic placement and aligning), but it's totally fine.
I can also add callbacks to buttons like this:
Code: (lua)
return {
callbacks = {
{
tag = "CONTINUE_BUTTON",
onPress = function(self)
continueGame()
end
},
{
tag = "NEW_GAME_BUTTON",
onPress = function(self)
print("NEW GAME IS NOT IMPLEMENTED YET")
end
},
{
tag = "EXIT_BUTTON",
onPress = function(self)
exitGame()
end
}
}
}

There's nothing novel about the implementation, just base GuiElement class which inherits from sf::Drawable and sf::Transformable, has some children and virtual load, update and draw functions.
Cursor has pretty nice input: it's kinda like key repeat, when you hold "down", it scrolls down the first time with bigger delay, but then continues scrolling down with less delay between "ticks". I manually keep track of time for delays to make it available to gamepad input and also not to depend on system settings (you can easly change delay of key repeat).

GUI system is already powerful, I've managed to make a Dialogue GUI with it!

It looks and behaves the same way as the old GUI, but now it's much easier to control it, drawing it is just this:
Code: (cpp)
target.draw(gui);

I will also implement main game UI next and also inventory screen. They will be a bit trickier to make, but it'll be so worth it. I'll also do options menu which will require some additional GUI work, but this will be done a bit later.

So, handling GUI is much easier now, but the best thing about it is that now I can have just a bunch of GameStates: MenuState (all the GUI will be there: main menu, dialogue, inventory screen, game UI, etc. and I'll just switch between them), LoadingState, GameState (which just calls updates to entity systems and rendering system draw function), TransitionState (used to in-between areas transitions, very tricky, uses some shaders, so I don't want to do it in Lua) and that's it! Other game states (mini-games, ghost state, etc.) can be easily implemented in Lua now.

They don't contain any of the game logic, all of it is now in Lua and this makes me incredibly happy! Engine and game are almost separate now, which means that it'll be easy for me to reuse my engine for other projects in the future.


I've also started working on AI... and there's so many things I have to do here! Better state machines (or maybe even planning system), better path finding... Path finding aspect is pretty hard to do, because I'll have to implement some algorithm for automatically building a nav-mesh (or maybe I'll be fine with just using grid graphs?) I don't want to create graphs by hand, it'll take lots of time and in the end it doesn't give very good results.

Some games just use steering behaviours for AI (and I've previously used just them too!), but this is only fine as long as your enemies are some monsters or "possesed" people (older Zelda games only use steering algorithms). I want enemies in my game be a just bit smarter and not get stuck in any obstacles on their way.


Enemies in Link to the Past get stuck all the time. They don't get completely stuck, however, because steering algorithm slides them along the wall. But it's still not as good as proper path finding. (Or maybe I'm overthinking it...)

Hope implementation of all that stuff won't take long. But I'm a bit glad that I'll finally get the chance to write all this stuff.


But that's not all. I'm also planning to work on combat system and I'll try to make combos, targeting and dodging to feel good. I want combat to feel a bit like it does in Dark Souls or 3d Zeldas. Basically, you approach the enemy, target it and now can circle around it, dodging it's hits and hitting it with combos. Not sure how it would work in 4 directions (it would have been perfect in 8 directions, but I can't draw so many animations!), and so far I haven't seen any 2d action rpgs with complex combat, so it'll be pretty interesting to see what I can do.

The closest to what I want is Bastion (hey, the main character uses hammer too!), but it uses isometric perspective and has 8 directions. If anyone knows good 2d top-down games with good melee combat system, please tell me about it! Grin
Logged
JobLeonard
Level 10
*****



View Profile
« Reply #154 on: December 06, 2016, 12:53:32 AM »

And that's why it's good to sit down and work out the architecture properly before writing any lines of code, kids!

Love the Mother 3 reference, btw Smiley
Logged
eliasdaler
Guest
« Reply #155 on: December 08, 2016, 11:41:11 PM »

Yes! :D

I've started working on AI!

The red path is original path found using Dijkstra's algorithm (going to implement A* soon!), the green line is "smoothed" path which just removes unnecessary edges to give even more efficient and natural paths.
The grid graph is created with a bit of brute force... I create a grid and then remove all vertices/edges which collide with the level. This gives somewhat okay result, though it's not very fast and very likely to be improved in the future.

I'm really glad it was pretty fast and easy to implement, there isn't much want to improve there! One more thing I'll soon add is wall avoidance which will make the movement even better.

From there I plan to implement a bit better AI state machines (or maybe I'll use behavioural trees and some goal planning behaviour). Some games use very simple AI, because the enemies are just some random monsters which may stuck in walls and it'll look okay, but in Re:creation you're mostly fighting with people, so they have to be somewhat intelligent, but of course I'm not going to make something overly complex.
Logged
JobLeonard
Level 10
*****



View Profile
« Reply #156 on: December 09, 2016, 02:06:17 AM »

If your level isn't dynamically generated, you could try one of those energy-based pathfinding options. I'll look up examples of what I mean later, at work now
Logged
Jabberwocky
Level 0
**


View Profile WWW
« Reply #157 on: January 25, 2017, 07:17:53 PM »

From one of your recent dev blogs:

Quote from: Elias Daler
I’m very glad to say this, but I feel like the core engine is almost done.

Famous last words.  Wink

All kidding aside, it's been so much fun watching your progress updates, both here and on the SFML forums, Elias. 

The in-game console and associated lua functionality looks really slick.  I can see how massively useful it would be.  Those lua function calls you type into the console are wicked cool, and I imagine great for quick testing and prototyping (no recompile!)

But one of the reasons I've shied away from too much scripting in my own games is because you lose the power of the C/C++/C#/whatever debugger.  Have you encountered many issues with this?  Dealing with bugs arising in lua code which would have been easy to debug had it been in non-scripted code?  How do you deal with tracking down bugs in lua?  Are the lua debuggers any good?

Logged
eliasdaler
Guest
« Reply #158 on: January 26, 2017, 11:50:35 PM »

From one of your recent dev blogs:
Quote from: Elias Daler
I’m very glad to say this, but I feel like the core engine is almost done.
Famous last words.  Wink

All kidding aside, it's been so much fun watching your progress updates, both here and on the SFML forums, Elias. 
Ha-ha, yeah! Thank you. I'm sorry that I stopped making progress updates lately, I've been reworking so much stuff that I couldn't keep up with all the changes, so I then realized that it'll be better to just write a post about my engine architecture in a big post. But this will come out in a month or two, I'm starting to work on more game stuff lately, so I want to show people that I can actually make a game now, not that I refactored and improved my engine for nothing. Smiley
The progress about the engine is just incredible. I've dealt with almost all technical debt, 100% of game logic is now in Lua, everything is just smaller and works faster and more generically. Smiley

The in-game console and associated lua functionality looks really slick.  I can see how massively useful it would be.  Those lua function calls you type into the console are wicked cool, and I imagine great for quick testing and prototyping (no recompile!)
Thanks again. Yes, it's very helpful, especially for debugging! What's cool about Lua is that I can easily write __tostring meta-methods and then just write print(myObject) and see the results. For example, if I do print(someVector) in Lua, I get "{234, 56}" in console. Very handy!
As for prototyping and adding new content via console - I haven't done much of that yet, as it's easier for me to write stuff in a text editor and then just reload the game. It's quick and still much faster than recompiling.

But one of the reasons I've shied away from too much scripting in my own games is because you lose the power of the C/C++/C#/whatever debugger.  Have you encountered many issues with this?  Dealing with bugs arising in lua code which would have been easy to debug had it been in non-scripted code?  How do you deal with tracking down bugs in lua?  Are the lua debuggers any good?
Thankfully, I've never had much problems with debugging in Lua. The biggest problems are typos in variable names! They don't crash the game, they don't make errors: just stuff I need becomes "nil". These bugs are the hardest to catch: I start to think that I have bugs in my code and something just doesn't call a needed function or passes some wrong param, but nope: just a typo!

Lots of debugging I do is just looking if some function got called or not. In that case I just put a bunch of print statements here and there and it works ok. But ZenoBrane has Lua debugger which can work even with C++ application, so that helps a lot sometimes.

Potentially in Lua you can have bugs because of you passing stuff of wrong type (or tables with wrong keys) to functions, but thankfully I've never made these.
Logged
Torchkas
Level 10
*****


collects sawdust


View Profile WWW
« Reply #159 on: March 05, 2017, 04:16:14 AM »

hi elias
Logged

Pages: 1 ... 6 7 [8] 9
Print
Jump to:  

Theme orange-lt created by panic