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.


Topics - Mrremrem

Pages: [1]
1
SFML projects / OpenVillage Game Engine
« on: November 26, 2023, 05:36:25 am »


Howdy!

I'm thrilled to introduce my tile based game engine, OpenVillage, a project I've been working on for quite a while now! OpenVillage encompasses a range of innovative features, including robust data structures for seamless entity handling, captivating sprite animations, and more.


It's definitely still a work in progress, like properly handling collisions (I'm currently working on it, I'm going back to school next week but I'll jump back as soon as possible!), refining little things that can help make games spark like textboxes (which works, but I really want to add in more customization options like next animations). Oh, and documentation is underway, with comments sprinkled throughout (more on the way, I promise!).

Anyways, I'm getting ready to leave home tomorrow! I'll see y'all soon!

Edit: Gahh forgot my Github link: https://github.com/Mrremrem/OpenVillage/

2
General / Rendering a map (effectively)
« on: May 30, 2023, 01:33:22 am »
Howdy!

Apologies if this isn't the right place to ask (I was debating with either General or Graphics but chose this :P). Anyway, at first I was rendering my map with a simple vector but I wanted to extend this further. I wanted to have layers that can be rendered in the order they are in (floor first, player next, anything above player goes after etc.) so I extended this with a 2D vector of layers with tiles. No problem. Most of the time (at least in my vision) there's going to be less tiles for every layer added. So the worst case being every layer filled with tiles is unlikely. However, I want to extend this with an unordered_map. The reason for this is because I have an entity base class that every tile and player derives. If I were to keep a 2D vector then finding a certain entity would take O(N) (let's say, Player 3). However, using a map I can find "Player" and find the second player in however many players there are (in this case 3). But, if I were to render everything, I would get something like this:

Code: [Select]
// The container:
// std::vector<std::unordered_map<std::string, std::vector<Entity*> > > entityLayerList;

for (auto& layerIndex : entityLayerList) {
        for (auto& entityList : layerIndex) {
            for (Entity* entityIndex : entityList.second) {
               
            }
        }
    }

Which scares me because this is way too many loops. Is there a better way to deal this? Should I go back to a 2D array and figure out ways to properly cast from entities to their own objects? Any feedback would be appreciated!

Pages: [1]