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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ghzmdr

Pages: [1]
1
SFML projects / Re: Enter the Unknown - Devlog
« on: April 12, 2015, 01:28:15 pm »
You defined a getComponent Method which returns void(at least in your blogpost) it should return a Component(*).
Yes that's a typo
Is there any reason for not letting the component know its parent entity? Is it possible for a component to change parents?
The parent entity is passed as reference in the update()
What exactly is ComponentID? Is it the same for each ComponentType?
If not why not define it as a const member?
I still have to tinker with it..
Basically I'm thinking about a way for letting a component know about another's internal state.
So for example, animation could know about texture size or the like, this is done by using the parent's getComponent(string id) and access the required fields. There should be a better way of doing this tho  ::)

Oh and maybe you shouldn't immediately react to collisions.As of now, if for example 2 balls collide only the first one to update will even react properly to the collision(because the collision will most probably be resolved by the time the second one will be updated).

What will happen:
1. o--><--o
2. o-><-o
3. oXo        (X = Collision!)
3.1 <-o Xo (First ball decides to bounce of)
3.2 <-o <-o   (Collision resolved, second ball follows its original path)

Thank you very much for this one! Solves a nasty issue with collisions  :)

Could someone reccomend some resources on Component System design?

I'm not updating the blog in these days because some things are keeping me away from the project, instead of updating weekly I'll update once there are some concrete changes.

2
SFML projects / Re: Enter the Unknown - Devlog
« on: March 29, 2015, 10:14:34 am »
Week 2 update here

3
SFML projects / Re: Enter the Unknown - Devlog
« on: March 25, 2015, 09:07:51 pm »
Thank you for the kind words. Indeed I'm facing some of issues with design but you're right, without actually implementhing things you can't do mistakes, thus learn. The codebase is 1817 lines now, but surely I wrote at least 2 times that much, and things get better each time.

One thing I learned from this project (wish I knew that before): if you look at a problem and start thinking that's too complicated and will take a lot of effort and you might not be able to solve it, you'll end up being afraid of actually doing it, so you'll not give your best and end up doing more work than necessary (my brain wrongly asserts: more difficult = more code = more effort). Instead you should start tackling it one step at a time and keep it simple, without being afraid of not doing it good, and sometimes the outcome will be even better than you expected. At least this works for me...

This and also that concretely defining your data models before actually implementing related code makes writing it a lot easier :P

4
SFML projects / Re: Enter the Unknown - Devlog
« on: March 22, 2015, 04:44:12 pm »
Sounds really cool man! How long do you expect this project to take?
When it comes to us programmers it can vary from years to hours.  The word "SOON" comes to mind.

Thanks! Indeed I have no ETAs, but I expect this to take around a year, level design included, given that is a solo project.

Surely I'll go as fast as I can physically bear, since this is my main goal for now. But I also have a lot to learn in this field, which at least at the beginning will be a bottleneck since I can code 12/7 but if then I have to spend double that time refractoring because I missed some patterns that's a great loss. So for now I spend a great part of that time studying. I really wish I could be like Neo and just plug knowledge in my brain then code as fast as I can, but that's sci-fi  ::)

Oh and I'll post a screen once is worth to, for now you would just see debugging bounds and crappy tilesheets :P

5
SFML projects / Re: Enter the Unknown - Devlog
« on: March 21, 2015, 06:15:03 pm »
Hi Nexus! Thanks for checking it out, already moved to the correct section.

Well, that will come later on, the story isn't already well defined and so are the features, for now I worked on the basics of the engine and the game idea is outlined only in my brain and some paper sheets, so that was everything I had to say.

I want to have gameplay features at least partially implemented before discussing them, also that post I'm talking about in the intro contains this kind of info and will be published once development reaches a more mature stage.

6
SFML projects / Enter the Unknown - Devlog
« on: March 21, 2015, 05:57:36 pm »
Hi guys from the community!

I decided to start a Devlog on my blog for the game I'm currently working on.

I't name is Enter the Unknown, you can find out why in the blog entry linked at the end of this post.

The game will be a fast paced roguelike/action RPG, with both a story mode and an endless mode. The latter will feature randomly generated levels and permadeath.

The engine will be dynamic and data-driven, restrictions posed will only be structural and really basic. Oh and there will be the prettiest pixel art graphics I can do!

Find out more on my blog, here's the link to the week 1 post (Last updated 21/03/15, 20:20 GMT+1)

If you're a newbie (like I am..) chances are you'll find useful informations, otherwise you'll inevitably see some errors.

In both cases give it a shot and tell me what you think! ;)

7
Graphics / Re: vector<sf::Sprite> VS sf::VertexArray for Tilemaps
« on: March 19, 2015, 11:10:31 pm »
Thanks for the explanation! I think I'll use a VertexArray for the map and a vector for custom objects then.

8
Graphics / vector<sf::Sprite> VS sf::VertexArray for Tilemaps
« on: March 19, 2015, 07:09:27 pm »
Hi there! I happen to be developing a game which is tile-based and even tough it shouldn't have enormous requirements I'm as always concerned about performance.

I had my background tiles in a vector of Sprites but today found out that when running on linux with nvidia drivers there was some tearing due to floating point view moving.

So after some searching I switched to a VertexArray, altought the problem isn't gone away (if you have any input on this that would be awesome, for now I'm just subtracting a little -- 0.0075 -- offset from the top of the tile and everythig is smooth, but that's only a workaround not a solution).

Anyway before that I was drawing tiles in a loop, only drawing those that were currently in view, plus a 2 tile offset in every direction for smoothness. Now I'm drawing the whole tilemap in a single call, but isn't there any looping involved in VertexArray drawing? If so, isn't cheaper to loop through every tile and just draw the ones I need? How can be faster to draw the whole array (even if treated as a single texture) VS drawing just the necessary tiles?

9
Graphics / Re: Flickering issue
« on: March 16, 2015, 06:15:10 am »
Holy crap... It was due to XFCE's compositing nothing to do with code or SFML... I'm thiking about suing 'em for the night I've spent on this  :o :o :o :o

10
Graphics / Re: Flickering issue
« on: March 16, 2015, 05:46:46 am »
Gosh that's really hard to see because youtube lowers video quality... I'll try to descibe the issue better, also there's another upload on yt and an mp4 as an attachment.


Some tiles are drawn out of place, I don't know how to call this, It's like if there was a line 100px or so from the bottom of the window, every tile under that line is drawn out of place when the view moves.

Like if there was some kind of lag in the drawing process. This appens only when the view moves (it follows player position) higher speed = more lag and more offset in the drawning.

I'm not doing anything fancy and this never happened in other games which share basic code with this one. Also it does not only happen with tiles, but with every sprite I draw. Tried running both with internal intel GPU and Nvidia, unfortunately I can't test this on other machines or Windows/Mac so I can't event figure out if it's my platform (ArchLinux 64 bit, intel/nvidia drivers, latest sfml binaries).

I think it could have more to do with the view moving than with the textures because I tried changing pngs, drawing only one large sprite instead of multiple tiles in a loop, enabling/disabling vsync and texture smoothing... This is a nasty one, I can't figure out how to debug it because sprites position it's ok It's like there were 2 buffers, one on top of that line and another on the bottom...

Try looking at the far left/right of the screen, where the tiles end, you can see some of them are out of place, with an offset of like 20px on the opposite direction.

Also here's the class which is causing this madness.

(click to show/hide)

11
Graphics / Flickering issue
« on: March 16, 2015, 03:25:53 am »
Hi everyone, I'm building a game prototype and there's an issue I can't get rid of.
Basically some sprites get drawn with a delay and out of place, I don't know what's the matter with them, I mean, I draw them in a simple loop like this:

void Zone::draw()
{  
    context.window->setView(worldView);    

    for (auto &tile : bgLayer)
    {
        if (isInBounds(tile))
            context.window->draw(tile);
    }

    context.window->draw(player);
}
 
where bgLayer is a vector of sf::Sprite. These are positioned once and do not get moved.
The window is cleared once in the main loop's render()

void Application::render()
{
    window.clear(sf::Color::Black);

    stateStack.draw();

    window.setView(window.getDefaultView());
    window.display();
}

 

There is no other window manipulation or drawing.

To better describe the issue I've uploaded a screen on youtube


Basically it seems like things get drawn out of position when the view moves, causing a strange flickering.

Anyone has an Idea about how to fix this? If you need to see more code just tell, I didn't want to clutter the post and I tought this could be a simple issue for someone more experieced. Thanks in advance!

Pages: [1]
anything