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 440052 times)

0 Members and 3 Guests are viewing this topic.

SpeCter

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re:creation - a top down action adventure about undeads
« Reply #360 on: December 01, 2015, 08:18:20 pm »
Voted from work pc and home pc ;D

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action adventure about undeads
« Reply #361 on: December 01, 2015, 11:00:54 pm »
Thanks you very much, everyone! Your support means a lot to me. I'm very glad that you find the game and the dev process interesting. Sometimes I have doubts about my skills, but hearing such kind words makes me confident and motivated to work more and more. :)

Jesper Juhl, Linux demo is totally coming when Windows version will be out. Though, I haven't compiled on Linux since March... hope most of the code works and there'll be no need to fix a lot of stuff. :D

(Btw, I'm working on wall shadows, they're pretty tricky to make)
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re:creation - a top down action adventure about undeads
« Reply #362 on: December 02, 2015, 04:36:54 pm »
Jesper Juhl, Linux demo is totally coming when Windows version will be out. Though, I haven't compiled on Linux since March... hope most of the code works and there'll be no need to fix a lot of stuff. :D
Why don't you set up a CI system like Jenkins or BuildBot to build every commit on all of your target platforms and then run your tests?

That way you'll instantly know if you caused a target to fail to build or a test to fail and you'll also know which exact commit broke it.

And you can use both physical machines and virtual ones (or a mix) as your build slaves.
« Last Edit: December 02, 2015, 04:38:27 pm by Jesper Juhl »

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action adventure about undeads
« Reply #363 on: December 02, 2015, 06:31:56 pm »
Yeah, I really need to do it some day. Any good articles about setting it all up? :D
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re:creation - a top down action adventure about undeads
« Reply #364 on: December 02, 2015, 06:50:00 pm »
Not really. But I've set up both BuildBot and Jenkins a few times, both at home and at a couple of employers - just using the official docs. It's really not that hard.  Set aside a day and read up on it in the morning and set it up in the afternoon. By evening you'll have a working setup and it'll be a day well spent going forward :-)

And your second step (when you have another day to burn) should then be to get your CI system to generate installation packages every night for all your target platforms. So that every morning you'll have a fresh set of MSI's, RPM's, DEB's, etc etc, ready to deploy to your customers.
And if you don't already have the generation of such packages/installers automated; well, pull out one more day from the calender and do that. That's also a day well spent (IMHO) - you really don't want to constantly have to do that crap by hand - a computer can do it better (every night).
« Last Edit: December 02, 2015, 07:04:06 pm by Jesper Juhl »

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action adventure about undeads
« Reply #365 on: December 03, 2015, 08:40:16 am »
Thanks for advice. I'll try something out very soon. :D

By the way, can someone give me advice about how to make this stuff better?
So, I load components from scripts like this:
void AIComponent::loadFromScript(const std::string& entityName, const LuaRefWrapper& componentTable,
    bool overwrite)
{
    scriptManager.getData(viewSize, "viewSize", componentTable, overwrite);
    scriptManager.getData(type, "type", componentTable, overwrite);
    ...
}
So, the first argument is the variable in which the value from the script is written. The second argument is the name of the value in the script, the third argument is the component table in the script and the fourth argument is the script manager mode (doesn't really matter that much, it's just a bool).

So, for example I have something like this in the script:
enemy = {
    AIComponent = {
        type = "chaser",
        ...
    }
}
So, the componentTable is enemy.AIComponent

As you can see, always passing the third and the fourth argument is getting pretty annoying. Is the some good way to make this code better? Something like this:
void AIComponent::loadFromScript(const std::string& entityName, const LuaRefWrapper& componentTable,
    bool overwrite)
{
    ... // temporally set componentTable and overwrite mode in ScriptManager
    scriptManager.getData(viewSize, "viewSize");
    scriptManager.getData(type, "type");
    ... // automatically unset this, so the next time I use scriptManager, it works as usual
}
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re:creation - a top down action adventure about undeads
« Reply #366 on: December 03, 2015, 10:04:43 am »
Why not just make a simple wrapper?

void AIComponent::loadFromScript(const std::string& entityName, const LuaRefWrapper& componentTable,
    bool overwrite)
{
    ScriptDataLoader loader(scriptManager, componentTable, overwrite);
    loader.get(viewSize, "viewSize");
    loader.get(type, "type");
}
Laurent Gomila - SFML developer

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action adventure about undeads
« Reply #367 on: December 03, 2015, 01:50:11 pm »
Why not just make a simple wrapper?

void AIComponent::loadFromScript(const std::string& entityName, const LuaRefWrapper& componentTable,
    bool overwrite)
{
    ScriptDataLoader loader(scriptManager, componentTable, overwrite);
    loader.get(viewSize, "viewSize");
    loader.get(type, "type");
}
Yeah, that's a good idea, thanks! Would make the code so much cleaner and easier to write. :D
(Btw, I was wondering, what is the name of this pattern? It kinda looks familiar)
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re:creation - a top down action adventure about undeads
« Reply #368 on: December 03, 2015, 02:41:33 pm »
I don't know if it's a known pattern ; maybe an adapter? Anyway, to me it's just "putting redundant stuff into a common place" ;)
Laurent Gomila - SFML developer

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action adventure about undeads
« Reply #369 on: December 03, 2015, 02:53:49 pm »
I don't know if it's a known pattern ; maybe an adapter? Anyway, to me it's just "putting redundant stuff into a common place" ;)
Yeah, looks like it. I did it, btw. Looks so much better!



I kinda want to write a macro like this:
#define GET_SCRIPT_DATA(loader, x) loader.get(x, #x)
so I could do this:
GET_SCRIPT_DATA(loader, chargeAnimationName);
// expands to loader.get(chargeAnimationName, "chargeAnimationName");
But that may be too extreme and silly. :D
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 adventure about undeads
« Reply #370 on: December 05, 2015, 10:14:21 pm »

QtCreator + CMake + GCC 5.2.1 + Xubuntu VM. Works pretty well, as you can see. Still have to fix some stuff, but I didn't have to change much to compile/run my game on Linux which is a very good sign! :D
The biggest fails were because of differences in newline characters. "\n" vs "\r\n". Any good way to deal with them? Remove them after each getline? Any other ways? :D
« Last Edit: December 05, 2015, 11:20:45 pm by Elias Daler »
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

dabbertorres

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • website/blog
Re:creation - a top down action adventure about undeads
« Reply #371 on: December 05, 2015, 11:54:14 pm »
I just always use '\n'. Everything I've used except Notepad (which no one in their right mind uses for programming) parses it just fine.

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action adventure about undeads
« Reply #372 on: December 06, 2015, 08:06:27 am »
I just always use '\n'. Everything I've used except Notepad (which no one in their right mind uses for programming) parses it just fine.
So, should I change line endings to Linux-style in every editor I use? :D
Btw, strangely enough:
getline(file, line); // this line is "SCRIPTS_BEGIN" in file
if(line == "SCRIPTS_BEGIN") { // true on Windows, false on Linux!
    ...
}
So I need to remove \r\n or just \n to get the expected results. This is because I read files with windows endings on Linux. Is there a better solution to the problem?

Question to those, who use CMake with large projects: do you use glob or do you specify source files by hand? I have 135 .cpp files and lots of sub-directories, so I'm afraid that specifying them by hand would take a long, but is it worth it?
« Last Edit: December 06, 2015, 08:20:35 am by Elias Daler »
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re:creation - a top down action adventure about undeads
« Reply #373 on: December 06, 2015, 01:36:46 pm »
If you don't open files with the std::ios::binary flag, newlines should be treated correctly by the stream, independantly of the platform.

I never use glob with CMake. Since I never add 150 files at once to the project, this is not really a problem ;)
Laurent Gomila - SFML developer

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action adventure about undeads
« Reply #374 on: December 06, 2015, 02:34:15 pm »
If you don't open files with the std::ios::binary flag, newlines should be treated correctly by the stream, independantly of the platform.
The problem is that I open files (which were created in Windows) in Linux, so getline produces different results on Windows and Linux. I'd probably write a function which will just remove line endings from strings. :D

I never use glob with CMake. Since I never add 150 files at once to the project, this is not really a problem ;)
Maybe I should devote some hours to it and just do it. :D
Btw, what is the correct way to manage subfolders? I know that I must add CMakeLists to each subfolder, but what should those files contain? I see that SFML sets SRC variable, but does it actually append to SRC? Can I use this method to do this in the main CMakeLists?
add_executable(game ${SRC})
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

 

anything