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 - SamuelMS

Pages: [1]
1
Graphics / Complex Map Generation & Rendering
« on: June 24, 2013, 07:15:33 pm »
Dear SFML gurus,

I only learned of your incredible library a few days ago, but I was so impressed by its feature list that I immediately began developing in it.

While I've been able to piece together a lot of elements from the documentation and the various posts across this board, I have a couple of questions that I haven't quite been able to resolve on my own. Since you guys know SFML inside and out, I figured the time to drop by these parts was nigh.

The first project I've set out to create is a fairly straightforward 2D space-based game, in which the player flies around a starship and impresses the locals. I'm currently at the world-building stage: I intend to generate a series of fairly complicated star maps for the player to traverse. These maps will be generated on the user's machine prior to gameplay (and then loaded from file each subsequent run), not pre-packaged into the game itself, and each map represents a given region of space.

For the sake of example, let us say each map is approximately 10000 square pixels, with its details (stars of various sizes and colors, nebulas, etc.) determined procedurally given one or more seed values. For the sake of added realism, let us also assume that parallax movement will be implemented, with each layer of detail (stars of various sizes, indicating distance; nebula layers) moving at unique speeds.

For proof of concept, I initially rendered these starmap details directly onto a single Renderwindow, which then could be navigated by moving a view. However, this method struck me as inefficient and limiting, as I'd have to update positions for thousands of elements every cycle. Instead, I thought I could render each layer to its own texture, which I could then "pan" at varying speeds as necessary.

Before I get started, though, I wanted to get some input from you folks, in case there's a better way of going about things. So, in summary, I need to generate several large layers of moderate complexity, which would then be rendered and moved as needed (likely in slices, for sake of memory).

What do you all think?

Thanks for your time and consideration.

Pages: [1]