Silly question: can you have an object that is both a subject and an observer? A "mothership" object with "spacefighter" child objects would require both the mothership and spacefighter objects to be both subjects and observers IMO so the mothership knows when it's child objects die and the spacefighter objects know when their mothership dies so they can start a new line of behaviour (find a new mothership with room for spacefighters or if they can't find one, they explode). You'd also need both
Also, would the observer pattern be a good way to decouple rendering from your game simulation? Your game simulation object (stores your game board, game objects like the player and enemies) could inherit the subject class and the renderer object could inherit the observer class. The game simulation notifies the renderer (and anybody else) on the creation and deletion of game objects, passing the references of these game objects up to the renderer. The renderer could then maintain it's own list of renderable objects that are linked up to the game objects stored in the game simulation also via the observer pattern. When a game object does something like explode or fire it's lasers or takes damage the renderable object is notified of the event and changes it's sprites to reflect the changes. A sound system object could potentially take advantage of a similar setup.
Finally, could you expand on what Entity is? Is it the Subject itself being passed through to the Observers? Event is an Enum?
I know this is a long-winded post but I'd really appreciate your answers and what you think of my ideas. I still have a bit of trouble solving logic problems but I have plenty of problems trying to structure my programs when they start growing any larger than a handful of small classes.
I'm confused. Why would initially financing an LLC with your own personal funds destroy the limited liability of the LLC? Couldn't you just take out a small loan and then instantly pay it back?
Very interesting. I like it much more than xmonad already - Haskell might be the second coming of christ for some but in the end I had to steal other people's configs to get basic things working and even then some of the features didn't work. Learning a new programming language shouldn't be necessary to configure a WM. Each to their own I guess.
Btw, if people are having lag issues when switching to the terms tab and resizing/moving/launching urxvt terms, comment out this line below in your ~/.Xdefaults.
URxvt*depth:
The same should apply for other terminal emulators like Xterm and so on and if there is no similar line in your ~/.Xdefaults, check the settings of your terminal emulator.
Fglrx users may also want to try using the old 2D rendering mode if the above doesn't help you.
Edit: subtle-hg in the AUR supports Xinerama/XRandr out of the box, subtle in the default repositories does not.
I started with Ubuntu/Kubuntu and screwed around with it in 06, 07, 08 and Ubuntu server in 09. I really had no clue what I was doing at first and they usually didn't stay installed longer than a week at most or were quickly forgotten largely because I still avidly played PC games.
Eventually this year I decided to forget about the xBuntus and try my hand at Arch Linux. I had a bit of experience with cruising around the prompt, editing grub and some other things but I never quite put all the pieces of the puzzle together to build a map of how a Linux OS works in my mind.
So I tried Arch Linux and I pretty much lost a week in getting it to start X with a DE. I was pretty frustrated by this point because I was still having difficulty getting stuff working so I eventually forgot about it and gave in. A little while later though, my curiosity piqued again I installed it, only taking a few days this time. I tried a few other distros like Slackware but I quickly grew to hate Slackware because hunting down packages for something obscure was a living nightmare.
I must have reinstalled Arch Linux many times but each time I learned something new. Sometimes I borked my system which prompted a reinstalled, even if were the most minor thing but it didn't matter, I was learning more and more each time.
Eventually I got here where the AL wiki fueled my desire for knowledge and now I have either a basic or intermediate understanding of the techniques, tools and working ideas behind a Linux OS to the point at which I could and did load up the AL live CD, chroot and install a slightly earlier kernel version to fix a boot problem. I now spend much more time in Arch Linux than I do with Windows and a terminal is where I spend most of my time.
Looking back, I realise that the xBuntus were actually quite good but only at what they were - pre-packaged distributions which is not what I wanted - I wanted to learn which the xBuntus failed to facilitate properly because they always got in your way. Arch Linux really does get out of your way an becomes the environment you want it to be.
Thanks gerundronaut. From the posts made I eventually figured out that I needed to keep the floating point x/y co-ordinates of the sprite seperate from the real integer points. Thank you also for mentioning the use of velocity in the terms of a game controller, it's helping me understand the underlying math that I've taken for granted in games.
Thank you everbody that posted. 8-bit_d-boy's post pointed how to get floating point incrementals (before I was just doing integer increments which made everything move too fast and miss the destination by a mile). After that, philh's post suddenly made complete sense - retain the incrementals and x/y co-ordinates as floating points, increment using floating points and do a rounding operation on the floating point x/y co-ordinates (but don't store them back) and change the rectangle's x/y co-ordinates based on the result of the rounding operation.
The result is damn-near precise movement in a multitude of directions, beyond 8-way movement.
I'm not entirely sure where vectors fit into this given that some trigonometry does the job but I'll certainly look into them some more.
Thanks again everybody, I couldn't have figured this out on my own in this short a time span. It's also made me realise that I've forgotten so much about mathematics in the short space of 3 years since I left HS and that I should get down to re-learning it.
And when I was saying floating point numbers are incompatible I was refering to how you can't increment x/y co-ordinates of a sprite by 0.625 or 0.8 or by some fractional amount - they have to be whole numbers like 1,2,3,4 or -1,-2,-3,-4, etc.
I'll definately look into re-calculation - at one time I had the incremental amount (as a floatign point) adding itself to the result of the rise/run calculation each time the x/y co-ordinates changed which improved the precision of the movement (still off a few pixels but not to the extent of completely missing the desired co-ordinates) but that too also had the side effect of increasing the speed of the sprite because its moving say +5 along the X axis and +1 along the Y axis however if it were going straight up/down/left/right it would only increment by one.
I'll look into this euclidean space stuff too and I'll see if it will solve my problem. All else fails though, I might just stick to a grid.
Silly question: can you have an object that is both a subject and an observer? A "mothership" object with "spacefighter" child objects would require both the mothership and spacefighter objects to be both subjects and observers IMO so the mothership knows when it's child objects die and the spacefighter objects know when their mothership dies so they can start a new line of behaviour (find a new mothership with room for spacefighters or if they can't find one, they explode). You'd also need both
Also, would the observer pattern be a good way to decouple rendering from your game simulation? Your game simulation object (stores your game board, game objects like the player and enemies) could inherit the subject class and the renderer object could inherit the observer class. The game simulation notifies the renderer (and anybody else) on the creation and deletion of game objects, passing the references of these game objects up to the renderer. The renderer could then maintain it's own list of renderable objects that are linked up to the game objects stored in the game simulation also via the observer pattern. When a game object does something like explode or fire it's lasers or takes damage the renderable object is notified of the event and changes it's sprites to reflect the changes. A sound system object could potentially take advantage of a similar setup.
Finally, could you expand on what Entity is? Is it the Subject itself being passed through to the Observers? Event is an Enum?
I know this is a long-winded post but I'd really appreciate your answers and what you think of my ideas. I still have a bit of trouble solving logic problems but I have plenty of problems trying to structure my programs when they start growing any larger than a handful of small classes.
I'm confused. Why would initially financing an LLC with your own personal funds destroy the limited liability of the LLC? Couldn't you just take out a small loan and then instantly pay it back?
Do you have dbus in your DAEMONS line in /etc/rc.conf? I know I had problems starting DEs/DMs when I didn't have dbus loaded.
You may also need to install the dbus package, dbus-core is a separate package and doesn't include the dbus daemon AFAIK.
Very interesting. I like it much more than xmonad already - Haskell might be the second coming of christ for some but in the end I had to steal other people's configs to get basic things working and even then some of the features didn't work. Learning a new programming language shouldn't be necessary to configure a WM. Each to their own I guess.
Btw, if people are having lag issues when switching to the terms tab and resizing/moving/launching urxvt terms, comment out this line below in your ~/.Xdefaults.
The same should apply for other terminal emulators like Xterm and so on and if there is no similar line in your ~/.Xdefaults, check the settings of your terminal emulator.
Fglrx users may also want to try using the old 2D rendering mode if the above doesn't help you.
Edit: subtle-hg in the AUR supports Xinerama/XRandr out of the box, subtle in the default repositories does not.
I started with Ubuntu/Kubuntu and screwed around with it in 06, 07, 08 and Ubuntu server in 09. I really had no clue what I was doing at first and they usually didn't stay installed longer than a week at most or were quickly forgotten largely because I still avidly played PC games.
Eventually this year I decided to forget about the xBuntus and try my hand at Arch Linux. I had a bit of experience with cruising around the prompt, editing grub and some other things but I never quite put all the pieces of the puzzle together to build a map of how a Linux OS works in my mind.
So I tried Arch Linux and I pretty much lost a week in getting it to start X with a DE. I was pretty frustrated by this point because I was still having difficulty getting stuff working so I eventually forgot about it and gave in. A little while later though, my curiosity piqued again I installed it, only taking a few days this time. I tried a few other distros like Slackware but I quickly grew to hate Slackware because hunting down packages for something obscure was a living nightmare.
I must have reinstalled Arch Linux many times but each time I learned something new. Sometimes I borked my system which prompted a reinstalled, even if were the most minor thing but it didn't matter, I was learning more and more each time.
Eventually I got here where the AL wiki fueled my desire for knowledge and now I have either a basic or intermediate understanding of the techniques, tools and working ideas behind a Linux OS to the point at which I could and did load up the AL live CD, chroot and install a slightly earlier kernel version to fix a boot problem. I now spend much more time in Arch Linux than I do with Windows and a terminal is where I spend most of my time.
Looking back, I realise that the xBuntus were actually quite good but only at what they were - pre-packaged distributions which is not what I wanted - I wanted to learn which the xBuntus failed to facilitate properly because they always got in your way. Arch Linux really does get out of your way an becomes the environment you want it to be.
Thanks gerundronaut. From the posts made I eventually figured out that I needed to keep the floating point x/y co-ordinates of the sprite seperate from the real integer points. Thank you also for mentioning the use of velocity in the terms of a game controller, it's helping me understand the underlying math that I've taken for granted in games.
Thank you everbody that posted. 8-bit_d-boy's post pointed how to get floating point incrementals (before I was just doing integer increments which made everything move too fast and miss the destination by a mile). After that, philh's post suddenly made complete sense - retain the incrementals and x/y co-ordinates as floating points, increment using floating points and do a rounding operation on the floating point x/y co-ordinates (but don't store them back) and change the rectangle's x/y co-ordinates based on the result of the rounding operation.
The result is damn-near precise movement in a multitude of directions, beyond 8-way movement.
I'm not entirely sure where vectors fit into this given that some trigonometry does the job but I'll certainly look into them some more.
Thanks again everybody, I couldn't have figured this out on my own in this short a time span. It's also made me realise that I've forgotten so much about mathematics in the short space of 3 years since I left HS and that I should get down to re-learning it.
When I meant rise/run I meant something like this: http://www.sonic.net/~geco/math/SlopeRiseRun.html
And when I was saying floating point numbers are incompatible I was refering to how you can't increment x/y co-ordinates of a sprite by 0.625 or 0.8 or by some fractional amount - they have to be whole numbers like 1,2,3,4 or -1,-2,-3,-4, etc.
I'll definately look into re-calculation - at one time I had the incremental amount (as a floatign point) adding itself to the result of the rise/run calculation each time the x/y co-ordinates changed which improved the precision of the movement (still off a few pixels but not to the extent of completely missing the desired co-ordinates) but that too also had the side effect of increasing the speed of the sprite because its moving say +5 along the X axis and +1 along the Y axis however if it were going straight up/down/left/right it would only increment by one.
I'll look into this euclidean space stuff too and I'll see if it will solve my problem. All else fails though, I might just stick to a grid.
Thanks!
End of this list.
Back to top