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

Author Topic: [ODFAEG] (Open Source Development Framework Adapted for Every Game)  (Read 158822 times)

0 Members and 2 Guests are viewing this topic.

Lolilolight

  • Hero Member
  • *****
  • Posts: 1232
    • View Profile
Re: [ODFAEG] (Open Source Development Framework Adapted for Every Game)
« Reply #255 on: May 30, 2014, 01:29:47 pm »
I've rewritten the abstract classes world and EntityManagerBase correctly, now, the world call the right function with the templates. (The function of the base class of all entity managers)

The developper can create entity managers as any type as he want, so if he want to have a more complexe entity manager, he can, but he have to redefines different functions (it depends if it is a 2D or a 3D entity manager)
Personaly I hesitate, which is the best, passing the entity manager type directly as a template argument of the world like the entity, or, don't pass it and force the developper to redefines some functions for 2 types of entity manager bases. (2D and 3D)

I prefer the second solution but I doubt a bit about it.

Anyway I have to ovewritte the functions of the class odfaeg::transform in the g2d::Entity class to pass 2D vectors instead of 3D vector, it'll be more practice, and finishing the tilesets and then, I'll be able to make a video.






select_this

  • Full Member
  • ***
  • Posts: 130
  • Current mood: just ate a pinecone
    • View Profile
    • darrenferrie.com
Re: [ODFAEG] (Open Source Development Framework Adapted for Every Game)
« Reply #256 on: May 30, 2014, 01:45:49 pm »
Personaly I hesitate, which is the best, passing the entity manager type directly as a template argument of the world like the entity, or, don't pass it and force the developper to redefines some functions for 2 types of entity manager bases. (2D and 3D)

I don't know much about what you're trying to do, but from the sound of it the second mechanism could get very unwieldy very quickly, especially if it doesn't cater for use cases you've not yet thought of. I suppose it depends on how much genericism you anticipate would be useful, and how many functions the user would be forced to override.
Follow me on Twitter, why don'tcha? @select_this

Lolilolight

  • Hero Member
  • *****
  • Posts: 1232
    • View Profile
Re: [ODFAEG] (Open Source Development Framework Adapted for Every Game)
« Reply #257 on: May 30, 2014, 02:52:55 pm »
The second solution is quite heavy but the genericism is also important, because, I can't manage 2D and 3D entities by the same way, 3D entities are stored in a 3D grid and 2D entitites in a 2D grid and the culling methods also differs. (I don't need a z culling for 2D entities)
The shadows and the light map generation also differs for 2D and 3D entitites.
I need to have a generic entity manager for 2D entitites and another one for 3D entities and defines some functions for all of them.

-The number of function to overload : I can decide it by myself. But to have a good entity manager, it's generally usefull to have something like 10 functions. (I use one for the frustum culling, another for loading 2D or 3D entities on components. (They decides how to render entitites), another to update the entities in the grid when they are transformed, another to find the path between two grid cells, etc...)

I don't use a BSP tree because of the path finding, I don't know how to do this with a BSP-tree and I want to let the possibility to the user to create one for 2D and 3D entities if he needs to make something more complex.
But excepted that difference, the mecanism is the same for 2D and 3D entities. (They use the same classes to render they vertices, it's just that the z of 2D entities is hidden, I use it only for the z-sorting and also in my shaders)
And the components make the links between 2D and 3D entities and the windows to render them in an more optimal way, later I think I'll make instanced rendering in components but actually I don't know how I can do that, it seems that this new features are not supported by a lot of PC's yet, I don't know if it's possible to do that with GLSL 130. (Which is the last version supported by my ati driver in ubuntu)
And moddern opengl (with glVertexAttribPointer) don't seems to render anything with my components but it works without any problems with older opengl function.  (with glVertexColorPointer)
But when I do moddern opengl directly in a main it render something. (I figure out that there is certainly a problem in the class RenderTarget with the gl context)

For the components there is only one type of component at the moment (RenderComponent) which render the entities of the framework but later I think it'll be usefull to add a second type (guicomponent) to render guis like buttons, checkbox, etc... with sf-gui.





« Last Edit: May 30, 2014, 02:56:27 pm by Lolilolight »

Lolilolight

  • Hero Member
  • *****
  • Posts: 1232
    • View Profile
Shadows and lights are there again!!!
« Reply #258 on: June 02, 2014, 04:25:20 pm »
Shadows and lights are there again!!! (With the shadow map and the lightmap generation)

I've pretty finished to improve and clean the graphic's engine bugs, so now, I'll do the same with the physic's engine.

And then I'll make a video!!!

And after that, I have to test the sound module, I never tested the one of SFML until now.



lezebulon

  • Full Member
  • ***
  • Posts: 235
    • View Profile
Re: [ODFAEG] (Open Source Development Framework Adapted for Every Game)
« Reply #259 on: June 02, 2014, 08:58:25 pm »
how does the "shadow map" work for 2D stuff ? what does it actually draw?

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
Re: [ODFAEG] (Open Source Development Framework Adapted for Every Game)
« Reply #260 on: June 02, 2014, 11:18:10 pm »
Its so confusing to use the shadow map term like that.. The shadow map is a well defined popular technique but I sense its been re-invented for some reason in this library..

Lolilolight

  • Hero Member
  • *****
  • Posts: 1232
    • View Profile
Re: [ODFAEG] (Open Source Development Framework Adapted for Every Game)
« Reply #261 on: June 02, 2014, 11:37:09 pm »
Hi!

I project the sprites and the walls on the ground and I draw them all on a rendertexture to get the shadowmap and then I draw the shadow on the ground.
It's why I called this technique "shadow map.", I just know there exists a similar technique for the 3D, this is why I called it shadow map. (In 3D this technique projet the shadow with a shader where a fragment is projected onto another fragment)

I use the same technique to draw lights with the lightmapping technik, for the 2D. (For the 3D I'll use normal mapping instead, or, vertex linghting with old graphics cards)

lezebulon

  • Full Member
  • ***
  • Posts: 235
    • View Profile
Re: [ODFAEG] (Open Source Development Framework Adapted for Every Game)
« Reply #262 on: June 03, 2014, 12:26:37 am »
I'm not really sure I understand... do you have a picture of how it actually project 2D sprites on the "ground"?

StormWingDelta

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
Re: [ODFAEG] (Open Source Development Framework Adapted for Every Game)
« Reply #263 on: June 03, 2014, 03:25:57 am »
Hi!

I project the sprites and the walls on the ground and I draw them all on a rendertexture to get the shadowmap and then I draw the shadow on the ground.
It's why I called this technique "shadow map.", I just know there exists a similar technique for the 3D, this is why I called it shadow map. (In 3D this technique projet the shadow with a shader where a fragment is projected onto another fragment)

I use the same technique to draw lights with the lightmapping technik, for the 2D. (For the 3D I'll use normal mapping instead, or, vertex linghting with old graphics cards)
I don't recommend Reinventing the Wheel if you don't have too or aren't trying to avoid relying on other libraries.  If it has been thought of chances are someone made a library for it.  Don't feel to bothered by using smaller libraries to save on time if you have too.
I have many ideas but need the help of others to find way to make use of them.

Lolilolight

  • Hero Member
  • *****
  • Posts: 1232
    • View Profile
Re: [ODFAEG] (Open Source Development Framework Adapted for Every Game)
« Reply #264 on: June 03, 2014, 03:51:41 pm »
I think that in one week (or two max) I'll be able to put a screen, I just want to be sure that all is ok.

Now I've just implemented this :

http://www.codezealot.org/archives/55

But I'll have to find a library for physics and especially for collisions ray/shapes.




Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
Re: [ODFAEG] (Open Source Development Framework Adapted for Every Game)
« Reply #265 on: June 03, 2014, 07:05:35 pm »
Can you explain why did you implement SAT if you are about to pick a physics library? You're making something really hard to make and yet, apparently, your biggest enemy is yourself :)

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: [ODFAEG] (Open Source Development Framework Adapted for Every Game)
« Reply #266 on: June 03, 2014, 07:14:38 pm »
I'm honestly suspecting that we are seeing a case of the Dunning–Kruger effect in action.
Not saying that to be demeaning or anything; we've probably all been there to some degree - it's just the most likely explanation as I see it.

Lolilolight

  • Hero Member
  • *****
  • Posts: 1232
    • View Profile
Re: [ODFAEG] (Open Source Development Framework Adapted for Every Game)
« Reply #267 on: June 03, 2014, 07:34:11 pm »
Quote
Can you explain why did you implement SAT if you are about to pick a physics library? You're making something really hard to make
.
It's not so hard to make after all, but it's not to use for bounding boxes because it's too slow, it's only for polygons.

Here is a screen shot with my shadow projections :

http://www.hostingpics.net/viewer.php?id=586783Capturedu20140603192908.png

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: [ODFAEG] (Open Source Development Framework Adapted for Every Game)
« Reply #268 on: June 03, 2014, 07:39:05 pm »
The shadow of the wall near the bonfire looks a bit "odd". But generally that looks nice - well done.
Perhaps the shadows would look better if they got slightly transparent near the edges and with a bit of antialiasing. But that's just a guess :)

Lolilolight

  • Hero Member
  • *****
  • Posts: 1232
    • View Profile
Re: [ODFAEG] (Open Source Development Framework Adapted for Every Game)
« Reply #269 on: June 03, 2014, 07:54:52 pm »
Yeah I know it isn't very accurate (for the shadow near the bonfire), it's because I've just projected the bottom points of the wall and build a convex shapes. (For the shadows of the walls)

This is why the shadow looks a bit odd.

I don't have another solution for the 2D. (because I haven't the z position of each pixels like in 3D)

Maybe add an antialiasing and transparency near the shadow edges like you said.






 

anything