Layl
|
|
« Reply #4740 on: March 01, 2015, 10:46:22 PM » |
|
After 3 months of work I'm realizing that the basic structure of my engine just doesn't work for projects of any decent size. Oh well, back to the drawing board.
|
|
|
Logged
|
|
|
|
framk
Level 2
I don't know anything
|
|
« Reply #4741 on: March 10, 2015, 09:02:03 AM » |
|
Not really programming centric, but more game development in general: I've overloaded myself as of late with helping various people out on their projects. Not only is it stressful to have things done on time, remembering naming and style conventions for 15 different projects and people is a pain in the ass.
|
|
|
Logged
|
|
|
|
Codestar
Level 1
One man, one game
|
|
« Reply #4742 on: March 10, 2015, 01:47:38 PM » |
|
Lately my game has gotten pretty hefty on it's CPU usage. I'm fighting the urge to redo parts of ImpactJS to handle an entity component based model of programming rather than an huge inheritance chain like it currently implements. One game I know of that's gotten a pretty good performance boost from this is Cross-code, and from their labor they were able to get some pretty good performance boosts in V8. It's really just a huge pain to optimize JS code, because you end up giving up a lot of things that make programming in JS great.
|
|
|
Logged
|
|
|
|
Boreal
Level 6
Reinventing the wheel
|
|
« Reply #4743 on: March 13, 2015, 05:46:21 AM » |
|
After using SDL2 for a long time I'm realizing that as a windowing API it's actually not very good except for the case of a single window. I would rather use GLFW but the super simple cross-platform low-level audio API that SDL2 provides is way too valuable to me.
Just seems like a waste to add a dependency to GLFW on top of SDL2 for the sole reason that SDL2 doesn't provide a window user pointer.
|
|
|
Logged
|
|
|
|
InfiniteStateMachine
|
|
« Reply #4744 on: March 13, 2015, 02:58:05 PM » |
|
Is SDL's audio api a wrapper over something existing or is it its own thing?
|
|
|
Logged
|
|
|
|
Quarry
|
|
« Reply #4745 on: March 13, 2015, 03:18:19 PM » |
|
OpenAL may be able to substitute
|
|
|
Logged
|
|
|
|
Sik
|
|
« Reply #4746 on: March 13, 2015, 08:00:32 PM » |
|
Just seems like a waste to add a dependency to GLFW on top of SDL2 for the sole reason that SDL2 doesn't provide a window user pointer.
https://wiki.libsdl.org/SDL_GetWindowFromIDAlthough yeah, providing a pointer would have been better. Same deal with the joysticks. EDIT: oh wait you mean a user-passed pointer, not the window pointer =/ The entire event system is guilty of that though, it's not just the windowing system - heck, the entire API for that matter since polling based functions aren't any better in that sense. I guess they just expect you to pass those events to some code that keeps track of everything relevant. Is SDL's audio api a wrapper over something existing or is it its own thing?
It's a portable wrapper to the non-portable system-specific libraries. It also handles format mismatches for you (so e.g. you can just assume 44100Hz 16-bit stereo and let SDL convert it behind the scenes). Of course it's still only good enough for the most basic cases (e.g. it supports only mono and stereo, not 5.1 or 7.1 or whatever), if you need anything advanced you'll probably have to deal with a different library. Most games don't need more than this though...
|
|
|
Logged
|
|
|
|
InfiniteStateMachine
|
|
« Reply #4747 on: March 14, 2015, 03:34:57 PM » |
|
Just seems like a waste to add a dependency to GLFW on top of SDL2 for the sole reason that SDL2 doesn't provide a window user pointer.
https://wiki.libsdl.org/SDL_GetWindowFromIDAlthough yeah, providing a pointer would have been better. Same deal with the joysticks. EDIT: oh wait you mean a user-passed pointer, not the window pointer =/ The entire event system is guilty of that though, it's not just the windowing system - heck, the entire API for that matter since polling based functions aren't any better in that sense. I guess they just expect you to pass those events to some code that keeps track of everything relevant. Is SDL's audio api a wrapper over something existing or is it its own thing?
It's a portable wrapper to the non-portable system-specific libraries. It also handles format mismatches for you (so e.g. you can just assume 44100Hz 16-bit stereo and let SDL convert it behind the scenes). Of course it's still only good enough for the most basic cases (e.g. it supports only mono and stereo, not 5.1 or 7.1 or whatever), if you need anything advanced you'll probably have to deal with a different library. Most games don't need more than this though... Ah cool so you could probably just use OpenAL with GLFW then.
|
|
|
Logged
|
|
|
|
Sik
|
|
« Reply #4748 on: March 14, 2015, 04:16:03 PM » |
|
Well, there's also the fact that SDL still handles a lot more of stuff (the other big ones that come to my mind are input devices, multithreading and the timers - not gonna count the satellite libraries here since technically they aren't SDL). Besides not having to figure out how to get everything you need from window events (harder than it sounds from non-game oriented windowing APIs) and not needing system-specific stuff for timers and threading, there's also the fact that SDL comes with a mapping database of common joysticks. It also has proper support for touch input (once you disable mouse emulation), but I guess that doesn't matter that much on computers.
Of course it all depends on how much stuff from SDL you're already using in the first place. I somehow managed to actually make use of nearly all of it O_O (hitting some interesting bugs from rarely used features in the process)
|
|
|
Logged
|
|
|
|
InfiniteStateMachine
|
|
« Reply #4749 on: March 15, 2015, 03:01:41 AM » |
|
GLFW covers the 3 major thing you had there (threading, timers, input) but yeah it doesnt have stuff like joystick mapping (that's pretty cool). Although the threading stuff you could just use te modern stl for these days.
|
|
|
Logged
|
|
|
|
Areku
Level 1
Well yeah.
|
|
« Reply #4750 on: March 15, 2015, 06:18:24 AM » |
|
self.view.x = self.X - self.halfwidth; self.view.x = self.Y - self.halfheight; Two days jumping around the codebase, testing every piece of code remotely connected to the display, trying to see what it was that caused objects to stop rendering when the player moved up or down slopes. I think I might need glasses.
|
|
|
Logged
|
|
|
|
Quarry
|
|
« Reply #4751 on: March 17, 2015, 10:55:28 AM » |
|
Never copy and paste anything with an x, y, z or w. Just don't. Not worth the hunt
|
|
|
Logged
|
|
|
|
Boreal
Level 6
Reinventing the wheel
|
|
« Reply #4752 on: March 25, 2015, 11:58:59 AM » |
|
Well apparently I'm dumb and jumped to conclusions because I recently discovered that SDL2 windows do in fact support user pointers. SDL_SetWindowData(window, "Data", data);
void *data = SDL_GetWindowData(window, "Data");
|
|
|
Logged
|
|
|
|
Sik
|
|
« Reply #4753 on: March 25, 2015, 04:11:32 PM » |
|
...I stand corrected ( ・・) I wonder who needed it first.
|
|
|
Logged
|
|
|
|
J-Snake
|
|
« Reply #4754 on: March 25, 2015, 05:16:17 PM » |
|
self.view.x = self.X - self.halfwidth; self.view.x = self.Y - self.halfheight; Two days jumping around the codebase, testing every piece of code remotely connected to the display, trying to see what it was that caused objects to stop rendering when the player moved up or down slopes. I think I might need glasses. Insider: In Ada that would not happen, x and y have different types!
|
|
|
Logged
|
|
|
|
Boreal
Level 6
Reinventing the wheel
|
|
« Reply #4755 on: March 25, 2015, 05:50:29 PM » |
|
...I stand corrected ( ・・) I wonder who needed it first.
It's invaluable to writing wrappers, or really any time you need to match up a window event with an object. What I was doing before was doing my own lookup table from window ID -> custom window class, but this is much simpler.
|
|
|
Logged
|
|
|
|
Layl
|
|
« Reply #4756 on: March 25, 2015, 10:53:20 PM » |
|
Don't you love having to make your opengl contexts current? I don't.
|
|
|
Logged
|
|
|
|
|
Layl
|
|
« Reply #4758 on: March 27, 2015, 08:07:54 AM » |
|
Obviously to prevent that problem we mirror the github repo at a server in your internal network. This is totally a thing everyone does, I mean, it would be silly if you don't, why would you be using decentralized source control if you don't make use of the decentralized part of it.
|
|
|
Logged
|
|
|
|
InfiniteStateMachine
|
|
« Reply #4759 on: March 30, 2015, 11:32:45 AM » |
|
So now you have 2 centralized endpoints mirroring each other in a decentralized system.
You can do that with a non-decentralized SCM as well, mirroring is not exclusive to a decentralized system.
|
|
|
Logged
|
|
|
|
|