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

Pages: 1 ... 12 13 [14] 15
196
General / New to SFML, game design questions
« on: September 02, 2011, 05:42:51 pm »
The abstract IRenderer is just something you'd need with multiple possible renderers, so you could have IRenderer that then becomes a CSFMLRenderer, a CDX9Renderer, a CDX11Renderer, a CSoftwareRenderer etc.

Otherwise you don't need it, and can just use Renderer*.

The concept of a service as used in XNA seems to be essentially only giving the information other components actually need to those components and hiding the rest of it.

The way they show them there could easily be you have a RendererService and then a RendererComponent that could also be a RendererService, or could even be a friend of RendererService or something, but more importantly it does all the "hidden" work the Renderer needs but doesn't need to expose to the rest of the system.
Or you could even just have a RendererService (Renderer).

Basically a service provider is an extensible way of sharing information between discrete components of the game engine without making that information global. Like I said, it's something you can look into or not ^^

197
General discussions / Who Are You? (the obligatory interview thread)
« on: September 02, 2011, 04:28:47 am »
Sure.
Gender: Male
Age: 19
Nationality: English

I'm currently a student attending the University of Brighton and about to start my second year studying Computer Science. It's a bachelor course but with the option to do a masters (which I'm considering), and afterwards maybe even a PhD ( entirely so I can make people call me Dr), but not sure yet.

I know a wide variety of programming languages and can pick them up pretty fast, but I started when I was about 13 with QuickBASIC (gasp, shock horror disgust) and quickly switched over to FreeBasic (gasp, shock, horror, outrage) before moving on to C++. Since then I've learnt others obviously, though I haven't touched a BASIC variant for more than five seconds in awhile (not exactly complaining).

I can also work with Databases and Websites, but I don't tend to enjoy it.

Socially, well I like drinking and dancing and it turns out there are these buildings called "Night Clubs" which permit you to do both of those in a relatively socially acceptable manner.

Fashion Sense: Ranging from the usual to the odd. I have a not-so-secret love for the waistcoat, and have been known to don a trilby from time to time ^^ (I believe I am wearing both in my profile picture xD)

Relationship status: I'm single, but that's more through choice than ineptitude.

Dream job? Programmer for an indie game developer or even founding my own company, though really I'll accept anything that presents me with enough problems to keep my interest ^^ "So long as it's not boring" is basically my mantra xD

198
General / PSP Homebrew with SFML?
« on: August 31, 2011, 01:30:45 am »
It maaaay be possible to port it to this without completely rewriting all the underlying code: http://www.goop.org/psp/gl/

Maybe? It'd still take some heavy modifications. All the threading, input and audio code would need an overhaul/rip-out/complete replacement. Doesn't seem worth it to me...

199
Graphics / How do i get the position of the center of my sprite?
« on: August 26, 2011, 10:01:27 pm »
pac.GetPosition().x + pac.GetCenter().x?

200
General / Problem running SFML apps
« on: August 25, 2011, 07:27:26 pm »
Were those applications written in SFML 1.6?
Does the PC that isn't working have an ATI graphics card?
If you answered yes to both questions, then it's most likely an issue with the ATI drivers and SFML 1.6 that was fixed in 2.0 ^^

201
General / How to code nicely with SFML?
« on: August 25, 2011, 05:15:53 pm »
I find the best use for prefixing is to narrow autocomplete down a bit further. For example, I know if I'm working with my own code and type _, autocomplete will show all private variables in that class.

It may not make much semantic difference, but I find it makes autocomplete actually run much faster by reducing the amount of work it has to do per character typed, and also reduces how much time I'm looking through autocomplete because I'm having a mental blank on the name of a variable, which makes a practical difference.

202
General / New to SFML, game design questions
« on: August 25, 2011, 02:37:38 pm »
Well the basic gist is you pass a reference to Renderer (* or &).

 You could use services: http://www.nuclex.org/articles/4-architecture/6-game-components-and-game-services
And just make each class aware of the service provider. Then they just get the services they need from the provider and you can abstract it out to use different renderers if you like.

203
General / Game states
« on: August 25, 2011, 12:27:26 pm »
Personally I tend and view things as tasks in a stack.

Each state is a collection of tasks, and as you push a state on top of the stack the tasks of the stack below it can decide either to suspend or continue. When a state is popped, all it's tasks are killed. You can obviously code in more fancy things too.

Tasks can be groubed by two additional properties: Process and Priority

- Process only matters if the program is multithreaded: Two tasks of process n are guaranteed to be running on the same thread whilst tasks of different processes may or may not, there are no guarantees.

- Likewise, tasks with the same process are guaranteed to be updated in order of priority (high -> low) whilst tasks on different processes aren't.

Some day I'll devise a more complex task system based around chaining tasks to execute concurrently (so you can say "Tasks X, Y and Z depend on Task A" and tasks X,Y and Z execute concurrently after A without interrupting the flow of any 'unlinked' tasks). Basically creating and scheduling "task trees"...Task tree! That sounds like a good way to implement it now that I think of it xD

204
General discussions / Design flaw in my game ?
« on: August 16, 2011, 02:42:34 pm »
Quote from: "unranked86"

Quote from: "MorleyDev"
Perhaps some kind of centralised event mapping system?

If you want to save, simply fire off an event state and anything that wants to listen to it handles it. And if not, then that state simply ignores it.

I'm really sorry, but I'm not quite sure what you mean. Do you mean some system like the "observer pattern" ?


Exactly. I rolled my own awhile ago that looked like this:

Code: [Select]

bool ASaveFunc(jml::typeinfo type, SaveEvent event)
{
      // do some saving
      return jml::typed_event_map::CONTINUE;
}

jml::typed_event_map events;
jml::typed_event_map::connection c = events.connect(typeid(SaveEvent), ASaveFunc);

events.queue(typeid(SaveEvent), SaveEvent); // Queue an event to be triggered
eventes.flush(); // Triggers all queued events

events.trigger(typeid(SaveEvent), SaveEvent); // Trigger an event, calling it instantly

c.disconnect();


Where typed event map is actually a specialisation of a generic "event_map" templated class that can use any hashable type as a key and any copyable class as a value.

I'd show it but it relies on a few other things I rolled for ease-of-use. A typeinfo wrapper that on windows uses hashes to avoid unneeded string comparisons whilst still crossing library boundaries (jml::typeinfo), a function that binds member functions to a functor without needing to use placeholders (by using variadic templates in gcc or just a lot of overloads in visual studio)...it'll all be opensource eventually xD

But yeah, maybe the state shouldn't be the saver...

205
General discussions / Design flaw in my game ?
« on: August 15, 2011, 07:09:54 pm »
Perhaps some kind of centralised event mapping system?

If you want to save, simply fire off an event state and anything that wants to listen to it handles it. And if not, then that state simply ignores it.

206
SFML projects / what do i need to publish a game?
« on: August 12, 2011, 05:33:12 pm »
Well depends. As with anything you create, own and release, a license tends to make what people are allowed to do with it clear.

If you want people to be able to see the code, there are a lot of sites that exist for hosting open source software and a lot of licenses targeted around open source. From the MIT (do what you like and don't blame me if stuff goes wrong) to the GPL (basically others can use the code but only in a GPL'd project...I dislike GPL for it's viral nature and even wrote a university essay on it but let's not go into that).

To be honest, for a simple game with no intent to sell a common solution is either Sourceforge or an alternative such as Google Code, Codeplex etc. (for Open Source) or even to just upload it to a hosting site such as Mediafire and post it on a few forums you frequent for critiques with some screenshots and the like.

207
SFML projects / Thor C++ Library – An SFML extension
« on: August 09, 2011, 02:41:54 pm »
Out of curiosity, in the tutorials you list unique_ptr as unique ownership and then auto_ptr as moved ownership. But from what I can tell, unique_ptr is also moveable via the use of r-value references (unique_ptr&&) and was intended to replace auto_ptr which is deprecated due to it's usage of hacks to simulate r-value references?

208
General discussions / Window drag keep rendering (solution) [SFML 2.0]
« on: August 05, 2011, 01:01:48 pm »
Yeah, the "lock-free" stuff is just a type of non-blocking algorithm. "A non-blocking algorithm is lock-free if there is guaranteed system-wide progress; wait-free if there is also guaranteed per-thread progress."

They are a fascinating field of study, and most of it goes right over my head at the moment xD

Valve often publish presentations they give at various conferences and have one such presentation on making games for multi-core where they briefly go into detail about non-blocking algorithms:
http://www.valvesoftware.com/publications/2007/GDC2007_SourceMulticore.pdf

209
General discussions / Window drag keep rendering (solution) [SFML 2.0]
« on: August 04, 2011, 12:10:07 pm »
There are numerous lock-free first-in first-out queue implementations floating around the internet based on the usage of Compare-And-Swap that would be well suited for an event queue ^^

210
General discussions / List of modifications from SFML 1.6 to 2.0
« on: August 03, 2011, 08:35:30 pm »
boost::thread is being implemented to in C++(0/1)x as std::thread. I prefer using boost::thread anyway since it gives me access to the rest of boost's thready goodness :P

Pages: 1 ... 12 13 [14] 15
anything