Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 06 Sep 2007
Offline Last Active Mar 23 2014 11:51 AM

Topics I've Started

my beef with the mobile version of gamedev

12 March 2013 - 12:45 AM

I use my phone religously at work.... I ride around in a truck 90% of the time. A lot of the time I peruse the site but I rarely ever post from my phone.

1: this is a galaxy s3 same with my old droidX.

Posting there is jo word wrap what so ever. Everything I type till I hit new line is all on one line...eaning at this point I cant read the beging of this sentaence anymore.
You cant scroll down to look at the thread youre posring about... im slow in the head give ke a break. When I rant I tend to go to the point I forget why I was ranting. Having to hit back to reread the thread just deletes everything I typeed.

Im jot sure if thisnis phone specific but also why I click back on the text box... the cursor should auto jump to the end of my texting. Its a b.... to scroll the txt box on a phone. I back track and add things to what. Said already a lot... which puts the cursor above the rest of the text then its almost jot worth appending the rest ofy post the end of it like im doing now. I cant for the lfe of me get it scroll down right now... let alone my phone wont let me hit j instead of n.

Navigating the site is actually quite elegant... I do like that aspect way more than the non mobile version. But the way posting works needs to change. That and one nit picky thing. I would love to be able to see the view count and other such info that the full version has... bit on the mobile version.

implementing a generic quad tree.

21 February 2013 - 02:39 PM

As a learning experience im putting together a templated quad tree as a container. But theres a few things im curious about and google on my phone is being a nuisance.

Im storing objects by there center and forcing them to only one quad at a time. My tree will be populated quite heavily with a limit to the amount per quad. My biggest concern lies in moving the objects. This will probably be trivial... 100 or more. Per frame with that number being very dynamic aswell as my tree possible being 20-30 + nodes deep.

The way im doing it right now is the owner of the objects will remove them from the tree then reinsert them every time it moves.

But all morning I was thinking maybe I should give a member function to my nodes to move an object. So I could do it logically. Such as no need to reinsert if it still is in the current node.

unexpected behavior with std list and pointers

08 December 2012 - 06:35 PM

This is from my phone please excuse the grammar.

I've got a very simple state machine that stores states as pointers in a std list. States have a isAlive flag that tells the statemachine that the state needs to be deleted. I always only ever operate on the back of he list which should always be the newest state. When I say a state is added. The machine adds the state after the current state is fully processed including deleting of it.

So far my game flows like so. Menu state is added. Runs. A level loader state gets added and his states adds a level state. When the level is lost it flags it self as dead and adds a gameover state. The game Hoover state flags itself as dead and the stack is cleared back down to the level loader state. Which has no more levels to load so flags itself as dead. Now all other states get deleted properly but for some reason when it reaches the check to see if the load level state is dead it just skips it. And he debugger clearly shows the state as dead even the code that sets it as dead runs right.

It's a lot of separate code else I would've posted it. I'm just really stumped on this one. Why it won't delete this state but all the great get cleaned up just fine.

what would be the proper oop way to do this?

15 November 2012 - 03:03 PM

Ok I feel like I'm a pretty good programmer but all my learning is self taught, so I'm trying to brush up on the "proper" ways to implement specific design patterns and other programming techniques. This situation kinda has me at a stand still scratching my head. I know how I would normally do it and for something this small it'd probably be the easiest without causing headache down the road. But I'm trying to learn so...

First to paint a picture, for the sake of this question the game is similar to 'Checkers'. Theres a game board that only two players play on. All the game pieces are the same except that they belong to different people.

What I'm wandering about is who should own the game pieces and how would interaction with the pieces be handled in all respects to OOP?

The way I would do it is the player would own the pieces and handle the interaction with the pieces. The first thing that pops out to me though is interaction between different players pieces would require each player to have some knowledge of the other players pieces. This makes me think I should have another class/function outside the player that handles player input and interaction with game pieces and just pass the whole lot of info to this controller. Am I on the right track with that?

comparing colors

30 January 2012 - 04:16 PM

Ok I got this idea for a little shader but one hurdle... i want to compare colors (rgb no alpha), and if they are close enough alter them as I see fit. Now I could do this with say a threshold and check every channel to see if it's close enough to the other channel they are the same. Though I also what to confine the resulting colors to either red, green or blue.... I'm mostly curious if there is an easier/ more elegant way to do this then checking every chennel for every pixel in a 5x5 radius for every pixel on the screen?

This is my idea so far.. psuedo...
float threshold = 0.25f;

if ( absolute(r1 - r2) <= threshold )
    red channel close enough...

// do this for each channel, if all pass then they colors are close enough.

// then check each channel to see which is the predominat one, and output that color only.

Now this is going to be doing an area comparison, so it isn't just going to check 4 pixels per pixel, but probably ~8-16 pixels to compare all surrounding pixels. Hopefully that made sense, I can try to explain more if needed... and thanks.